[PATCH v2] spl: mmc: Use correct MMC device when loading image

Tom Rini trini at konsulko.com
Thu Aug 4 22:52:27 CEST 2022


On Mon, Jul 11, 2022 at 02:35:32PM +0200, Harald Seiler wrote:

> When attempting to load images from multiple MMC devices in sequence,
> spl_mmc_load() chooses the wrong device from the second attempt onwards.
> 
> The reason is that MMC initialization is only done on its first call and
> spl_mmc_load() will then continue using this same device for all future
> calls.
> 
> Fix this by checking the devnum of the "cached" device struct against
> the one which is requested.  If they match, use the cached one but if
> they do not match, initialize the new device.
> 
> This fixes specifying multiple MMC devices in the SPL's boot order to
> fall back when U-Boot Proper is corrupted or missing on the first
> attempted MMC device.
> 
> Fixes: e1eb6ada4e38 ("spl: Make image loader infrastructure more universal")
> Signed-off-by: Harald Seiler <hws at denx.de>

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/20220804/b57ea0dc/attachment.sig>


More information about the U-Boot mailing list