]> git.baikalelectronics.ru Git - arm-tf.git/commitdiff
fix(st): add max size for FIP in eMMC boot part
authorYann Gautier <yann.gautier@st.com>
Fri, 2 Sep 2022 06:36:40 +0000 (08:36 +0200)
committerYann Gautier <yann.gautier@st.com>
Wed, 7 Sep 2022 07:36:48 +0000 (09:36 +0200)
When putting FIP binary in eMMC boot partition (with STM32MP_EMMC_BOOT),
the FIP max size should be precised. If it is not, an assert fails in
io_block driver, as cur->size will be zero.
For this length, we then use the size of the eMMC boot partition minus
STM32MP_EMMC_BOOT_FIP_OFFSET.

Signed-off-by: Yann Gautier <yann.gautier@st.com>
Change-Id: I48b7635cff64f52d4b337a4c8c3becd9a0be72e8

plat/st/common/bl2_io_storage.c

index 8d0bdccca400866c3ba6acb4feeefcc20d8c1b84..72225848bc5f9fbe04c12697294cb72eb6fb3ce7 100644 (file)
@@ -257,6 +257,7 @@ static void boot_mmc(enum mmc_device_type mmc_dev_type,
                VERBOSE("%s: FIP header found on eMMC boot partition\n",
                        __func__);
                image_block_spec.offset = STM32MP_EMMC_BOOT_FIP_OFFSET;
+               image_block_spec.length = mmc_boot_part_size() - STM32MP_EMMC_BOOT_FIP_OFFSET;
        }
 #endif
 }