mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
odroid-c2: Populate serial# environment variable from efuse
This commit is contained in:
parent
fb07f97d6e
commit
cb86d3746a
1 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue