[PATCH v2] cmd: bcb: select user(0) hwpart in __bcb_load()

Tom Rini trini at konsulko.com
Mon Oct 24 14:22:47 CEST 2022


On Thu, Oct 13, 2022 at 02:25:59PM +0200, Mattijs Korpershoek wrote:

> For some blk operations, it's possible that a different hw partition
> gets selected via blk_dselect_hwpart().
> In that case, only the region of the device covered by that partition
> is accessible.
> 
> This breaks "bcb load" which attempts to read the gpt and assumes it's
> on the user(0) hw partition:
> 
> => bcb load 2 misc
> GUID Partition Table Header signature is wrong: 0xDE7B17AD07D9E5D6 != 0x5452415020494645
> find_valid_gpt: *** ERROR: Invalid GPT ***
> GUID Partition Table Header signature is wrong: 0x0 != 0x5452415020494645
> find_valid_gpt: *** ERROR: Invalid Backup GPT ***
> Error: mmc 2:misc read failed (-2)
> 
> Add a fail-safe in __bcb_load() to ensure we will always read from the
> user(0) hwpartition.
> 
> This fixes the following fastboot sequence:
> 
> $ fastboot erase mmc2boot1    # switch to hwpart1
> $ fastboot reboot bootloader  # switch to hwpart0, then reads GPT
> 
> Signed-off-by: Mattijs Korpershoek <mkorpershoek at baylibre.com>
> Reviewed-by: Sean Anderson <sean.anderson at seco.com>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20221024/db46f7d5/attachment.sig>


More information about the U-Boot mailing list