Subject: Re: how to add PCI card?
To: None <netbsd-help@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: netbsd-help
Date: 10/13/2004 21:46:36
On Wed, Oct 13, 2004 at 08:49:34PM +0200, Jukka Salmi wrote:
> Hi,
> 
> I added a serial I/O PCI card (VScom PCI-200, two ports, 16C550 UARTs)
> to a i386 system running NetBSD 2.0_RC4. The card was detected as
> 
> PLX Technology product 0x1103 (serial communications, revision 0x01) at
>  pci0 dev 9 function 0 not configured
> 
> I suspect the puc(4) driver to work for this card. If yes, I should
> probably add a new entry to src/sys/dev/pci/pucdata.c, but I don't
> understand most of the struct puc_device_description members. So far
> I assume rval[0] to be the vendor ID and rval[1] to be the device ID,
> but what are rval[2] and rval[3], rmask, ports.bar, ports.offset and
> ports.flags?

rval[2]/rval[3] are the alternate vendor/device ID. The rmask array are
masks to be applied to the values read from registers before checking
against rval. In most case, you have rval[0]/rval[1] set to the vendor/device
ID, rmask[0] = rmask[1] = 0xffffff, rval[2] = rval[3] = rmask[2] = rmask[3] = 0.

ports.bar: which base address register to use for this function,
ports.offset: at which offset from the BAR are located the registers for
this function.
ports.flags: flags for this funtion, also contain the clock rate.

I added the entry for the VScom PCI-800. There was intructions for linux
available, which had all the needed infos. Does your card come with such
linux instructions or drivers ?

Otherwise you'll have to make guesses from the output of pcictl dump

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--