U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] odroid-c2: Populate serial# environment variable from efuse
@ 2017-06-23 13:40 Martin Böh
  2017-07-07 11:41 ` [U-Boot] " Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Böh @ 2017-06-23 13:40 UTC (permalink / raw)
  To: u-boot

---
 board/amlogic/odroid-c2/odroid-c2.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/board/amlogic/odroid-c2/odroid-c2.c b/board/amlogic/odroid-c2/odroid-c2.c
index 9306b56a6a..b29f56d5eb 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;
 }
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-07-07 11:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-23 13:40 [U-Boot] [PATCH] odroid-c2: Populate serial# environment variable from efuse Martin Böh
2017-07-07 11:41 ` [U-Boot] " Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox