Re: driver writing newbie
Thus spake Kenneth Wayne Culver ([EMAIL PROTECTED]): SYS_RES_MEMORY instead of SYS_RES_IOPORT (all these combinations are for use in bus_alloc_resource). The thing is everything I've tried fails to work, so I can't attach my driver because it won't map the resources. Can anyone suggest other things I could try to make this work right? Source? Alex -- WELCOME DATACOMP! To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: driver writing newbie
On Wed, 25 Jul 2001, Kenneth Wayne Culver wrote: Sorry to post to this forum, but I'm not getting any replies from -hackers or -questions, and I've looked at the webpages on writing device drivers, as well as several other drivers. Here's my problem/question/whatever... I am writing a driver right now for the Hardware monitoring features of the via686a and via686b south bridge chips. I have documentation and have looked at the linux driver to see how things are done. My problem is that I've got the chip probing, and I have the pci_read_config telling me that my device needs a memory port (what's wierd is that I had to use the base register value of the chip instead of PCIR_COMMAND in pci_read_config to get it to tell me that it wanted me to set up a port instead of mem which is 0x70) So I set up the regid as 0x10 (PCIR_MAPS) as outlined in the I meant above that the base register is 0x70 for my chip... webpage, and SYS_RES_IOPORT as I found in the pci driver for the es137x sound chip. I've also tried several combinations. So far the only thing I havn't tried is setting the regid to 0x10 (PCIR_MAPS) and using SYS_RES_MEMORY instead of SYS_RES_IOPORT (all these combinations are for use in bus_alloc_resource). The thing is everything I've tried fails to work, so I can't attach my driver because it won't map the resources. Can anyone suggest other things I could try to make this work right? Ken To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: driver writing newbie
Well, I could do that, but I'd rather write a complete driver with all the regular interfaces... (open, close, ioctl, and a specific major/minor in the kernel, I'm going to add other chips to this driver eventually) The way you are suggesting just opens /dev/io and uses inb and outb to do some hacking around I believe. Ken On Wed, 25 Jul 2001 [EMAIL PROTECTED] wrote: Hello Kenneth, shouldn't you use 0x70 for the mapping register of HWMon function ? With ABit KT7A (686B) # pciconf -l hostb1@pci0:7:4: class=0x06 card=0x chip=0x30571106 rev=0x40 hdr=0x00 # pciconf -r pci0:7:4 0x70 0x6001 and 0x6000 can be used as an i/o-base by a dirty hack to directly inb() the monitor data. I stripped it from the NetBSD driver (I think). Juha To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: driver writing newbie
On Wed, 25 Jul 2001, Kenneth Wayne Culver wrote: Well, I could do that, but I'd rather write a complete driver with all the regular interfaces... (open, close, ioctl, and a specific major/minor in the kernel, I'm going to add other chips to this driver eventually) The way you are suggesting just opens /dev/io and uses inb and outb to do some hacking around I believe. You are absolutely correct. I was not suggesting this as the proper approach, but as a throw-away checkpoint only (the mapping registers seemed inconsistent between OS/motherboard combinations). I suppose 0x70 is for HWMon and 0x90 is for the SMBus function, in Via 686B. Have you checked NetBSD, the seem to have a framework for temperature alarms etc. Juha To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message
Re: driver writing newbie
I havn't checked, but I'll probably do that soon. Ken On Wed, 25 Jul 2001 [EMAIL PROTECTED] wrote: On Wed, 25 Jul 2001, Kenneth Wayne Culver wrote: Well, I could do that, but I'd rather write a complete driver with all the regular interfaces... (open, close, ioctl, and a specific major/minor in the kernel, I'm going to add other chips to this driver eventually) The way you are suggesting just opens /dev/io and uses inb and outb to do some hacking around I believe. You are absolutely correct. I was not suggesting this as the proper approach, but as a throw-away checkpoint only (the mapping registers seemed inconsistent between OS/motherboard combinations). I suppose 0x70 is for HWMon and 0x90 is for the SMBus function, in Via 686B. Have you checked NetBSD, the seem to have a framework for temperature alarms etc. Juha To Unsubscribe: send mail to [EMAIL PROTECTED] with unsubscribe freebsd-current in the body of the message