diff --git a/board/qca/arm/ipq807x/ipq807x.c b/board/qca/arm/ipq807x/ipq807x.c index 9c4562ee1a..83675781ed 100644 --- a/board/qca/arm/ipq807x/ipq807x.c +++ b/board/qca/arm/ipq807x/ipq807x.c @@ -1440,3 +1440,19 @@ void run_tzt(void *address) { 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 af59c72e1f..3ace236191 100644 --- a/common/env_common.c +++ b/common/env_common.c @@ -95,6 +95,11 @@ char *getenv_default(const char *name) 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 @@ void set_default_env(const char *s) 0, NULL) == 0) error("Environment import failed: errno = %d\n", errno); + set_platform_specific_default_env(); + gd->flags |= GD_FLG_ENV_READY; }