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: How can i print log to UART0 in tiboot3 of UBOOT-R5??

Part Number: AM62A7

Hello,every experts:

1.I have conifg my device tree as follow:

aliases {
remoteproc0 = &sysctrler;
remoteproc1 = &a53_0;
serial0 = &wkup_uart0;
serial3 = &main_uart0;
};

chosen {
stdout-path = "serial3:115200n8";
tick-timer = &timer1;
};

main_uart0: serial@2800000 {
compatible = "ti,am64-uart", "ti,am654-uart";
reg = <0x00 0x02800000 0x00 0x100>;
interrupts = <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&k3_pds 146 TI_SCI_PD_EXCLUSIVE>;
clocks = <&k3_clks 146 0>;
clock-names = "fclk";
status = "disabled";
};

2. am62a7_init.c source code:

* configuration is always done.
*/
if (IS_ENABLED(CONFIG_SPL_CLK_K3)) {
ret = uclass_get_device_by_driver(UCLASS_CLK, DM_GET_DRIVER(ti_clk), &dev);
if (ret)
printf("Failed to initialize clk-k3!\n");
}

preloader_console_init();
printf("tsggg---------------------------\r\n");
/* Output System Firmware version info */
k3_sysfw_print_ver();

/* Disable ROM configured firewalls right after loading sysfw */
remove_fwl_configs(cbass_main_fwls, ARRAY_SIZE(cbass_main_fwls));

#if defined(CONFIG_K3_AM62A_DDRSS)
ret = uclass_get_device(UCLASS_RAM, 0, &dev);
if (ret)
panic("DRAM init failed: %d\n", ret);
But it still can not print log to UART0
3. My hardware schema:
  • Hi,

    Please allow a day or so to look at this.

    ~ Judith

  • Hi,what did you mean?You say where i look at??

  • Hi Kingphy,

    My understanding is that you want to send R5 SPL logs to MAIN_UART0? If so, this is already setup in TI Processor SDK.

    Also, what Processor SDK version are you using?

    ~ Judith

  • my sdk version is 8.6,it setup in UART3 IN UBOOT-R5.

    I just see UBOOT-A53 used UART0.

  • Hi Kingphy,

    k3-am625-r5-sk.dts is for R5 SPL, it includes: k3-am625-sk.dts which includes k3-am62x-sk-common.dtsi

    In k3-am62x-sk-common.dtsi:
    serial2 = &main_uart0;

    Also,

    k3-am62x-r5-sk-common.dtsi:
        chosen {
            stdout-path = "serial2:115200n8";
            bootargs = "console=ttyS2,115200n8 earlycon=ns16550a,mmio32,0x02800000";
        };

    So in summary:

    serial0 = &wkup_uart0 used by DM firmware
    serial2 = &main_uart0; used by u-boot
    serial3 = &main_uart1; used by TIFS firmware


    ~ Judith

  • Here is what my dts's setting.It is same to what you show.I don't know what't problem now.

    2. My am62a init code as follow:

    */
    ret = is_rom_loaded_sysfw(&bootdata);
    if (!ret)
    panic("ROM has not loaded TIFS firmware\n");

    k3_sysfw_loader(true, NULL, NULL);

    /*
    * Relocate boot information to OCRAM to allow the next stages to
    * know about primary vs backup bootmodes
    */
    store_boot_info_to_ocram();
    #endif

    /*
    * Force probe of clk_k3 driver here to ensure basic default clock
    * configuration is always done.
    */
    if (IS_ENABLED(CONFIG_SPL_CLK_K3)) {
    ret = uclass_get_device_by_driver(UCLASS_CLK, DM_GET_DRIVER(ti_clk), &dev);
    if (ret)
    printf("Failed to initialize clk-k3!\n");
    }

    preloader_console_init();
    printf("tsggg---------------------------\r\n");
    /* Output System Firmware version info */
    k3_sysfw_print_ver();
    3.Whether does tiboot3 need load sys_fw?May my initial programe be stuck in load sysfw?
  • Hi,

    Ok, I see. You have changed serial3 alias to be $main_uart0.  It is supposed to be &main_uart1:

        aliases {
            remoteproc0 = &sysctrler;
            remoteproc1 = &a53_0;
            serial0 = &wkup_uart0;
            serial3 = &main_uart1;
        };

        chosen {
            stdout-path = "serial2:115200n8";
            tick-timer = &timer1;
        };

    Whether does tiboot3 need load sys_fw?May my initial programe be stuck in load sysfw?

    -- Can I see the log, to check where you are getting stuck.

    If you need to understand the boot flow, please look at the following doc: https://software-dl.ti.com/processor-sdk-linux-rt/esd/AM62X/08_06_00_42/exports/docs/linux/Foundational_Components/U-Boot/UG-General-Info.html#boot-flow

    ~ Judith

  • But my board only connect the UART0 and wakupuart.

    There are not any log shown.I dont know how to debug where is stucked.

    Help me what the method I can analysis my problem next step?

    The boot flow I have read several times.I see there are not load sysfw in sbl_emmc example of MCU_SDK.

    But I dont decisive if it is correct.

  • Hi,

    If you have main_uart0 and wakup uart, then you should see u-boot logs via main_uart0. Please look at the device tree in TI SDK and follow the same setup for main_uart0.

    Here are some debugging pointers if you need them: dev.ti.com/.../node


    ~ Judith

  • it is not DTS setting problem.

    Now I can debug u-boot-spl of tiboot3.bin in JTAG,I see that the DTB isn't included.

    How can I load dtb file in CCS??

    And How make the dtb file out?What is it's flow?

    How to config r5_defconfig file.Why the SDK default config can not work?

    I doubt that there not DTB in tiboot3.bin.How can i check??

  • Hi,

    Will forward this thread to correct engineer.

    ~ Judith

  • Now I can debug u-boot-spl of tiboot3.bin in JTAG,I see that the DTB isn't included.

    How can I load dtb file in CCS??

    For debugging U-Boot SPL on R5 on AM6x devices, you'd want to use a "native" method to boot tiboot3.bin, which always includes the DTB file you need. This way you have always the correct execution environment, including TIFS firmware being installed by ROM already, something that is very VERY difficult to re-create all using JTAG alone. You can find more details on this here: https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-edgeai/AM62AX/09_00_00/exports/docs/linux/Foundational_Components/U-Boot/Apps-SPL-Debug.html  (note that this documentation section may contain some references to other AM6x family devices so it may not be 100% applicable as-is, however the general concept still applies).

    I doubt that there not DTB in tiboot3.bin.How can i check??

    You can easily do this for example by looking at the hex dump of tiboo3.bin. The DTB can be found somewhere in the middle of that file, and you can see it by a section there that has many of the strings present in the DTS file, such as model, compatible, and chosen properties, see below example:

    $ hexdump -C board-support/prebuilt-images/tiboot3.bin | less
    
    <...snip...>
    
    00026910  00 00 00 03 00 00 00 1c  00 00 00 00 54 65 78 61  |............Texa|
    00026920  73 20 49 6e 73 74 72 75  6d 65 6e 74 73 20 41 4d  |s Instruments AM|
    00026930  36 32 41 37 20 53 4b 00  00 00 00 03 00 00 00 17  |62A7 SK.........|
    00026940  00 00 00 06 74 69 2c 61  6d 36 32 61 37 2d 73 6b  |....ti,am62a7-sk|
    00026950  00 74 69 2c 61 6d 36 32  61 37 00 00 00 00 00 03  |.ti,am62a7......|
    00026960  00 00 00 04 00 00 00 11  00 00 00 02 00 00 00 03  |................|
    00026970  00 00 00 04 00 00 00 20  00 00 00 02 00 00 00 01  |....... ........|
    00026980  63 68 6f 73 65 6e 00 00  00 00 00 03 00 00 00 11  |chosen..........|
    00026990  00 00 00 2c 73 65 72 69  61 6c 32 3a 31 31 35 32  |...,serial2:1152|
    000269a0  30 30 6e 38 00 00 00 00  00 00 00 03 00 00 00 19  |00n8............|
    000269b0  00 00 00 38 2f 62 75 73  40 66 30 30 30 30 2f 74  |...8/bus@f0000/t|
    000269c0  69 6d 65 72 40 32 34 30  30 30 30 30 00 00 00 00  |imer@2400000....|
    000269d0  00 00 00 02 00 00 00 01  62 75 73 40 66 30 30 30  |........bus@f000|
    000269e0  30 00 00 00 00 00 00 03  00 00 00 0b 00 00 00 06  |0...............|
    000269f0  73 69 6d 70 6c 65 2d 62  75 73 00 00 00 00 00 03  |simple-bus......|
    00026a00  00 00 00 04 00 00 00 11  00 00 00 02 00 00 00 03  |................|
    00026a10  00 00 00 04 00 00 00 20  00 00 00 02 00 00 00 03  |....... ........|

    But it still can not print log to UART0

    Also back to your original question, you are not getting any prints in the UART, right?

    One valuable experiment in this context they can try is trying to free up some SRAM memory by disabling some CONFIG options they don't need for the first stage bootloader (R5 SPL, also known as tiboot3.bin). This stage runs from internal SRAM and space is very VERY tight. And you do not necessarily get a build error if you use to much memory, so it can cause hidden side effects, such as (silent) crashes or hidden DDR init failures (I've seen the DDR device tree data getting overwritten by the stack in some cases, leading to incorrect DDR init values getting used).

    For example, one good experiment is to disable SPI flash support, by turning off all of the below CONFIG options in your configs/am62ax_evm_r5_defconfig equivalent file. This should free quite a bit of memory. Even if they do want SPI flash support later, I do suggest this as an experiment to help narrow things down.

    • CONFIG_SYS_SPI_U_BOOT_OFFS
    • CONFIG_SPL_DM_SPI
    • CONFIG_SPL_SPI_FLASH_SUPPORT
    • CONFIG_SPL_SPI_SUPPORT
    • CONFIG_SPL_DM_SPI_FLASH
    • CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT
    • CONFIG_SPL_SPI_LOAD

    Regards, Andreas

  • Thank you .Now I find the problem.

    Yes ,you are right I have the DTB in my tiboot3.bin.

    My uart can not print.Because the device tree is fault .