mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Trent Piepho <trent.piepho@igorinstitute.com>
To: Konstantin Kletschke <konstantin.kletschke@inside-m2m.de>
Cc: Sascha Hauer <sha@pengutronix.de>,
	Barebox List <barebox@lists.infradead.org>
Subject: Re: Compiled in boot environment and dtbo files
Date: Wed, 16 Jun 2021 12:55:33 -0700	[thread overview]
Message-ID: <CAMHeXxMF7uGBTtL0mJNzXUuJQUABKOAkC3YPV5Lsc7JzB0Ms5A@mail.gmail.com> (raw)
In-Reply-To: <D8E37CF9-C7A1-40AE-B747-69E000D1B727@inside-m2m.de>

On Wed, Jun 16, 2021 at 8:59 AM Konstantin Kletschke
<konstantin.kletschke@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.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


  reply	other threads:[~2021-06-16 19:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  8:10 Konstantin Kletschke
2021-06-16 12:34 ` Sascha Hauer
2021-06-16 15:57   ` Konstantin Kletschke
2021-06-16 19:55     ` Trent Piepho [this message]
2021-06-18 12:43       ` Konstantin Kletschke
2021-06-17  6:41     ` Sascha Hauer
2021-06-18 13:15       ` Konstantin Kletschke
2021-06-21  4:01         ` Sascha Hauer
2021-06-21 14:21           ` Konstantin Kletschke
2021-06-22 10:40             ` Konstantin Kletschke
2021-06-18  6:48 ` Ahmad Fatoum
2021-06-18 13:16   ` Konstantin Kletschke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMHeXxMF7uGBTtL0mJNzXUuJQUABKOAkC3YPV5Lsc7JzB0Ms5A@mail.gmail.com \
    --to=trent.piepho@igorinstitute.com \
    --cc=barebox@lists.infradead.org \
    --cc=konstantin.kletschke@inside-m2m.de \
    --cc=sha@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox