aboutsummaryrefslogtreecommitdiff
path: root/platform/include
diff options
context:
space:
mode:
authorRaef Coles <raef.coles@arm.com>2021-01-07 15:42:38 +0000
committerKevin Peng <kevin.peng@arm.com>2021-01-19 07:26:49 +0000
commit79d8208f6783b7a7df6452cde73e10f660b952a1 (patch)
treee4845571103a19740de279abf9cbcb8bed0c357a /platform/include
parente38a4841b846597197cf488b540eb7d2f666be6c (diff)
Platform: Add linker script for LVL1 and LVL2
Instead of generating from template. Also, update the macros used to place symbols into a particular sections to match the new linker scripts. Change-Id: I7b0f14687ba0bb4e6d2f1ffdfe70030738bfbec3 Signed-off-by: Raef Coles <raef.coles@arm.com>
Diffstat (limited to 'platform/include')
-rw-r--r--platform/include/tfm_plat_defs.h29
-rw-r--r--platform/include/tfm_plat_test.h16
-rw-r--r--platform/include/tfm_platform_system.h6
3 files changed, 30 insertions, 21 deletions
diff --git a/platform/include/tfm_plat_defs.h b/platform/include/tfm_plat_defs.h
index 487bba592..808a6d3ed 100644
--- a/platform/include/tfm_plat_defs.h
+++ b/platform/include/tfm_plat_defs.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -36,9 +36,12 @@ enum tfm_plat_err_t {
*
* \param[in] TFM_PARTITION_NAME TF-M partition name assigned in the manifest
* file "name" field.
+ * \param[in] TFM_PARTITION_TYPE TF-M partition type assigned in the manifest
+ * file "type" field.
*/
-#define TFM_LINK_SET_RO_IN_PARTITION_SECTION(TFM_PARTITION_NAME) \
- __attribute__((section(TFM_PARTITION_NAME"_ATTR_FN")))
+#define TFM_LINK_SET_RO_IN_PARTITION_SECTION(TFM_PARTITION_NAME, \
+ TFM_PARTITION_TYPE) \
+ __attribute__((section(TFM_PARTITION_NAME "_" TFM_PARTITION_TYPE "_ATTR_FN")))
/*!
* \def TFM_LINK_SET_RW_IN_PARTITION_SECTION(TFM_PARTITION_NAME)
@@ -48,9 +51,12 @@ enum tfm_plat_err_t {
*
* \param[in] TFM_PARTITION_NAME TF-M partition name assigned in the manifest
* file "name" field.
+ * \param[in] TFM_PARTITION_TYPE TF-M partition type assigned in the manifest
+ * file "type" field.
*/
-#define TFM_LINK_SET_RW_IN_PARTITION_SECTION(TFM_PARTITION_NAME) \
- __attribute__((section(TFM_PARTITION_NAME"_ATTR_RW")))
+#define TFM_LINK_SET_RW_IN_PARTITION_SECTION(TFM_PARTITION_NAME, \
+ TFM_PARTITION_TYPE) \
+ __attribute__((section(TFM_PARTITION_NAME "_" TFM_PARTITION_TYPE "_ATTR_RW")))
/*!
* \def TFM_LINK_SET_ZI_IN_PARTITION_SECTION(TFM_PARTITION_NAME)
@@ -60,12 +66,15 @@ enum tfm_plat_err_t {
*
* \param[in] TFM_PARTITION_NAME TF-M partition name assigned in the manifest
* file "name" field.
+ * \param[in] TFM_PARTITION_TYPE TF-M partition type assigned in the manifest
+ * file "type" field.
*/
-#define TFM_LINK_SET_ZI_IN_PARTITION_SECTION(TFM_PARTITION_NAME) \
- __attribute__((section(TFM_PARTITION_NAME"_ATTR_ZI")))
+#define TFM_LINK_SET_ZI_IN_PARTITION_SECTION(TFM_PARTITION_NAME, \
+ TFM_PARTITION_TYPE) \
+ __attribute__((section(TFM_PARTITION_NAME "_" TFM_PARTITION_TYPE "_ATTR_ZI")))
#else
-#define TFM_LINK_SET_RO_IN_PARTITION_SECTION(TFM_PARTITION_NAME)
-#define TFM_LINK_SET_RW_IN_PARTITION_SECTION(TFM_PARTITION_NAME)
-#define TFM_LINK_SET_ZI_IN_PARTITION_SECTION(TFM_PARTITION_NAME)
+#define TFM_LINK_SET_RO_IN_PARTITION_SECTION(TFM_PARTITION_NAME, TFM_PARTITION_TYPE)
+#define TFM_LINK_SET_RW_IN_PARTITION_SECTION(TFM_PARTITION_NAME, TFM_PARTITION_TYPE)
+#define TFM_LINK_SET_ZI_IN_PARTITION_SECTION(TFM_PARTITION_NAME, TFM_PARTITION_TYPE)
#endif
#endif /* __TFM_PLAT_DEFS_H__ */
diff --git a/platform/include/tfm_plat_test.h b/platform/include/tfm_plat_test.h
index 513134d74..58bc6e0cd 100644
--- a/platform/include/tfm_plat_test.h
+++ b/platform/include/tfm_plat_test.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2019-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -13,13 +13,13 @@
/**
* \brief Busy wait until the user presses a specific button
*/
-TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_CORE_TEST")
+TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_CORE_TEST", "PSA-ROT")
void tfm_plat_test_wait_user_button_pressed(void);
/**
* \brief Busy wait until the user releases a specific button
*/
-TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_CORE_TEST")
+TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_CORE_TEST", "PSA-ROT")
void tfm_plat_test_wait_user_button_released(void);
/**
@@ -27,7 +27,7 @@ void tfm_plat_test_wait_user_button_released(void);
*
* \return Returns the current status of LEDs
*/
-TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_CORE_TEST")
+TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_CORE_TEST", "PSA-ROT")
uint32_t tfm_plat_test_get_led_status(void);
/**
@@ -35,7 +35,7 @@ uint32_t tfm_plat_test_get_led_status(void);
*
* \param[in] status The status to be set
*/
-TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_CORE_TEST")
+TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_CORE_TEST", "PSA-ROT")
void tfm_plat_test_set_led_status(uint32_t status);
/**
@@ -43,7 +43,7 @@ void tfm_plat_test_set_led_status(uint32_t status);
*
* \return Returns the mask of the LEDs used for testing
*/
-TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_CORE_TEST")
+TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_CORE_TEST", "PSA-ROT")
uint32_t tfm_plat_test_get_userled_mask(void);
/**
@@ -54,13 +54,13 @@ uint32_t tfm_plat_test_get_userled_mask(void);
* the timer should be long enough so that the test service can go to the state
* where it starts waiting for the interrupt.
*/
-TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_IRQ_TEST_1")
+TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_IRQ_TEST_1", "APP-ROT")
void tfm_plat_test_secure_timer_start(void);
/**
* \brief Stops the Secure timer and clears the timer interrupt.
*/
-TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_IRQ_TEST_1")
+TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_IRQ_TEST_1", "APP-ROT")
void tfm_plat_test_secure_timer_stop(void);
/**
diff --git a/platform/include/tfm_platform_system.h b/platform/include/tfm_platform_system.h
index c297d3b76..40bd13026 100644
--- a/platform/include/tfm_platform_system.h
+++ b/platform/include/tfm_platform_system.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -25,7 +25,7 @@ extern "C" {
*
* \details Requests a system reset to reset the MCU.
*/
-TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_PLATFORM")
+TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_PLATFORM", "PSA-ROT")
void tfm_platform_hal_system_reset(void);
/*!
@@ -38,7 +38,7 @@ void tfm_platform_hal_system_reset(void);
*
* \return Returns values as specified by the \ref tfm_platform_err_t
*/
-TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_PLATFORM")
+TFM_LINK_SET_RO_IN_PARTITION_SECTION("TFM_SP_PLATFORM", "PSA-ROT")
enum tfm_platform_err_t tfm_platform_hal_ioctl(tfm_platform_ioctl_req_t request,
psa_invec *in_vec,
psa_outvec *out_vec);