From e494afc05f8562455e09b4f131f2699990a744f8 Mon Sep 17 00:00:00 2001 From: Yann Gautier Date: Tue, 5 Mar 2024 15:31:04 +0100 Subject: [PATCH] feat(stm32mp2): add ddr-fw parameter for fiptool When generating fiptool for STM32MP2, a new parameter is added to put DDR firmware inside the FIP. To avoid duplicating fiptool platform files, move tools/fiptool/plat_fiptool/st/stm32mp1 files in their parent directory and move plat_def_fip_uuid.h in in plat/st/common/include. Signed-off-by: Nicolas Le Bayon Signed-off-by: Yann Gautier Change-Id: I1dd796847869e2bfb6ee8c2bcef25c595fa5197a --- plat/st/{stm32mp1 => common}/include/plat_def_fip_uuid.h | 6 +++++- .../plat_fiptool/st/{stm32mp1 => }/plat_def_uuid_config.c | 7 ++++++- .../fiptool/plat_fiptool/st/{stm32mp1 => }/plat_fiptool.mk | 6 +++--- 3 files changed, 14 insertions(+), 5 deletions(-) rename plat/st/{stm32mp1 => common}/include/plat_def_fip_uuid.h (59%) rename tools/fiptool/plat_fiptool/st/{stm32mp1 => }/plat_def_uuid_config.c (71%) rename tools/fiptool/plat_fiptool/st/{stm32mp1 => }/plat_fiptool.mk (71%) diff --git a/plat/st/stm32mp1/include/plat_def_fip_uuid.h b/plat/st/common/include/plat_def_fip_uuid.h similarity index 59% rename from plat/st/stm32mp1/include/plat_def_fip_uuid.h rename to plat/st/common/include/plat_def_fip_uuid.h index e5fbc2dfc..096fd952f 100644 --- a/plat/st/stm32mp1/include/plat_def_fip_uuid.h +++ b/plat/st/common/include/plat_def_fip_uuid.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022, STMicroelectronics - All Rights Reserved + * Copyright (c) 2021-2024, STMicroelectronics - All Rights Reserved * * SPDX-License-Identifier: BSD-3-Clause */ @@ -7,6 +7,10 @@ #ifndef PLAT_DEF_FIP_UUID_H #define PLAT_DEF_FIP_UUID_H +#define UUID_DDR_FW \ + {{0xb1, 0x12, 0x49, 0xbe}, {0x92, 0xdd}, {0x4b, 0x10}, 0x86, 0x7c, \ + {0x2c, 0x6a, 0x4b, 0x47, 0xa7, 0xfb} } + #define UUID_STM32MP_CONFIG_CERT \ {{0x50, 0x1d, 0x8d, 0xd2}, {0x8b, 0xce}, {0x49, 0xa5}, 0x84, 0xeb, \ {0x55, 0x9a, 0x9f, 0x2e, 0xae, 0xaf} } diff --git a/tools/fiptool/plat_fiptool/st/stm32mp1/plat_def_uuid_config.c b/tools/fiptool/plat_fiptool/st/plat_def_uuid_config.c similarity index 71% rename from tools/fiptool/plat_fiptool/st/stm32mp1/plat_def_uuid_config.c rename to tools/fiptool/plat_fiptool/st/plat_def_uuid_config.c index 4df414468..8d3329fc0 100644 --- a/tools/fiptool/plat_fiptool/st/stm32mp1/plat_def_uuid_config.c +++ b/tools/fiptool/plat_fiptool/st/plat_def_uuid_config.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023, STMicroelectronics - All Rights Reserved + * Copyright (c) 2022-2024, STMicroelectronics - All Rights Reserved * * SPDX-License-Identifier: BSD-3-Clause */ @@ -11,6 +11,11 @@ #include "tbbr_config.h" toc_entry_t plat_def_toc_entries[] = { + { + .name = "DDR_FW", + .uuid = UUID_DDR_FW, + .cmdline_name = "ddr-fw" + }, { .name = "STM32MP CONFIG CERT", .uuid = UUID_STM32MP_CONFIG_CERT, diff --git a/tools/fiptool/plat_fiptool/st/stm32mp1/plat_fiptool.mk b/tools/fiptool/plat_fiptool/st/plat_fiptool.mk similarity index 71% rename from tools/fiptool/plat_fiptool/st/stm32mp1/plat_fiptool.mk rename to tools/fiptool/plat_fiptool/st/plat_fiptool.mk index 0d69dbdd0..494715cc3 100644 --- a/tools/fiptool/plat_fiptool/st/stm32mp1/plat_fiptool.mk +++ b/tools/fiptool/plat_fiptool/st/plat_fiptool.mk @@ -1,5 +1,5 @@ # -# Copyright (c) 2021-2022, STMicroelectronics - All Rights Reserved +# Copyright (c) 2021-2024, STMicroelectronics - All Rights Reserved # # SPDX-License-Identifier: BSD-3-Clause # @@ -9,14 +9,14 @@ # in the plat_def_toc_entries[]. PLAT_DEF_UUID_FILE_NAME := plat_def_uuid_config -INCLUDE_PATHS += -I${PLAT_DIR}/include -I./ +INCLUDE_PATHS += -I../../plat/st/common/include -I./ PLAT_DEF_UUID := yes ifeq (${PLAT_DEF_UUID},yes) HOSTCCFLAGS += -DPLAT_DEF_FIP_UUID -${PLAT_DEF_UUID_FILE_NAME}.o: plat_fiptool/st/stm32mp1/${PLAT_DEF_UUID_FILE_NAME}.c +${PLAT_DEF_UUID_FILE_NAME}.o: plat_fiptool/st/${PLAT_DEF_UUID_FILE_NAME}.c $(host-cc) -c ${CPPFLAGS} ${HOSTCCFLAGS} ${INCLUDE_PATHS} $< -o $@ PLAT_OBJECTS += ${PLAT_DEF_UUID_FILE_NAME}.o