eMMC layout and boot blobs storage

Where can I find the information about default eMMC partition layout?
I am interested where the boot blobs (bb1st.sto.bin.signed, blob-bl2e/x.) are stored as well as the device-fip.bin.signed image.
I have built the ubuntu image but didn’t notice that these blobs were inserted into the vim1s-ubuntu-20.04-server-linux-5.4-fenix-1.4.2-*-emmc-develop.img image.

Hello @NewDwarf

Maybe you can check the scripts here: u-boot/fip

Hi. Looks like Pengutronix - eMMC Hardware Partitioning
can answer this question. The eMMC storage has so called hardware partitions boot0, boot1, RPMB, and the user data partition.
I have installed Ubuntu on eMMC and just dumped first 1024 bytes of the boot0 partition.

00000000  01 00 00 00 00 20 01 00  00 00 00 00 00 00 00 00  |..... ..........|
00000010  00 40 00 00 08 00 00 00  00 00 00 00 00 00 00 00  |.@..............|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000001f0  00 00 00 00 00 00 00 00  00 00 00 00 09 60 01 00  |.............`..|
00000200  40 4d 4c 20 8d 66 31 ed  00 00 00 00 80 05 00 00  |@ML .f1.........|
00000210  a4 f3 b6 52 0c bb ff b8  ff 62 e0 b1 1d 82 fb 97  |...R.....b......|
00000220  84 8a 15 14 88 df bd 01  0c 92 46 00 57 69 22 dc  |..........F.Wi".|
00000230  0a 3a 2c b2 3f 2e d5 93  9c eb cb 8a 2b 2e 78 c8  |.:,.?.......+.x.|

Comparison with the bb1st.sto.bin.signed image showed that its content matches to the dumped one.
…then I rebooted the board and noticed that BL2 reports

BL2 Built : 12:56:48, Sep 27 2022. s4 origin/master gb841f78 - jenkins@walle02-sh

boot area list:
1STBLOB 00000200        0002a000
BL2E    0002a200        00013000
BL2X    0003d200        00011000
DDRFIP  0004e200        00040000
DEVFIP  0008e200        00300000

which confirms above result.
So, I got the answers except the question when and how 1STBLOB, BL2E, BL2X, DDRFIP, DEVFIP are stored in the eMMC.

i think its was answer :wink: offset 0x00000200 = 512 bytes and size 0x0002a000 = 172032 bytes etc …

boot0 same as boot1 its additional special boot areas and its optional , common bootloader can be stored into normal disk area

What is the common bootloader in this context? Is it just uboot or the whole chain BL2 → … BL33?
And what is the normal disk area? Is it a user data area in terms of the hardware partitioning?
Is hardware partitioning of the eMMC memory the industrial standard? Or the device/chipset vendors are free to choose the memory as they want?
In my understanding, it is very specific to the SoC’s Boot ROM which looks for the BL2 from the different non-volitile memory types (eMMC, NAND, SPI-NOR, etc…) and it is important that partitioning will be common for most/all flash memory vendors as the chipset vendor, more likely, intends to be compatible with many different eMMC vendors.

SoC looks for a magic header at specific offsets to determine available boot options (according to the default priorities in silicon or forced in hardware) and loads signed BL2 => BL33 chain; basically the standard ATF boot flow using their downstream fork that’s been lightly “improved” by Amlogic staff developers. It’s not hard to create signed u-boot for yourself and sources are available; but the signing process still depends on closed-source and device-specific bits, as is common with ARM boot stuff.

1 Like

Originally, I meant that we consider booting only from the eMMC. And that is why I emphasize on the eMMC partitioning that it is difficult to implement different partitioning schemes on eMMC memory as the Boot ROM cannot be modified after burning (Boot ROM logic decides how to work with the eMMC partitioning scheme). At the same time, it is very important to support as many as possible eMMC memory vendors from the commercial perspective.