Hi Stefan,

On 7/31/2026 5:10 PM, Stefan Monnier wrote:
> Jonas Karlman [2026-07-31 10:32:03] wrote:
>> On 7/30/2026 3:34 PM, Johan Jonker wrote:
>>> +for data. It is not possible to place these blocks randomly.
>>> +
>>> +* eMMC/SD card:
>>> +
>>> +  Rockchip uses a unified GPT partition layout for it's open source 
>>> products.
>>> +  With this GPT partition layout U-Boot can be compatible with other 
>>> components,
>>> +  like miniloader, trusted-os, arm-trusted-firmware.
>>> +
>>> +  There are some documents about partitions in the link below.
>>> +  
>>> https://web.archive.org/web/20260501050119/https://opensource.rock-chips.com/wiki_Partitions
>>
>> Please drop this entire 'unified GPT partition layout' section, it is
>> not something we should encourage user to use. It is legacy and nothing
>> in mainline U-Boot that depends on this layout.
> 
> At the very least we should distinguish what is technically needed from
> what is some arbitrary convention that's been cargo-culted.

I agree, and for MMC devices the BootROM typically look for the IDBlock
header at sector 64, 1088, 2112, 3136 and 4160 and does not care about
partitions.

U-Boot SPL will typically look for FIT (or u-boot.img) at sector 16384
(SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x4000). This can be adjusted or
re-configured to instead look for a specific partition with Kconfig
options, something that the khadas-edge2-rk3588s target does.

The legacy GPT partition layout is something that was inherited from old
vendor miniloader blobs. The miniloader looked for miniloader packed
U-Boot at the 'loader2' partition offset and trust (tf-a/optee) from a
'trust' partition offset. Newer vendor U-Boot SPL typically also look
for FIT at a partition named 'uboot' and falls back to sector 16384.

So the text to write u-boot-rockchip.bin at sector 64 is the only
relevant part of information for this section of the documentation.

It may also be worth mentioning that a filesystem should not be created
at 0-16 MiB of MMC device if boot firmware is also intended to be stored
on the same device to be safe for both vendor and mainline boot firmware,
at least for rk33xx and newer SoCs.

> 
>> For mainline a more appropriate layout would be to reserve initial 0-16
>> MiB of boot media for partition table and firmware, and use remaining
>> freely.
> 
> [ FWIW, I'm a big fan of having a partition to hold U-Boot, rather than
>   hiding it in the first few unattributed blocks.  ]

I agree, it can be useful to create one of more partitions to ease with
flashing a new u-boot-rockchip.bin to a 'firmware' partition or similar.

Regards,
Jonas

> 
> === Stefan
> 

Reply via email to