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.)
B) If so, where should the overlays/ directory live...?
C) Or does barebox handle this in a different way?
Thanks,
-Jon