Boot process comparison between Rock Pi E and Rock 5B

Greetings all!

I do not own any Rock Pi boards yet but I would love to hack on some in the future. I am just trying to study them from information I can find and I’d love it if someone who understands the boot process in detail can answer my questions. For now, my questions are comparing the Rock Pi E and newer Rock 5B boards.

It’s a non-trivial amount of questions but I could not find this info on the wiki so I hope someone who knows more can help answer details about how the boot process works on these two boards.

Now…

The Rock Pi E has USB-OTG support, but it appears on headers on the PCB rather than a port. Apparently you need to remove the eMMC and microSD so that rkdeveloptool can load some portion of I am guessing U-Boot of some kind to bring the machine up into functional state. What exactly is in rk3328_loader_ddr333_v1.16.250.bin?? Then I do not understand you need to plug in the eMMC module while the machine is on? This is not a problem? Then you write some img file, does this contain U-Boot + kernel + userspace in one image including already in partitions? I think it must because you can use rkdeveloptool to write to specific partitions but I don’t understand why the byte offsets are double what they actually are on the partitions (like why “rkdeveloptool wl 64 foo.img” to write to only 32KB in?). Is source available to the First stage loader (I guess U-Boot SPL?) and main U-boot image and also all of ATF? Do I need kernel image + initrd on separate partition or can it be one big / parition? Also can the U-Boot be modified to choose between booting from eMMC or microSD card, preferably with menu like Tow-Boot provides? As far as I can tell there is no dedicated SPI Flash chip to write U-Boot to (although I see one on the Rock 5 model B board) so is the boot code in maskrom on the SOC always going to boot from eMMC no matter what first, looking for something useful to init the RAM, etc 32KB into the eMMC (I guess this is not even in the partition table but the maskrom code just looks at those sectors anyway and does not care?). What if eMMC is empty or unplugged, can you boot from microSD card as second option? Obviously USB-OTG boot is possible if both other sources are unplugged…

Now there is even LESS info about the Rock5 Model B boot process, so I would also love to know about this. All the links to schematics are dead links on the wiki, so I don’t know who can answer this, but is U-Boot SPL and second stage of U-Boot and ATF all stored in the SPI Flash chip on the underside of the board? What is the make/model of the SPI Flash chip (what voltage)? This is standard SOIC-8 package? Is full source available for all of these components (no blobs, even for video output) and can I write to the SPI flash chip in full with no issues? I am guessing it has no partition table, right? Will it be released the byte offsets of the locations of the boot code like is available for the Rock Pi E? I see no mention of USB-OTG support for this board, are ALL four USB Type A ports purely “host” ports with no OTG support and the USB-C port purely for delivering power (no data, no alt mode, no video, no audio, no OTG)? If there is no USB-OTG then rkdeveloptool will not work on the Rock5 Model B, is this correct? What happens if the data in the SPI Flash chip is corrupted or empty, will the machine be effectively bricked or does the maskrom boot code in the RK3588 SOC know how to look for eMMC or microSD card to boot from? If so, what are the offsets to store U-Boot SPL, U-Boot primary stage, ATF, and root partition in either eMMC or microSD? Can it boot from NVMe SSD? If the maskrom does not know how to find bootloader in NVMe SSD, then can it be somewhere else (SPI Flash or eMMC) and load the kernel, initrd, and root filesystem from the NVMe SSD? I don’t mind if the bootloader (and ATF) is on slower storage, but I am sure to want my OS on a PCIe 3.0 x4 bus compared to eMMC or microSD speeds… if the source of U-Boot is available in its entirety this should be possible to load OS from NVMe SSD, right (even if maskrom has to load initial code from somewhere else before U-Boot points to the NVMe SSD where the OS is)? On that note, what is the status of mainline U-Boot support for the Rock5 Model B? And is the full source of the ATF available on some ARM VCS repo for this board? Does the ATF have to be stored alongside both stages of U-Boot (no matter if on SPI Flash, eMMC, microSD, or in crazy case the SOC knows how to boot from this medium, the NVMe SSD?)

Okay I think that is all the questions about booting I have for now… I think that is 11 questions (in first paragraph about Rock Pi E) and 15 questions in second paragraph (about Rock 5B). ALL of them are interesting to know, so I hope someone with a lot of info finds this post!! :grin:

Thanks in advance!