]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
imx9: soc: Print ELE information
authorPeng Fan <peng.fan@nxp.com>
Thu, 19 Sep 2024 04:01:25 +0000 (12:01 +0800)
committerFabio Estevam <festevam@gmail.com>
Thu, 19 Sep 2024 03:12:41 +0000 (00:12 -0300)
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 <peng.fan@nxp.com>
arch/arm/mach-imx/imx9/soc.c

index 9494c73996973b302be81127a4eeeaa10a813ce4..ba04abff262e6e71b987670c6d16ecd7faa7cf53 100644 (file)
@@ -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"))