From b7066086424c2f6fd04880db852306d6f487962e Mon Sep 17 00:00:00 2001 From: Yann Gautier Date: Mon, 13 Dec 2021 15:24:41 +0100 Subject: [PATCH] feat(stm32mp1): skip TOS_FW_CONFIG if not in FIP Thanks to dyn_cfg_dtb_info_get_index(), we can check if TOS_FW_CONFIG is inside the FIP partition. If not we can skip its treatment when populating FIP images. Change-Id: If5623eabd1ba484549d4a908d4a6f43325b36875 Signed-off-by: Yann Gautier --- plat/st/stm32mp1/bl2_plat_setup.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plat/st/stm32mp1/bl2_plat_setup.c b/plat/st/stm32mp1/bl2_plat_setup.c index 218f28d12..a52dd8a3f 100644 --- a/plat/st/stm32mp1/bl2_plat_setup.c +++ b/plat/st/stm32mp1/bl2_plat_setup.c @@ -352,6 +352,7 @@ int bl2_plat_handle_post_image_load(unsigned int image_id) const struct dyn_cfg_dtb_info_t *config_info; bl_mem_params_node_t *tos_fw_mem_params; unsigned int i; + unsigned int idx; unsigned long long ddr_top __unused; const unsigned int image_ids[] = { BL32_IMAGE_ID, @@ -370,8 +371,14 @@ int bl2_plat_handle_post_image_load(unsigned int image_id) set_config_info(STM32MP_FW_CONFIG_BASE, STM32MP_FW_CONFIG_MAX_SIZE, FW_CONFIG_ID); fconf_populate("FW_CONFIG", STM32MP_FW_CONFIG_BASE); + idx = dyn_cfg_dtb_info_get_index(TOS_FW_CONFIG_ID); + /* Iterate through all the fw config IDs */ for (i = 0U; i < ARRAY_SIZE(image_ids); i++) { + if ((image_ids[i] == TOS_FW_CONFIG_ID) && (idx == FCONF_INVALID_IDX)) { + continue; + } + bl_mem_params = get_bl_mem_params_node(image_ids[i]); assert(bl_mem_params != NULL);