PROCESSOR-SDK-AM62X: [AM62X] [uboot][Runtime uboot configuration] how to load uboot device overlays (not linux device tree overlays)

Part Number: PROCESSOR-SDK-AM62X
Other Parts Discussed in Thread: AM625

Tool/software:

Hi Ti, 

Kindly help me on how to load uboot device tree overlays from uboot ?

Actually i am working on run time uboot configugration via FDT .

we have 4 customised board using same AM625 processor . we nee to provide the single uboot binary for 4 boards . For that we need to load base device tree which is common to all 4 boards and on top of it i have to load uboot device tree overlays for each board(not linux device tree overlays ).

Kindly help me how to create uboot device tree overlays and how to compile it and how to load on the top of basedevice tree ?

Kindly assist on this as it is critical to us .

Thanks, Naresh

  • Hi Naresh,

    There is no provision to create or load Uboot DT overlays.

    What kind of variations are present in the 4 customised boards? There is a concept of FDT fixups in U-boot. You can load a single DT file, and in runtime, you can identify the  boards based on certain HW registers, and make device tree fixups as required.

    Reference: https://github.com/u-boot/u-boot/blob/master/arch/arm/mach-k3/am62x/am625_fdt.c

    Regards,
    Aparna

  • Hi Aparna ,

    Thank you for Quick response .

    Could you please eleberate more on "device tree fixups "

    we have 4 customised AM625 board with some interfaces variations board to board 

    is this uboot DT overlays not a provision to load from uboot ? or this uboot DT overlays concepts is itslef is not supported ?

    As we thought , first we need to load base device tree which is common to all boards and then load uboot device tree overlay for each board , as you confirmed that in uboot , There is no provision to create or load Uboot DT overlays. Kindly suggest , how to achieve this ?

    ==========================================================================================================

    This is other topic :-

    Query : k3-am625-sk.dtb is a part of u-boot.img  , where i try to load this u-boot.img  then uboot binary loading along with k3-am625-sk.dtb .                                                 my query is how to seperately load uboot "k3-am625-sk.dts "binary instead of combinely loading with u-boot.img ?

    Thanks, Naresh

  • we have 4 customised AM625 board with some interfaces variations board to board 

    I need the information about the variations that are present in these boards. Do you need to modify the dts files only?

    Query : k3-am625-sk.dtb is a part of u-boot.img  , where i try to load this u-boot.img  then uboot binary loading along with k3-am625-sk.dtb .                                                 my query is how to seperately load uboot "k3-am625-sk.dts "binary instead of combinely loading with u-boot.img ?

    It is not possible to load the dtb file separately. It is combined with u-boot.img

    Regards,
    Aparna

  • Hi ,

    possible

    Got it .

    I saw this flag "OF_SEPARATE" in uboot , can we use this flag to seperate the k3-am625-sk.dtb binary from uboot image .

    May i know what is the use of this OF_SEPERATE flag.

    Is there any way to load seperately uboot k3-am625-sk.dtb binary ?

    Thanks, Naresh

  • Hi Naresh,

    Yes, looks like a separate dtb file can be created and loaded in U-boot using the OF_SEPARATE config option.
    https://github.com/u-boot/u-boot/blob/master/doc/develop/devicetree/control.rst

    ...

    If `OF_SEPARATE` is selected by Kconfig, then it will be built and placed in a u-boot.dtb file alongside u-boot-nodtb.bin with the combined result placed in u-boot.bin so you can still just flash u-boot.bin onto your board.

    Is there any way to load seperately uboot k3-am625-sk.dtb binary ?

    I have not tried this myself, could you experiment by placing the u-boot.dtb file and u-boot-nodtb.bin file in your boot partition.

    Regards,
    Aparna

  • Hi Aparna ,

    OF_SEPARATE

    I tried to enable this flag in uboot , compiled the source code and generated u-boot.bin , u-boot.dtb  & u-boot-nodtb.bin

    then after i trying to boot the device from sd card but device is not booted , its stuck at SPL.

    what i did : 

    in SDCARD 1st partition i placed u-boot.bin (instead of u-boot.img) and then i did plug the sdcard to board and power on the board . Then board is stuck at SPL.

    what i thought if device is booted with u-boot.bin then in uboot , i will try to load u-boot.dtb/u-boot-nodtb.bin . but u-boot.bin itself is not loading.

    Thanks, Naresh

  • Hi Naresh,

    I have to try this out at my end. Will let you know by tomorrow.

    Regards,
    Aparna

  • Hi Naresh,

    A customer here had the requirement of applying DT overlays based on GPIO inputs. Hence they modified the Uboot env variable to load corresponding overlay file. Is this something you can utilize for your use-case: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1422521/am62a7-configure-gpio-as-input-and-read-gpio-value-from-u-boot-source-code/5512592#5512592

    Regards,
    Aparna