Core: Remove unnecessary functions
- Do not call tfm_spm_hal_setup_isolation_hw() if TFM_LVL != 1.
- Do not call tfm_nspm_configure_clients() in IPC model.
Change-Id: I55cfcbd3954fd44d501ed2e992bc2c16d7926726
Signed-off-by: Edison Ai <edison.ai@arm.com>
diff --git a/platform/ext/target/mps2/an519/spm_hal.c b/platform/ext/target/mps2/an519/spm_hal.c
index a895d14..90b477e 100644
--- a/platform/ext/target/mps2/an519/spm_hal.c
+++ b/platform/ext/target/mps2/an519/spm_hal.c
@@ -157,18 +157,16 @@
return SPM_ERR_OK;
}
-#endif /* TFM_LVL != 1 */
enum tfm_plat_err_t tfm_spm_hal_setup_isolation_hw(void)
{
-#if TFM_LVL != 1
if (tfm_spm_mpu_init() != SPM_ERR_OK) {
ERROR_MSG("Failed to set up initial MPU configuration! Halting.");
return TFM_PLAT_ERR_SYSTEM_ERR;
}
-#endif
return TFM_PLAT_ERR_SUCCESS;
}
+#endif /* TFM_LVL != 1 */
void MPC_Handler(void)
{
diff --git a/platform/ext/target/mps2/an521/spm_hal.c b/platform/ext/target/mps2/an521/spm_hal.c
index c785da4..bddb1a3 100644
--- a/platform/ext/target/mps2/an521/spm_hal.c
+++ b/platform/ext/target/mps2/an521/spm_hal.c
@@ -157,18 +157,16 @@
return SPM_ERR_OK;
}
-#endif /* TFM_LVL != 1 */
enum tfm_plat_err_t tfm_spm_hal_setup_isolation_hw(void)
{
-#if TFM_LVL != 1
if (tfm_spm_mpu_init() != SPM_ERR_OK) {
ERROR_MSG("Failed to set up initial MPU configuration! Halting.");
return TFM_PLAT_ERR_SYSTEM_ERR;
}
-#endif
return TFM_PLAT_ERR_SUCCESS;
}
+#endif /* TFM_LVL != 1 */
void MPC_Handler(void)
{
diff --git a/platform/ext/target/mps3/an524/spm_hal.c b/platform/ext/target/mps3/an524/spm_hal.c
index 2a1885d..ce2fbac 100644
--- a/platform/ext/target/mps3/an524/spm_hal.c
+++ b/platform/ext/target/mps3/an524/spm_hal.c
@@ -173,18 +173,16 @@
return SPM_ERR_OK;
}
-#endif /* TFM_LVL != 1 */
enum tfm_plat_err_t tfm_spm_hal_setup_isolation_hw(void)
{
-#if TFM_LVL != 1
if (tfm_spm_mpu_init() != SPM_ERR_OK) {
ERROR_MSG("Failed to set up initial MPU configuration! Halting.");
return TFM_PLAT_ERR_SYSTEM_ERR;
}
-#endif
return TFM_PLAT_ERR_SUCCESS;
}
+#endif /* TFM_LVL != 1 */
void MPC_Handler(void)
{
diff --git a/platform/ext/target/musca_a/spm_hal.c b/platform/ext/target/musca_a/spm_hal.c
index f576fd8..845a4cb 100644
--- a/platform/ext/target/musca_a/spm_hal.c
+++ b/platform/ext/target/musca_a/spm_hal.c
@@ -164,18 +164,16 @@
return SPM_ERR_OK;
}
-#endif /* TFM_LVL != 1 */
enum tfm_plat_err_t tfm_spm_hal_setup_isolation_hw(void)
{
-#if TFM_LVL != 1
if (tfm_spm_mpu_init() != SPM_ERR_OK) {
ERROR_MSG("Failed to set up initial MPU configuration! Halting.");
return TFM_PLAT_ERR_SYSTEM_ERR;
}
-#endif
return TFM_PLAT_ERR_SUCCESS;
}
+#endif /* TFM_LVL != 1 */
void MPC_Handler(void)
{
diff --git a/platform/ext/target/musca_b1/spm_hal.c b/platform/ext/target/musca_b1/spm_hal.c
index 4ed6c30..08effda 100644
--- a/platform/ext/target/musca_b1/spm_hal.c
+++ b/platform/ext/target/musca_b1/spm_hal.c
@@ -168,18 +168,16 @@
return SPM_ERR_OK;
}
-#endif /* TFM_LVL != 1 */
enum tfm_plat_err_t tfm_spm_hal_setup_isolation_hw(void)
{
-#if TFM_LVL != 1
if (tfm_spm_mpu_init() != SPM_ERR_OK) {
ERROR_MSG("Failed to set up initial MPU configuration! Halting.");
return TFM_PLAT_ERR_SYSTEM_ERR;
}
-#endif
return TFM_PLAT_ERR_SUCCESS;
}
+#endif /* TFM_LVL != 1 */
void MPC_Handler(void)
{
diff --git a/platform/include/tfm_spm_hal.h b/platform/include/tfm_spm_hal.h
index b6820f5..38f22ff 100644
--- a/platform/include/tfm_spm_hal.h
+++ b/platform/include/tfm_spm_hal.h
@@ -76,6 +76,7 @@
*/
enum tfm_plat_err_t tfm_spm_hal_init_isolation_hw(void);
+#if TFM_LVL != 1
/**
* \brief This function initialises the HW used for isolation, and sets the
* default configuration for them.
@@ -84,6 +85,7 @@
* \return Returns values as specified by the \ref tfm_plat_err_t
*/
enum tfm_plat_err_t tfm_spm_hal_setup_isolation_hw(void);
+#endif
/**
* \brief Configure peripherals for a partition based on the platfotm data from