summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRouven Czerwinski <r.czerwinski@pengutronix.de>2023-10-17 16:51:08 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-10-18 10:07:43 +0200
commitfd6f05fca036bf309a4f2546bbb448024c4597de (patch)
tree4f1b70a915f39c8dfddac88d79f979be2fb3aed6
parentea7ba9b7972e33a28f2319c42037481ba0d51ed6 (diff)
downloadbarebox-fd6f05fca036bf309a4f2546bbb448024c4597de.tar.gz
barebox-fd6f05fca036bf309a4f2546bbb448024c4597de.tar.xz
i.MX: HABv4: retrieve HAB ROM version for i.MX8M
The HAB userguide mentions this additional API calls introduced in 2018 (which coincides with the introduction of i.MX8M SoCs). Call this API call unconditionally on i.MX8M SoCs to print the HAB version the ROM code supports. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Link: https://lore.barebox.org/20231017145131.3069283-7-m.felsch@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/hab/habv4.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/hab/habv4.c b/drivers/hab/habv4.c
index 0238b98dfb..f74de009fc 100644
--- a/drivers/hab/habv4.c
+++ b/drivers/hab/habv4.c
@@ -168,6 +168,7 @@ struct habv4_rvt {
#define FSL_SIP_HAB_REPORT_STATUS 0x04
#define FSL_SIP_HAB_FAILSAFE 0x05
#define FSL_SIP_HAB_CHECK_TARGET 0x06
+#define FSL_SIP_HAB_GET_VERSION 0x07
static enum hab_status hab_sip_report_status(enum hab_config *config,
enum habv4_state *state)
@@ -193,6 +194,15 @@ static enum hab_status hab_sip_report_status(enum hab_config *config,
return (enum hab_status)res.a0;
}
+static uint32_t hab_sip_get_version(void)
+{
+ struct arm_smccc_res res;
+
+ arm_smccc_smc(FSL_SIP_HAB, FSL_SIP_HAB_GET_VERSION, 0, 0, 0, 0, 0, 0, &res);
+
+ return (uint32_t)res.a0;
+}
+
#define IMX8MQ_ROM_OCRAM_ADDRESS 0x9061C0
#define IMX8MM_ROM_OCRAM_ADDRESS 0x908040
#define IMX8MN_ROM_OCRAM_ADDRESS 0x908040
@@ -610,6 +620,8 @@ static int init_imx8m_hab_get_status(void)
/* can happen in multi-image builds and is not an error */
return 0;
+ pr_info("ROM version: 0x%x\n", hab_sip_get_version());
+
/*
* Nobody will check the return value if there were HAB errors, but the
* initcall will fail spectaculously with a strange error message.