aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMingyang Sun <mingyang.sun@arm.com>2020-12-07 10:45:17 +0800
committerMingyang Sun <mingyang.sun@arm.com>2021-01-06 10:22:44 +0800
commit9763dee6fdc533fda5f334b2df976db39569f4dd (patch)
treead045d53527d4857e9942cd5cd35a3ed3dad565b
parenta891d4f8f0c931a6f79f13c15c2233e49598a13e (diff)
downloadtrusted-firmware-m-9763dee6fdc533fda5f334b2df976db39569f4dd.tar.gz
Build: Put CONFIG_TFM_ENABLE_MEMORY_PROTECT flag to platform
The flag "CONFIG_TFM_ENABLE_MEMORY_PROTECT" is a platform-scope option, move it to platform_s target. Remove the isolation setup in library SPM code and reuse the one of SPM HAL, since they are doing the same things. Change-Id: I5766ddecc525ee2eda3f2e5989b31dd5c41fde6b Signed-off-by: Mingyang Sun <mingyang.sun@arm.com>
-rw-r--r--interface/CMakeLists.txt1
-rwxr-xr-xplatform/CMakeLists.txt1
-rw-r--r--secure_fw/spm/cmsis_func/main.c11
3 files changed, 4 insertions, 9 deletions
diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt
index 37ecfbc56d..f68396d4ad 100644
--- a/interface/CMakeLists.txt
+++ b/interface/CMakeLists.txt
@@ -45,7 +45,6 @@ target_compile_definitions(psa_interface
$<$<BOOL:${TFM_NS_CLIENT_IDENTIFICATION}>:TFM_NS_CLIENT_IDENTIFICATION>
$<$<BOOL:${CONFIG_TFM_ENABLE_CTX_MGMT}>:CONFIG_TFM_ENABLE_CTX_MGMT>
$<$<BOOL:${TFM_ISOLATION_LEVEL}>:TFM_LVL=${TFM_ISOLATION_LEVEL}>
- $<$<OR:$<VERSION_GREATER:${TFM_ISOLATION_LEVEL},1>,$<STREQUAL:"${TEST_PSA_API}","IPC">>:CONFIG_TFM_ENABLE_MEMORY_PROTECT>
$<$<BOOL:${TFM_MULTI_CORE_TOPOLOGY}>:TFM_MULTI_CORE_TOPOLOGY>
$<$<BOOL:${TFM_MULTI_CORE_MULTI_CLIENT_CALL}>:TFM_MULTI_CORE_MULTI_CLIENT_CALL>
$<$<BOOL:${FORWARD_PROT_MSG}>:FORWARD_PROT_MSG=${FORWARD_PROT_MSG}>
diff --git a/platform/CMakeLists.txt b/platform/CMakeLists.txt
index 6cd9befdfb..85f2c38b17 100755
--- a/platform/CMakeLists.txt
+++ b/platform/CMakeLists.txt
@@ -66,6 +66,7 @@ target_compile_definitions(platform_s
TFM_SPM_LOG_LEVEL=${TFM_SPM_LOG_LEVEL}
PRIVATE
$<$<BOOL:${SYMMETRIC_INITIAL_ATTESTATION}>:SYMMETRIC_INITIAL_ATTESTATION>
+ $<$<OR:$<VERSION_GREATER:${TFM_ISOLATION_LEVEL},1>,$<STREQUAL:"${TEST_PSA_API}","IPC">>:CONFIG_TFM_ENABLE_MEMORY_PROTECT>
)
#========================= Platform Non-Secure ================================#
diff --git a/secure_fw/spm/cmsis_func/main.c b/secure_fw/spm/cmsis_func/main.c
index 304739ddea..2dde940ea6 100644
--- a/secure_fw/spm/cmsis_func/main.c
+++ b/secure_fw/spm/cmsis_func/main.c
@@ -9,6 +9,7 @@
#include "common/tfm_boot_data.h"
#include "region.h"
#include "spm_func.h"
+#include "tfm_hal_defs.h"
#include "tfm_hal_platform.h"
#include "tfm_irq_list.h"
#include "tfm_nspm.h"
@@ -61,8 +62,8 @@ static int32_t tfm_core_init(void)
* Access to any peripheral should be performed after programming
* the necessary security components such as PPC/SAU.
*/
- plat_err = tfm_spm_hal_init_isolation_hw();
- if (plat_err != TFM_PLAT_ERR_SUCCESS) {
+ hal_status = tfm_hal_set_up_static_boundaries();
+ if (hal_status != TFM_HAL_SUCCESS) {
return TFM_ERROR_GENERIC;
}
@@ -135,12 +136,6 @@ int main(void)
tfm_core_panic();
}
-#ifdef CONFIG_TFM_ENABLE_MEMORY_PROTECT
- if (tfm_spm_hal_setup_isolation_hw() != TFM_PLAT_ERR_SUCCESS) {
- tfm_core_panic();
- }
-#endif /* CONFIG_TFM_ENABLE_MEMORY_PROTECT */
-
tfm_spm_partition_set_state(TFM_SP_CORE_ID, SPM_PARTITION_STATE_RUNNING);
REGION_DECLARE(Image$$, ARM_LIB_STACK, $$ZI$$Base)[];