From: Peng Fan Date: Thu, 19 Sep 2024 04:01:25 +0000 (+0800) Subject: imx9: soc: Print ELE information X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=3166537ae42006df649c654fd7ceba40554643fa;p=u-boot.git imx9: soc: Print ELE information The boot image includes Edgelock Enclave(ELE) Firmware. Print the information out to let user know which version firmware is being used. Signed-off-by: Peng Fan --- diff --git a/arch/arm/mach-imx/imx9/soc.c b/arch/arm/mach-imx/imx9/soc.c index 9494c73996..ba04abff26 100644 --- a/arch/arm/mach-imx/imx9/soc.c +++ b/arch/arm/mach-imx/imx9/soc.c @@ -582,6 +582,39 @@ static int fixup_thermal_trips(void *blob, const char *name) return 0; } +void build_info(void) +{ + u32 fw_version, sha1, res, status; + int ret; + + printf("\nBuildInfo:\n"); + + ret = ele_get_fw_status(&status, &res); + if (ret) { + printf(" - ELE firmware status failed %d, 0x%x\n", ret, res); + } else if ((status & 0xff) == 1) { + ret = ele_get_fw_version(&fw_version, &sha1, &res); + if (ret) { + printf(" - ELE firmware version failed %d, 0x%x\n", ret, res); + } else { + printf(" - ELE firmware version %u.%u.%u-%x", + (fw_version & (0x00ff0000)) >> 16, + (fw_version & (0x0000fff0)) >> 4, + (fw_version & (0x0000000f)), sha1); + ((fw_version & (0x80000000)) >> 31) == 1 ? puts("-dirty\n") : puts("\n"); + } + } else { + printf(" - ELE firmware not included\n"); + } + puts("\n"); +} + +int arch_misc_init(void) +{ + build_info(); + return 0; +} + int ft_system_setup(void *blob, struct bd_info *bd) { if (fixup_thermal_trips(blob, "cpu-thermal"))