Boot does not work when changing default dts
m.salvini at koansoftware.com
Tue Apr 6 15:30:36 CEST 2021
I also wrote on RPI forums  to discuss about this problem.
I'm using a CM4 module on CMIO board, with an image built by Yocto
(dunfell version) and containing u-boot version 2020.01.
When I add some overlays via config.txt file, or I change the original
Linux dts and rebuild its dtb, often occours that the boot stops with
this error message:
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
generated by the "fdt addr" command in boot.scr script, executed by u-boot.
If I delete the env file (that boot.scr saves in FAT partition), boot
restarts to work without errors. If I modify another time the devicetree
(for example undoing the last modification), error happens again. Then,
the problem is not related to dts errors.
This behavior seems to occour when a overlay (or a dts modification)
adds or removes some pieces of dts: if overlay/modification overwrites
existing properties values, error does not happen.
In fact, it seems that u-boot always uses fdt_addr saved in environment
(when an env is saved), instead of the value passed by the RPI firmware,
that changes if a modification (via dts rebuild or via overlay
addition/remove) happens since the last loaded devicetree.
Is this the expected behavior (delete .env when there is a devicetree
mdoification) or could be a bug?
Thanks in advance, regards
Mauro S. | KOAN sas | Bergamo - Italia
embedded software engineering
More information about the U-Boot