On 2011-03-07, Tero Koskinen <[email protected]> wrote:
> Hi,
>
> I recently bought a PCI express card[1] with two UARTs, but OpenBSD/amd64
> 4.9-beta doesn't recognize it.
>
> pcidump says following:
> 2:0:0: Oxford unknown
> 0x0000: Vendor ID: 1415 Product ID: c158
> 0x0004: Command: 0107 Status ID: 0010
> 0x0008: Class: 07 Subclass: 00 Interface: 02 Revision: 00
> 0x000c: BIST: 00 Header Type: 00 Latency Timer: 00 Cache Line Size: 10
> 0x0010: BAR mem 32bit addr: 0xfe9fc000/0x00004000
> 0x0014: BAR mem 32bit addr: 0xfe600000/0x00200000
> 0x0018: BAR mem 32bit addr: 0xfe400000/0x00200000
> 0x001c: BAR empty (00000000)
> 0x0020: BAR empty (00000000)
> 0x0024: BAR empty (00000000)
> 0x0028: Cardbus CIS: 00000000
> 0x002c: Subsystem Vendor ID: 1415 Product ID: c158
> 0x0030: Expansion ROM Base Address: 00000000
> 0x0038: 00000000
> 0x003c: Interrupt Pin: 01 Line: 0b Min Gnt: 00 Max Lat: 00
> 0x0040: Capability 0x01: Power Management
> 0x0070: Capability 0x10: PCI Express
> Link Speed: 2.5 / 2.5 Gb/s Link Width: x1 / x1
> 0x00b0: Capability 0x11: Extended Message Signaled Interrupts (MSI-X)
>
> The card seems to use some Oxford chip. I tried to add the product id to
> the pcidevs list and to pucdata.c, but whole system freezes in a few seconds
> after boot (keyboard/mouse/network/ssh not working). Usually at the point
> when xdm had been started.
>
> Does anyone have any idea what I should put to pucdata.c? My current
> entry was a pure guess. (Is there any datasheet about the chipset
> available?)
>
> The card itself seems to be ok, since Fedora 14 recognizes it and
> both UARTs work as expected.
>
> dmesg (without any patches) and my patching attempt below.
[snip]
> Index: dev/pci/pucdata.c
>===================================================================
> RCS file: /cvs/src/sys/dev/pci/pucdata.c,v
> retrieving revision 1.72
> diff -u -p -r1.72 pucdata.c
> --- dev/pci/pucdata.c 22 Jul 2010 17:16:10 -0000 1.72
> +++ dev/pci/pucdata.c 7 Mar 2011 19:35:50 -0000
> @@ -897,6 +897,17 @@ const struct puc_device_description puc_
> { PUC_PORT_TYPE_COM, 0x14, 0x00, COM_FREQ },
> },
> },
> +#if 1
> + /* Oxford Semiconductor OX16PCIE952 PCIe `950 UARTs - 128 byte FIFOs */
> + { /* "Oxford Semiconductor OX16PCIE952 UARTs", */
> + { PCI_VENDOR_OXFORD2, PCI_PRODUCT_OXFORD2_OX16PCIE952, 0, 0 },
> + { 0xffff, 0xffff, 0, 0 },
> + {
> + { PUC_PORT_TYPE_COM, 0x10, 0x200, COM_FREQ },
> + { PUC_PORT_TYPE_COM, 0x14, 0x200, COM_FREQ },
> + },
> + },
> +#endif
The PCIE parts use quite different addresses. You can try these:
{ PUC_PORT_TYPE_COM, 0x10, 0x1000, 4000000 * 8 },
{ PUC_PORT_TYPE_COM, 0x10, 0x1200, 4000000 * 8 },
The speeds will almost certainly be wrong, you'll probably need to
cu -s 4800 to get a 9600 baud connection with this (the divisor should
be 4000000 * 16 but I couldn't get this to work, for more info see
http://marc.info/?l=openbsd-tech&m=126446213208560&w=2).
I may have datasheets for this somewhere...you can learn some things
from the linux driver too, they have some fancy stuff to work out how
many ports the devices have, etc.