Skip to main content
Visitor II
March 22, 2022
Solved

u-boot with custom dts name won't boot

  • March 22, 2022
  • 4 replies
  • 2109 views

OpenStLinux 5.4 Dunfell 06 22 20

Boot chain of TF-A, U-Boot and kernel.

I had forked the three .dts files with custom board names. TF-A starts fine.

But in u-boot, hangs before it starts.

With exact same dts contents just using original dts name as the DEVICE_TREE then u-boot runs fine.

I have heard that the "compatible" property needs to be the same, which it is, but that seems to have no effect.

Example u-boot build:

make DEVICE_TREE=my-device-tree-name #won't boot

make DEVICE_TREE=original-device-tree-name #boots

Any ideas?

    This topic has been closed for replies.
    Best answer by Kevin HUBER

    Hello @BillR​ ,

    I made some test on my 157c-dk2 board and it works.

    The name of my new dts is "stm32mp157c-dk2-test.dts", it is just a copy of "stm32mp157c-dk2.dts".

    I didn't modified the "compatible" property, it is still:

    	compatible = "st,stm32mp157c-dk2", "st,stm32mp157";

    Please can you verify that you also made a copy of the u-boot.dtsi file with the same name?

    [osboxes@osboxes ...es/arm-ostl-linux-gnueabi/u-boot-stm32mp-v2020.10-stm32mp-r2-r0/u-boot-stm32mp-v2020.10-stm32mp-r2/arch/arm/dts]
    $ ll stm32mp157c-dk2*
    -rw-rw-r-- 1 osboxes osboxes 119378 Apr 15 06:47 stm32mp157c-dk2.dtb
    -rw-r--r-- 1 osboxes osboxes 2918 Apr 14 14:10 stm32mp157c-dk2.dts
    -rw-rw-r-- 1 osboxes osboxes 119378 Apr 15 07:22 stm32mp157c-dk2-test.dtb
    -rw-r--r-- 1 osboxes osboxes 2918 Apr 14 14:10 stm32mp157c-dk2-test.dts
    -rw-r--r-- 1 osboxes osboxes 139 Apr 15 06:46 stm32mp157c-dk2-test-u-boot.dtsi
    -rw-r--r-- 1 osboxes osboxes 139 Oct 18 13:27 stm32mp157c-dk2-u-boot.dtsi

    You can see in the ls -l above that I have a:

    • stm32mp157c-dk2-test.dts
    • stm32mp157c-dk2-test-u-boot.dtsi

    The u-boot.dtsi file is important because it is automatically included in the dts file with the same name.

    This behavior is explained in the wiki: https://wiki.st.com/stm32mpu/wiki/STM32MP15_U-Boot#STM32MP15x_lines_support

    -----------------------

    You can use the command dtc, to verify that your dtb is correct without flashing your board.

    dtc arch/arm/dts/stm32mp157c-dk2.dtb > dtc-stm32mp157c-dk2.dts
    dtc arch/arm/dts/stm32mp157c-dk2-test.dtb > dtc-stm32mp157c-dk2-test.dts

    The command "dtc" convert a generated dtb in a big dts file. This command is very helpful to verity the content of your final DTB, because all the include files have already been processed.

    Once converted your two DTB files in dts, you can then verify that they are identical:

    diff dtc-stm32mp157c-dk2.dts dtc-stm32mp157c-dk2-test.dts

    or by using a diff tool like "meld".

    Hope it helps,

    Regards,

    Kevin

    4 replies

    Technical Moderator
    April 15, 2022

    Hello @BillR​ ,

    I made some test on my 157c-dk2 board and it works.

    The name of my new dts is "stm32mp157c-dk2-test.dts", it is just a copy of "stm32mp157c-dk2.dts".

    I didn't modified the "compatible" property, it is still:

    	compatible = "st,stm32mp157c-dk2", "st,stm32mp157";

    Please can you verify that you also made a copy of the u-boot.dtsi file with the same name?

    [osboxes@osboxes ...es/arm-ostl-linux-gnueabi/u-boot-stm32mp-v2020.10-stm32mp-r2-r0/u-boot-stm32mp-v2020.10-stm32mp-r2/arch/arm/dts]
    $ ll stm32mp157c-dk2*
    -rw-rw-r-- 1 osboxes osboxes 119378 Apr 15 06:47 stm32mp157c-dk2.dtb
    -rw-r--r-- 1 osboxes osboxes 2918 Apr 14 14:10 stm32mp157c-dk2.dts
    -rw-rw-r-- 1 osboxes osboxes 119378 Apr 15 07:22 stm32mp157c-dk2-test.dtb
    -rw-r--r-- 1 osboxes osboxes 2918 Apr 14 14:10 stm32mp157c-dk2-test.dts
    -rw-r--r-- 1 osboxes osboxes 139 Apr 15 06:46 stm32mp157c-dk2-test-u-boot.dtsi
    -rw-r--r-- 1 osboxes osboxes 139 Oct 18 13:27 stm32mp157c-dk2-u-boot.dtsi

    You can see in the ls -l above that I have a:

    • stm32mp157c-dk2-test.dts
    • stm32mp157c-dk2-test-u-boot.dtsi

    The u-boot.dtsi file is important because it is automatically included in the dts file with the same name.

    This behavior is explained in the wiki: https://wiki.st.com/stm32mpu/wiki/STM32MP15_U-Boot#STM32MP15x_lines_support

    -----------------------

    You can use the command dtc, to verify that your dtb is correct without flashing your board.

    dtc arch/arm/dts/stm32mp157c-dk2.dtb > dtc-stm32mp157c-dk2.dts
    dtc arch/arm/dts/stm32mp157c-dk2-test.dtb > dtc-stm32mp157c-dk2-test.dts

    The command "dtc" convert a generated dtb in a big dts file. This command is very helpful to verity the content of your final DTB, because all the include files have already been processed.

    Once converted your two DTB files in dts, you can then verify that they are identical:

    diff dtc-stm32mp157c-dk2.dts dtc-stm32mp157c-dk2-test.dts

    or by using a diff tool like "meld".

    Hope it helps,

    Regards,

    Kevin

    Technical Moderator
    May 4, 2022

    Hello @BillR​ ,

    Did it solves your issue?

    Regards,

    Kevin

    In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'

    BillRAuthor
    Visitor II
    May 4, 2022

    Kevin, since it wasn't currently a show stopper I have not tried this yet. It does sound like that is likely the issue, about the dtsi file. I will getting back into this work maybe this week and try it out - I'll let you know, Thanks!

    BillRAuthor
    Visitor II
    June 1, 2022

    Kevin, yes that was it!

    Because I didn't generate our DTs with CubeMX, but rather modified from existing files (an Octavo ref. design) I didn't realize the corresponding dtsi file was required since I didn't see it included in the dts.

    Thanks again, Bill

    Technical Moderator
    June 1, 2022

    Hi @BillR​ ,

    Thank you for the feedback ;)

    Regards,

    Kevin