From 44639ab73e43e0b79da834dff8c85266d68e5066 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Mon, 29 Nov 2021 16:59:02 +0000 Subject: [PATCH] feat(plat/fvp): add EL3 SPMC #defines Introduce additional #defines for running with the EL3 SPMC on the FVP. The increase in xlat tables has been chosen to allow the test cases to complete successfully and may need adjusting depending on the desired usecase. Signed-off-by: Marc Bonnici Change-Id: I7f44344ff8b74ae8907d53ebb652ff8def2d2562 --- plat/arm/board/fvp/fvp_common.c | 2 +- plat/arm/board/fvp/include/platform_def.h | 43 +++++++++++++++++++++-- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/plat/arm/board/fvp/fvp_common.c b/plat/arm/board/fvp/fvp_common.c index e9f725c04..a7028f6cf 100644 --- a/plat/arm/board/fvp/fvp_common.c +++ b/plat/arm/board/fvp/fvp_common.c @@ -127,7 +127,7 @@ const mmap_region_t plat_arm_mmap[] = { */ ARM_MAP_BL1_RW, #endif /* CRYPTO_SUPPORT && !BL2_AT_EL3 */ -#if SPM_MM +#if SPM_MM || SPMC_AT_EL3 ARM_SP_IMAGE_MMAP, #endif #if ARM_BL31_IN_DRAM diff --git a/plat/arm/board/fvp/include/platform_def.h b/plat/arm/board/fvp/include/platform_def.h index e70114418..82bd7c8a5 100644 --- a/plat/arm/board/fvp/include/platform_def.h +++ b/plat/arm/board/fvp/include/platform_def.h @@ -86,6 +86,35 @@ #define FVP_DTB_DRAM_MAP_START ULL(0x82000000) #define FVP_DTB_DRAM_MAP_SIZE ULL(0x02000000) /* 32 MB */ +#define ARM_DTB_DRAM_NS MAP_REGION_FLAT( \ + FVP_DTB_DRAM_MAP_START, \ + FVP_DTB_DRAM_MAP_SIZE, \ + MT_MEMORY | MT_RO | MT_NS) + +#if SPMC_AT_EL3 +/* + * Number of Secure Partitions supported. + * SPMC at EL3, uses this count to configure the maximum number of supported + * secure partitions. + */ +#define SECURE_PARTITION_COUNT 1 + +/* + * Number of Normal World Partitions supported. + * SPMC at EL3, uses this count to configure the maximum number of supported + * NWd partitions. + */ +#define NS_PARTITION_COUNT 1 + +/* + * Number of Logical Partitions supported. + * SPMC at EL3, uses this count to configure the maximum number of supported + * logical partitions. + */ +#define MAX_EL3_LP_DESCS_COUNT 1 + +#endif /* SPMC_AT_EL3 */ + /* * Load address of BL33 for this platform port */ @@ -102,9 +131,12 @@ # define MAX_XLAT_TABLES 11 # else # define MAX_XLAT_TABLES 9 -# endif +# endif # define PLAT_SP_IMAGE_MMAP_REGIONS 30 # define PLAT_SP_IMAGE_MAX_XLAT_TABLES 10 +# elif SPMC_AT_EL3 +# define PLAT_ARM_MMAP_ENTRIES 13 +# define MAX_XLAT_TABLES 11 # else # define PLAT_ARM_MMAP_ENTRIES 9 # if USE_DEBUGFS @@ -122,8 +154,13 @@ # endif # endif #elif defined(IMAGE_BL32) -# define PLAT_ARM_MMAP_ENTRIES 9 -# define MAX_XLAT_TABLES 6 +# if SPMC_AT_EL3 +# define PLAT_ARM_MMAP_ENTRIES 270 +# define MAX_XLAT_TABLES 10 +# else +# define PLAT_ARM_MMAP_ENTRIES 9 +# define MAX_XLAT_TABLES 6 +# endif #elif !USE_ROMLIB # define PLAT_ARM_MMAP_ENTRIES 11 # define MAX_XLAT_TABLES 5 -- 2.39.5