Apologies if this is the wrong place for this question, I'm not currently sure which level the problem is at so I'm hedging my bets a tad.
System is a LeopardBoard DM368 running TI's own SDK / LSP / BusyBox kernel.
By default the system has one UART enabled, UART0, mounted as /dev/ttyS0 which is also used/invoked via the bootargs console=ttyS0,115200n8 earlyprintk
.
We want to enable UART1 as /dev/ttyS1, so have gone through the low-level board initialisation code which sets up the pinmux, clocks, etc.
On booting, the low-level init reports (via printk's I added in) that it's enabled the UART1, and the driver code reports happiness too:
[ 0.547812] serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A
[ 0.569849] serial8250.0: ttyS1 at MMIO 0x1d06000 (irq = 41) is a 16550A
However, the port does not (reliably) appear in /dev/, and there are discrepancies with its status (flow control bits) which I suspect may be causing it to hang / never transmit:
cat /proc/tty/driver/serial
serinfo:1.0 driver revision:
0: uart:16550A mmio:0x01C20000 irq:40 tx:97998 rx:0 CTS|DSR
1: uart:16550A mmio:0x01D06000 irq:41 tx:0 rx:0 DSR
If I try to modify it from the command line I get an error:
>: stty -F /dev/ttyS1
stty: /dev/ttyS1: Inappropriate ioctl for device
Bizarrely, if I change the bootargs to console=ttyS1,115200n8 earlyprintk
the port works perfectly, and ttyS0 is initialised correctly and works too:
cat /proc/tty/driver/serial
serinfo:1.0 driver revision:
0: uart:16550A mmio:0x01C20000 irq:40 tx:0 rx:0 CTS|DSR
1: uart:16550A mmio:0x01D06000 irq:41 tx:11563 rx:0 RTS|DTR|DSR
Now, that would be fine, but our bootloader must use UART0 so it would be nice to keep all the console stuff on ttyS0 and have ttyS1 for our secondary comms.
Edit to add: I inserted a couple of printk's into serial_core.c and it seems like uart_open() is never being called for ttyS1, I'm assuming it's something in the Linux init/startup sequence that needs modifying?
I'll state now that I'm not a hardy Linux hacker so it's entirely possible I've missed some obvious/dumb thing in either the kernel code, initialisation sequence, etc.
Any thoughts greatly appreciated!
Well a nice chap over on the Linux board solved it, I need to insert a mknod /dev/ttyS1 c 4 65
somewhere.
Quite why this (apparently) happens for ttyS0
or whichever port is console
I don't know, but right now all that matters is it works!
Comments / further info on the reasons why would be welcome for my own knowledge / future generations.