Subject: Re: how to add PCI card?
To: None <netbsd-help@netbsd.org>
From: Jukka Salmi <j+nbsd@2004.salmi.ch>
List: netbsd-help
Date: 10/14/2004 15:13:54
--Pd0ReVV5GZGQvF3a
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Manuel Bouyer --> netbsd-help (2004-10-13 21:46:36 +0200):
> 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.

Thanks for the detailed explanation.


> 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 ?

Linux (I checked with 2.6.8.1 and 2.4.27) supports the card, but
unfortunately I'm still too stupid to figure out what values to use
for a new puc_device_description element...


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

Output is attached.


Help is appreciated!

TIA, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~

--Pd0ReVV5GZGQvF3a
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="vscom200.pcictl_dump"

PCI configuration registers:
  Common header:
    0x00: 0x110310b5 0x02800003 0x07000001 0x00000008

    Vendor Name: PLX Technology (0x10b5)
    Device ID: 0x1103
    Command register: 0x0003
      I/O space accesses: on
      Memory space accesses: on
      Bus mastering: off
      Special cycles: off
      MWI transactions: off
      Palette snooping: off
      Parity error checking: off
      Address/data stepping: off
      System error (SERR): off
      Fast back-to-back transactions: off
    Status register: 0x0280
      Capability List support: off
      66 MHz capable: off
      User Definable Features (UDF) support: off
      Fast back-to-back capable: on
      Data parity error detected: off
      DEVSEL timing: medium (0x1)
      Slave signaled Target Abort: off
      Master received Target Abort: off
      Master received Master Abort: off
      Asserted System Error (SERR): off
      Parity error detected: off
    Class Name: communications (0x07)
    Subclass Name: serial (0x00)
    Interface: 0x00
    Revision ID: 0x01
    BIST: 0x00
    Header Type: 0x00 (0x00)
    Latency Timer: 0x00
    Cache Line Size: 0x08

  Type 0 ("normal" device) header:
    0x10: 0xeb001000 0x0000a401 0x0000a801 0x0000ac01
    0x20: 0x00000000 0x0000b001 0x00000000 0x110310b5
    0x30: 0x00000000 0x00000000 0x00000000 0x00000105

    Base address register at 0x10
      type: 32-bit nonprefetchable memory
      base: 0xeb001000, not sized
    Base address register at 0x14
      type: i/o
      base: 0x0000a400, not sized
    Base address register at 0x18
      type: i/o
      base: 0x0000a800, not sized
    Base address register at 0x1c
      type: i/o
      base: 0x0000ac00, not sized
    Base address register at 0x20
      not implemented(?)
    Base address register at 0x24
      type: i/o
      base: 0x0000b000, not sized
    Cardbus CIS Pointer: 0x00000000
    Subsystem vendor ID: 0x10b5
    Subsystem ID: 0x1103
    Expansion ROM Base Address: 0x00000000
    Reserved @ 0x34: 0x00000000
    Reserved @ 0x38: 0x00000000
    Maximum Latency: 0x00
    Minimum Grant: 0x00
    Interrupt pin: 0x01 (pin A)
    Interrupt line: 0x05

  Device-dependent header:
    0x40: 0x00000000 0x00000000 0x00000000 0x00000000
    0x50: 0x00000000 0x00000000 0x00000000 0x00000000
    0x60: 0x00000000 0x00000000 0x00000000 0x00000000
    0x70: 0x00000000 0x00000000 0x00000000 0x00000000
    0x80: 0x00000000 0x00000000 0x00000000 0x00000000
    0x90: 0x00000000 0x00000000 0x00000000 0x00000000
    0xa0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xb0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xc0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xd0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xe0: 0x00000000 0x00000000 0x00000000 0x00000000
    0xf0: 0x00000000 0x00000000 0x00000000 0x00000000


--Pd0ReVV5GZGQvF3a--