From 1dab28f99dfa03dc11538056a90f00f37bfb1085 Mon Sep 17 00:00:00 2001 From: Lionel Debieve Date: Thu, 24 Feb 2022 18:58:46 +0100 Subject: [PATCH] feat(stm32mp1): retrieve FIP partition by type UUID Modify the function to retrieve the FIP partition looking the UUID type define for FIP. If not defined, compatibility used to find the FIP partition by name. Signed-off-by: Lionel Debieve Change-Id: I76634dea891f51d913a549fb9a077cf7284d5cb2 --- plat/st/common/bl2_io_storage.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plat/st/common/bl2_io_storage.c b/plat/st/common/bl2_io_storage.c index 94c36d9a8..49f6465ad 100644 --- a/plat/st/common/bl2_io_storage.c +++ b/plat/st/common/bl2_io_storage.c @@ -37,6 +37,7 @@ #include #include +#include #include #include #include @@ -451,13 +452,20 @@ int bl2_plat_handle_pre_image_load(unsigned int image_id) */ #if !PSA_FWU_SUPPORT const partition_entry_t *entry; + const struct efi_guid img_type_guid = STM32MP_FIP_GUID; + uuid_t img_type_uuid; + guidcpy(&img_type_uuid, &img_type_guid); partition_init(GPT_IMAGE_ID); - entry = get_partition_entry(FIP_IMAGE_NAME); + entry = get_partition_entry_by_type(&img_type_uuid); if (entry == NULL) { - ERROR("Could NOT find the %s partition!\n", - FIP_IMAGE_NAME); - return -ENOENT; + entry = get_partition_entry(FIP_IMAGE_NAME); + if (entry == NULL) { + ERROR("Could NOT find the %s partition!\n", + FIP_IMAGE_NAME); + + return -ENOENT; + } } image_block_spec.offset = entry->start; -- 2.39.5