[PATCH v4 20/28] coreboot: Set wifi mac addr from VPD

Stephen Boyd swboyd at chromium.org
Sat May 24 00:58:35 CEST 2025


Set the environment variable for the wlan mac address based on the value
stored in VPD.

Signed-off-by: Stephen Boyd <swboyd at chromium.org>
---
 lib/coreboot/cb_sysinfo.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/coreboot/cb_sysinfo.c b/lib/coreboot/cb_sysinfo.c
index 92e4f9ca0c0c..555abc93f1cb 100644
--- a/lib/coreboot/cb_sysinfo.c
+++ b/lib/coreboot/cb_sysinfo.c
@@ -12,6 +12,7 @@
 #include <init.h>
 #include <mapmem.h>
 #include <net.h>
+#include <net-common.h>
 #include <asm/global_data.h>
 #include <linux/errno.h>
 
@@ -703,6 +704,15 @@ static unsigned int coreboot_set_one(const u8 *blob, unsigned int i)
 
 		strncpy(serialno, val, val_len);
 		env_set("serial#", serialno);
+	} else if (!strncmp(key, "wifi_mac0", key_len)) {
+		u8 buf[ARP_HLEN_ASCII + 1];
+		unsigned char ethaddr[6];
+
+		if (!eth_env_get_enetaddr("wifiaddr", ethaddr)) {
+			strncpy(buf, val, val_len);
+			string_to_enetaddr(buf, ethaddr);
+			eth_env_set_enetaddr("wifiaddr", ethaddr);
+		}
 	}
 
 	return i;
-- 
Sent by a computer, using git, on the internet



More information about the U-Boot mailing list