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.

Linux/AM5726: Changing console UART in U-boot

Part Number: AM5726


Tool/software: Linux

Hi,

I'm following this thread https://e2e.ti.com/support/arm/sitara_arm/f/791/t/556788 on how to change console UART in u-boot for our custom hw. I'm using the latest SDK 4.3.0.5

(1) I think I need to change both pad_conf_entry_early_padconf[] and core_padconf_array_essential_x15[] in board/ti/am57xx/mux_data.h to replace uart3 pinmux settings with our uart port. Please confirm.

(2) I cannot find all mentioned changes in the dts files, maybe due to version updates. I found the following in am57xx-beagle-x15-common.dtsi, but I cannot find uart3_pins_default in the dts files.

chosen {
  stdout-path = &uart3;
 };

Can you confirm I need something like uart3_pins_default or what else I need to change?

Thanks!

Jan

  • Hello Jan,

    The only change you need is to modify the chosen stdout-path in the device tree and verify that the selected port pins are correctly pinmuxed as UART.

    chosen {
      stdout-path = &uartX;
     };

    Best regards,
    Kemal



  • Are there any other u-boot configuration variables that need to be set?

    I'm building am335x_beaglebone_config

    I've tried patching u-boot/arch/arm/dts/am335x-boneblack.dts and u-boot/arch/arm/dts/am335x-evm.dts, with:


    chosen {
    stdout-path = &uart1;
    };

    But I always get the console on UART0.

    Looking at am335x_boneblack_config, I'm not seeing how am335x-boneblack.dtb is selected by the build.
  • Hi Kemal,
    I'm following the directions of changing dts and pinmux, but I'm having trouble getting UART console to work on our custom board. Does the UART console have dependency on SDRAM? I thought I could get UART console to work 1st and run my SDRAM test code within on-chip SRAM before loading code into SDRAM to verify DDR settings... When unable to get any output from the console, I experimented on EVM by setting DDR to incorrect settings, then I was unable to see any console output from EVM. Is this expected? Should I be able to see at least the very early part of the boot messages before jumping into SDRAM, if my DDR settings are incorrect but UART setting is correct? Please advice!
    Thank you!
    Jan
  • I did an experiment on my AM572x GP EVM by changing the stdout-path from uart3 to uart1 in am57xx-beale-x15-common.dtsi:

    chosen {
      stdout-path = &uart1;
     };

    I expected to see no output from the console, but to my surprise I still see output. This change doesn't seem to have effect. What am I missing?

    Thank you!

    Jan

  • Hi Jan,

    Check out the patch attached here:

    e2e.ti.com/.../2528243

    The patch is for am43x, but I modified it for the am335x. I'm sure it similar for the am572x.

    The one extra thing I had to do was edit:

    ./board/ti/am335x/Kconfig

    And under CONS_INDEX, set default to '2'. I am using UART1 which is at INDEX 2. Theoretically you can put that setting in your defconfig. I have it there too, but I kept loosing the setting for some reason so I just edited the Kconfig.

    Hope that helps!
  • Hi Matt, thank you so much for your suggestions! I tried to change CONS_INDEX in /board/ti/am57xx/Kconfig on EVM, but it made no difference, I still see SPL output from the same uart3. I think perhaps our version of Linux (U-Boot SPL 2017.01-g4491df3) don't share the same code base?

    I think the change Kemal recommended to stdout-path in dts only applies to u-boot. I found after applying the stdout-path change on EVM, I no longer see any u-boot messages. However it has no effect on SPL console output.

    So my question is how to redirect SPL console output?

    Thanks!

    Jan

  • Hi Kemal, this change applies to u-boot console output. I should have asked how to change console output for SPL?
    Thanks!
    Jan
  • Here are the SPL changes I had to make to move from UART0 to UART1 on the am335x:


    diff --git a/arch/arm/include/asm/arch-am33xx/hardware.h b/arch/arm/include/asm/arch-am33xx/hardware.h
    index 3437e61..91f7d5f 100644
    --- a/arch/arm/include/asm/arch-am33xx/hardware.h
    +++ b/arch/arm/include/asm/arch-am33xx/hardware.h
    @@ -53,7 +53,7 @@
    #define DDR_CONTROL_BASE_ADDR 0x44E11404

    /* UART */
    -#define DEFAULT_UART_BASE UART0_BASE
    +#define DEFAULT_UART_BASE UART1_BASE

    /* GPMC Base address */
    #define GPMC_BASE 0x50000000
    diff --git a/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h b/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h
    index fa9b84f..5154004 100644
    --- a/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h
    +++ b/arch/arm/include/asm/arch-am33xx/hardware_am33xx.h
    @@ -15,6 +15,7 @@

    /* UART Base Address */
    #define UART0_BASE 0x44E09000
    +#define UART1_BASE 0x48022000

    /* GPIO Base address */
    #define GPIO2_BASE 0x481AC000
    diff --git a/board/ti/am335x/board.c b/board/ti/am335x/board.c
    index 8ad03c9..d83812f 100644
    --- a/board/ti/am335x/board.c
    +++ b/board/ti/am335x/board.c
    @@ -84,7 +84,7 @@ struct serial_device *default_serial_console(void)
    if (board_is_icev2())
    return &eserial4_device;
    else
    - return &eserial1_device;
    + return &eserial2_device;
    }
    #endif

    diff --git a/configs/am335x_boneblack_defconfig b/configs/am335x_boneblack_defconfig
    index c4bb75e..7afcbb1 100644
    --- a/configs/am335x_boneblack_defconfig
    +++ b/configs/am335x_boneblack_defconfig
    @@ -49,3 +49,4 @@ CONFIG_G_DNL_MANUFACTURER="Texas Instruments"
    CONFIG_G_DNL_VENDOR_NUM=0x0451
    CONFIG_G_DNL_PRODUCT_NUM=0xd022
    CONFIG_OF_LIBFDT=y
    +CONFIG_CONS_INDEX=2
  • Hello Jan,

    Please, see this thread.

    Best regards,
    Kemal

  • Thank you Kemal for the info!

    Could you please confirm DDR must function before console UART can work? On Am527x GP EVM if I mis-config an EMIF register, then I don't see any console output. This is very different from an older versions of u-boot I had experienced on which I could get MLO output before DDR was successfully configured. Could you please confirm this?

    Thank you!

    Jan

  • I am looking into this. I found where the printf is for the SPL message, now I am looking to find where EMIF is configured.

    Steve K.
  • Hi Steve,

    Do you have any updates?

    Thanks!

    Jan

  • I think DDR is configured before UART.

    I also tried changing the UART and I'm not seeing output from u-boot on UART3, but I still see SPL using UART3. As soon as I figure out why SPL is still using UART3, I'll attach a patch that changes the UART for both. The patch is ready, you can find it here.

    Steve K.