#include <log.h>
#include <asm/arch/sci/sci.h>
#include <asm/mach-imx/sys_proto.h>
+#include <asm/global_data.h>
#include <imx_sip.h>
+#include <env.h>
#include <linux/arm-smccc.h>
+#include <generated/version_autogenerated.h>
+#include <linux/libfdt.h>
+
+DECLARE_GLOBAL_DATA_PTR;
int sc_pm_setup_uart(sc_rsrc_t uart_rsrc, sc_pm_clock_rate_t clk_rate)
{
return 0;
}
+extern uint32_t _end_ofs;
+
+static void set_buildinfo_to_env(uint32_t scfw, uint32_t secofw, char *mkimage, char *atf)
+{
+ if (!mkimage || !atf)
+ return;
+
+ env_set("commit_mkimage", mkimage);
+ env_set("commit_atf", atf);
+ env_set_hex("commit_scfw", (ulong)scfw);
+ env_set_hex("commit_secofw", (ulong)secofw);
+}
+
void build_info(void)
{
struct arm_smccc_res res;
u32 seco_build = 0, seco_commit = 0;
u32 sc_build = 0, sc_commit = 0;
+ char *mkimage_commit, *temp;
ulong atf_commit = 0;
/* Get SCFW build and commit id */
seco_commit = 0;
}
+ /* Get imx-mkimage commit id.
+ * The imx-mkimage puts the commit hash behind the end of u-boot.bin
+ */
+ mkimage_commit = (char *)(ulong)(CONFIG_SYS_TEXT_BASE +
+ _end_ofs + fdt_totalsize(gd->fdt_blob));
+ temp = mkimage_commit + 8;
+ *temp = '\0';
+
+ if (strlen(mkimage_commit) == 0) {
+ debug("IMX-MKIMAGE does not support build info\n");
+ mkimage_commit = "0"; /* Display 0 */
+ }
+
/* Get ARM Trusted Firmware commit id */
arm_smccc_smc(IMX_SIP_BUILDINFO, IMX_SIP_BUILDINFO_GET_COMMITHASH,
0, 0, 0, 0, 0, 0, &res);
atf_commit = 0x30; /* Display 0 */
}
- printf("Build: SCFW %08x, SECO-FW %08x, ATF %s\n",
- sc_commit, seco_commit, (char *)&atf_commit);
+ /* Set all to env */
+ set_buildinfo_to_env(sc_commit, seco_commit, mkimage_commit, (char *)&atf_commit);
+
+ printf("\n BuildInfo: \n - SCFW %08x, SECO-FW %08x, IMX-MKIMAGE %s, ATF %s\n - %s \n\n",
+ sc_commit, seco_commit, mkimage_commit, (char *)&atf_commit, U_BOOT_VERSION);
}