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>
diff --git a/platform/include/tfm_plat_defs.h b/platform/include/tfm_plat_defs.h
index 487bba5..808a6d3 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 @@
  *
  * \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 @@
  *
  * \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 @@
  *
  * \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 513134d..58bc6e0 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 @@
  *
  * \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 @@
  *
  * \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 @@
  *
  * \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 @@
  * 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 c297d3b..40bd130 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 @@
  *
  * \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 @@
  *
  * \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);