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.

AM62A7: R5 SPL log can't be output to console of main_uart5

Part Number: AM62A7

Hi,

This is a continuation of the previous question.
The following URL is the previous question.

I tried to perform an SD boot using the generated tiboot3.bin (tiboot3-am62ax-hs-fs-evm.bin),
but nothing was output to the console and the boot seemed to have failed.

The tispl.bin and u-boot.img are the same ones used when the A53 and linux kernel logs are being output.
Also, the sdk version is 9.1.0.8.

Could you please confirm?

Regards,
Rei

  • Hello Rei,

    Hope you have referred to the FAQ and made necessary changes as discussed in the previous thread.
    Could you share the patch for the same, so that we can guide you further?

    Regards,
    Aparna

  • Hello,Aparna

    I apologize for forgetting to attach a patch and URL of previous question.

    Below is the question I wanted to send.


    This is a continuation of the previous question.
    The following URL is the previous question.

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1360819/am62a7-changing-u-boot-console-uart0-to-uart5-part2/5198400#5198400

    I tried this answer,so that A53 boot log and linux kernel log were output to console of uart5.
    However,R5 boot log wasn't output to console of uart5.

    Since I was unable to make any changes to u-boot-ti-staging for r5, I edited it as shown in the patch below.
     
    From 1d4f555ac2954d580fa8edefc37364932d4c4d39 Mon Sep 17 00:00:00 2001
    From: Your Name <you@example.com>
    Date: Tue, 21 May 2024 11:12:25 +0900
    Subject: [PATCH] change-r5-u-boot
    
    change-r5-u-boot-2
    ---
     arch/arm/dts/k3-am62a7-r5-sk.dts      |  3 ++-
     arch/arm/dts/k3-am62a7-sk-u-boot.dtsi | 10 +++++-----
     arch/arm/dts/k3-am62a7-sk.dts         | 18 ++++++++++++++++--
     board/ti/am62ax/am62ax.env            |  4 ++--
     configs/am62ax_evm_r5_defconfig       |  3 ++-
     5 files changed, 27 insertions(+), 11 deletions(-)
    
    diff --git a/arch/arm/dts/k3-am62a7-r5-sk.dts b/arch/arm/dts/k3-am62a7-r5-sk.dts
    index 5f1bd32a75..988a43a576 100644
    --- a/arch/arm/dts/k3-am62a7-r5-sk.dts
    +++ b/arch/arm/dts/k3-am62a7-r5-sk.dts
    @@ -17,10 +17,11 @@
     		remoteproc1 = &a53_0;
     		serial0 = &wkup_uart0;
     		serial3 = &main_uart1;
    +		serial4 = &main_uart5;
     	};
     
     	chosen {
    -		stdout-path = "serial2:115200n8";
    +		stdout-path = "serial4:115200n8";
     		tick-timer = &timer1;
     	};
     
    diff --git a/arch/arm/dts/k3-am62a7-sk-u-boot.dtsi b/arch/arm/dts/k3-am62a7-sk-u-boot.dtsi
    index 0905205005..1f8df53c2e 100644
    --- a/arch/arm/dts/k3-am62a7-sk-u-boot.dtsi
    +++ b/arch/arm/dts/k3-am62a7-sk-u-boot.dtsi
    @@ -6,7 +6,7 @@
     
     / {
     	chosen {
    -		stdout-path = "serial2:115200n8";
    +		stdout-path = "serial4:115200n8";
     		tick-timer = &timer1;
     	};
     
    @@ -63,12 +63,12 @@
     	bootph-pre-ram;
     };
     
    -&main_uart0 {
    -	bootph-pre-ram;
    +&main_uart5 {
    +        bootph-pre-ram;
     };
     
    -&main_uart0_pins_default {
    -	bootph-pre-ram;
    +&main_uart5_pins_default {
    +        bootph-pre-ram;
     };
     
     &main_uart1 {
    diff --git a/arch/arm/dts/k3-am62a7-sk.dts b/arch/arm/dts/k3-am62a7-sk.dts
    index f727b5f825..56b5a8d616 100644
    --- a/arch/arm/dts/k3-am62a7-sk.dts
    +++ b/arch/arm/dts/k3-am62a7-sk.dts
    @@ -19,13 +19,14 @@
     
     	aliases {
     		serial2 = &main_uart0;
    +		serial4 = &main_uart5;
     		mmc0 = &sdhci0;
     		mmc1 = &sdhci1;
     		spi0 = &ospi0;
     	};
     
     	chosen {
    -		stdout-path = "serial2:115200n8";
    +		stdout-path = "serial4:115200n8";
     	};
     
     	memory@80000000 {
    @@ -173,6 +174,13 @@
     		>;
     	};
     
    +	main_uart5_pins_default: main-uart5-pins-default {
    +                pinctrl-single,pins = <
    +                        AM62AX_IOPAD(0x1d8, PIN_INPUT, 1) /* (B17) UART5_RXD */
    +                        AM62AX_IOPAD(0x1dc, PIN_OUTPUT, 1) /* (C18)UART5_TXD */
    +                >;
    +        };
    +
     	main_i2c0_pins_default: main-i2c0-pins-default {
     		pinctrl-single,pins = <
     			AM62AX_IOPAD(0x1e0, PIN_INPUT_PULLUP, 0) /* (B16) I2C0_SCL */
    @@ -395,11 +403,17 @@
     };
     
     &main_uart0 {
    -	status = "okay";
    +	status = "disabled";
     	pinctrl-names = "default";
     	pinctrl-0 = <&main_uart0_pins_default>;
     };
     
    +&main_uart5 {
    +        status = "okay";
    +        pinctrl-names = "default";
    +        pinctrl-0 = <&main_uart5_pins_default>;
    +};
    +
     &fss {
     	status = "okay";
     };
    diff --git a/board/ti/am62ax/am62ax.env b/board/ti/am62ax/am62ax.env
    index 9d44c80cd8..61fc7cf72d 100644
    --- a/board/ti/am62ax/am62ax.env
    +++ b/board/ti/am62ax/am62ax.env
    @@ -11,8 +11,8 @@ findfdt=
     	setenv name_fdt ${default_device_tree};
     	setenv fdtfile ${name_fdt}
     name_kern=Image
    -console=ttyS2,115200n8
    -args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02800000
    +console=ttyS4,115200n8
    +args_all=setenv optargs ${optargs} earlycon=ns16550a,mmio32,0x02850000
     	${mtdparts}
     run_kern=booti ${loadaddr} ${rd_spec} ${fdtaddr}
     
    diff --git a/configs/am62ax_evm_r5_defconfig b/configs/am62ax_evm_r5_defconfig
    index b92fea415a..9c57744d9b 100644
    --- a/configs/am62ax_evm_r5_defconfig
    +++ b/configs/am62ax_evm_r5_defconfig
    @@ -124,4 +124,5 @@ CONFIG_TIMER=y
     CONFIG_SPL_TIMER=y
     CONFIG_OMAP_TIMER=y
     CONFIG_LIB_RATIONAL=y
    -CONFIG_SPL_LIB_RATIONAL=y
    \ No newline at end of file
    +CONFIG_SPL_LIB_RATIONAL=y
    +CONFIG_CONS_INDEX=6
    -- 
    2.34.1
    
    
    After that, I built tiboot3 using the following command:
     
    MACHINE=am62axx-evm-k3r5 bitbake u-boot-ti-staging
     
    I tried to perform an SD boot using the generated tiboot3.bin (tiboot3-am62ax-hs-fs-evm.bin),
    but nothing was output to the console and the boot seemed to have failed.

    The tispl.bin and u-boot.img are the same ones used when the A53 and linux kernel logs are being output.
    Also, the sdk version is 9.1.0.8.

    Could you please confirm?


    Regards,
    Rei

  • Hi Rei,

    I understand that you tried to change UART0 to UART5 from the FAQ provided in the linked question.

    So to have your logs on a certain UART port would mostly depend on the schematics, if a particular UART was not meant to output data in the first place, it would not do so.(I will confirm on this).

    I would also like you to go through this FAQ: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1276094/faq-sk-am62-purpose-of-different-uarts?tisearch=e2e-sitesearch&keymatch=UART%20Vaibhav#

    Please also have a look at the schematics for AM62A. I am attaching a snippet from the schematics which matches with the UART ports mentioned in the above FAQ.

    So safe to say you can try to change the console output to either of the four ports mentioned both in the above highlighted section and the FAQ.

    Regards,

    Vaibhav

  • Hi Vaibhav,

    Thank you for answering.

    I found that it is safe to use the four UARTs shown above.
    I would like to try it with main_uart0.

    Also, if possible, it would be helpful if there was a page that listed all the UARTs that cannot be used as a console.

    I have one question. Is there any explanation in the datasheet or elsewhere as to why some UARTs cannot be used as consoles?

    Regards,
    Rei

  • Hi Rei,

    Allow me sometime to comment on your question.

    Also the FAQ should mostly give away the UART ports used for different purposes.(FAQ mentioned in my previous response.)

    Allow me sometime to comment on the UART5 usage, as I am confirming on the same and seeing if it can be used to output data.

    it would not do so.(I will confirm on this).

    I am confirming and I will follow up after sometime.

    Regards,

    Vaibhav

  • Hi Reii,

    Thank you very much for your patience.

    A quick update here.

    So a UART peripheral can be used to output logs onto the console only if it is interfaced to Quad UART-USB FT4232HL.

    Else normally the TX/RX will work but you wont see the output on the console if it is not interfaced as mentioned earlier.

    Regards,

    Vaibhav