SIIG 4S PCIe 4-port Serial Card

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

SIIG 4S PCIe 4-port Serial Card

William Ahern-2
The puc(4) man page lists the SIIG Cyber 4S PCI as supported. I just
inserted a SIIG Cyber 4S PCIe. I figured it would look the same as the PCI
card, considering that the new chip is named OXPCIe954, similar to the old
OXPCI954.

But obviously that was hopelessly naive. Instead I get:

        vendor "Oxford", unknown product 0xc208 (class communications
        subclass serial, rev 0x00) at pci13 dev 0 function 0 not configured

It looks like the vendor id is PCI_VENDOR_OXFORD2, and not PCI_VENDOR_SIIG.
Any pointers on what data structure and defines I should try adding? It
looks like the actual PUC driver is simple enough, I just need the card to
be recognized.

I'm running stock OpenBSD 5.1/amd64 on a Soekris net6501.

Reply | Threaded
Open this post in threaded view
|

Re: SIIG 4S PCIe 4-port Serial Card

Kurt Mosiejczuk-2
William Ahern wrote:
> The puc(4) man page lists the SIIG Cyber 4S PCI as supported. I just
> inserted a SIIG Cyber 4S PCIe. I figured it would look the same as the PCI
> card, considering that the new chip is named OXPCIe954, similar to the old
> OXPCI954.

> But obviously that was hopelessly naive. Instead I get:

> vendor "Oxford", unknown product 0xc208 (class communications
> subclass serial, rev 0x00) at pci13 dev 0 function 0 not configured

> It looks like the vendor id is PCI_VENDOR_OXFORD2, and not PCI_VENDOR_SIIG.
> Any pointers on what data structure and defines I should try adding? It
> looks like the actual PUC driver is simple enough, I just need the card to
> be recognized.

> I'm running stock OpenBSD 5.1/amd64 on a Soekris net6501.

When I put a variant in, I looked at the following files:

http://www.openbsd.org/cgi-bin/cvsweb/src/sys/dev/pci/pucdata.c?annotate=1.51

Search for henning and the section starting on line 551 is the patch in
this file you want.

This was the other (which didn't go in right away since I mangled the
patch in email):

http://www.openbsd.org/cgi-bin/cvsweb/src/sys/dev/pci/pcidevs?annotate=1.1434

Look for miod or 1.1434 to find that one line change.

Now, mine mostly worked, except communication was garbled.  Mine was one
of the cards with a faster crystal.  Assuming your just isn't
recognized, some work with something like lspci would get the exact
identifiers for you.

It's been 4-5 years since then, and I had to look up these files, but I
suspect this is the areas you are looking for.

--Kurt Mosiejczuk

Reply | Threaded
Open this post in threaded view
|

Re: SIIG 4S PCIe 4-port Serial Card

Stuart Henderson
In reply to this post by William Ahern-2
On 2012/10/19 12:44, William Ahern wrote:

> The puc(4) man page lists the SIIG Cyber 4S PCI as supported. I just
> inserted a SIIG Cyber 4S PCIe. I figured it would look the same as the PCI
> card, considering that the new chip is named OXPCIe954, similar to the old
> OXPCI954.
>
> But obviously that was hopelessly naive. Instead I get:
>
> vendor "Oxford", unknown product 0xc208 (class communications
> subclass serial, rev 0x00) at pci13 dev 0 function 0 not configured
>
> It looks like the vendor id is PCI_VENDOR_OXFORD2, and not PCI_VENDOR_SIIG.
> Any pointers on what data structure and defines I should try adding? It
> looks like the actual PUC driver is simple enough, I just need the card to
> be recognized.
>
> I'm running stock OpenBSD 5.1/amd64 on a Soekris net6501.
>

My original mail about the chip (including diff) is at
http://marc.info/?l=openbsd-tech&m=126446213208560&w=2, there is
some problem I was unable to track down which prevents things from
working when the port is set to the correct frequency, but setting
to half the frequency gets a usable port, you just need to half
the desired baud rate of the serial port (e.g. cu -s 4800 -l cua03).

Diff there won't apply directly as things have changed since then.

The pcidevs change might apply with patch but is simple enough to
hand-apply; after doing this, run "make" in sys/dev/pci to update
the pcidevs.h/pcidevs_data.h files.

The pucdata.c table has changed format since then to save memory,
something like the below should be about right, you can't get the
speed bang-on with the new table format (rather than recording
actual speed it uses shorthand to allow multipliers or powers-of-two
of the standard COM port UART frequency 1.8432MHz; the exact needed
speed can't be stored in this notation but using a multiplier of 17
should be close enough for other ports to lock onto it - if not
then try 18). This version is untested though as I am lacking
machines with PCIe slots that I can use for testing.

        /* Oxford Semiconductor OXPCIe954 PCIe */
        {   /* "OXPCIe954", */
            { PCI_VENDOR_OXFORD2, PCI_PRODUCT_OXFORD2_OXPCIE954, 0, 0 },
            { 0xffff, 0xffff, 0, 0 },
            {
                /*
                 * Clock is fixed at 62.5 MHz, derived from PCIe clock.
                 * But this doesn't work so use half the speed.
                 * XXX Number of ports should not be hard-coded, it can vary
                 * and should be fetched from BAR offset 0x0004.
                 */
                { PUC_COM_MUL(17), 0x10, 0x1000 },
                { PUC_COM_MUL(17), 0x10, 0x1200 },
                { PUC_COM_MUL(17), 0x10, 0x1400 },
                { PUC_COM_MUL(17), 0x10, 0x1600 },
            },
        },

Also the first PCIe954 chip can be connected to a companion chip(/s?)
to allow for up to 8 extra ports but you can't determine whether
this has been done just by looking at PCI IDs, you are supposed to
fetch information about how many ports are wired up from information
provided by the chip itself - however hardcoding the first 4 ports
is enough to get the 4-port card working.

Reply | Threaded
Open this post in threaded view
|

Re: SIIG 4S PCIe 4-port Serial Card

William Ahern-2
On Fri, Oct 19, 2012 at 10:54:33PM +0100, Stuart Henderson wrote:
<snip>

> My original mail about the chip (including diff) is at
> http://marc.info/?l=openbsd-tech&m=126446213208560&w=2, there is
> some problem I was unable to track down which prevents things from
> working when the port is set to the correct frequency, but setting
> to half the frequency gets a usable port, you just need to half
> the desired baud rate of the serial port (e.g. cu -s 4800 -l cua03).
>
> Diff there won't apply directly as things have changed since then.
>
> The pcidevs change might apply with patch but is simple enough to
> hand-apply; after doing this, run "make" in sys/dev/pci to update
> the pcidevs.h/pcidevs_data.h files.
>
> The pucdata.c table has changed format since then to save memory,
> something like the below should be about right, you can't get the
> speed bang-on with the new table format (rather than recording
> actual speed it uses shorthand to allow multipliers or powers-of-two
> of the standard COM port UART frequency 1.8432MHz; the exact needed
> speed can't be stored in this notation but using a multiplier of 17
> should be close enough for other ports to lock onto it - if not
> then try 18). This version is untested though as I am lacking
> machines with PCIe slots that I can use for testing.

The patch worked as advertised and unedited. Many thanks.

I have a few days before this thing goes into the colo, so I'm free to
experiment a little. If you have any ideas you want to test out, feel free
to send me a patch.