fix(st): don't try to read boot partition on SD cards

When trying to boot from an SD card with STM32MP_EMMC_BOOT enabled,
booting fails with:

	ERROR:   Got unexpected value for active boot partition, 0
	ASSERT: plat/st/common/bl2_stm32_io_storage.c:285

because SD cards don't provide a boot partition. So only try reading
from such a partition when booting from eMMC.

Fixes: 214c8a8d08 ("feat(plat/st): add STM32MP_EMMC_BOOT option")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Change-Id: I354b737a3ae3ea577e83dfeb7096df22275d852d
This commit is contained in:
Uwe Kleine-König 2022-03-10 22:21:55 +01:00
parent 7c6d460eff
commit 9492b391a3
1 changed files with 13 additions and 11 deletions

View File

@ -379,6 +379,7 @@ static void boot_mmc(enum mmc_device_type mmc_dev_type,
stm32_sdmmc2_mmc_get_device_size();
#if STM32MP_EMMC_BOOT
if (mmc_dev_type == MMC_IS_EMMC) {
magic = get_boot_part_ssbl_header();
if (magic == BOOT_API_IMAGE_HEADER_MAGIC_NB) {
@ -393,6 +394,7 @@ static void boot_mmc(enum mmc_device_type mmc_dev_type,
} else {
WARN("%s: Can't find STM32 header on a boot partition\n", __func__);
}
}
#endif
/* Open MMC as a block device to read GPT table */