diff options
author | Ken Liu <Ken.Liu@arm.com> | 2021-05-22 17:41:25 +0800 |
---|---|---|
committer | Ken Liu <ken.liu@arm.com> | 2021-06-30 05:45:14 +0200 |
commit | ea45b0d4fb29351c029a13dc66b76898d41d53ce (patch) | |
tree | a4fa875f5868b88239d939f55125dc873121ad4a /platform/ext | |
parent | e5c151d0c8dd37c0b79ff928109a3b8537162d8c (diff) | |
download | trusted-firmware-m-ea45b0d4fb29351c029a13dc66b76898d41d53ce.tar.gz |
SPM: Add partition runtime region in the linker
- Add ZI region in the linker script for holding partition runtime
and service runtime data, replacing the original runtime data
arrays.
- Organize the partition and service runtime data with linked list.
- The logic for loading partitions and services is changed
accordingly.
Change-Id: I7ccfb5055cf62b7a3d185812af43084c767a98dd
Signed-off-by: Ken Liu <Ken.Liu@arm.com>
Co-authored-by: Mingyang Sun <mingyang.sun@arm.com>
Diffstat (limited to 'platform/ext')
-rw-r--r-- | platform/ext/common/armclang/tfm_common_s.sct | 8 | ||||
-rw-r--r-- | platform/ext/common/armclang/tfm_isolation_l3.sct.template | 8 | ||||
-rw-r--r-- | platform/ext/common/gcc/tfm_common_s.ld | 11 | ||||
-rw-r--r-- | platform/ext/common/gcc/tfm_isolation_l3.ld.template | 11 |
4 files changed, 38 insertions, 0 deletions
diff --git a/platform/ext/common/armclang/tfm_common_s.sct b/platform/ext/common/armclang/tfm_common_s.sct index 872b52b06a..c68fd6292d 100644 --- a/platform/ext/common/armclang/tfm_common_s.sct +++ b/platform/ext/common/armclang/tfm_common_s.sct @@ -196,6 +196,14 @@ LR_CODE S_CODE_START S_CODE_SIZE { * (+RW +ZI) } + ER_PART_RT_POOL +0 ALIGN 4 { + *(.bss.part_runtime) + } + + ER_SERV_RT_POOL +0 ALIGN 4 { + *(.bss.serv_runtime) + } + /**** PSA RoT DATA 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 4c7b40c5c7..c546061e06 100644 --- a/platform/ext/common/armclang/tfm_isolation_l3.sct.template +++ b/platform/ext/common/armclang/tfm_isolation_l3.sct.template @@ -134,6 +134,14 @@ LR_CODE S_CODE_START { * (+RW +ZI) } + ER_PART_RT_POOL +0 ALIGN 4 { + *(.bss.part_runtime) + } + + ER_SERV_RT_POOL +0 ALIGN 4 { + *(.bss.serv_runtime) + } + /**** PSA RoT RWZI 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 f295abcfd0..75de32d15e 100644 --- a/platform/ext/common/gcc/tfm_common_s.ld +++ b/platform/ext/common/gcc/tfm_common_s.ld @@ -515,6 +515,13 @@ SECTIONS .TFM_BSS : ALIGN(4) { __bss_start__ = .; + __partition_runtime_start__ = .; + KEEP(*(.bss.part_runtime)) + __partition_runtime_end__ = .; + . = ALIGN(4); + __service_runtime_start__ = .; + KEEP(*(.bss.serv_runtime)) + __service_runtime_end__ = .; *(.bss*) *(COMMON) . = ALIGN(4); @@ -522,6 +529,10 @@ SECTIONS } > RAM AT> RAM Image$$ER_TFM_DATA$$ZI$$Base = ADDR(.TFM_BSS); Image$$ER_TFM_DATA$$ZI$$Limit = ADDR(.TFM_BSS) + SIZEOF(.TFM_BSS); + Image$$ER_PART_RT_POOL$$ZI$$Base = __partition_runtime_start__; + Image$$ER_PART_RT_POOL$$ZI$$Limit = __partition_runtime_end__; + Image$$ER_SERV_RT_POOL$$ZI$$Base = __service_runtime_start__; + Image$$ER_SERV_RT_POOL$$ZI$$Limit = __service_runtime_end__; Image$$ER_TFM_DATA$$Base = ADDR(.TFM_DATA); Image$$ER_TFM_DATA$$Limit = ADDR(.TFM_DATA) + SIZEOF(.TFM_DATA) + SIZEOF(.TFM_BSS); diff --git a/platform/ext/common/gcc/tfm_isolation_l3.ld.template b/platform/ext/common/gcc/tfm_isolation_l3.ld.template index d781c07fb5..14ef0cabbe 100644 --- a/platform/ext/common/gcc/tfm_isolation_l3.ld.template +++ b/platform/ext/common/gcc/tfm_isolation_l3.ld.template @@ -491,6 +491,13 @@ SECTIONS .TFM_BSS : ALIGN(4) { __bss_start__ = .; + __partition_runtime_start__ = .; + KEEP(*(.bss.part_runtime)) + __partition_runtime_end__ = .; + . = ALIGN(4); + __service_runtime_start__ = .; + KEEP(*(.bss.serv_runtime)) + __service_runtime_end__ = .; *(.bss*) *(COMMON) . = ALIGN(4); @@ -498,6 +505,10 @@ SECTIONS } > RAM AT> RAM Image$$ER_TFM_DATA$$ZI$$Base = ADDR(.TFM_BSS); Image$$ER_TFM_DATA$$ZI$$Limit = ADDR(.TFM_BSS) + SIZEOF(.TFM_BSS); + Image$$ER_PART_RT_POOL$$ZI$$Base = __partition_runtime_start__; + Image$$ER_PART_RT_POOL$$ZI$$Limit = __partition_runtime_end__; + Image$$ER_SERV_RT_POOL$$ZI$$Base = __service_runtime_start__; + Image$$ER_SERV_RT_POOL$$ZI$$Limit = __service_runtime_end__; Image$$ER_TFM_DATA$$Base = ADDR(.TFM_DATA); Image$$ER_TFM_DATA$$Limit = ADDR(.TFM_DATA) + SIZEOF(.TFM_DATA) + SIZEOF(.TFM_BSS); |