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.

DM365 UART1 flow control

Other Parts Discussed in Thread: OMAP-L138

Hi all,

we are using a kernel from dvsdk 4.02 in version 2.6.32 on our custom board. Now we need to enable flow control on uart1, but I'm not sure how to correctly do that. I have found this howto http://processors.wiki.ti.com/index.php/Enabling_UART1_on_AM18X/DA850/OMAP-L138_running_Linux but it is related to a different processor (but with the same uart core). Can this patch be used to enable flow control also on dm365?

Is the following bug presented also on the dm365

if (cpu_is_davinci_da850())
   up->bugs |= UART_BUG_NOMSR;

best regards
Jan

  • Hi Jan,

    You may have to trace schematic and find on your custom board if UART1 RTS/CTS lines are brought out on a connector. If so then you need change(patch 2 in above wiki link) in board-dm365.c to force the UART to AR7 type.

    Yes, you need to have below change as UART IP on dm365 doesnot support modem status change interrupt.

    if (cpu_is_davinci_da850())
       up->bugs |= UART_BUG_NOMSR;

    Thanks,

    Prakash

  • Hi Prakash,

    thank you for the asnwer. I patched the kernel as you adviced, but I still can't get UART1 working (with or without flow control) .  When I let the dm365.c unpatched eg.

    {
    .mapbase = DAVINCI_UART1_BASE,
    .irq = IRQ_UARTINT1,
    .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
    UPF_IOREMAP,
    .iotype = UPIO_MEM,
    .regshift = 2,
    },

    UART1 is not registered. Dmesg  shows only a message for UART0 (serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A).

    When I force UART1 to be AR7 - it is registered, but I can't measure any signal on the TX pin when trying echo "xxxx" > /dev/ttyS1. I hope I have the PINMUX set up correctly, so I must be missing something else...

    regards
    Jan

  • I have found the main problem.

    There is a bug in 2.6.32 psp - .mapbase = DAVINCI_UART1_BASE is wrong for the dm365 SOC, there has to be a new define e.g.
    #define DM365_UART1_BASE    (IO_PHYS + 0x106000)

    However, I still don't know, why the /dev/ttyS1 is not registered, when the AR7 type is not specified.

    regards
    Jan

  • Hi Jan,

    Did you check schematics of your board if all 4 UART1 signals brought out? Please check UART1 pinmuxing after kernel boots up using devmem2 utility. Can you please share the boot log?

    Thanks,

    Prakash

  • Hi Prakash,

    yes, I have all 4 UART1 signals brought out and pinmuxing is also OK. It seems that the type field has to be explicitly specified for the UART1. In fact I'm not sure, why not so for UART0. The autoconfig of the 8250 probably sets the correct type, but not for the UART1.

    static struct plat_serial8250_port dm365_serial_platform_data[] = {
    {
    .mapbase = DAVINCI_UART0_BASE,
    .irq = IRQ_UARTINT0,
    .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
    UPF_IOREMAP,
    .iotype = UPIO_MEM,
    .regshift = 2,
    },
    {
    .mapbase = DM365_UART1_BASE,
    .irq = IRQ_UARTINT1,
      .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP | UPF_FIXED_TYPE,
      .type = PORT_16550A, /* or PORT_AR7 for flow control */
    .iotype = UPIO_MEM,
    .regshift = 2,
    },
    {
    .flags = 0
    },
    }; 

    You said that dm365 does not support modem status change interrupt so I hope the following patch is OK

    if (cpu_is_davinci_da850() || cpu_is_davinci_dm365())
      up->bugs |= UART_BUG_NOMSR; 

    Could you please also tell me, how to set UART1 baud rate on kernel level? After booting it is set to 9600 bd, but I want it to be 115200 bd.

    regards
    Jan