From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: MIME-Version: 1.0 From: Jon Ringle Date: Sat, 31 Aug 2019 22:35:05 -0400 Message-ID: Subject: [ptxdist] RPi3b+ boot sequence with DistroKit (barebox) List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de, jon@ringle.org Content-Type: multipart/mixed; boundary="===============0020436577==" Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.com --===============0020436577== Content-Type: multipart/alternative; boundary="000000000000ae92e2059174b4c5" --000000000000ae92e2059174b4c5 Content-Type: text/plain; charset="UTF-8" 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 --000000000000ae92e2059174b4c5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I am a little confused about the boot sequence and where e= ach boot stage gets configuration from. Here's my current understanding= , which I am sure is flawed:

1. On power on or reset, th= e GPU executes the 1st stage bootloader from ROM
2. 1st stage boo= tloader 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 co= nfuses me with regards to how other RPi distros work vs DistroKit with bare= box...]
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=3Dbarebo= x.img` in config.txt).
However, it seems like barebox is als= o handling the loading and manipulating of the DTB that will then be used b= y the Linux kernel when barebox boots to it...

5. The 3rd stage bootloader read the &quo= t;4th stage" and releases the CPU to execute it.
With Distro= Kit, 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 wi= th 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:=C2=A0https://www.raspberrypi.= org/documentation/configuration/device-tree.md=C2=A0and=C2=A0= https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README=C2=A0?


--000000000000ae92e2059174b4c5-- --===============0020436577== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de --===============0020436577==--