mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-22 12:34:19 +00:00
plat/arm: SPM: Force BL31 to DRAM when SPM is used
BL31 is running out of space, and the use-case of SPM doesn't require it to be in SRAM. To prevent BL31 from running out of space in the future, move BL31 to DRAM if SPM is enabled. Secure Partition Manager design document updated to reflect the changes. Increased the size of the stack of BL31 for builds with SPM. The translation tables used by SPM in Arm platforms have been moved back to the 'xlat_tables' region instead of 'arm_el3_tzc_dram'. Everything is in DRAM now, so it doesn't make sense to treat them in a different way. Change-Id: Ia6136c8e108b8da9edd90e9d72763dada5e5e5dc Signed-off-by: Antonio Nino Diaz <antonio.ninodiaz@arm.com>
This commit is contained in:
parent
b62507ac84
commit
e829a3796f
4 changed files with 16 additions and 11 deletions
|
@ -126,8 +126,7 @@ the rest of this document.
|
||||||
|
|
||||||
To enable SPM support in TF-A, the source code must be compiled with the build
|
To enable SPM support in TF-A, the source code must be compiled with the build
|
||||||
flag ``ENABLE_SPM=1``. On Arm platforms the build option ``ARM_BL31_IN_DRAM``
|
flag ``ENABLE_SPM=1``. On Arm platforms the build option ``ARM_BL31_IN_DRAM``
|
||||||
can be used to select the location of BL31, both SRAM and DRAM are supported.
|
must be set to 1. Also, the location of the binary that contains the BL32 image
|
||||||
Also, the location of the binary that contains the BL32 image
|
|
||||||
(``BL32=path/to/image.bin``) must be specified.
|
(``BL32=path/to/image.bin``) must be specified.
|
||||||
|
|
||||||
First, build the Standalone MM Secure Partition. To build it, refer to the
|
First, build the Standalone MM Secure Partition. To build it, refer to the
|
||||||
|
@ -139,7 +138,7 @@ image in the FIP:
|
||||||
::
|
::
|
||||||
|
|
||||||
BL32=path/to/standalone/mm/sp BL33=path/to/bl33.bin \
|
BL32=path/to/standalone/mm/sp BL33=path/to/bl33.bin \
|
||||||
make PLAT=fvp ENABLE_SPM=1 fip all
|
make PLAT=fvp ENABLE_SPM=1 ARM_BL31_IN_DRAM=1 fip all
|
||||||
|
|
||||||
Describing Secure Partition resources
|
Describing Secure Partition resources
|
||||||
-------------------------------------
|
-------------------------------------
|
||||||
|
|
|
@ -30,7 +30,9 @@
|
||||||
#elif defined(IMAGE_BL2U)
|
#elif defined(IMAGE_BL2U)
|
||||||
# define PLATFORM_STACK_SIZE 0x200
|
# define PLATFORM_STACK_SIZE 0x200
|
||||||
#elif defined(IMAGE_BL31)
|
#elif defined(IMAGE_BL31)
|
||||||
#ifdef PLAT_XLAT_TABLES_DYNAMIC
|
#if ENABLE_SPM
|
||||||
|
# define PLATFORM_STACK_SIZE 0x500
|
||||||
|
#elif PLAT_XLAT_TABLES_DYNAMIC
|
||||||
# define PLATFORM_STACK_SIZE 0x800
|
# define PLATFORM_STACK_SIZE 0x800
|
||||||
#else
|
#else
|
||||||
# define PLATFORM_STACK_SIZE 0x400
|
# define PLATFORM_STACK_SIZE 0x400
|
||||||
|
@ -94,7 +96,11 @@
|
||||||
* PLAT_ARM_MAX_BL31_SIZE is calculated using the current BL31 debug size plus a
|
* PLAT_ARM_MAX_BL31_SIZE is calculated using the current BL31 debug size plus a
|
||||||
* little space for growth.
|
* little space for growth.
|
||||||
*/
|
*/
|
||||||
|
#if ENABLE_SPM
|
||||||
|
# define PLAT_ARM_MAX_BL31_SIZE 0x40000
|
||||||
|
#else
|
||||||
# define PLAT_ARM_MAX_BL31_SIZE 0x20000
|
# define PLAT_ARM_MAX_BL31_SIZE 0x20000
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef AARCH32
|
#ifdef AARCH32
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -98,12 +98,6 @@
|
||||||
/* Total number of memory regions with distinct properties */
|
/* Total number of memory regions with distinct properties */
|
||||||
#define ARM_SP_IMAGE_NUM_MEM_REGIONS 6
|
#define ARM_SP_IMAGE_NUM_MEM_REGIONS 6
|
||||||
|
|
||||||
/*
|
|
||||||
* Name of the section to put the translation tables used by the S-EL1/S-EL0
|
|
||||||
* context of a Secure Partition.
|
|
||||||
*/
|
|
||||||
#define PLAT_SP_IMAGE_XLAT_SECTION_NAME "arm_el3_tzc_dram"
|
|
||||||
|
|
||||||
/* Cookies passed to the Secure Partition at boot. Not used by ARM platforms. */
|
/* Cookies passed to the Secure Partition at boot. Not used by ARM platforms. */
|
||||||
#define PLAT_SPM_COOKIE_0 ULL(0)
|
#define PLAT_SPM_COOKIE_0 ULL(0)
|
||||||
#define PLAT_SPM_COOKIE_1 ULL(0)
|
#define PLAT_SPM_COOKIE_1 ULL(0)
|
||||||
|
|
|
@ -206,5 +206,11 @@ ifneq (${BL2_AT_EL3}, 0)
|
||||||
override BL1_SOURCES =
|
override BL1_SOURCES =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq (${ENABLE_SPM},1)
|
||||||
|
ifneq (${ARM_BL31_IN_DRAM},1)
|
||||||
|
$(error "Error: SPM needs BL31 to be located in DRAM.")
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
include plat/arm/board/common/board_common.mk
|
include plat/arm/board/common/board_common.mk
|
||||||
include plat/arm/common/arm_common.mk
|
include plat/arm/common/arm_common.mk
|
||||||
|
|
Loading…
Add table
Reference in a new issue