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.

Using UART1 on TI-LCDK under Linux

Other Parts Discussed in Thread: DA8XX, OMAPL138

I'm currently working to utilize UART1 on the TI-LCDK Arm. I am using mcsdk_1_01_00_02 linux-3.3-psp03.22.00.06.sdk

UART1 Tx was tested to work using StarterWare. While using StarterWare, I had J15 pin 19 (UART1_TX) connected to an oscilloscope to verify data was being transmitted as well as successfully looping back data to J15 pin 17 (UART1_RX). This indicates the board level hardware changes were made correctly.

When I change the software from StarterWare to Linux, I can not produce any output on UART1 when running Linux. I do see Linux console output on UART2. I am trying to utilize UART1 for my application. The following steps were taken to configure Linux. Any ideas on what I'm missing?

I've followed other instructions here on the forum to properly configure the hardware:

- removed R205, R208 and shorted R206, R209 as described here https://e2e.ti.com/support/dsp/omap_applications_processors/f/42/p/200681/722900#722900

- disabled McASP, I2C, SATA, USB, etc via menuconfig

- add pin muxing code in /arch/arm/mach-davinci/board-omapl138-lcdk.c 

* commented out __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);

* added the following:

/* Support for UART 1 */
ret = davinci_cfg_reg_list(da850_uart1_pins);
if (ret) pr_warning("da850_evm_init: UART 1 mux setup failed:" " %d\n", ret);
davinci_serial_init(&omapl138_lcdk_uart_config);

During kernel boot I can see the PIN MUX4 register initialization for UART1

MUX: initialized UART1_RXD
MUX: Setting register UART1_RXD
PINMUX4 (0x00000010) = 0x00222288 -> 0x02222288
MUX: initialized UART1_TXD
MUX: Setting register UART1_TXD
PINMUX4 (0x00000010) = 0x02222288 -> 0x22222288

I can write to UART1 in various ways (programmaticly via C code or from the command line interface). I do not see any out put on J15 pin 19. I do see the serial driver debug via cat /proc/tty/driver/serial indicating ttyS1 sent data. For Example:

root@omapl138-lcdk:~# cat /proc/tty/driver/serial
serinfo:1.0 driver revision:
0: uart:AR7 mmio:0x01C42000 irq:25 tx:0 rx:0 CTS
1: uart:AR7 mmio:0x01D0C000 irq:53 tx:14 rx:0 CTS
2: uart:AR7 mmio:0x01D0D000 irq:61 tx:3405 rx:172 RTS|CTS|DTR

Enabling DEBUG_INTR macro in ../drivers/tty/serial/8250/8250.c I can see serial8250_tx_chars() is writing the data as I receive the debug output "THRE..." but a corresponding IRQ debug statement "status = %x..." is never outputed from serial8250_handle_irq(). On the console I see a series of "THRE..." followed by "status = %x..." and "serial8250_interrupt" debug output.

Any ideas as to why UART1 isn't working under Linux given this configuration? I'm not sure why the interrupt is never firing...

  • I changed the pin mux for UART1 Tx and Rx to operate as GPIO. I connected the two pins via a jumper on TI-LCDK J15. I am able to utilize sysfs to control the two pins as GPIO.

    This suggests the issue is with the 8250 serial driver.
  • Dear MattS,
    Please refer to the following post.
    e2e.ti.com/.../1241144
  • Hi Titus - thank you for the response. I reviewed the post you suggested but didn't find a solution. The post referenced was for configuring UART1 as console. I'd like to keep UART2 as console and utilize UART1 from my application. As a first step, I am just trying to see output on UART1 TXD. The next step would be to loop UART1 TXD/RXD.

    From the referenced post, are you suggesting to initialize UART1 from within the bootloader?

    In my board-omapl138-init.c I have the following code to enable UART1 pins:

    /* Support for UART 1 */
    ret = davinci_cfg_reg_list(da850_uart1_pins);
    if (ret)
    pr_warning("da850_evm_init: UART 1 mux setup failed:" " %d\n", ret);
    davinci_serial_init(&omapl138_lcdk_uart_config);
    //__raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
  • This issues appears to be the same as the one identified here: e2e.ti.com/.../1659895
  • I was able to produce output on UART1 TX. I changed the bootloader to initialize UART1 (but not set it as console). See changes listed below. I also had to enable LPSC PSC1 12 when generating the AIS bootloader image. Perhaps not all of the changes were required (e.g. pinmuxing is also done in the kernel board init).

    It seems most of these changes should live in the kernel board initialization or serial driver. Does anyone have insight on where the best place for these changes to be made? 

    1) include/asm/arch/hardware.h

    /* Emulation suspend bits */

    #define DAVINCI_SYSCFG_SUSPSRC_EMAC             (1 << 5)

    #define DAVINCI_SYSCFG_SUSPSRC_I2C              (1 << 16)

    #define DAVINCI_SYSCFG_SUSPSRC_SPI0             (1 << 21)

    #define DAVINCI_SYSCFG_SUSPSRC_SPI1             (1 << 22)

    #define DAVINCI_SYSCFG_SUSPSRC_UART0            (1 << 18)

    #define DAVINCI_SYSCFG_SUSPSRC_UART1            (1 << 19) // MWS added for UART1

    #define DAVINCI_SYSCFG_SUSPSRC_UART2            (1 << 20)

    #define DAVINCI_SYSCFG_SUSPSRC_TIMER0           (1 << 27)

    2) include/configs/omapl138_lcdk.h

    /*

    * Serial Driver info

    */

    #define CONFIG_SYS_NS16550

    #define CONFIG_SYS_NS16550_SERIAL

    #define CONFIG_SYS_NS16550_REG_SIZE     -4      /* NS16550 register size */

    #define CONFIG_SYS_NS16550_COM1 DAVINCI_UART2_BASE /* Base address of UART2 */

    #define CONFIG_SYS_NS16550_COM2 DAVINCI_UART1_BASE /* MWS Base address of UART1 */

    #define CONFIG_SYS_NS16550_CLK  clk_get(DAVINCI_UART2_CLKID)

    #define CONFIG_CONS_INDEX       1               /* use UART0 for console */

    #define CONFIG_BAUDRATE         115200          /* Default baud rate */

    #define CONFIG_SYS_BAUDRATE_TABLE       { 9600, 19200, 38400, 57600, 115200 }

    3) board/davinci/da8xxevm/omapl138_lcdk.c

    /* UART pin muxer settings */

    static const struct pinmux_config uart_pins[] = {

           { pinmux(4), 2, 6 }, // MWS UART1_RXD

           { pinmux(4), 2, 7 }, // MWS UART1_TXD

           { pinmux(0), 4, 6 },

           { pinmux(0), 4, 7 },

           { pinmux(4), 2, 4 },

           { pinmux(4), 2, 5 }

    };

          /* setup the SUSPSRC for ARM to control emulation suspend */

           /* MWS added UART1 */

           writel(readl(&davinci_syscfg_regs->suspsrc) &

                  ~(DAVINCI_SYSCFG_SUSPSRC_EMAC | DAVINCI_SYSCFG_SUSPSRC_I2C |

                    DAVINCI_SYSCFG_SUSPSRC_SPI1 | DAVINCI_SYSCFG_SUSPSRC_TIMER0 |

                    DAVINCI_SYSCFG_SUSPSRC_UART2 | DAVINCI_SYSCFG_SUSPSRC_UART1),

                  &davinci_syscfg_regs->suspsrc);

           /* MWS added for UART1 enable the console UART */

           writel((DAVINCI_UART_PWREMU_MGMT_FREE | DAVINCI_UART_PWREMU_MGMT_URRST                

    | DAVINCI_UART_PWREMU_MGMT_UTRST), &davinci_uart1_ctrl_regs->pwremu_mgmt);

     


  • Dear MattS,
    Sorry for the delayed response on this.
    Glad to hear that you able to resolve the problem.
    Yes, we can also configure any peripheral support in u-boot and should not touch that peripheral part in kernel, then it will be fine.