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>
diff --git a/secure_fw/spm/cmsis_func/main.c b/secure_fw/spm/cmsis_func/main.c
index 304739d..2dde940 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 @@
* 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 @@
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)[];