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.

[FAQ] TDA4VM: J721e:/J7200: How to switch console to a different UART instance

Part Number: TDA4VM

I want to switch console to a different UART instance. I do not have MAIN_UART0 wired out can i move all
the prints to MCU_UART0? If yes how do I do that?

  • Yes. That is possible.

    As per the boot flow we have 3 stages.

    1. R5 SPL
    2. A72 SPL
    3. A72 u-boot.

    So we need to change at all levels. On top of that ATF(Arm Trusted Firmware) also needs to change the console port as needed.

    Following are the dts changes on J7200 & similar changes for J721e will work fine:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    diff --git a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi
    index 207448c4..7a27938a 100644
    --- a/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi
    +++ b/arch/arm/dts/k3-j7200-common-proc-board-u-boot.dtsi
    @@ -5,7 +5,7 @@
    / {
    chosen {
    - stdout-path = "serial2:115200n8";
    + stdout-path = "serial1:115200n8";
    tick-timer = &timer1;
    };
    diff --git a/arch/arm/dts/k3-j7200-common-proc-board.dts b/arch/arm/dts/k3-j7200-common-proc-board.dts
    index 423cf546..3ac1e9e3 100644
    --- a/arch/arm/dts/k3-j7200-common-proc-board.dts
    +++ b/arch/arm/dts/k3-j7200-common-proc-board.dts
    @@ -14,8 +14,8 @@
    / {
    chosen {
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    The above dts changes take care of the SPL/u-boot side.

    Now we also need to change in ATF (Arm Trusted Firmware).

    Attached patch needs to be applied on top of ATF directory in the SDK: 

    0001-plat-ti-k3-include-platform_def.h-Change-console-UAR.patch.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    From 54990cac252c3f2eadfd5027198501817f2e5af0 Mon Sep 17 00:00:00 2001
    From: Keerthy <j-keerthy@ti.com>
    Date: Tue, 23 Mar 2021 21:56:29 +0530
    Subject: [PATCH] plat: ti: k3: include: platform_def.h: Change console UART
    from MAIN_UART0 to MCU_UART0
    Change console UART from MAIN_UART0 to MCU_UART0.
    Signed-off-by: Keerthy <j-keerthy@ti.com>
    ---
    plat/ti/k3/include/platform_def.h | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)
    diff --git a/plat/ti/k3/include/platform_def.h b/plat/ti/k3/include/platform_def.h
    index 690c68e5c..db083ca2f 100644
    --- a/plat/ti/k3/include/platform_def.h
    +++ b/plat/ti/k3/include/platform_def.h
    @@ -91,14 +91,14 @@
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Follow the below instructions to apply and compile:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    cd $SDK_PATH/board-support/trusted-firmware-a-2.3
    git am 0001-plat-ti-k3-include-platform_def.h-Change-console-UAR.patch.txt
    make CROSS_COMPILE=aarch64-linux-gnu- ARCH=aarch64 PLAT=k3 TARGET_BOARD=generic SPD=opteed
    cp ./build/k3/generic/release/bl31.bin ../prebuilt-images/
    cd ../..
    make u-boot
    cp board-support/u-boot_build/A72/tispl.bin board-support/u-boot_build/A72/u-boot.img /media/$USER/BOOT
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    In case you want to avoid compilation of ATF: Just unzip & use the attached binary:


    bl31.zip

    copy it directly to $SDK_PATH/prebuilt-images

    then 'make u-boot' to make the new bl31.bin part of tispl.bin.

    Kernel changes for switching console from MAIN_UART0 to MCU_UART

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    diff --git a/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts b/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts
    index 3ac2dab2a..f67fd65af 100644
    --- a/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts
    +++ b/arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts
    @@ -15,8 +15,8 @@
    / {
    chosen {
    - stdout-path = "serial2:115200n8";
    - bootargs = "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000";
    + stdout-path = "serial1:115200n8";
    + bootargs = "console=ttyS1,115200n8 earlycon=ns16550a,mmio32,0x40a00000";
    };
    vdd_mmc1: fixedregulator-sd {
    @@ -144,6 +144,11 @@
    power-domains = <&k3_pds 146 TI_SCI_PD_SHARED>;
    };
    +&mcu_uart0 {
    + power-domains = <&k3_pds 149 TI_SCI_PD_SHARED>;
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    Best Regards,
    Keerthy