build: Print the full TF-M version on boot
Unify the version extraction with documentation.
Print the boot TF-M version with tag and SHA, provieded by git describe
in a form: <TAG>+<SHA>
Signed-off-by: Anton Komlev <anton.komlev@arm.com>
Change-Id: I64b6202e231a98860973f7cb2ba8d5e3eeffb34f
diff --git a/secure_fw/spm/cmsis_func/main.c b/secure_fw/spm/cmsis_func/main.c
index b08a0d4..c5fa6b5 100644
--- a/secure_fw/spm/cmsis_func/main.c
+++ b/secure_fw/spm/cmsis_func/main.c
@@ -183,7 +183,7 @@
FIH_LABEL_CRITICAL_POINT();
/* Print the TF-M version */
- SPMLOG_INFMSG("\033[1;34mBooting TFM v"VERSION_FULLSTR"\033[0m\r\n");
+ SPMLOG_INFMSG("\033[1;34mBooting TF-M "VERSION_FULLSTR"\033[0m\r\n");
spm_err = tfm_spm_db_init();
if (spm_err != SPM_ERR_OK) {
diff --git a/secure_fw/spm/cmsis_psa/main.c b/secure_fw/spm/cmsis_psa/main.c
index 1777e44..4e886bb 100644
--- a/secure_fw/spm/cmsis_psa/main.c
+++ b/secure_fw/spm/cmsis_psa/main.c
@@ -133,7 +133,7 @@
FIH_LABEL_CRITICAL_POINT();
/* Print the TF-M version */
- SPMLOG_INFMSG("\033[1;34mBooting TFM v"VERSION_FULLSTR"\033[0m\r\n");
+ SPMLOG_INFMSG("\033[1;34mBooting TF-M "VERSION_FULLSTR"\033[0m\r\n");
/*
* Prioritise secure exceptions to avoid NS being able to pre-empt
diff --git a/secure_fw/spm/include/tfm_version.h.in b/secure_fw/spm/include/tfm_version.h.in
index fa815f7..ff19e49 100644
--- a/secure_fw/spm/include/tfm_version.h.in
+++ b/secure_fw/spm/include/tfm_version.h.in
@@ -11,13 +11,13 @@
/*
* Defines for TFM version.
*/
-#cmakedefine TFM_VERSION @TFM_VERSION@
-
-#define VERSION_STRING ""
+#cmakedefine TFM_VERSION @TFM_VERSION@
+#cmakedefine TFM_VERSION_FULL @TFM_VERSION_FULL@
#define VERSTR(x) #x
#define VERCON(x) VERSTR(x)
-#define VERSION_FULLSTR VERCON(TFM_VERSION)""VERSION_STRING
+#define VERSION_STR VERCON(TFM_VERSION)
+#define VERSION_FULLSTR VERCON(TFM_VERSION_FULL)
#endif /* __TFM_VERSION_H__ */