Serial issues with EG20T (Topcliff) PCH uarts
I provide a lot of details below, so here's a brief summary of what I'm running into:
o Using a PCIe attached EG20T (Topcliff) uart at 0xb060, INT 18
o BIOS redirection to serial works
o Syslinux redirection to serial doesn't
o kernel messages only appear well into the boot process (after PCI init)
o getty doesn't present login over serial
OK, so what follows is are the details.
I'm working with a board with PCIe connected Topcliff PCH uarts. A serial expansion board provides a serial->usb converter so that you plug in a microUSB from your host to the board and you get a usb uart (ie /dev/ttyUSB0 on your host, which communicates with /dev/ttyS1 on the board). This UART line (basically 3 wire UART, not RS232) are connected to a TUSB3410RHB which exports them over USB to the host. As far as the board is concerned, it is regular serial ports.. well, a regular PCIe attached serial port.
Using the ti_usb_3410_5052 driver with modified vendor/product strings, I am able to get ttyUSB0 on my host and open it in minicom:
$ sudo modprobe ti_usb_3410_5052 vendor_3410=0x0451 product_3410=0x5053 $ minicom -D /dev/ttyUSB0
I configure minicom for 115200,8,none,1,no,no
In the board's BIOS, I configure console redirection to go over COM2 (COM0 and COM1 are marked as "Not Present", COM2 is PCI,Bus5,Dec10,Func2) and set its baud,etc accordingly. After rebooting, I get POST and BIOS over serial. I can enter the BIOS, move around, it just works. \o/
Next is syslinux, using "serial [0123] 115200" I simply cannot get anything from syslinux across the wire. :(
The kernel eventually loads (console=ttyS1,115200), we miss all of the ACPI table messages, MM init, CPU init, some PCI init, audio, even some USB, and finally the serial driver finds the PCI serial ports, identifying ttyS1 with the same PCI bus,dev,and func values from BIOS above and starts spewing kernel messages to the console. :|
The getty is spawned from inittab:
S:2345:respawn:/sbin/getty 115200 ttyS1
but no output appears over serial. :(
At this point I have 2 bits that work over serial and two that don't.
If I disable the serial getty in inittab and reboot, I can start to use setserial and minicom. I first take a look at dmesg:
root@board:~# dmesg | grep tty Kernel command line: initrd=initrd LABEL=boot console=ttyS1,115200 console=tty0 root=/dev/ram0 BOOT_IMAGE=vmlinuz console [tty0] enabled console [ttyS1] enabled 0000:05:0a.1: ttyS0 at I/O 0xb070 (irq = 18) is a 16550A 0000:05:0a.2: ttyS1 at I/O 0xb060 (irq = 18) is a 16550A <-- THIS ONE 0000:05:0a.3: ttyS2 at I/O 0xb050 (irq = 18) is a 16550A 0000:05:0a.4: ttyS3 at I/O 0xb040 (irq = 18) is a 16550A
Then at setserial:
root@board:~# setserial -g /dev/ttyS* /dev/ttyS0, UART: 16550A, Port: 0xb070, IRQ: 18 /dev/ttyS1, UART: 16550A, Port: 0xb060, IRQ: 18 <-- THIS ONE /dev/ttyS2, UART: 16550A, Port: 0xb050, IRQ: 18 /dev/ttyS3, UART: 16550A, Port: 0xb040, IRQ: 18
I tried using setserial autoconfig:
root@board:~# setserial /dev/ttyS1 irq 18 port 0xb060 autoconfig root@board:~# setserial -g /dev/ttyS1 /dev/ttyS1, UART: 16550A, Port: 0xb060, IRQ: 18
Now lets watch /proc/interrupts and /proc/tty/driver/serial on the FRI2 while I type on both sides of the connection with minicom. Both sides are configured the
same: 115200,8,n,1,no,no.
Every 2s: cat /proc/interrupts; cat /proc/tty/driver/serial 2011-09-24 04:43:04
CPU0 CPU1
0: 693420 0 IO-APIC-edge timer 9: 0 0 IO-APIC-fasteoi acpi 16: 188 0 IO-APIC-fasteoi ahci, hda_intel 17: 0 0 IO-APIC-fasteoi pch-dma,
spi_topcliff_pch, i2c_eg20t, mmc0, mmc1
18: 175 0 IO-APIC-fasteoi pch-dma, ehci_hcd:usb1,
ohci_hcd:usb3, ohci_hcd:usb4, ohci_hcd:usb5, pch_udc, serial
19: 7329 0 IO-APIC-fasteoi ehci_hcd:usb2,
ohci_hcd:usb6, ohci_hcd:usb7, ohci_hcd:usb8, eth0
NMI: 0 0 Non-maskable interrupts LOC: 2293 352542 Local timer interrupts SPU: 0 0 Spurious interrupts PMI: 0 0 Performance monitoring interrupts IWI: 0 0 IRQ work interrupts RES: 5316 5126 Rescheduling interrupts CAL: 8 9 Function call interrupts TLB: 642 304 TLB shootdowns ERR: 0 MIS: 0
serinfo:1.0 driver revision:
0: uart:16550A port:0000B070 irq:18 tx:0 rx:0
1: uart:16550A port:0000B060 irq:18 tx:100 rx:134 fe:67 brk:67 RTS|DTR
2: uart:16550A port:0000B050 irq:18 tx:0 rx:0
3: uart:16550A port:0000B040 irq:18 tx:0 rx:0
INT18 goes up by one for every character I type on either side of the connection. Starting on the board I see tx (for the /proc/tty/driver/serial line 1 near the bottom) go up by 1 for each character typed. So far so good - but the characters don't appear on the receiving end.
When I type on the other side (my laptop) I see INT18 increment once per character, but I see the lower rx go up by 6 for each char typed, and fe and brk go up by 3 for each char typed. After a few characters, RTS|DTR appear. I'm not sure what to make of this, but it doesn't sound good.
When running windows on the board, it is necessary to adjust the CLOCK from 48K to 64K for the serial port driver. Is it possible that there is something I need to do in order to account for that in Linux? This is using the pch_uart driver as far as I can tell, so perhaps something in pch_uart_port_init? There is something board specific in there now:
base_baud = 1843200; /* 1.8432MHz */ /* quirk for CM-iTC board */ board_name = dmi_get_system_info(DMI_BOARD_NAME); if (board_name && strstr(board_name, "CM-iTC")) base_baud = 192000000; /* 192.0MHz */
The fact that the kernel is able to display messages, suggests to me that the driver is working properly and that the getty issue is with my configuration. But the lack of output in minicom, and the odd rx increments sound a bit like a BAUD/CLOCK mismatch. I'm just out of ideas of what to try.
As for syslinux, I'm concerned it may not be able to access a PCIe connected serial port.
Can anyone offer up some ideas on what I might try to get:
1) the getty working
2) the earlier kernel messages to appear
3) syslinux working
over the serial port?
Thanks,
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel
Quoted 5 lines
Using the
ti_usb_3410_5052driver with modified vendor/product strings, I am able to get ttyUSB0 on my host and open it in minicom:$ sudo modprobe ti_usb_3410_5052 vendor_3410=0x0451 product_3410=0x5053 $ minicom -D /dev/ttyUSB0
Please submit those idents to GregKH for the ti_usb driver.
Quoted 7 lines
Can anyone offer up some ideas on what I might try to get:
1) the getty working
2) the earlier kernel messages to appear
3) syslinux workingover the serial port?
It may depend a lot on the port. If it boots in PCI D3 (power saved) then it's going to be fun. Otherwise forcing the address of the port ought to do the trick.
See
console=uart8250,io 0xb060,115200n8
although it's polled so you may want to drop the speed a bit!
netconsole might also be useful to debug the early serial problems !
No idea for syslinux.
Alan
Hi Alan,
Thanks for the suggestions. Still not working, details follow.
Quoted 8 lines · Alan Cox
Quoted 5 lines
Using the
ti_usb_3410_5052driver with modified vendor/product strings, I am able to get ttyUSB0 on my host and open it in minicom:$ sudo modprobe ti_usb_3410_5052 vendor_3410=0x0451 product_3410=0x5053 $ minicom -D /dev/ttyUSB0Please submit those idents to GregKH for the
ti_usbdriver.
I will. I need to confirm this is something I can do now (if I can use the product name, etc.).
Quoted 6 lines
Quoted 6 lines
Can anyone offer up some ideas on what I might try to get:
1) the getty working
2) the earlier kernel messages to appear
3) syslinux working
Quoted 8 lines
Quoted 1 line
over the serial port?
It may depend a lot on the port. If it boots in PCI D3 (power saved) then it's going to be fun. Otherwise forcing the address of the port ought to do the trick.
See
console=uart8250,io 0xb060,115200n8
I tried:
console=uart8250,io,0xb060,115200n8
With this I got 4 non-ascii chars
Quoted 2 lines
although it's polled so you may want to drop the speed a bit!
I switched all my terminal emulators, syslinux config, the getty, and console redirection in the bios to use 9600n8. Then ran with:
console=uart8250,io,0xb060,9600n8
This printed several bursts of garbled non-ascii strings, but did so very early! :)
With minicom on each end, I see the INT 18 count go up by 1 for every char sent from the board and up by 3 for every char sent from my dev box, as well as the irregular rx,fe increment mentioned originally.
Quoted 2 lines
netconsole might also be useful to debug the early serial problems !
I did give that a shot, it complained about eth0 not existing, despite the driver being compiled in. Possibly an init race with netconsole and pch_gbe? Similar posts sent to linux-next earlier this year.
Quoted 2 lines
No idea for syslinux.
Doesn't like 9600 either.
Quoted 2 lines
Alan
So I'm bugging the hardware/firmware guys, really looks like something is bad under the covers to me.
Thanks Alan!
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel
Quoted 63 lines · Darren Hart
Hi Alan,
Thanks for the suggestions. Still not working, details follow.
Quoted 8 lines · Alan Cox
Quoted 5 lines
Using the
ti_usb_3410_5052driver with modified vendor/product strings, I am able to get ttyUSB0 on my host and open it in minicom:$ sudo modprobe ti_usb_3410_5052 vendor_3410=0x0451 product_3410=0x5053 $ minicom -D /dev/ttyUSB0Please submit those idents to GregKH for the
ti_usbdriver.I will. I need to confirm this is something I can do now (if I can use the product name, etc.).
Quoted 6 lines
Quoted 6 lines
Can anyone offer up some ideas on what I might try to get:
1) the getty working
2) the earlier kernel messages to appear
3) syslinux workingQuoted 8 lines
Quoted 1 line
over the serial port?
It may depend a lot on the port. If it boots in PCI D3 (power saved) then it's going to be fun. Otherwise forcing the address of the port ought to do the trick.
See
console=uart8250,io 0xb060,115200n8I tried:
console=uart8250,io,0xb060,115200n8
With this I got 4 non-ascii chars
Quoted 2 lines
although it's polled so you may want to drop the speed a bit!
I switched all my terminal emulators, syslinux config, the getty, and console redirection in the bios to use 9600n8. Then ran with:
console=uart8250,io,0xb060,9600n8
This printed several bursts of garbled non-ascii strings, but did so very early! :)
With minicom on each end, I see the INT 18 count go up by 1 for every char sent from the board and up by 3 for every char sent from my dev box, as well as the irregular rx,fe increment mentioned originally.
Quoted 2 lines
netconsole might also be useful to debug the early serial problems !
I did give that a shot, it complained about eth0 not existing, despite the driver being compiled in. Possibly an init race with netconsole and
pch_gbe? Similar posts sent to linux-next earlier this year.Quoted 1 line
Quoted 3 lines
Quoted 1 line
No idea for syslinux.
Doesn't like 9600 either.
Are you using "serial 1" or similar for the syslinux config? I don't know how syslinux learns the (port -> address) mapping, but doc/syslinux.txt says you can also specify the address directly, e.g., "serial 0xb060 9600".
I'm not familiar with the EG20T hardware, but all the code in drivers/tty/serial/pch_uart.c makes me wonder how 16550-compatible those things really are. If the EG20T UARTs require special tickling, syslinux isn't likely to know how to do that.
Bjorn
Quoted 8 lines · Bjorn Helgaas
Quoted 7 lines · Darren Hart
Hi Alan,
Thanks for the suggestions. Still not working, details follow.
Quoted 1 line · Alan Cox
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
No idea for syslinux.
Doesn't like 9600 either.
Are you using "serial 1" or similar for the syslinux config? I don't know how syslinux learns the (port -> address) mapping, but
doc/syslinux.txtsays you can also specify the address directly, e.g., "serial0xb0609600".
I was using 0,1,2,3, with no output. Using serial 0xb060 as you describe results in a single char appearing in minicom when syslinux tries to output to the serial port.
Quoted 5 lines
I'm not familiar with the EG20T hardware, but all the code in
drivers/tty/serial/pch_uart.cmakes me wonder how 16550-compatible those things really are. If the EG20T UARTs require special tickling, syslinux isn't likely to know how to do that.
I the results of the test above support this concern. Syslinux apparently couldn't find the ports by itself. Specifying the IO address directly gets it to the right place, but something appears to not be initialized.
I wonder if this could be fixed with some help from the firmware.
Signature · 3 lines
Darren Hart Intel Open Source Technology Center Yocto Project - Linux Kernel