PCI-E OXPCIe952 dual serial card

prix

New Member


Messages: 3

Hello!

I have been trying to setup PCI-E OXPCIe952 dual serial card which I got from Ebay. It's an "el cheapo" serial expansion card but I thought it should work since this chipset seems to be supported under freebsd FreeBSD.

This is pciconf -lv:
Code:
# pciconf -lv:

none1@pci0:2:0:0:       class=0x070002 card=0xc1401415 chip=0xc1401415 rev=0x00 hdr=0x00
    vendor     = 'Oxford Semiconductor Ltd'
    class      = simple comms
    subclass   = UART
none2@pci0:2:0:1:       class=0x070002 card=0xc1411415 chip=0xc1411415 rev=0x00 hdr=0x00
    vendor     = 'Oxford Semiconductor Ltd'
    class      = simple comms
    subclass   = UART
I have checked under pucdata.c:
Code:
        {   0x1415, 0xc138, 0xffff, 0,
            "Oxford Semiconductor OXPCIe952 UARTs",
            DEFAULT_RCLK * 0x22,
            PUC_PORT_NONSTANDARD, 0x10, 0, -1,
            .config_function = puc_config_oxford_pcie
        },
I manually edited pucdata.c and added chip 0xc140:
Code:
        {   0x1415, 0xc140, 0xffff, 0,
            "Oxford Semiconductor OXPCIe952 UARTs",
            DEFAULT_RCLK * 0x22,
            PUC_PORT_NONSTANDARD, 0x10, 0, -1,
            .config_function = puc_config_oxford_pcie
        },
I rebooted the machine and hoped for the best; nothing changes. Can you tell me what I am doing wrong?

This is dmesg | grep -i pci2:
Code:
pci2: <ACPI PCI bus> on pcib2
pci2: <simple comms, UART> at device 0.0 (no driver attached)
pci2: <simple comms, UART> at device 0.1 (no driver attached)
And I am using GENERIC kernel with FreeBSD 9.0. (kernel modules puc, uart, ppc)


Thanks for answers!

Prix
 
Last edited by a moderator:

Uniballer

Well-Known Member

Reaction score: 63
Messages: 337

You'll need to rebuild the kernel for there to be any hope of your changes being incorporated.

At a minimum:

Code:
cd /usr/src
make buildkernel
make installkernel
 
OP
OP
P

prix

New Member


Messages: 3

Will try that... I also thought this it the case since this pucdat.c is C source but didn't know how to "apply" changes to the file :)

CU, Prix
 
OP
OP
P

prix

New Member


Messages: 3

Hello!

Now I have recompiled kernel with modified pucdata.c.
This is added description of the chip:
Code:
        {   0x1415, 0xc140, 0xffff, 0,
            "Oxford Semiconductor OXPCIe952 UARTs",
            DEFAULT_RCLK * 0x22,
            PUC_PORT_NONSTANDARD, 0x10, 0, -1,
            .config_function = puc_config_oxford_pcie
        },

        {   0x1415, 0xc141, 0xffff, 0,
            "Oxford Semiconductor OXPCIe952 UARTs",
            DEFAULT_RCLK * 0x22,
            PUC_PORT_NONSTANDARD, 0x10, 0, -1,
            .config_function = puc_config_oxford_pcie
        },
Now puc driver is asigned with pci-e serial card but there is no UART:

output of dmesg | grep -i pci2:
Code:
pci2: <ACPI PCI bus> on pcib2
puc0: <Oxford Semiconductor OXPCIe952 UARTs> port 0xd800-0xd807 irq 18 at device 0.0 on pci2
puc1: <Oxford Semiconductor OXPCIe952 UARTs> port 0xd400-0xd407 irq 19 at device 0.1 on pci2
output of dmesg | grep -i uart:
Code:
puc0: <Oxford Semiconductor OXPCIe952 UARTs> port 0xd800-0xd807 irq 18 at device 0.0 on pci2
puc0: -2133601977 UARTs detected
puc1: <Oxford Semiconductor OXPCIe952 UARTs> port 0xd400-0xd407 irq 19 at device 0.1 on pci2
puc1: -2133601977 UARTs detected
I was at least expecting something like this:
Code:
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: [FILTER]
Is there anything else that I should do... Where to look for somekind of output/logs?
ps. Also I don't have any /dev/ttyu..

Thanks!
 

hishnik

New Member

Reaction score: 1
Messages: 7

Did you solve this issue?
Same here, but FreeBSDs 12.0 and 12.1 are hangs or panics with this code in kernel when such expresscard plugged in.
 

Phishfry

Son of Beastie

Reaction score: 1,524
Messages: 4,429

I addition to adding the VID+PID to the driver you must enable the new UART's in /boot/device.hints
Take a look at the file and replicate the existing UART's with your new ones in /boot/devive.hints
 

hishnik

New Member

Reaction score: 1
Messages: 7

Thank you for paying attention to my problems.

Can you give me a link to manual or smth. on this hints?
I need to insert this card in runtime. device.hints can help me with this?
Where should I get all those bus, port, flags, irq and hint.uart.* device numbers for the new expresscard COM-ports?

Thank you very much for setting me on the proper path.
 

Phishfry

Son of Beastie

Reaction score: 1,524
Messages: 4,429

Where should I get all those bus, port, flags, irq and hint.uart.* device numbers for the new expresscard COM-ports?
After inserting expresscard check here: pciconf -lvcbe

More reading for you:
 

Phishfry

Son of Beastie

Reaction score: 1,524
Messages: 4,429

In some cases you might need to disable the UART's in /boot/device.hints. Why?
Well your laptop may have serial ports built on the motherboard even though there are no DB9 connectors.
Here is my HP laptop's non-existent serial port:
dmesg | grep uart
uart2: <Intel Panther Point KT Controller> port 0x5050-0x5057 mem 0xd443b000-0xd443bfff irq 17 at device 22.3 on pci0
This laptop has zero serial connectors yet still has a uart showing.
Perhaps this could interfere with an add on serial port expresscard.
 

hishnik

New Member

Reaction score: 1
Messages: 7

There is no any built-in uarts or serial ports in my laptop.
It's lenovo x230t.
`dmesg | grep uart` gives me nothing.
device.hints has default uart records in it:
Code:
...
hint.uart.0.at="isa"
hint.uart.0.port="0x3F8"
hint.uart.0.flags="0x10"
hint.uart.0.irq="4"
hint.uart.1.at="isa"
hint.uart.1.port="0x2F8"
hint.uart.1.irq="3"
...
expresscard has 2 RS232C COM-ports.

As far as I can see, I could change records in device.hints from
hint.uart.*.at="isa"
to
hint.uart.*.at="pci".
Am I right?
Where can I get correct values for 'flags', 'port' addresses and 'IRQs'?
 

Phishfry

Son of Beastie

Reaction score: 1,524
Messages: 4,429

Where can I get correct values for 'flags', 'port' addresses and 'IRQs'?
Those will come from your dmesg output.
With no UART's showing in dmesg (or pciconf for hot plugged devices) that means your device is not recognized by FreeBSD.
You might need to do some more work on the source code for the puc driver.
You did recompile after your edits correct?
Does anything show up in the terminal when you hotplug the device.
Why do you need to hotplug the device anyway? That may take extra tweaks to get working.

Am I right?
I am unsure what bus the express cards would use.
There is a chance that /boot/device.hints might not need any entries.
You must get the card showing correctly in pciconf before worrying about /boot/device.hints.
 

hishnik

New Member

Reaction score: 1
Messages: 7

Those will come from your dmesg output.
With no UART's showing in dmesg (or pciconf for hot plugged devices) that means your device is not recognized by FreeBSD.
When kernel is compiled with no modifications to pucdata.c it shows me the same as topicstarter wrote earlier:

Code:
pci3: <ACPI PCI bus> on pcib3
pci3: <simple comms, UART> at device 0.0 (no driver attached)
pci3: <simple comms, UART> at device 0.1 (no driver attached)
Now I'm recompiling my kernel, so more accurate results I'll give you later.
If memory serves me right, I had the same result.

You might need to do some more work on the source code for the puc driver.
You did recompile after your edits correct?
Does anything show up in the terminal when you hotplug the device.
I recompiled my kernel with changes in pucdata.c, of course.
With default kernel results like above pci3:...

Why do you need to hotplug the device anyway? That may take extra tweaks to get working.
I have my boot partition on external card, and this card is seizing my expresscard slot.

I am unsure what bus the express cards would use.
It's pci bus in any case.
...

I'll give you more results after recompiling my kernel with default pucdata.c .

<...some time later...>

pciconf -vl | grep 1415 -A 3
Code:
none1@pci0:4:0:0:    class=0x070002 card=0xc1401415 chip=0xc1401415 rev=0x00 hdr=0x00
    vendor     = 'Oxford Semiconductor Ltd'
    class      = simple comms
    subclass   = UART
none2@pci0:4:0:1:    class=0x070002 card=0xc1411415 chip=0xc1411415 rev=0x00 hdr=0x00
    vendor     = 'Oxford Semiconductor Ltd'
    class      = simple comms
    subclass   = UART
dmesg|grep pci3
Code:
pci3: <ACPI PCI bus> on pcib3
pci3: <simple comms, UART> at device 0.0 (no driver attached)
pci3: <simple comms, UART> at device 0.1 (no driver attached)
Maybe I have to edit ./sys/dev/uart/uart_bus_pci.c ?

<...some more time spent...>
After changing uart_bus_pci.c and pucdata.c and kernel recompile I got system hang after inserting card.
In 1 of 3 insert cases it writes kernel message, like:
Code:
pci3: <ACPI PCI bus> on pcib3
puc0: <Oxford Semiconductor OXPCIe952 UARTs> port 0x4000-0x4007 at device 0.0 on pci3
puc0: 8 UARTs detected
puc0: <Oxford Semiconductor OXPCIe952 UARTs> at device 0.1 on pci3
...and after such output I'm getting total OS hangup.

Why it sees 8 UARTs at first puc?
 
Top