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>
This commit is contained in:
Pascal Vizeli
2020-11-27 17:28:21 +01:00
committed by Neil Armstrong
parent cf47c0e23a
commit d42e7964d9
3 changed files with 21 additions and 0 deletions

View File

@@ -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)) {