OpenWrt Forum Archive

Topic: Multiport RS232 miniPCI

The content of this topic has been archived on 4 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

first my setup:

Avila GW2348-4 Network Platform
AAEON PER-C40C 4 port RS232 miniPCI card based on Oxford semiconductor OXmPCI954 chip
TRANSCEND 4GB Industrial CompactFlash
(some additional miniPCI expansion cards - not used till I solve problem)
Kamikaze r11060 - compiled for Avila/ixp4xx target

Nearly everything (just mini_fo bug) work fine but no luck with RS232 miniPCI. As documentation say I tried this (and similar) commands:

mknod -m 666 /dev/ttyS4 c 4 68
setserial /dev/ttyS4 port 1000 irq 28 uart 16950 baud_base 115200

last command produce this output:

/dev/ttyS4: No such device or address

There is no word about Oxford semiconductor chip in dmesg nor logread.
lspci -v output is:

00:01.0 Serial controller: Oxford Semiconductor Ltd OX16PCI954 (Quad 16950 UART) function 0 (Uart) (prog-if 06 [16950])
        Subsystem: Oxford Semiconductor Ltd Unknown device 0000
        Flags: medium devsel, IRQ 28
        I/O ports at 1000 [disabled] [size=32]
        Memory at 48010000 (32-bit, non-prefetchable) [disabled] [size=4K]
        I/O ports at 1020 [disabled] [size=32]
        Memory at 48011000 (32-bit, non-prefetchable) [disabled] [size=4K]
        Capabilities: [40] Power Management version 1

00:01.1 Bridge: Oxford Semiconductor Ltd OX16PCI954 (Quad 16950 UART) function 1 (8bit bus)
        Subsystem: Oxford Semiconductor Ltd Unknown device 0000
        Flags: medium devsel, IRQ 27
        I/O ports at 1040 [disabled] [size=32]
        Memory at 48012000 (32-bit, non-prefetchable) [disabled] [size=4K]
        I/O ports at 1060 [disabled] [size=32]
        Memory at 48013000 (32-bit, non-prefetchable) [disabled] [size=4K]
        Capabilities: [40] Power Management version 1

Any ideas?

More info:

I tried to put RS232 card into my notebook on Slackware 12.0 distro. Card is somehow conflicting with onboard serial controller but interesting part is lspci -v output:

00:09.0 Serial controller: Oxford Semiconductor Ltd OX16PCI954 (Quad 16950 UART) function 0 (Uart) (prog-if 06 [16950])
        Subsystem: Oxford Semiconductor Ltd Unknown device 0000
        Flags: medium devsel, IRQ 10
        I/O ports at 1820 [size=32]
        Memory at d0004000 (32-bit, non-prefetchable) [size=4K]
        I/O ports at 1800 [size=32]
        Memory at d0003000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: [40] Power Management version 1
        Kernel driver in use: serial

00:09.1 Bridge: Oxford Semiconductor Ltd OX16PCI954 (Quad 16950 UART) function 1 (8bit bus)
        Subsystem: Oxford Semiconductor Ltd Unknown device 0000
        Flags: medium devsel, IRQ 10
        I/O ports at 1860 [size=32]
        Memory at d0006000 (32-bit, non-prefetchable) [size=4K]
        I/O ports at 1840 [size=32]
        Memory at d0005000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: [40] Power Management version 1
        Kernel driver in use: serial

If you compare it with Avila lspci -v output there are two important diferencies:
1.
I/O ports at 1000 [disabled] [size=32] ||| Avila@Kamikaze
I/O ports at 1820 [size=32] ||| Notebook@Slackware
Memory at 48012000 (32-bit, non-prefetchable) [disabled] [size=4K] ||| Avila@Kamikaze
Memory at d0004000 (32-bit, non-prefetchable) [size=4K] ||| Notebook@Slackware

2.
THERE IS NO KERNEL DRIVER LOADED ||| Avila@Kamikaze
Kernel driver in use: serial ||| Notebook@Slackware

So primary question is how to enable IO ports and memory on Avila@Kamikaze.

Part of notebook dmesg:

Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
serial8250: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
00:09: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A
PCI: Enabling device 0000:00:08.0 (0000 -> 0003)
ACPI: PCI Interrupt Link [LNK6] enabled at IRQ 10
PCI: setting IRQ 10 as level-triggered
ACPI: PCI Interrupt 0000:00:08.0[A] -> Link [LNK6] -> GSI 10 (level, low) -> IRQ 10
ACPI: PCI interrupt for device 0000:00:08.0 disabled
PCI: Enabling device 0000:00:09.0 (0000 -> 0003)
ACPI: PCI Interrupt Link [LNK3] enabled at IRQ 10
ACPI: PCI Interrupt 0000:00:09.0[A] -> Link [LNK3] -> GSI 10 (level, low) -> IRQ 10
ttyS1: detected caps 00000700 should be 00000100
0000:00:09.0: ttyS1 at I/O 0x1820 (irq = 10) is a 16C950/954
ttyS2: detected caps 00000700 should be 00000100
0000:00:09.0: ttyS2 at I/O 0x1828 (irq = 10) is a 16C950/954
ttyS3: detected caps 00000700 should be 00000100
0000:00:09.0: ttyS3 at I/O 0x1830 (irq = 10) is a 16C950/954
Couldn't register serial port 0000:00:09.0: -28
PCI: Enabling device 0000:00:09.1 (0000 -> 0003)
ACPI: PCI Interrupt Link [LNK2] enabled at IRQ 10
ACPI: PCI Interrupt 0000:00:09.1[b] -> Link [LNK2] -> GSI 10 (level, low) -> IRQ 10
Couldn't register serial port 0000:00:09.1: -28

(Last edited by zedd on 10 May 2008, 18:22)

Seems you have to enable PCI support for 8250/16550 in the Kernel which is disabled by default and recompile.

Run 'make kernel_menuconfig' and select: Device Drivers > Character devices > Serial drivers > 8250/16550 PCI device support: M -- Maximum number of 8250/16550 serial ports: 4 -- Number of 8250/16550 serial ports to register at runtime: 4
Maybe you have to play with the extended options for 8250/16550 as well. I don't know.

Then Save and Exit kernel_menuconfig. Now recompile the Kernel with 'make target/linux/{clean,compile}'. After some time you have a new Kernel module (build_dir/linux-ixp4xx_generic/linux-2.6.25.1/drivers/serial/8250_pci.ko) which you have to transfer to your router.

'insmod 8250_pci' and see if you get further. If not you may also have to reflash the image. Paste output from 'dmesg | grep tty'. If everything works you can build and install the setserial package and configure your serial ports.

If it works you can finally compile 8250_pci directly into the Kernel or package it as a Kernel package (kmod, see package/kernel/modules/other.mk).

(Last edited by forum2008 on 10 May 2008, 19:20)

Thanks a lot! That helped.
I reflashed kernel image and now 2 of 4 ports on miniPCI card work. So I need to set:
Maximum number of 8250/16550 serial ports: 6
Number of 8250/16550 serial ports to register at runtime: 6

or is it possible to feed this parameter to kernel during boot? I found on some forum this post:

--------------------------------------------------------------------------------------------
I have found that I can add the kernel boot option "8250.nr_uarts=4"
which gets around the problem. I presume the number of serial ports to
determine at boot time was configured to 2 in this release of the kernel.
--------------------------------------------------------------------------------------------
Allow RedBoot kernel options posting?
Maybe:
exec -c "8250.nr_uarts=6"
will do the work - no, it doesn't work - kernel do not start with this option - maybe bad syntax? Where I can learn correct settings?

Once more: THANKS A LOT!

The discussion might have continued from here.