aboutsummaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2020-04-22 10:51:13 +0800
committerStefano Babic <sbabic@denx.de>2020-05-01 13:46:21 +0200
commita07bcec403a22f6b848cff06c8094f1da7bc23e1 (patch)
tree50301d586997fc29dd14f3c91a975164cdd1b963 /arch/arm
parent3f4974280188c6d06e3238939cc49fcc1a332acd (diff)
downloadu-boot-a07bcec403a22f6b848cff06c8094f1da7bc23e1.zip
u-boot-a07bcec403a22f6b848cff06c8094f1da7bc23e1.tar.gz
u-boot-a07bcec403a22f6b848cff06c8094f1da7bc23e1.tar.bz2
imx8m: acquire ATF commit hash
Acquire ATF commit hash when booting U-Boot to make user easy to know the ATF version. Reviewed-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-imx/imx8m/soc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/imx8m/soc.c b/arch/arm/mach-imx/imx8m/soc.c
index 8711795..8b6be7b 100644
--- a/arch/arm/mach-imx/imx8m/soc.c
+++ b/arch/arm/mach-imx/imx8m/soc.c
@@ -425,3 +425,27 @@ void reset_cpu(ulong addr)
}
}
#endif
+
+#if defined(CONFIG_ARCH_MISC_INIT)
+static void acquire_buildinfo(void)
+{
+ u64 atf_commit = 0;
+
+ /* Get ARM Trusted Firmware commit id */
+ atf_commit = call_imx_sip(IMX_SIP_BUILDINFO,
+ IMX_SIP_BUILDINFO_GET_COMMITHASH, 0, 0, 0);
+ if (atf_commit == 0xffffffff) {
+ debug("ATF does not support build info\n");
+ atf_commit = 0x30; /* Display 0, 0 ascii is 0x30 */
+ }
+
+ printf("\n BuildInfo:\n - ATF %s\n\n", (char *)&atf_commit);
+}
+
+int arch_misc_init(void)
+{
+ acquire_buildinfo();
+
+ return 0;
+}
+#endif