Platform: Add SPE platform-specific hw initialization
Adding tfm_spm_hal_post_init() and tfm_spm_hal_post_init_platform()
functions.
Contrarily to SystemInit() intended for a high priority hw
initialization (for example clock and power subsystems), and called
on a very early boot stage from startup code, this function is called
from C code, hence variables and other drivers data are protected from
being cleared up by the C library init.
These functions can be used for initializing platform-specific hw
resources (e.g. IPC, UART) thus freeing up application main() function
from the platform details.
tfm_spm_hal_post_init() function is intended for initialization common
to all platforms, while tfm_spm_hal_post_init_platform() implements
platform-specific initialization.
Signed-off-by: Andrei Narkevitch <ainh@cypress.com>
Change-Id: I7e5c9941c86a1be7fe718d1ebee7427526e8dd83
diff --git a/platform/include/tfm_spm_hal.h b/platform/include/tfm_spm_hal.h
index 38f22ff..cd12ae4 100644
--- a/platform/include/tfm_spm_hal.h
+++ b/platform/include/tfm_spm_hal.h
@@ -67,6 +67,32 @@
#endif
/**
+ * \brief This function initializes peripherals common to all platforms.
+ *
+ * Contrarily to SystemInit() intended for a high-priority hw initialization
+ * (for example clock and power subsystems), and called on a very early boot
+ * stage from startup code, this function is called from C code, hence variables
+ * and other drivers data are protected from being cleared up by the C library
+ * init.
+ * In addition to performing initialization common to all platforms, it also
+ * calls tfm_spm_hal_post_init_platform() function which implements
+ * initialization of platform-specific peripherals and other hw.
+ *
+ * \return Returns values as specified by the \ref tfm_plat_err_t
+ */
+enum tfm_plat_err_t tfm_spm_hal_post_init(void);
+
+/**
+ * \brief This function initializes platform-specific peripherals and hardware.
+ *
+ * Called from tfm_spm_hal_post_init(), this function is intended for
+ * platform-specific portion of hardware initialization.
+ *
+ * \return Returns values as specified by the \ref tfm_plat_err_t
+ */
+enum tfm_plat_err_t tfm_spm_hal_post_init_platform(void);
+
+/**
* \brief This function initialises the HW used for isolation, and sets the
* default configuration for them.
*