mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Jon Ringle <jonringle@gmail.com>
To: ptxdist@pengutronix.com
Subject: [ptxdist] RPi3b+ boot sequence with DistroKit (barebox)
Date: Sat, 31 Aug 2019 22:35:05 -0400	[thread overview]
Message-ID: <CAMwGMjyt1zhEdTpg+h9oLC-3gEL6cKjPKpbDDrxJBVtTcXqV7A@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1881 bytes --]

I am a little confused about the boot sequence and where each boot stage
gets configuration from. Here's my current understanding, which I am sure
is flawed:

1. On power on or reset, the GPU executes the 1st stage bootloader from ROM
2. 1st stage bootloader reads the file bootcode.bin from the 1st partition
(fat) on SDCard and loads it to L2 cache and executes this as the 2nd stage
bootloader.
3. The 2nd stage bootloader initializes and enables SDRAM and reads the
file start.elf to ram as the 3rd stage bootloader.
4. The 3rd stage bootloader reads the config.txt.
[This is the part that confuses me with regards to how other RPi distros
work vs DistroKit with barebox...]
I thought that this stage would also load the DTB and any dtoverlay before
loading the "4th stage bootloader" (by default is the file kernel.img, but
barebox changes this by having `kernel=barebox.img` in config.txt).
However, it seems like barebox is also handling the loading and
manipulating of the DTB that will then be used by the Linux kernel when
barebox boots to it...

5. The 3rd stage bootloader read the "4th stage" and releases the CPU to
execute it.
With DistroKit, the config.txt and the GPU bootloader images, and
barebox.img are on /dev/disk0.0 (available in barebox at /boot/), but the
DTB is on /dev/disk0.1 (available in /mnt/disk0.1/boot/). There is neither
a /boot/overlays/ nor a /mnt/disk0.1/boot/overlays/ directory. (Which is
why I'm confused with my comments on 4 above.)

A) Can I create an overlays/ directory in order to affect the DTB that gets
sent to the Linux kernel as described by the RPi docs:
https://www.raspberrypi.org/documentation/configuration/device-tree.md and
https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README ?

B) If so, where should the overlays/ directory live...?
C) Or does barebox handle this in a different way?

Thanks,
-Jon

[-- Attachment #1.2: Type: text/html, Size: 2365 bytes --]

[-- Attachment #2: Type: text/plain, Size: 92 bytes --]

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

             reply	other threads:[~2019-09-01  2:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-01  2:35 Jon Ringle [this message]
2019-09-03 13:53 ` Roland Hieber
2019-09-07  5:42   ` Jon Ringle
2019-09-07 20:06     ` Jon Ringle
2019-09-09  6:15       ` Michael Olbrich
2019-09-09 10:59       ` Roland Hieber

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=CAMwGMjyt1zhEdTpg+h9oLC-3gEL6cKjPKpbDDrxJBVtTcXqV7A@mail.gmail.com \
    --to=jonringle@gmail.com \
    --cc=jon@ringle.org \
    --cc=ptxdist@pengutronix.com \
    --cc=ptxdist@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