diff options
author | Roberto Vargas <roberto.vargas@arm.com> | 2018-05-23 09:27:06 +0100 |
---|---|---|
committer | Roberto Vargas <roberto.vargas@arm.com> | 2018-08-06 13:08:51 +0100 |
commit | 1eb735d75366526c0fdc1acee6a1a78ef6617975 (patch) | |
tree | bd5feb70ec3af7f87b545bc73f4169d534f45364 /include | |
parent | 5accce5bcc211c08e80c638acbd01099af81cc37 (diff) |
Add librom support in FVP
Change-Id: Idb9ba3864d6de3053260724f07172fd32c1523e0
Signed-off-by: Roberto Vargas <roberto.vargas@arm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/plat/arm/board/common/board_arm_def.h | 17 | ||||
-rw-r--r-- | include/plat/arm/common/arm_def.h | 26 | ||||
-rw-r--r-- | include/plat/arm/common/plat_arm.h | 2 |
3 files changed, 41 insertions, 4 deletions
diff --git a/include/plat/arm/board/common/board_arm_def.h b/include/plat/arm/board/common/board_arm_def.h index c3ae5643..a388ed9a 100644 --- a/include/plat/arm/board/common/board_arm_def.h +++ b/include/plat/arm/board/common/board_arm_def.h @@ -71,9 +71,12 @@ #elif defined(IMAGE_BL32) # define PLAT_ARM_MMAP_ENTRIES 8 # define MAX_XLAT_TABLES 5 -#else +#elif !USE_ROMLIB # define PLAT_ARM_MMAP_ENTRIES 11 # define MAX_XLAT_TABLES 5 +#else +# define PLAT_ARM_MMAP_ENTRIES 12 +# define MAX_XLAT_TABLES 6 #endif /* @@ -83,6 +86,18 @@ #define PLAT_ARM_MAX_BL1_RW_SIZE 0xB000 /* + * PLAT_ARM_MAX_ROMLIB_RW_SIZE is define to use a full page + */ + +#if USE_ROMLIB +#define PLAT_ARM_MAX_ROMLIB_RW_SIZE 0x1000 +#define PLAT_ARM_MAX_ROMLIB_RO_SIZE 0xe000 +#else +#define PLAT_ARM_MAX_ROMLIB_RW_SIZE 0 +#define PLAT_ARM_MAX_ROMLIB_RO_SIZE 0 +#endif + +/* * PLAT_ARM_MAX_BL2_SIZE is calculated using the current BL2 debug size plus a * little space for growth. */ diff --git a/include/plat/arm/common/arm_def.h b/include/plat/arm/common/arm_def.h index 47f2ac21..5da8cdb4 100644 --- a/include/plat/arm/common/arm_def.h +++ b/include/plat/arm/common/arm_def.h @@ -268,6 +268,17 @@ - BL_COHERENT_RAM_BASE, \ MT_DEVICE | MT_RW | MT_SECURE) #endif +#if USE_ROMLIB +#define ARM_MAP_ROMLIB_CODE MAP_REGION_FLAT( \ + ROMLIB_RO_BASE, \ + ROMLIB_RO_LIMIT - ROMLIB_RO_BASE,\ + MT_CODE | MT_SECURE) + +#define ARM_MAP_ROMLIB_DATA MAP_REGION_FLAT( \ + ROMLIB_RW_BASE, \ + ROMLIB_RW_END - ROMLIB_RW_BASE,\ + MT_MEMORY | MT_RW | MT_SECURE) +#endif /* * The max number of regions like RO(code), coherent and data required by @@ -346,14 +357,23 @@ ******************************************************************************/ #define BL1_RO_BASE PLAT_ARM_TRUSTED_ROM_BASE #define BL1_RO_LIMIT (PLAT_ARM_TRUSTED_ROM_BASE \ - + PLAT_ARM_TRUSTED_ROM_SIZE) + + (PLAT_ARM_TRUSTED_ROM_SIZE - \ + PLAT_ARM_MAX_ROMLIB_RO_SIZE)) /* * Put BL1 RW at the top of the Trusted SRAM. */ #define BL1_RW_BASE (ARM_BL_RAM_BASE + \ ARM_BL_RAM_SIZE - \ - PLAT_ARM_MAX_BL1_RW_SIZE) -#define BL1_RW_LIMIT (ARM_BL_RAM_BASE + ARM_BL_RAM_SIZE) + (PLAT_ARM_MAX_BL1_RW_SIZE +\ + PLAT_ARM_MAX_ROMLIB_RW_SIZE)) +#define BL1_RW_LIMIT (ARM_BL_RAM_BASE + \ + (ARM_BL_RAM_SIZE - PLAT_ARM_MAX_ROMLIB_RW_SIZE)) + +#define ROMLIB_RO_BASE BL1_RO_LIMIT +#define ROMLIB_RO_LIMIT (PLAT_ARM_TRUSTED_ROM_BASE + PLAT_ARM_TRUSTED_ROM_SIZE) + +#define ROMLIB_RW_BASE (BL1_RW_BASE + PLAT_ARM_MAX_BL1_RW_SIZE) +#define ROMLIB_RW_END (ROMLIB_RW_BASE + PLAT_ARM_MAX_ROMLIB_RW_SIZE) /******************************************************************************* * BL2 specific defines. diff --git a/include/plat/arm/common/plat_arm.h b/include/plat/arm/common/plat_arm.h index 506bed34..1af4dd1a 100644 --- a/include/plat/arm/common/plat_arm.h +++ b/include/plat/arm/common/plat_arm.h @@ -72,6 +72,8 @@ typedef struct arm_tzc_regions_info { void arm_setup_page_tables(const mmap_region_t bl_regions[], const mmap_region_t plat_regions[]); +void arm_setup_romlib(void); + #if defined(IMAGE_BL31) || (defined(AARCH32) && defined(IMAGE_BL32)) /* * Use this macro to instantiate lock before it is used in below |