From 499f538fac14dc945efec64a6cca9a371d002c02 Mon Sep 17 00:00:00 2001 From: Gokul Sriram Palanisamy Date: Thu, 25 Jun 2020 12:11:34 +0530 Subject: [PATCH] qca: Made machid and soc_hw_version as default env Made machid, soc_hw_version, soc_version_minor and soc_version_major as default env across all qca arm platforms. Signed-off-by: Gokul Sriram Palanisamy Change-Id: I0f284dac705d929f7b6588bc8fe4eaf17916b4b6 --- board/qca/arm/common/env.c | 24 ++++++++++++++++++++++++ board/qca/arm/ipq807x/ipq807x.c | 14 -------------- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/board/qca/arm/common/env.c b/board/qca/arm/common/env.c index a28c076203..4f6b7e6bd7 100644 --- a/board/qca/arm/common/env.c +++ b/board/qca/arm/common/env.c @@ -128,4 +128,28 @@ int board_mmc_env_init(qca_mmc mmc_host) } return ret; } + +void set_platform_specific_default_env(void) +{ + uint32_t soc_ver_major, soc_ver_minor, soc_version; + uint32_t machid; + uint32_t soc_hw_version; + int ret; + + machid = smem_get_board_platform_type(); + if (machid != 0) + setenv_addr("machid", (void *)machid); + + soc_hw_version = get_soc_hw_version(); + if (soc_hw_version) + setenv_hex("soc_hw_version", (unsigned long)soc_hw_version); + + 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); + } +} #endif diff --git a/board/qca/arm/ipq807x/ipq807x.c b/board/qca/arm/ipq807x/ipq807x.c index c5162b68e3..b1d3a2e35d 100644 --- a/board/qca/arm/ipq807x/ipq807x.c +++ b/board/qca/arm/ipq807x/ipq807x.c @@ -1790,20 +1790,6 @@ 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); - } -} - void sdi_disable(void) { qca_scm_sdi();