aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorPascal Vizeli2020-11-27 17:28:21 +0100
committerNeil Armstrong2021-01-11 14:59:54 +0100
commitd42e7964d9ca756bced0c0e7e879ed06edb4b6cb (patch)
tree95965ca555f63a40e58c762ed8a7c8f5ca78787d /board
parentcf47c0e23a25f10ea87fdb3ac4b1e4ea14823e16 (diff)
meson: Add soc_rev to environment
Add SoC revision to environment. This can be useful to select the correct device tree at runtime (N2/N2+). Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch> Signed-off-by: Stefan Agner <stefan@agner.ch> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Diffstat (limited to 'board')
-rw-r--r--board/amlogic/odroid-n2/odroid-n2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/board/amlogic/odroid-n2/odroid-n2.c b/board/amlogic/odroid-n2/odroid-n2.c
index caf7fd68100..dc0d933a39e 100644
--- a/board/amlogic/odroid-n2/odroid-n2.c
+++ b/board/amlogic/odroid-n2/odroid-n2.c
@@ -12,6 +12,7 @@
#include <asm/io.h>
#include <asm/arch/sm.h>
#include <asm/arch/eth.h>
+#include <asm/arch/boot.h>
#define EFUSE_MAC_OFFSET 20
#define EFUSE_MAC_SIZE 12
@@ -23,6 +24,10 @@ int misc_init_r(void)
char efuse_mac_addr[EFUSE_MAC_SIZE], tmp[3];
ssize_t len;
+ if (IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG) &&
+ meson_get_soc_rev(tmp, sizeof(tmp)) > 0)
+ env_set("soc_rev", tmp);
+
meson_eth_init(PHY_INTERFACE_MODE_RGMII, 0);
if (!eth_env_get_enetaddr("ethaddr", mac_addr)) {