aboutsummaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorGalanakis, Minos <minos.galanakis@arm.com>2020-02-04 11:12:38 +0000
committerMinos Galanakis <minos.galanakis@arm.com>2020-05-04 15:22:16 +0000
commit68eb4063200191fb7a08c6140369cc270fb1d79c (patch)
tree4bec2b632081390df28a1957b06ce2fe066059c3 /platform
parentb628664dfc580b0fb1b6622497bc9882f4f65c21 (diff)
downloadtrusted-firmware-m-68eb4063200191fb7a08c6140369cc270fb1d79c.tar.gz
SST: Move the SST partition to Application Root Of Trust
Migrate the Protected Storage (SST) partition from PSA RoT to Application RoT, and configure the flash peripherals for unpriviledge secure access. Change-Id: I0306d432448e5cb551a0c3b3d05ecb7098ad4e54 Signed-off-by: Raef Coles <raef.coles@arm.com> Signed-off-by: Minos Galanakis <minos.galanakis@arm.com>
Diffstat (limited to 'platform')
-rw-r--r--platform/ext/common/armclang/tfm_common_s.sct42
-rw-r--r--platform/ext/common/gcc/tfm_common_s.ld99
-rw-r--r--platform/ext/common/iar/tfm_common_s.icf58
3 files changed, 104 insertions, 95 deletions
diff --git a/platform/ext/common/armclang/tfm_common_s.sct b/platform/ext/common/armclang/tfm_common_s.sct
index 44b5841f1b..26991d5050 100644
--- a/platform/ext/common/armclang/tfm_common_s.sct
+++ b/platform/ext/common/armclang/tfm_common_s.sct
@@ -46,13 +46,6 @@ LR_CODE S_CODE_START {
TFM_PSA_CODE_START +0 ALIGN 32 EMPTY 0x0 {
}
-#ifdef TFM_PARTITION_SECURE_STORAGE
- TFM_SP_STORAGE_LINKER +0 ALIGN 32 {
- *tfm_storage* (+RO)
- *(TFM_SP_STORAGE_ATTR_FN)
- }
-#endif /* TFM_PARTITION_SECURE_STORAGE */
-
#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
TFM_SP_ITS_LINKER +0 ALIGN 32 {
*tfm_internal_trusted_storage* (+RO)
@@ -139,6 +132,14 @@ LR_CODE S_CODE_START {
TFM_APP_CODE_START +0 ALIGN 32 EMPTY 0x0 {
}
+#ifdef TFM_PARTITION_SECURE_STORAGE
+ TFM_SP_STORAGE_LINKER +0 ALIGN 32 {
+ *tfm_storage* (+RO)
+ *test_sst_nv_counters.* (+RO)
+ *(TFM_SP_STORAGE_ATTR_FN)
+ }
+#endif /* TFM_PARTITION_SECURE_STORAGE */
+
#ifdef TFM_PARTITION_TEST_CORE
TFM_SP_CORE_TEST_2_LINKER +0 ALIGN 32 {
*tfm_ss_core_test_2.* (+RO)
@@ -239,6 +240,20 @@ LR_CODE S_CODE_START {
TFM_APP_RW_STACK_START +0 ALIGN 32 EMPTY 0x0 {
}
+#ifdef TFM_PARTITION_SECURE_STORAGE
+ TFM_SP_STORAGE_LINKER_DATA +0 ALIGN 32 {
+ *tfm_storage* (+RW +ZI)
+ *test_sst_nv_counters.* (+RW +ZI)
+ *(TFM_SP_STORAGE_ATTR_RW)
+ *(TFM_SP_STORAGE_ATTR_ZI)
+ }
+
+#if defined (TFM_PSA_API)
+ TFM_SP_STORAGE_LINKER_STACK +0 ALIGN 128 EMPTY 0x800 {
+ }
+#endif
+#endif /* TFM_PARTITION_SECURE_STORAGE */
+
#ifdef TFM_PARTITION_TEST_CORE
TFM_SP_CORE_TEST_2_LINKER_DATA +0 ALIGN 32 {
*tfm_ss_core_test_2.* (+RW +ZI)
@@ -351,19 +366,6 @@ LR_CODE S_CODE_START {
TFM_PSA_RW_STACK_START +0 ALIGN 32 EMPTY 0x0 {
}
-#ifdef TFM_PARTITION_SECURE_STORAGE
- TFM_SP_STORAGE_LINKER_DATA +0 ALIGN 32 {
- *tfm_storage* (+RW +ZI)
- *(TFM_SP_STORAGE_ATTR_RW)
- *(TFM_SP_STORAGE_ATTR_ZI)
- }
-
-#if defined (TFM_PSA_API)
- TFM_SP_STORAGE_LINKER_STACK +0 ALIGN 128 EMPTY 0x800 {
- }
-#endif
-#endif /* TFM_PARTITION_SECURE_STORAGE */
-
#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
TFM_SP_ITS_LINKER_DATA +0 ALIGN 32 {
*tfm_internal_trusted_storage* (+RW +ZI)
diff --git a/platform/ext/common/gcc/tfm_common_s.ld b/platform/ext/common/gcc/tfm_common_s.ld
index c8b77a8778..ba581beef6 100644
--- a/platform/ext/common/gcc/tfm_common_s.ld
+++ b/platform/ext/common/gcc/tfm_common_s.ld
@@ -318,20 +318,6 @@ SECTIONS
/**** PSA RoT RO part (CODE + RODATA) start here */
Image$$TFM_PSA_CODE_START$$Base = .;
-#ifdef TFM_PARTITION_SECURE_STORAGE
- .TFM_SP_STORAGE_LINKER : ALIGN(32)
- {
- *tfm_storage*:*(.text*)
- *tfm_storage*:*(.rodata*)
- *(TFM_SP_STORAGE_ATTR_FN)
- . = ALIGN(32);
- } > FLASH
- Image$$TFM_SP_STORAGE_LINKER$$RO$$Base = ADDR(.TFM_SP_STORAGE_LINKER);
- Image$$TFM_SP_STORAGE_LINKER$$RO$$Limit = ADDR(.TFM_SP_STORAGE_LINKER) + SIZEOF(.TFM_SP_STORAGE_LINKER);
- Image$$TFM_SP_STORAGE_LINKER$$Base = ADDR(.TFM_SP_STORAGE_LINKER);
- Image$$TFM_SP_STORAGE_LINKER$$Limit = ADDR(.TFM_SP_STORAGE_LINKER) + SIZEOF(.TFM_SP_STORAGE_LINKER);
-#endif /* TFM_PARTITION_SECURE_STORAGE */
-
#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
.TFM_SP_ITS_LINKER : ALIGN(32)
{
@@ -480,6 +466,22 @@ SECTIONS
/**** APPLICATION RoT RO part (CODE + RODATA) start here */
Image$$TFM_APP_CODE_START$$Base = .;
+#ifdef TFM_PARTITION_SECURE_STORAGE
+ .TFM_SP_STORAGE_LINKER : ALIGN(32)
+ {
+ *tfm_storage*:*(.text*)
+ *tfm_storage*:*(.rodata*)
+ *test_sst_nv_counters.*(.text*)
+ *test_sst_nv_counters.*(.rodata*)
+ *(TFM_SP_STORAGE_ATTR_FN)
+ . = ALIGN(32);
+ } > FLASH
+ Image$$TFM_SP_STORAGE_LINKER$$RO$$Base = ADDR(.TFM_SP_STORAGE_LINKER);
+ Image$$TFM_SP_STORAGE_LINKER$$RO$$Limit = ADDR(.TFM_SP_STORAGE_LINKER) + SIZEOF(.TFM_SP_STORAGE_LINKER);
+ Image$$TFM_SP_STORAGE_LINKER$$Base = ADDR(.TFM_SP_STORAGE_LINKER);
+ Image$$TFM_SP_STORAGE_LINKER$$Limit = ADDR(.TFM_SP_STORAGE_LINKER) + SIZEOF(.TFM_SP_STORAGE_LINKER);
+#endif /* TFM_PARTITION_SECURE_STORAGE */
+
#ifdef TFM_PARTITION_TEST_CORE
.TFM_SP_CORE_TEST_2_LINKER : ALIGN(32)
{
@@ -706,6 +708,42 @@ SECTIONS
/**** APPLICATION RoT DATA start here */
Image$$TFM_APP_RW_STACK_START$$Base = .;
+#ifdef TFM_PARTITION_SECURE_STORAGE
+ .TFM_SP_STORAGE_LINKER_DATA : ALIGN(32)
+ {
+ *tfm_storage*:*(.data*)
+ *test_sst_nv_counters.*(.data*)
+ *(TFM_SP_STORAGE_ATTR_RW)
+ . = ALIGN(32);
+ } > RAM AT> FLASH
+ Image$$TFM_SP_STORAGE_LINKER_DATA$$RW$$Base = ADDR(.TFM_SP_STORAGE_LINKER_DATA);
+ Image$$TFM_SP_STORAGE_LINKER_DATA$$RW$$Limit = ADDR(.TFM_SP_STORAGE_LINKER_DATA) + SIZEOF(.TFM_SP_STORAGE_LINKER_DATA);
+
+ .TFM_SP_STORAGE_LINKER_BSS : ALIGN(32)
+ {
+ start_of_TFM_SP_STORAGE_LINKER = .;
+ *tfm_storage*:*(.bss*)
+ *tfm_storage*:*(COMMON)
+ *test_sst_nv_counters.*(.bss*)
+ *test_sst_nv_counters.*(COMMON)
+ *(TFM_SP_STORAGE_ATTR_ZI)
+ . += (. - start_of_TFM_SP_STORAGE_LINKER) ? 0 : 4;
+ . = ALIGN(32);
+ } > RAM AT> RAM
+ Image$$TFM_SP_STORAGE_LINKER_DATA$$ZI$$Base = ADDR(.TFM_SP_STORAGE_LINKER_BSS);
+ Image$$TFM_SP_STORAGE_LINKER_DATA$$ZI$$Limit = ADDR(.TFM_SP_STORAGE_LINKER_BSS) + SIZEOF(.TFM_SP_STORAGE_LINKER_BSS);
+
+#if defined (TFM_PSA_API)
+ .TFM_SP_STORAGE_LINKER_STACK : ALIGN(128)
+ {
+ . += 0x800;
+ } > RAM
+ Image$$TFM_SP_STORAGE_LINKER_STACK$$ZI$$Base = ADDR(.TFM_SP_STORAGE_LINKER_STACK);
+ Image$$TFM_SP_STORAGE_LINKER_STACK$$ZI$$Limit = ADDR(.TFM_SP_STORAGE_LINKER_STACK) + SIZEOF(.TFM_SP_STORAGE_LINKER_STACK);
+#endif
+
+#endif /* TFM_PARTITION_SECURE_STORAGE */
+
#ifdef TFM_PARTITION_TEST_CORE
.TFM_SP_CORE_TEST_2_LINKER_DATA : ALIGN(32)
{
@@ -962,39 +1000,6 @@ SECTIONS
/**** PSA RoT DATA start here */
Image$$TFM_PSA_RW_STACK_START$$Base = .;
-#ifdef TFM_PARTITION_SECURE_STORAGE
- .TFM_SP_STORAGE_LINKER_DATA : ALIGN(32)
- {
- *tfm_storage*:*(.data*)
- *(TFM_SP_STORAGE_ATTR_RW)
- . = ALIGN(32);
- } > RAM AT> FLASH
- Image$$TFM_SP_STORAGE_LINKER_DATA$$RW$$Base = ADDR(.TFM_SP_STORAGE_LINKER_DATA);
- Image$$TFM_SP_STORAGE_LINKER_DATA$$RW$$Limit = ADDR(.TFM_SP_STORAGE_LINKER_DATA) + SIZEOF(.TFM_SP_STORAGE_LINKER_DATA);
-
- .TFM_SP_STORAGE_LINKER_BSS : ALIGN(32)
- {
- start_of_TFM_SP_STORAGE_LINKER = .;
- *tfm_storage*:*(.bss*)
- *tfm_storage*:*(COMMON)
- *(TFM_SP_STORAGE_ATTR_ZI)
- . += (. - start_of_TFM_SP_STORAGE_LINKER) ? 0 : 4;
- . = ALIGN(32);
- } > RAM AT> RAM
- Image$$TFM_SP_STORAGE_LINKER_DATA$$ZI$$Base = ADDR(.TFM_SP_STORAGE_LINKER_BSS);
- Image$$TFM_SP_STORAGE_LINKER_DATA$$ZI$$Limit = ADDR(.TFM_SP_STORAGE_LINKER_BSS) + SIZEOF(.TFM_SP_STORAGE_LINKER_BSS);
-
-#if defined (TFM_PSA_API)
- .TFM_SP_STORAGE_LINKER_STACK : ALIGN(128)
- {
- . += 0x800;
- } > RAM
- Image$$TFM_SP_STORAGE_LINKER_STACK$$ZI$$Base = ADDR(.TFM_SP_STORAGE_LINKER_STACK);
- Image$$TFM_SP_STORAGE_LINKER_STACK$$ZI$$Limit = ADDR(.TFM_SP_STORAGE_LINKER_STACK) + SIZEOF(.TFM_SP_STORAGE_LINKER_STACK);
-#endif
-
-#endif /* TFM_PARTITION_SECURE_STORAGE */
-
#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
.TFM_SP_ITS_LINKER_DATA : ALIGN(32)
{
diff --git a/platform/ext/common/iar/tfm_common_s.icf b/platform/ext/common/iar/tfm_common_s.icf
index 3502825754..04d5ebbea8 100644
--- a/platform/ext/common/iar/tfm_common_s.icf
+++ b/platform/ext/common/iar/tfm_common_s.icf
@@ -46,13 +46,6 @@ define block TFM_UNPRIV_CODE with alignment = 32 {
*/
define block TFM_PSA_CODE_START with alignment = 32, size = 0 { };
-#ifdef TFM_PARTITION_SECURE_STORAGE
-define block TFM_SP_STORAGE_LINKER with alignment = 32 {
- ro object *tfm_storage*,
- section TFM_SP_STORAGE_ATTR_FN
- };
-#endif /* TFM_PARTITION_SECURE_STORAGE */
-
#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
define block TFM_SP_ITS_LINKER with alignment = 32 {
ro object *tfm_internal_trusted_storage*,
@@ -137,6 +130,13 @@ define block TFM_PSA_CODE_END with alignment = 32, size = 0 { };
*/
define block TFM_APP_CODE_START with alignment = 32, size = 0 { };
+#ifdef TFM_PARTITION_SECURE_STORAGE
+define block TFM_SP_STORAGE_LINKER with alignment = 32 {
+ ro object *tfm_storage*,
+ ro object *test_sst_nv_counters.*,
+ };
+#endif /* TFM_PARTITION_SECURE_STORAGE */
+
#ifdef TFM_PARTITION_TEST_CORE
define block TFM_SP_CORE_TEST_2_LINKER with alignment = 32 {
ro object *tfm_ss_core_test_2.*,
@@ -199,6 +199,17 @@ define block TFM_UNPRIV_DATA with alignment = 32 {
define block TFM_APP_RW_STACK_START with alignment = 32, size = 0 { };
+#ifdef TFM_PARTITION_SECURE_STORAGE
+define block TFM_SP_STORAGE_LINKER_DATA with alignment = 32 {
+ rw object *tfm_storage*,
+ rw object *test_sst_nv_counters.*,
+ };
+
+#if defined (TFM_PSA_API)
+define block TFM_SP_STORAGE_LINKER_STACK with alignment = 128, size = 0x800 { };
+#endif
+#endif /* TFM_PARTITION_SECURE_STORAGE */
+
#ifdef TFM_PARTITION_TEST_CORE
define block TFM_SP_CORE_TEST_2_LINKER_DATA with alignment = 32 {
rw object *tfm_ss_core_test_2.*,
@@ -294,16 +305,6 @@ define block ER_TFM_DATA with alignment = 8 {readwrite};
*/
define block TFM_PSA_RW_STACK_START with alignment = 32, size = 0 { };
-#ifdef TFM_PARTITION_SECURE_STORAGE
-define block TFM_SP_STORAGE_LINKER_DATA with alignment = 32 {
- rw object *tfm_storage*,
- };
-
-#if defined (TFM_PSA_API)
-define block TFM_SP_STORAGE_LINKER_STACK with alignment = 128, size = 0x600 { };
-#endif
-#endif /* TFM_PARTITION_SECURE_STORAGE */
-
#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
define block TFM_SP_ITS_LINKER_DATA with alignment = 32 {
rw object *tfm_internal_trusted_storage*,
@@ -419,9 +420,6 @@ define block LR_CODE with fixed order {
block TFM_UNPRIV_CODE,
block TFM_PSA_CODE_START,
-#ifdef TFM_PARTITION_SECURE_STORAGE
- block TFM_SP_STORAGE_LINKER,
-#endif /* TFM_PARTITION_SECURE_STORAGE */
#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
block TFM_SP_ITS_LINKER,
#endif /* TFM_PARTITION_INTERNAL_TRUSTED_STORAGE */
@@ -458,6 +456,10 @@ define block LR_CODE with fixed order {
* of APP RoT code.
*/
block TFM_APP_CODE_START,
+#ifdef TFM_PARTITION_SECURE_STORAGE
+ block TFM_SP_STORAGE_LINKER,
+#endif /* TFM_PARTITION_SECURE_STORAGE */
+
#ifdef TFM_PARTITION_TEST_CORE
block TFM_SP_CORE_TEST_2_LINKER,
#endif /* TFM_PARTITION_TEST_CORE */
@@ -530,6 +532,14 @@ define block DATA with fixed order {
*/
block TFM_APP_RW_STACK_START,
+#ifdef TFM_PARTITION_SECURE_STORAGE
+ block TFM_SP_STORAGE_LINKER_DATA,
+
+#if defined (TFM_PSA_API)
+ block TFM_SP_STORAGE_LINKER_STACK,
+#endif
+#endif /* TFM_PARTITION_SECURE_STORAGE */
+
#ifdef TFM_PARTITION_TEST_CORE
block TFM_SP_CORE_TEST_2_LINKER_DATA,
@@ -603,14 +613,6 @@ define block DATA with fixed order {
*/
block TFM_PSA_RW_STACK_START,
-#ifdef TFM_PARTITION_SECURE_STORAGE
- block TFM_SP_STORAGE_LINKER_DATA,
-
-#if defined (TFM_PSA_API)
- block TFM_SP_STORAGE_LINKER_STACK,
-#endif
-#endif /* TFM_PARTITION_SECURE_STORAGE */
-
#ifdef TFM_PARTITION_INTERNAL_TRUSTED_STORAGE
block TFM_SP_ITS_LINKER_DATA,