This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ttyS1 not being initialised [DM368 IPNC]

Sorry to cross-post but this is looking more like a Linux problem than a hardware one.

I'm trying to enable UART1 on our DM368 hardware (Appro IPNC SDK 4.x, psp 3.21.00.4), I'm pretty sure I've done all the correct hardware driver changes*, setting the pinmux, clocks, etc., but although the UART shows up in the startup logs, it does not get initialised (uart_open() is never called)

In the boot process it shows the following:

[    0.263546] davinci_serial_init: uart0 initialised
[    0.274028] davinci_serial_init: uart1 initialised
[    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

If I do ls /dev/ I can see ttyS1, if I echo text to /dev/ttyS1 it returns OK but nothing happens (confirmed with oscillioscope), if I do 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 I get an error:
> stty -F /dev/ttyS1
stty: /dev/ttyS1: Inappropriate ioctl for device

Here's the strange thing: If I modify bootargs to set the console to be ttyS1 (setenv bootargs 'console=ttyS1,115200n8 ....) UART1 works fine and reports:

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

Can anyone tell me what I've missed or done wrong?

(* = see http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/t/295760.aspx)

  • Just to add - I inserted some printk's in the uart init code / 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 posted this answer in this thread...

    http://e2e.ti.com/support/embedded/linux/f/354/p/92138/323320.aspx#323320

    “you need to check your davinci_uart_config parameter in your board file in the kernel.  It will have a .enabled_uarts parameter that is a bit mask.  So two uarts would be a 3.”

    This may explain why open isn't called.


    Also I answered my own question in his thread...

    http://e2e.ti.com/support/embedded/linux/f/354/t/75483.aspx
    1) The address of UART1 in the kernel is wrong.  Check the memory map of the DM368/DM365 against the value of DAVINCI_UART1_BASE.  That's why the UART doesn't respond to the kernel.

    2) There are two different GPIO pins that can be assigned to UART1.  Make sure that you have the correct pins enabled.

    JohnA

  • Hi John, thanks for taking the time to look in.

    Being a shameful cross-poster I put more low-level info in the DaVinci forum:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/t/295760.aspx

    Using the default for the board:
    dvsdk_ipnctools/ipnc_psp_03_21_00_04/ti-davinci/arch/arm/mach-davinci/board-dm368-ipnc.c
    606:    .enabled_uarts = (7 << 0),

    DAVINCI_UART1_BASE is ignored / re-defined in the source (see link)

    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

    Shows the correct address as far as I can tell.

    The GPIO / UART1 pins are correct as far as I can tell, when I use ttyS1 as console (console=...) it works fine on the expected (alternate to default) pins.

    It looks like I can make it work by using mknod, but I'm unclear as to where to insert this in the startup process (or which file to insert it) and whether mknod is the correct answer or a dirty hack.