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.

AM625: How to add multiple device tree overlays in uboot

Part Number: AM625

Tool/software:

Hi ,

Working on AM625 .

host : ubuntu.

please provide the support how to add the device tree overlays in uboot ?

Thanks , Naresh

  • Hi below uEnv.txt file created and boot the board . but overlay getting issue. please find below error logs.

    i found below config in <uboot_src>/board/ti/am62x/am62x.env

    fyi , device tree overlays and device tree binary placed in SDCARD 2nd partiton (path : boot/dtb/ti/ )

    # Set the default device tree
    default_device_tree=ti/k3-am625-sk.dtb
      	
    # Script to find and set the appropriate device tree
    findfdt=echo "Reading from Tessolve uEnv.txt..."; setenv name_fdt ${default_device_tree}; \
        if test $board_name = am62x_skevm; then \
            setenv name_fdt ti/k3-am625-sk.dtb; \
        fi; \
        if test $board_name = am62x_lp_skevm; then \
            setenv name_fdt ti/k3-am62-lp-sk.dtb; \
        fi; \
        if test $board_name = am62x_beagleplay; then \
            setenv name_fdt ti/k3-am625-beagleplay.dtb; \
        fi; \
        setenv fdtfile ${name_fdt}
     
    # Load the device tree and overlays
    uenvcmd=run findfdt; \
        echo "Loading device tree: ${fdtfile}"; \
        load mmc 1:2 ${fdtaddr} /boot/dtb/${fdtfile}; \
        fdt addr ${fdtaddr}; \
        echo "Loading overlay 1: /board/dtb/ti/k3-am625-beagleplay-csi2-ov5640.dtbo"; \
        load mmc 1:2 0x89000000 /board/dtb/ti/k3-am625-beagleplay-csi2-ov5640.dtbo; \
        fdt apply 0x89000000; \
        echo "Overlay 1 applied."; \
        echo "Loading overlay 2: /board/dtb/ti/k3-am62x-sk-csi2-imx219.dtbo"; \
        load mmc 1:2 0x89000000 /board/dtb/ti/k3-am62x-sk-csi2-imx219.dtbo; \
        fdt apply 0x89000000; \
        echo "Overlay 2 applied."; \
        echo "Loading overlay 3: /board/dtb/ti/k3-am62x-sk-csi2-ov5640.dtbo"; \
        load mmc 1:2 0x89000000 /board/dtb/ti/k3-am62x-sk-csi2-ov5640.dtbo; \
        fdt apply 0x89000000; \
        echo "Overlay 3 applied."; \
        fdt resize

    ERROR LOGS 

    Loading overlay 1: /board/dtb/ti/k3-am625-beagleplay-csi2-ov5640.dtbo
    Failed to load '/board/dtb/ti/k3-am625-beagleplay-csi2-ov5640.dtbo'
    libfdt fdt_check_header(): FDT_ERR_BADMAGIC
    Overlay 1 applied.

    U-Boot 2023.04-ti-gf9b966c67473 (Mar 19 2024 - 20:31:40 +0000)
    
    SoC:   AM62X SR1.0 GP
    Model: Texas Instruments AM625 SK
    EEPROM not available at 80, trying to read at 81
    Reading on-board EEPROM at 0x51 failed -121
    DRAM:  2 GiB
    Core:  72 devices, 32 uclasses, devicetree: separate
    MMC:   mmc@fa10000: 0, mmc@fa00000: 1
    Loading Environment from nowhere... OK
    In:    serial
    Out:   serial
    Err:   serial
    EEPROM not available at 80, trying to read at 81
    Reading on-board EEPROM at 0x51 failed -121
    Net:   eth0: ethernet@8000000port@1
    Hit any key to stop autoboot:  0 
    i2c_write: error waiting for data ACK (status=0x116)
    pca953x gpio@22: Error reading output register
    switch to partitions #0, OK
    mmc1 is current device
    i2c_write: error waiting for data ACK (status=0x116)
    pca953x gpio@22: Error reading output register
    SD/MMC found on device 1
    Failed to load 'boot.scr'
    1488 bytes read in 16 ms (90.8 KiB/s)
    Loaded env from uEnv.txt
    Importing environment from mmc1 ...
    Running uenvcmd ...
    Reading from Tessolve uEnv.txt...
    Loading device tree: ti/k3-am625-sk.dtb
    60299 bytes read in 21 ms (2.7 MiB/s)
    Working FDT set to 88000000
    Loading overlay 1: /board/dtb/ti/k3-am625-beagleplay-csi2-ov5640.dtbo
    Failed to load '/board/dtb/ti/k3-am625-beagleplay-csi2-ov5640.dtbo'
    libfdt fdt_check_header(): FDT_ERR_BADMAGIC
    Overlay 1 applied.
    Loading overlay 2: /board/dtb/ti/k3-am62x-sk-csi2-imx219.dtbo
    Failed to load '/board/dtb/ti/k3-am62x-sk-csi2-imx219.dtbo'
    libfdt fdt_check_header(): FDT_ERR_BADMAGIC
    Overlay 2 applied.
    Loading overlay 3: /board/dtb/ti/k3-am62x-sk-csi2-ov5640.dtbo
    Failed to load '/board/dtb/ti/k3-am62x-sk-csi2-ov5640.dtbo'
    libfdt fdt_check_header(): FDT_ERR_BADMAGIC
    Overlay 3 applied.
    Reading from Tessolve uEnv.txt...
    ## Error: "main_cpsw0_qsgmii_phyinit" not defined
    22034944 bytes read in 892 ms (23.6 MiB/s)
    60299 bytes read in 21 ms (2.7 MiB/s)
    Working FDT set to 88000000
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
    Working FDT set to 88000000
       Loading Device Tree to 000000008feee000, end 000000008fffffff ... OK
    Working FDT set to 8feee000
    
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
    [    0.000000] Linux version 6.1.80-ti-g2e423244f8c0 (oe-user@oe-host) (aarch64-oe-linux-gcc (GCC) 11.4.0, GNU ld (GNU Binutils) 2.38.20220708) #1 SMP PREEMPT Wed Mar 20 14:43:33 UTC 2024
    [    0.000000] Machine model: Texas Instruments AM625 SK TESS
    [    0.000000] earlycon: ns16550a0 at MMIO32 0x0000000002800000 (options '')
    [    0.000000] printk: bootconsole [ns16550a0] enabled
    [    0.000000] efi: UEFI not found.
    

    Note : I am using device tree overlays binaries which comes along with linux kernel 6.1 .

    Kindly help me on this .

    Thanks, Naresh

  • Hello Naresh, 

    Can you apply the overlays from U-boot prompt using the command:

    Hit any key to stop autoboot:  0
            =>
            => setenv name_overlays <name-of-overlay>.dtbo
            => boot

    Regards,
    Aparna

  • Hi Aparna ,

    Thanks for response. 

    with name_overlays its working fine , name overalys configured in which file in uboot source code ?

    why i am not able to load device tree overlay with below 

    # Load the device tree and overlays
    uenvcmd=run findfdt; \
    echo "Loading device tree: ${fdtfile}"; \
    load mmc 1:2 ${fdtaddr} /boot/dtb/${fdtfile}; \
    fdt addr ${fdtaddr}; \
    echo "Loading overlay 1: /board/dtb/ti/k3-am625-beagleplay-csi2-ov5640.dtbo"; \
    load mmc 1:2 0x89000000 /board/dtb/ti/k3-am625-beagleplay-csi2-ov5640.dtbo; \
    fdt apply 0x89000000; \
    echo "Overlay 1 applied."; \

    Thanks, Naresh

  • Hello Naresh,

    Please refer the following documentation:
    https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/09_02_01_10/exports/docs/linux/How_to_Guides/Target/How_to_enable_DT_overlays_in_linux.html?highlight=overlay#how-to-enable-dt-overlays-in-linux

    Update the uEnv.txt file to let u-boot recognize the overlay you are trying to apply.

    Regards,
    Aparna

  • HI Aparna,

    Thanks, Naresh