#ifndef __MESON_BOOT_H__
#define __MESON_BOOT_H__
+#include <linux/types.h>
+
/* Boot device */
#define BOOT_DEVICE_RESERVED 0
#define BOOT_DEVICE_EMMC 1
int meson_get_boot_device(void);
+int meson_get_soc_rev(char *buff, size_t buff_len);
+
#endif /* __MESON_BOOT_H__ */
return 0;
}
+
+int meson_get_soc_rev(char *buff, size_t buff_len)
+{
+ unsigned int socinfo;
+
+ socinfo = get_socinfo();
+ if (!socinfo)
+ return -1;
+
+ /* Write SoC info */
+ return snprintf(buff, buff_len, "%x", socinfo_to_minor(socinfo));
+}
#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
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)) {