Compiled in boot environment and dtbo files

Trent Piepho trent.piepho at igorinstitute.com
Wed Jun 16 12:55:33 PDT 2021


On Wed, Jun 16, 2021 at 8:59 AM Konstantin Kletschke
<konstantin.kletschke at inside-m2m.de> wrote:
> global.bootm.image=/boot/uImage
> global.bootm.oftree=/boot/am335x-boneblack.dtb
>
> Is the order of loading (of_overlay before loading devicetree) messing things up? If not, what does?
> Is it reasonable for me to learn the bootloader spec stuff?

While I have not yet used overlays in barebox, and don't know what is
wrong here, the order of loading is not what you think.

Setting global.bootm.* only sets a env variable.  It does not load
anything.  The file doesn't even need to exist, i.e. it can be on a
device that is not mounted yet.  These variables set the defaults for
when the "bootm" command is run.  One can put dtb and kernel image on
the command line of bootm too, so override the default from the env
variables.

So the dtb will always be loaded after calling of_overlay, since the
dtb is not loaded until the last command barebox will run to actually
boot the kernel.

of_overlay will call of_register_overlay(), and that registers the
overlay to be loaded when bootm runs, after it has loaded the main dtb
and is applying fixups.  But it registers to binary dtb data, not just
the file name, so the file is loaded when of_overlay is run.  Looks
like that fixup process run by bootm didn't work for some reason and
this is the source of the errors.

To be more consistent with the rest of bootm, there should probably be
variables "global.bootm.ofoverlay.*" and bootm will load the files in
those variables as overlays.  Those improvements Sascha alluded to are
probably something like this.



More information about the barebox mailing list