aboutsummaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorMartin Böh <mart.b@outlook.de>2017-06-23 13:40:00 +0000
committerTom Rini <trini@konsulko.com>2017-07-06 13:09:36 -0400
commitcb86d3746a4a3f74142ca25f5a21848d5c2b5b55 (patch)
tree13aeabea1d7d281e50a627289ba53d6c4d140e90 /board
parentfb07f97d6e1cebc41762bc69e36f31beba5ea7b1 (diff)
downloadu-boot-cb86d3746a4a3f74142ca25f5a21848d5c2b5b55.zip
u-boot-cb86d3746a4a3f74142ca25f5a21848d5c2b5b55.tar.gz
u-boot-cb86d3746a4a3f74142ca25f5a21848d5c2b5b55.tar.bz2
odroid-c2: Populate serial# environment variable from efuse
Diffstat (limited to 'board')
-rw-r--r--board/amlogic/odroid-c2/odroid-c2.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/board/amlogic/odroid-c2/odroid-c2.c b/board/amlogic/odroid-c2/odroid-c2.c
index 9306b56..b29f56d 100644
--- a/board/amlogic/odroid-c2/odroid-c2.c
+++ b/board/amlogic/odroid-c2/odroid-c2.c
@@ -24,6 +24,7 @@ int board_init(void)
int misc_init_r(void)
{
u8 mac_addr[EFUSE_MAC_SIZE];
+ char serial[EFUSE_SN_SIZE];
ssize_t len;
/* Set RGMII mode */
@@ -50,5 +51,12 @@ int misc_init_r(void)
eth_setenv_enetaddr("ethaddr", mac_addr);
}
+ if (!getenv("serial#")) {
+ len = meson_sm_read_efuse(EFUSE_SN_OFFSET, serial,
+ EFUSE_SN_SIZE);
+ if (len == EFUSE_SN_SIZE)
+ setenv("serial#", serial);
+ }
+
return 0;
}