From 24e224b41cc6fda4b507861cf8e409d8e4a3f7cd Mon Sep 17 00:00:00 2001 From: Manish V Badarkhe Date: Tue, 27 Jun 2023 11:29:34 +0100 Subject: [PATCH] fix(fvp): adjust BL31 maximum size as per total SRAM size Adjusted BL31 maximum size as per total SRAM size. Change-Id: Ifdfdedb8af3e001cebba8e60c973f3c72be11652 Signed-off-by: Manish V Badarkhe --- include/plat/arm/common/arm_def.h | 3 ++- plat/arm/board/fvp/include/platform_def.h | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/plat/arm/common/arm_def.h b/include/plat/arm/common/arm_def.h index 6be6ffd9a..bf1f93a80 100644 --- a/include/plat/arm/common/arm_def.h +++ b/include/plat/arm/common/arm_def.h @@ -539,7 +539,8 @@ MEASURED_BOOT * Define limit of firmware configuration memory: * ARM_FW_CONFIG + ARM_BL2_MEM_DESC memory */ -#define ARM_FW_CONFIGS_LIMIT (ARM_BL_RAM_BASE + (PAGE_SIZE * 2)) +#define ARM_FW_CONFIGS_SIZE (PAGE_SIZE * 2) +#define ARM_FW_CONFIGS_LIMIT (ARM_BL_RAM_BASE + ARM_FW_CONFIGS_SIZE) #if ENABLE_RME /* diff --git a/plat/arm/board/fvp/include/platform_def.h b/plat/arm/board/fvp/include/platform_def.h index cd468e1f7..99dd6c7da 100644 --- a/plat/arm/board/fvp/include/platform_def.h +++ b/plat/arm/board/fvp/include/platform_def.h @@ -230,9 +230,12 @@ defined(IMAGE_BL2) && MEASURED_BOOT /* * Since BL31 NOBITS overlays BL2 and BL1-RW, PLAT_ARM_MAX_BL31_SIZE is * calculated using the current BL31 PROGBITS debug size plus the sizes of - * BL2 and BL1-RW + * BL2 and BL1-RW. + * Size of the BL31 PROGBITS increases as the SRAM size increases. */ -#define PLAT_ARM_MAX_BL31_SIZE (UL(0x3D000) - ARM_L0_GPT_SIZE) +#define PLAT_ARM_MAX_BL31_SIZE (PLAT_ARM_TRUSTED_SRAM_SIZE - \ + ARM_SHARED_RAM_SIZE - \ + ARM_FW_CONFIGS_SIZE - ARM_L0_GPT_SIZE) #endif /* RESET_TO_BL31 */ #ifndef __aarch64__