diff options
author | Mingyang Sun <mingyang.sun@arm.com> | 2021-04-02 16:51:05 +0800 |
---|---|---|
committer | Mingyang Sun <mingyang.sun@arm.com> | 2021-05-08 16:23:14 +0800 |
commit | f6a78572d5722a8e08d4e2bc1bcac8736e684eac (patch) | |
tree | a01392c5b3138fc8ef3b28fb4e4e4e02924e643d /platform/ext/common | |
parent | 00df2357ff73936a6da5e94c41ccf7f9e7f11041 (diff) | |
download | trusted-firmware-m-f6a78572d5722a8e08d4e2bc1bcac8736e684eac.tar.gz |
Build: Build and arrange partition static data
- Add a template to generate partition static data into
dedicated source files. For the ns internal partition,
manually add a source file for it.
- Put these data into a dedicated memory section, to
prepare for partition loading.
Change-Id: Iad988608b04d2db9f5f43e7528f3ef21c1252f31
Signed-off-by: Mingyang Sun <mingyang.sun@arm.com>
Diffstat (limited to 'platform/ext/common')
-rw-r--r-- | platform/ext/common/armclang/tfm_common_s.sct | 5 | ||||
-rw-r--r-- | platform/ext/common/armclang/tfm_isolation_l3.sct.template | 5 | ||||
-rw-r--r-- | platform/ext/common/gcc/tfm_common_s.ld | 9 | ||||
-rw-r--r-- | platform/ext/common/gcc/tfm_isolation_l3.ld.template | 9 | ||||
-rw-r--r-- | platform/ext/common/iar/tfm_common_s.icf | 9 |
5 files changed, 37 insertions, 0 deletions
diff --git a/platform/ext/common/armclang/tfm_common_s.sct b/platform/ext/common/armclang/tfm_common_s.sct index 4186d09cbd..ded5aabe7e 100644 --- a/platform/ext/common/armclang/tfm_common_s.sct +++ b/platform/ext/common/armclang/tfm_common_s.sct @@ -34,6 +34,11 @@ LR_CODE S_CODE_START S_CODE_SIZE { *psa_lifecycle.* (+RO) } + /**** Section for holding partition static data */ + TFM_SP_STATIC_LIST +0 ALIGN 4 { + *(.partition_info) + } + /**** PSA RoT RO part (CODE + RODATA) start here */ /* * This empty, zero long execution region is here to mark the start address diff --git a/platform/ext/common/armclang/tfm_isolation_l3.sct.template b/platform/ext/common/armclang/tfm_isolation_l3.sct.template index cb108df6f4..c25534bdce 100644 --- a/platform/ext/common/armclang/tfm_isolation_l3.sct.template +++ b/platform/ext/common/armclang/tfm_isolation_l3.sct.template @@ -40,6 +40,11 @@ LR_CODE S_CODE_START { * (+RO) } + /**** Section for holding partition static data */ + TFM_SP_STATIC_LIST +0 ALIGN 4 { + *(.partition_info) + } + /**** PSA RoT CODE + RO-data starts here */ {% for partition in partitions %} {% if partition.manifest.type == 'PSA-ROT' %} diff --git a/platform/ext/common/gcc/tfm_common_s.ld b/platform/ext/common/gcc/tfm_common_s.ld index 3939b6471f..e29fbd6680 100644 --- a/platform/ext/common/gcc/tfm_common_s.ld +++ b/platform/ext/common/gcc/tfm_common_s.ld @@ -141,6 +141,15 @@ SECTIONS Image$$TFM_UNPRIV_CODE$$RO$$Base = ADDR(.TFM_UNPRIV_CODE); Image$$TFM_UNPRIV_CODE$$RO$$Limit = ADDR(.TFM_UNPRIV_CODE) + SIZEOF(.TFM_UNPRIV_CODE); + /**** Section for holding partition static RO data */ + .TFM_SP_STATIC_LIST : ALIGN(4) + { + KEEP(*(.partition_info)) + } > FLASH + Image$$TFM_SP_STATIC_LIST$$RO$$Base = ADDR(.TFM_SP_STATIC_LIST); + Image$$TFM_SP_STATIC_LIST$$RO$$Limit = ADDR(.TFM_SP_STATIC_LIST) + SIZEOF(.TFM_SP_STATIC_LIST); + . = ALIGN(32); + /**** PSA RoT RO part (CODE + RODATA) start here */ Image$$TFM_PSA_CODE_START$$Base = .; diff --git a/platform/ext/common/gcc/tfm_isolation_l3.ld.template b/platform/ext/common/gcc/tfm_isolation_l3.ld.template index 493870eb25..ccbe7bcf03 100644 --- a/platform/ext/common/gcc/tfm_isolation_l3.ld.template +++ b/platform/ext/common/gcc/tfm_isolation_l3.ld.template @@ -101,6 +101,15 @@ SECTIONS . = ALIGN(32); Image$$PT_RO_START$$Base = .; + /**** Section for holding partition static RO data */ + .TFM_SP_STATIC_LIST : ALIGN(4) + { + KEEP(*(.partition_info)) + } > FLASH + Image$$TFM_SP_STATIC_LIST$$RO$$Base = ADDR(.TFM_SP_STATIC_LIST); + Image$$TFM_SP_STATIC_LIST$$RO$$Limit = ADDR(.TFM_SP_STATIC_LIST) + SIZEOF(.TFM_SP_STATIC_LIST); + . = ALIGN(32); + /**** PSA RoT RO CODE + RO-data starts here */ {% for partition in partitions %} {% if partition.manifest.type == 'PSA-ROT' %} diff --git a/platform/ext/common/iar/tfm_common_s.icf b/platform/ext/common/iar/tfm_common_s.icf index c9d49e9c05..542284b5c4 100644 --- a/platform/ext/common/iar/tfm_common_s.icf +++ b/platform/ext/common/iar/tfm_common_s.icf @@ -39,6 +39,11 @@ define block TFM_UNPRIV_CODE with alignment = 32 { ro object tfm_log_raw.o }; + /**** Section for holding partition static data */ +#define block TFM_SP_STATIC_LIST with alignment = 4 { + ro section .partition_info object static_info_*.o, +} + /**** PSA RoT RO part (CODE + RODATA) start here */ /* * This empty, zero long execution region is here to mark the start address @@ -196,6 +201,10 @@ define block SRAM_WATERMARK with size = 0 { }; define block LR_CODE with fixed order { block ER_TFM_CODE, block TFM_UNPRIV_CODE, + +/**** Section for holding partition static data */ + block TFM_SP_STATIC_LIST, + block TFM_PSA_CODE_START, block TFM_PSA_ROT_LINKER, |