diff options
author | John Tsichritzis <john.tsichritzis@arm.com> | 2018-07-30 13:41:52 +0100 |
---|---|---|
committer | John Tsichritzis <john.tsichritzis@arm.com> | 2018-09-04 10:32:22 +0100 |
commit | ba597da7fd23d34e8867342f1dfee7925991300c (patch) | |
tree | 4c77f781eadf9d68aa91ba8c7442e3fef1e1c917 /include | |
parent | 6d01a463348b04af2afa3c00579ebc6ecd12eaf1 (diff) | |
download | platform_external_arm-trusted-firmware-ba597da7fd23d34e8867342f1dfee7925991300c.tar.gz platform_external_arm-trusted-firmware-ba597da7fd23d34e8867342f1dfee7925991300c.tar.bz2 platform_external_arm-trusted-firmware-ba597da7fd23d34e8867342f1dfee7925991300c.zip |
Support shared Mbed TLS heap for FVP
This patch introduces the shared Mbed TLS heap optimisation for Arm
platforms. The objective is the Mbed TLS heap to be shared between BL1
and BL2 so as to not allocate the heap memory twice. To achieve that,
the patch introduces all the necessary helpers for implementing this
optimisation. It also applies it for FVP.
Change-Id: I6d85eaa1361517b7490956b2ac50f5fa0d0bb008
Signed-off-by: John Tsichritzis <john.tsichritzis@arm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/plat/arm/common/arm_def.h | 11 | ||||
-rw-r--r-- | include/plat/arm/common/arm_dyn_cfg_helpers.h | 7 | ||||
-rw-r--r-- | include/plat/arm/common/plat_arm.h | 2 |
3 files changed, 19 insertions, 1 deletions
diff --git a/include/plat/arm/common/arm_def.h b/include/plat/arm/common/arm_def.h index ea9d811c2..c4994173a 100644 --- a/include/plat/arm/common/arm_def.h +++ b/include/plat/arm/common/arm_def.h @@ -242,6 +242,17 @@ MT_MEMORY | MT_RW | MT_SECURE) /* + * Mapping for the BL1 RW region. This mapping is needed by BL2 in order to + * share the Mbed TLS heap. Since the heap is allocated inside BL1, it resides + * in the BL1 RW region. Hence, BL2 needs access to the BL1 RW region in order + * to be able to access the heap. + */ +#define ARM_MAP_BL1_RW MAP_REGION_FLAT( \ + BL1_RW_BASE, \ + BL1_RW_LIMIT - BL1_RW_BASE, \ + MT_MEMORY | MT_RW | MT_SECURE) + +/* * If SEPARATE_CODE_AND_RODATA=1 we define a region for each section * otherwise one region is defined containing both. */ diff --git a/include/plat/arm/common/arm_dyn_cfg_helpers.h b/include/plat/arm/common/arm_dyn_cfg_helpers.h index 382ec6011..cb17c95f2 100644 --- a/include/plat/arm/common/arm_dyn_cfg_helpers.h +++ b/include/plat/arm/common/arm_dyn_cfg_helpers.h @@ -6,12 +6,17 @@ #ifndef __ARM_DYN_CFG_HELPERS_H__ #define __ARM_DYN_CFG_HELPERS_H__ +#include <stddef.h> #include <stdint.h> -/* Function declaration */ +/* Function declarations */ int arm_dyn_get_config_load_info(void *dtb, int node, unsigned int config_id, uint64_t *config_addr, uint32_t *config_size); int arm_dyn_tb_fw_cfg_init(void *dtb, int *node); int arm_dyn_get_disable_auth(void *dtb, int node, uint32_t *disable_auth); +int arm_get_dtb_mbedtls_heap_info(void *dtb, void **heap_addr, + size_t *heap_size); +int arm_set_dtb_mbedtls_heap_info(void *dtb, void *heap_addr, + size_t heap_size); #endif /* __ARM_DYN_CFG_HELPERS_H__ */ diff --git a/include/plat/arm/common/plat_arm.h b/include/plat/arm/common/plat_arm.h index 1af4dd1ac..0770c0ec5 100644 --- a/include/plat/arm/common/plat_arm.h +++ b/include/plat/arm/common/plat_arm.h @@ -223,6 +223,8 @@ int arm_io_is_toc_valid(void); void arm_load_tb_fw_config(void); void arm_bl2_set_tb_cfg_addr(void *dtb); void arm_bl2_dyn_cfg_init(void); +void arm_bl1_set_mbedtls_heap(void); +int arm_get_mbedtls_heap(void **heap_addr, size_t *heap_size); /* * Mandatory functions required in ARM standard platforms |