[PATCH v2] sunxi: eMMC: support TOC0 on boot partitions

Samuel Holland samuel at sholland.org
Sat Jan 21 20:39:01 CET 2023


On 1/20/23 19:51, Andre Przywara wrote:
> To determine whether we have been booted from an eMMC boot partition, we
> replay some of the checks that the BROM must have done to successfully
> load the SPL. This involves a checksum check, which currently relies on
> the SPL being wrapped in an "eGON" header.
> 
> If a board has secure boot enabled, the BROM will only accept the "TOC0"
> format, which is internally very different, but uses the same
> checksumming algorithm. Actually the only difference for calculating the
> checksum is that the size of the SPL is stored at a different offset.
> 
> Do a header check to determine whether we deal with an eGON or TOC0
> format, then set the SPL size accordingly. The rest of the code is
> unchanged.
> 
> This fixes booting from an eMMC boot partition on devices with secure
> boot enabled, like the Remix Mini PC.
> 
> Signed-off-by: Andre Przywara <andre.przywara at arm.com>
> ---
> Changelog v2 .. v1:
> - use struct members instead of indexing buffer array
> 
>  arch/arm/mach-sunxi/board.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)

Reviewed-by: Samuel Holland <samuel at sholland.org>



More information about the U-Boot mailing list