SPM: Print the TF-M version as early as possible
For debug purposes it is good practice for the boot banner to be the
first message that is logged.
The earliest point that we can start logging is after the platform has
initialized it's logging backend, like a UART driver.
We therefore move the boot banner from after tfm_core_init to just
after tfm_hal_platform_init.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
Change-Id: I771f8fa0867382ee6a688322b91943a247d1fd72
diff --git a/secure_fw/spm/core/main.c b/secure_fw/spm/core/main.c
index faf7ea9..9d139af 100644
--- a/secure_fw/spm/core/main.c
+++ b/secure_fw/spm/core/main.c
@@ -49,6 +49,12 @@
FIH_RET(fih_int_encode(SPM_ERROR_GENERIC));
}
+ /*
+ * Print the TF-M version now that the platform has initialized
+ * the logging backend.
+ */
+ SPMLOG_INFMSG("\033[1;34mBooting TF-M "VERSION_FULLSTR"\033[0m\r\n");
+
plat_err = tfm_plat_otp_init();
if (plat_err != TFM_PLAT_ERR_SUCCESS) {
FIH_RET(fih_int_encode(SPM_ERROR_GENERIC));
@@ -106,9 +112,6 @@
/* All isolation should have been set up at this point */
FIH_LABEL_CRITICAL_POINT();
- /* Print the TF-M version */
- SPMLOG_INFMSG("\033[1;34mBooting TF-M "VERSION_FULLSTR"\033[0m\r\n");
-
/*
* Prioritise secure exceptions to avoid NS being able to pre-empt
* secure SVC or SecureFault. Do it before PSA API initialization.