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.

Custom board based on am335x UART0 pin mapping

First let me apologize for my lack of knowledge up front, this is all new to me. I have been using the am335xevm board as a development platform for a new custom board being built. The new board is in and I am trying to get the serial port (uart0) working. The pins on the new board used for rx/tx are lcd_data9/lcd_data8.

I tried modifying the board/ti/am335x/mux.c file to change the uart0_pin_mux setting to use the lcd_data9 and lcd_data8 pins and rebuit the u-boot.img and MLO files but that didn't help.

Where and what should I be modifying to get the serial port working?

  • Ok, have a workaround for the moment using the uart0_rxd and uart0_txd pins to get to the console. Now I can at least see some output however it doesn't get very far.

    U-Boot SPL 2011.09 (Jul 26 2012 - 17:18:20)
    Texas Instruments Revision detection unimplemented

    Incorrect magic numer in EEPROM

    read_eeprom() failure. continuing with ddr3

    Incorrect magic number in EEPROM

    And then it stops at this point.

    Any pointers as to why it stops would be gratefully received.

    I did try rebuilding the MLO and u-boot.img files using the arago cross compiler with some changes in the mux.c file,

    but when I swapped in the new MLO/u-boot.img I get no output at all.

  • Not familiar with the AM335X. Some guesses. A quick trace through the U-boot code would suggest changing from UART0 to UART5 would require several changes.

    ---File:board/ti/am335x/mux.c---
    ...
    static struct module_pin_mux uart5_pin_mux[] = {
        {OFFSET(lcd_data9), (MODE(4) | PULLUP_EN | RXACTIVE)},    /* UART5_RXD */
        {OFFSET(lcd_data8), (MODE(4) | PULLUDEN)},        /* UART5_TXD */
        {-1},
    };
    ...
    void enable_uart5_pin_mux(void)
    {
        configure_module_pin_mux(uart5_pin_mux);
    }
    ...

    --File:arch/arm/include/asm/arch-am33xx/sys_proto.h---
    ...
    void enable_uart5_pin_mux(void);
    ...

    --File:arch_arm_cpu_armv7_am33xx_board.c--

    struct uart_sys *uart_base = (struct uart_sys *)DEFAULT_UART_BASE;

    void s_init(void)
    {
    ...
    //    enable_uart0_pin_mux();
        enable_uart5_pin_mux();

    --File:arch/arm/include/asm/arch-am33xx/hardware.h
    /* Module base addresses */
    #define UART0_BASE 0x44E09000
    #define UART1_BASE 0x48022000
    #define UART2_BASE 0x48024000
    #define UART3_BASE 0x481A6000
    #define UART4_BASE 0x481A8000
    #define UART5_BASE 0x481AA000

    /* UART */
    #define DEFAULT_UART_BASE        UART5_BASE

    --File:include_configs_am335x_evm.h
    //#define CONFIG_SYS_NS16550_COM1       0x44e09000 /* Base EVM has UART0 */
    #define CONFIG_SYS_NS16550_COM1         0x481AA000 /* Custom has UART5 */

    These boards appear to use a common kernel that are runtime configured dependent on EEPROM contents. It appears you have not programmed your the EEPROM on your custom board.

    EDIT: Correct base address format.

  • Thanks for the uart suggestion I'll take a look into that. With regard to programming the EEPROM, there is no EEPROM on our board connected to the processor so I'm guessing that I will have to modify the u-boot code to fake it out (if that is possible).

  • I vaguely remember looking at this code before. The Linux code is also heavily dependent on the EEPROM.