Build: Fix library model build warnings
There are some redefination warnings when building TF_M library model.
This patch made the following changes:
- Rename "SPM_PART_FLAG_PSA_ROT" to "PARTITION_MODEL_PSA_ROT".
- Move "TFM_PARTITION_UNPRIVILEGED_MODE" and
"TFM_PARTITION_PRIVILEGED_MODE" from partition_define.h to spm_ipc.h.
Change-Id: I2b40fdfe8c1578ca3d08145d3b834c37859efb87
Signed-off-by: Shawn Shan <Shawn.Shan@arm.com>
diff --git a/secure_fw/spm/cmsis_psa/spm_ipc.c b/secure_fw/spm/cmsis_psa/spm_ipc.c
index 054ee11..d78c49c 100644
--- a/secure_fw/spm/cmsis_psa/spm_ipc.c
+++ b/secure_fw/spm/cmsis_psa/spm_ipc.c
@@ -259,7 +259,7 @@
#if TFM_LVL == 1
return TFM_PARTITION_PRIVILEGED_MODE;
#else /* TFM_LVL == 1 */
- if (partition_flags & SPM_PART_FLAG_PSA_ROT) {
+ if (partition_flags & PARTITION_MODEL_PSA_ROT) {
return TFM_PARTITION_PRIVILEGED_MODE;
} else {
return TFM_PARTITION_UNPRIVILEGED_MODE;
diff --git a/secure_fw/spm/cmsis_psa/spm_ipc.h b/secure_fw/spm/cmsis_psa/spm_ipc.h
index 2de04a9..cab522f 100644
--- a/secure_fw/spm/cmsis_psa/spm_ipc.h
+++ b/secure_fw/spm/cmsis_psa/spm_ipc.h
@@ -22,6 +22,10 @@
#define TFM_CONN_HANDLE_MAX_NUM 16
+/* Privileged definitions for partition thread mode */
+#define TFM_PARTITION_UNPRIVILEGED_MODE (0U)
+#define TFM_PARTITION_PRIVILEGED_MODE (1U)
+
/*
* Set a number limit for stateless handle.
* Valid handle must be positive, set client handle minimum value to 1.
diff --git a/secure_fw/spm/include/load/partition_defs.h b/secure_fw/spm/include/load/partition_defs.h
index a427c5b..88ca9f8 100644
--- a/secure_fw/spm/include/load/partition_defs.h
+++ b/secure_fw/spm/include/load/partition_defs.h
@@ -21,10 +21,6 @@
#define PARTITION_INFO_MAGIC_MASK (0xFFFF0000)
#define PARTITION_INFO_MAGIC (0x5F5F0000)
-/* Privileged definitions for partition thread mode */
-#define TFM_PARTITION_UNPRIVILEGED_MODE (0U)
-#define TFM_PARTITION_PRIVILEGED_MODE (1U)
-
/*
* Partition load data - flags
* bit 7-0: priority
@@ -38,9 +34,7 @@
#define PARTITION_PRI_LOWEST (0xFF)
#define PARTITION_PRI_MASK (0xFF)
-/* TODO: This def couples with library model, rename it later. */
-#define SPM_PART_FLAG_PSA_ROT (1U << 8)
-
+#define PARTITION_MODEL_PSA_ROT (1U << 8)
#define PARTITION_MODEL_IPC (1U << 9)
#define PARTITION_PRIORITY(flag) ((flag) & PARTITION_PRI_MASK)