diff mbox series

[v2,2/2] board: amlogic: add meson_generate_serial_ethaddr fallback to p200

Message ID 20240324151905.3817732-3-christianshewitt@gmail.com
State Accepted
Commit 65d5c367b00cb392bda560c3da1834979adcf137
Delegated to: Neil Armstrong
Headers show
Series ARM: dts: fix Ethernet and random MAC's on WeTek Hub/Play2 | expand

Commit Message

Christian Hewitt March 24, 2024, 3:19 p.m. UTC
Add a fall-back method to generate ethaddr from CPU serial on p200 boards
if the MAC cannot be read from efuse. This prevents random MAC addresses
on the WeTek Hub/Play2 boards.

Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
---
 board/amlogic/p200/p200.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/board/amlogic/p200/p200.c b/board/amlogic/p200/p200.c
index 7c432f9d281..3061f7a6b3c 100644
--- a/board/amlogic/p200/p200.c
+++ b/board/amlogic/p200/p200.c
@@ -30,6 +30,8 @@  int misc_init_r(void)
 					  mac_addr, EFUSE_MAC_SIZE);
 		if (len == EFUSE_MAC_SIZE && is_valid_ethaddr(mac_addr))
 			eth_env_set_enetaddr("ethaddr", mac_addr);
+		else
+			meson_generate_serial_ethaddr();
 	}
 
 	if (!env_get("serial#")) {