HAL: Migrate the FIH HAL to TFM HAL for IPC model
This patch moves the tfm_spm_hal version HAL for FIH to tfm_hal.
Change-Id: I4fcc733148da6a799095b16713e1b29c9eb02667
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/docs/technical_references/design_docs/tfm_physical_attack_mitigation.rst b/docs/technical_references/design_docs/tfm_physical_attack_mitigation.rst
index dba6013..42f14c3 100644
--- a/docs/technical_references/design_docs/tfm_physical_attack_mitigation.rst
+++ b/docs/technical_references/design_docs/tfm_physical_attack_mitigation.rst
@@ -516,7 +516,7 @@
.. code-block:: c
- fih_int tfm_spm_hal_verify_isolation_hw(void);
+ fih_int tfm_hal_verify_static_boundaries(void);
This function is intended to be called just before the security state
transition and is responsible for checking all critical hardware
diff --git a/platform/include/tfm_hal_isolation.h b/platform/include/tfm_hal_isolation.h
index 120cdf5..437f0a0 100644
--- a/platform/include/tfm_hal_isolation.h
+++ b/platform/include/tfm_hal_isolation.h
@@ -39,6 +39,15 @@
fih_int tfm_hal_set_up_static_boundaries(void);
/**
+ * \brief This function is responsible for checking all critical isolation
+ configurations.
+ *
+ * \return TFM_HAL_SUCCESS - the verification passed.
+ * TFM_HAL_ERROR_GENERIC - the verification failed.
+ */
+fih_int tfm_hal_verify_static_boundaries(void);
+
+/**
* \brief Update the isolation boundaries.
*
* \param[in] p_ldinf Partition load information.
diff --git a/platform/include/tfm_spm_hal.h b/platform/include/tfm_spm_hal.h
index 6d8afee..fc3a8b5 100644
--- a/platform/include/tfm_spm_hal.h
+++ b/platform/include/tfm_spm_hal.h
@@ -72,18 +72,6 @@
fih_int tfm_spm_hal_configure_default_isolation(
bool privileged,
const struct platform_data_t *platform_data);
-
-/**
- * \brief This function verifies the settings of HW used for memory isolation,
- * to make sure that important settings was not skipped due to fault
- * injection attacks.
- *
- * This function is called during TF-M core late startup, before passing
- * execution to non-secure code.
- *
- * \return Returns values as specified by FIH specific platform error code
- */
-fih_int tfm_spm_hal_verify_isolation_hw(void);
#else /* TFM_FIH_PROFILE_ON */
#ifdef CONFIG_TFM_ENABLE_MEMORY_PROTECT
/**
diff --git a/secure_fw/spm/cmsis_func/main.c b/secure_fw/spm/cmsis_func/main.c
index 0ea1911..1a44ebc 100644
--- a/secure_fw/spm/cmsis_func/main.c
+++ b/secure_fw/spm/cmsis_func/main.c
@@ -201,8 +201,8 @@
SPM_PARTITION_STATE_RUNNING);
#ifdef TFM_FIH_PROFILE_ON
- FIH_CALL(tfm_spm_hal_verify_isolation_hw, fih_rc);
- if (fih_not_eq(fih_rc, fih_int_encode(TFM_PLAT_ERR_SUCCESS))) {
+ FIH_CALL(tfm_hal_verify_static_boundaries, fih_rc);
+ if (fih_not_eq(fih_rc, fih_int_encode(TFM_HAL_SUCCESS))) {
tfm_core_panic();
}
#endif
diff --git a/secure_fw/spm/cmsis_psa/main.c b/secure_fw/spm/cmsis_psa/main.c
index 46fef6f..34959cb 100644
--- a/secure_fw/spm/cmsis_psa/main.c
+++ b/secure_fw/spm/cmsis_psa/main.c
@@ -61,8 +61,8 @@
#endif /* TFM_FIH_PROFILE_ON */
#ifdef TFM_FIH_PROFILE_ON
- FIH_CALL(tfm_spm_hal_verify_isolation_hw, fih_rc);
- if (fih_not_eq(fih_rc, fih_int_encode(TFM_PLAT_ERR_SUCCESS))) {
+ FIH_CALL(tfm_hal_verify_static_boundaries, fih_rc);
+ if (fih_not_eq(fih_rc, fih_int_encode(TFM_HAL_SUCCESS))) {
tfm_core_panic();
}
#endif