diff options
author | Andre Przywara <andre.przywara@arm.com> | 2021-07-12 11:06:50 +0100 |
---|---|---|
committer | Andre Przywara <andre.przywara@arm.com> | 2022-04-05 00:08:40 +0100 |
commit | b9a2e1853351218b80cd647253a8c97bad0e31ac (patch) | |
tree | 56ec686d3b9d7d569ede9a4e0ff28e09aab29266 /doc/README.fsl-hwconfig | |
parent | 59073573227ce7aeae3957744146cdf23849c8b9 (diff) | |
download | u-boot-b9a2e1853351218b80cd647253a8c97bad0e31ac.tar.gz u-boot-b9a2e1853351218b80cd647253a8c97bad0e31ac.tar.bz2 u-boot-b9a2e1853351218b80cd647253a8c97bad0e31ac.zip |
sunxi: eMMC: Improve automatic boot source detection
When the Allwinner BROM loads the SPL from an eMMC boot partition, it
sets the boot source byte to the same value as when booting from the
user data partition. This prevents us from determining the boot source
to load U-Boot proper from the proper partition for sure.
The generic SPL MMC code already looks at the enabled boot partition
number, to load U-Boot proper from the same partition, but this fails
if there is nothing bootable in this partition, as the BROM then
silently falls back to the user data partition, which the SPL misses.
To learn about the actual boot source anyway, we repeat the algorithm
the BROM used to select the boot partition in the first place:
- Test EXT_CSD[179] to check if an eMMC boot partition is enabled.
- Test EXT_CSD[177] to check for valid MMC interface settings.
- Check if BOOT_ACK is enabled.
- Check the beginning of the first sector for a valid eGON signature.
- Load the whole SPL.
- Recalculate the checksum to verify the SPL is valid.
If one of those steps fails, we bail out and continue loading from the
user data partition. Otherwise we load from the selected boot partition.
Since the boot source is needed twice in the boot process, we cache the
result of this test to avoid doing this costly test multiple times.
This allows the very same image file to be put onto an SD card, into the
eMMC user data partition or into the eMMC boot partition, and safely
loads the whole of U-Boot from there.
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'doc/README.fsl-hwconfig')
0 files changed, 0 insertions, 0 deletions