diff options
| author | Rasmus Villemoes <[email protected]> | 2026-01-29 11:54:32 +0100 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-02-10 15:54:04 -0600 |
| commit | 589d0a687b020fa6000afec454ec82f192613ed5 (patch) | |
| tree | f210f2b5600b6935264448e49818850134a80fa0 /include/android_bootloader_message.h | |
| parent | eed514b11d04a2f8a949521ad3bffba3ec98bd2f (diff) | |
am335x: add support for loading u-boot from multiple offsets
The am335x knows nothing about eMMC boot partitions, so in order to
implement an update procedure of the bootloader which is robust
against power failure or other interruptions, one must make use of the
fact that ROM code on the am335x looks for a valid first stage
bootloader at several different offsets. Updating that can then be
implemented by (assume we put MLO at offsets 128K and 256K):
(1) At least one of the two slots must contain a valid header, since
we successfully booted. Pick the other one.
(2) Overwrite the first sector of the slot chosen in step (a) with all
zeroes.
(3) Write everything but the first sector to the chosen slot.
(4) Write the first sector (containing the magic signature that the
boot ROM uses to identify a valid image) to the chosen slot.
(5) Repeat steps (2)-(4) for the other slot.
It's not possible to simply write the whole MLO in one go, especially
not when updating the 128K slot, because an interruption after the
first sector is written would make the ROM code believe the image is
valid.
But this only caters for SPL itself; regardless of where SPL was
loaded from, it would go on to load U-Boot proper from
SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR. So in order to update the whole
bootloader, we need to teach SPL to use a different offset for U-Boot
proper depending on where SPL itself was loaded from (*). With that,
the update procedure is just amended by a step
(3a) Write U-Boot proper to the offset corresponding to the SPL slot
being updated.
We can know (*) because the ROM code sets a new bit in a certain
"trace vector" before each successive attempt.
Signed-off-by: Rasmus Villemoes <[email protected]>
Diffstat (limited to 'include/android_bootloader_message.h')
0 files changed, 0 insertions, 0 deletions
