ipq807x: Adding SOC version to default env.
Adding soc_version_major and soc_version_minor to the default
environment.
Change-Id: I38ee6dd228382111beaa2bdacfade1e3d2c989de
Signed-off-by: Nikhil Prakash V <nprakash@codeaurora.org>
diff --git a/board/qca/arm/ipq807x/ipq807x.c b/board/qca/arm/ipq807x/ipq807x.c
index 7c94b77..2facf76 100644
--- a/board/qca/arm/ipq807x/ipq807x.c
+++ b/board/qca/arm/ipq807x/ipq807x.c
@@ -1317,3 +1317,19 @@
{
execute_tzt(address);
}
+
+void set_platform_specific_default_env(void)
+{
+ uint32_t soc_ver_major, soc_ver_minor, soc_version;
+ int ret;
+
+ ret = ipq_smem_get_socinfo_version((uint32_t *)&soc_version);
+ if (!ret) {
+ soc_ver_major = SOCINFO_VERSION_MAJOR(soc_version);
+ soc_ver_minor = SOCINFO_VERSION_MINOR(soc_version);
+ setenv_ulong("soc_version_major", (unsigned long)soc_ver_major);
+ setenv_ulong("soc_version_minor", (unsigned long)soc_ver_minor);
+ }
+
+ return;
+}
diff --git a/common/env_common.c b/common/env_common.c
index af59c72..3ace236 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -95,6 +95,11 @@
return ret_val;
}
+__weak void set_platform_specific_default_env(void)
+{
+ return;
+}
+
void set_default_env(const char *s)
{
int flags = 0;
@@ -122,6 +127,8 @@
0, NULL) == 0)
error("Environment import failed: errno = %d\n", errno);
+ set_platform_specific_default_env();
+
gd->flags |= GD_FLG_ENV_READY;
}