u-boot/common/spl
Harald Seiler bf28d9a659 spl: mmc: Use correct MMC device when loading image
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: e1eb6ada4e ("spl: Make image loader infrastructure more universal")
Signed-off-by: Harald Seiler <hws@denx.de>
2022-08-04 13:59:59 -04:00
..
Kconfig u-boot-imx-20220726 2022-07-26 10:26:00 -04:00
Kconfig.nxp spl: Move all VPL, TPL and PowerPC specific CONFIG options to separate files 2022-06-06 12:09:29 -04:00
Kconfig.tpl spl: binman: Disable u_boot_any symbols for i.MX8M boards 2022-06-28 03:09:52 +01:00
Kconfig.vpl spl: binman: Disable u_boot_any symbols for i.MX8M boards 2022-06-28 03:09:52 +01:00
Makefile spl: Rename Kconfig SPL_LEGACY_IMAGE_SUPPORT to SPL_LEGACY_IMAGE_FORMAT 2022-05-11 09:22:24 -04:00
spl_atf.c spl: atf: add support for LOAD_IMAGE_V2 2020-12-04 16:09:06 -05:00
spl_bootrom.c spl: pass args to board_return_to_bootrom 2019-10-08 16:35:16 +02:00
spl_dfu.c env: Drop environment.h header file where not needed 2019-08-11 16:43:41 -04:00
spl_ext.c SPL: Add struct spl_boot_device parameter into spl_parse_board_header() 2022-01-20 11:35:29 +01:00
spl_fat.c SPL: Add struct spl_boot_device parameter into spl_parse_board_header() 2022-01-20 11:35:29 +01:00
spl_fit.c spl: fit: pass real compatible flags to fpga_load() 2022-07-26 09:34:21 +02:00
spl_legacy.c spl: spl_legacy: fix the use of SPL_COPY_PAYLOAD_ONLY 2022-07-13 23:03:37 +02:00
spl_mmc.c spl: mmc: Use correct MMC device when loading image 2022-08-04 13:59:59 -04:00
spl_nand.c spl: nand: support loading legacy image with payload compressed 2022-07-13 23:03:37 +02:00
spl_net.c SPL: Add struct spl_boot_device parameter into spl_parse_board_header() 2022-01-20 11:35:29 +01:00
spl_nor.c Convert CONFIG_SYS_SPL_ARGS_ADDR to Kconfig 2022-06-06 12:09:29 -04:00
spl_onenand.c SPL: Add struct spl_boot_device parameter into spl_parse_board_header() 2022-01-20 11:35:29 +01:00
spl_opensbi.c common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
spl_optee.S Rockchip-focused changes for v2018.11-rc2: 2018-10-05 13:40:42 -04:00
spl_ram.c spl: binman: Fix use of undeclared u_boot_any symbols 2022-06-28 03:09:52 +01:00
spl_sata.c Convert CONFIG_SPL_FS_LOAD_PAYLOAD_NAME et al to Kconfig 2022-06-06 12:09:00 -04:00
spl_sdp.c spl: sdp: Pass the USB index to board_usb_init() 2022-07-14 16:13:11 +02:00
spl_semihosting.c spl: Add semihosting boot method 2022-04-01 15:03:13 -04:00
spl_spi.c spl: spl_spi: add spi_nor_remove() to soft reset flash 2022-07-18 19:15:19 +05:30
spl_ubi.c SPL: Add struct spl_boot_device parameter into spl_parse_board_header() 2022-01-20 11:35:29 +01:00
spl_usb.c SPL: Add struct spl_boot_device parameter into spl_parse_board_header() 2022-01-20 11:35:29 +01:00
spl_xip.c Convert CONFIG_SYS_SPL_ARGS_ADDR to Kconfig 2022-06-06 12:09:29 -04:00
spl_ymodem.c spl: ymodem: Fix buffer overflow during Image copy 2022-02-03 12:15:33 -05:00
spl.c spl: binman: Check at runtime if binman symbols were filled in 2022-06-28 03:09:52 +01:00