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.

AM335x U-boot configuration for UART

Other Parts Discussed in Thread: AM3352

Hi,

I am trying to port software on our custom board which uses AM3352.

U-boot version is u-boot-2011.09-psp04.06.00.08.

I would like to change UART channel which is used by U-boot from UART 0 to UART1.

I've modified AM335x confiuratiuon as follows:

/include/configs/am335x_evm.h

#define CONFIG_SYS_NS16550_COM1        0x44e09000    /* Base EVM has UART0 */

#define CONFIG_SYS_NS16550_COM1        0x48022000    /* Base EVM has UART1 */

However, no character is displayed on terminal both of UART0 and UART1.

Which point should I modified else?

I have confirmed that UART1 worked properly, since kernel did output characters on UART1 with modification of uEnv.txt.

Thank you.

Mukawa

  • Hi Mukawa,

    There are these following lines that should initialize UART1 pins, inside <u-boot_folder>/board/ti/am335x/board.c:

    #ifdef CONFIG_SERIAL2
        enable_uart1_pin_mux();
    #endif /* CONFIG_SERIAL2 */

    I checked and CONFIG_SERIAL2 is used when you make U-Boot with the following command:

    make am335x_evm_uart1

    Did you try this? Please check the <u-boot_folder>/boards.cfg file for more information.

    Best regards,
    Miroslav

  • Hi Miroslav,

    Thank you for your quick reply.

    I cannot find board.c under <u-boot_folder>/board/ti/am335x

    Even though board.c is exist under <u-boot_folder>/arch/arm/lib , but I couldn't find calling "enable_uart1_pin_mux()" in this file.

    I just have executed make am335x_evm_uart1,but  I also couldn't find that rule in Makefile(attached).

    # make: *** No rule to make target `am335x_evm_uart1'.  Stop.

    Thanks and Best Regards,

    Mukawa

  • Mukawa,

    Can you update to a newer version of u-boot? The u-boot in the 05.07.00.00 SDK supports building u-boot for any of the serial ports like Miroslav described. Looking at boards.cfg you will see

    am335x_evm_uart1             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL2,CONS_INDEX=2
    am335x_evm_uart2             arm         armv7       am335x              ti             am33xx      am335x_evm:SERIAL3,CONS_INDEX=3

    So that typing in 'make am335x_evm_uart1' will put the console on uart1. There are build targets for all of the uarts.

    Steve K.

  • Hi Mukawa,

    Which version of the SDK/PSP are you using? I'm using the latest which is AM335x SDK 05.07.00.00. The mentioned files are present in the latest release.

    The list of configs is not inside the Makefile. It is inside <u-boot_folder>/boards.cfg (Search for "am335x" inside this file).

    Here is how the options work:

    For target am335x_evm_uart1 you have options: am335x_evm:SERIAL2,CONS_INDEX=2

    This means that the file include/configs/am335x_evm.h will be used and the following defines will be created:

    #define SERIAL2 1
    #define CONS_INDEX 2

    Best regards,
    Miroslav

  • Hi Steve,

    Thank you for your comment,

    Even though I had tried to update newer version and merge our modification, but that version didn't work well on our board.

    Is there method to change UART channel  with  04.06.00.08?

    If none, I will try to update again.

    Thank you,

    Best Regards,

    Mukawa

  • Hi Miroslav

    I'm using older version(V04.06.00.08) than yours as I described.

    Thank you for teaching me how to configuration.

    I'll try to do your method if I have been able to update to 05.07.00.00.

    Thank you

    Best Regards,

    Mukawa

  • Mukawa,

    You have to enable the clock for uart1. In board/ti/am335x/pll.c you would want to add

            /* UART1 */
            writel(PRCM_MOD_EN, CM_PER_UART1_CLKCTRL);
            while (readl(CM_PER_UART1_CLKCTRL) != PRCM_MOD_EN);

    You also have to add to arch/arm/include/asm/arch-ti81xx/cpu.h

    #define CM_PER_UART1_CLKCTRL            (CM_PER + 0x6C) /* UART1 */

    I have not tested this, but it should work.

    Steve K.

  • Hi Steve,

    Thank you for your answer, and sorry for reply delayed.

    Now I have been able to run U-Boot on UART1 with  your instruction.

    Thanks for your advice.

    Best Regards,

    Mukawa

  • Hi steve, Mukawa,

    I want to configure UART1, I've done pin-muxing. I'm using SDK 7.0 and there is no board/ti/am335x/pll.c and arch/arm/include/asm/arch-ti81xx/cpu.h. Which files and regs should I modify to do below configuration?

    1. UA_8_DATA_BITS,     /**< Size of data */
    2. UA_1_STOP_BIT,      /**< Number of stop bits */
    3. UA_NO_PARITY,       /**< Byte parity */
    4. 57600u,             /**< Bit rate of uart channel */
    5. UA_HANDSHAKE_NONE,  /**< Handshake type */

    Regards,

    Gangadhar

  • For uboot used setbrg and start() functions in drivers/serial/serial.c,

    did reset of required uart in arch/arm/cpu/ armv7/am335x/board.c

    and also made changes in drivers/serial/serial_ns16550.c and got it working.

    Regards,

    Gangadhar

  • Hi Gangadhar, 

    We are also currently using TI SDK 7 and trying to use UART1 for console output. Can you explain your changes in more detail?

    From what I understood, setbrg was used to update the baud-rate. The DEFAULT_UART_BASE must be changed to reset UART1 instead of UART0. I don't understand what changes you'll need in drivers/serial/serial_ns16550.c after setting the "CONFIG_CONS_INDEX" as 2 for UART1. 

    Thanks,

    Manan.

  • For SDK 7, to build u-boot for UART1, you only need to

    make am335x_evm_uart1

    No other changes.

    Steve K.

  • Hi Steve, 

    Thanks for the prompt response. 

    I should have a been a bit more specific. I'm working on the latest AM437x processor and we have the EVM board and our custom boards in lab. The custom boards use UART1, and hence the requirement.

    Do you think that if I make the appropriate code changes for  "am335x_evm:SERIAL2,CONS_INDEX=1" related MACROS, I should get it working on AM437x? Should there be some additional changes?

    Thanks,

    Manan.

  • Hi Manan,

    In boards.cfg you should have am43xx_evm:SERIAL2, CONS_INDEX=2.

    Regards,

    Gangadhar

  • Thanks Gangadhar.

    I will test U-Boot with these changes and update soon.

  • Hi,

    I have updated u-boot as per above comment. i.e just compile with am335x_evm_uart1 option.

    But when i boot it using new u-boot then i am unable to see any boot messages on UART1.

    Do i need to change any other thing ?

    Regards

    Viraj