All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] net: smc911x: Automatically Update ethaddr with MAC
@ 2020-08-18 13:19 Adam Ford
  2020-09-26 11:06 ` Adam Ford
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Adam Ford @ 2020-08-18 13:19 UTC (permalink / raw)
  To: u-boot

The ethernet controller can read the MAC from EEPROM and display it,
but if ethaddr is not set, the ethernet is still unavailable.

This patch checks will automatically set the MAC address if it has
not already been set.

Signed-off-by: Adam Ford <aford173@gmail.com>
---
V2:  Fix typo

diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 09372d7f6b..1fa3667b77 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -6,6 +6,7 @@
  */
 
 #include <common.h>
+#include <env.h>
 #include <command.h>
 #include <malloc.h>
 #include <net.h>
@@ -185,6 +186,8 @@ static void smc911x_handle_mac_address(struct smc911x_priv *priv)
 	smc911x_set_mac_csr(priv, ADDRH, addrh);
 
 	printf(DRIVERNAME ": MAC %pM\n", m);
+	if (!env_get("ethaddr"))
+		env_set("ethaddr", (const char *)m);
 }
 
 static bool smc911x_read_mac_address(struct smc911x_priv *priv)
-- 
2.17.1

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

end of thread, other threads:[~2020-10-01 19:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18 13:19 [PATCH V2] net: smc911x: Automatically Update ethaddr with MAC Adam Ford
2020-09-26 11:06 ` Adam Ford
2020-09-28 18:03 ` Joe Hershberger
2020-10-01 14:09 ` Tom Rini
2020-10-01 17:48   ` Marek Vasut
2020-10-01 18:17     ` Tom Rini
2020-10-01 18:22       ` Adam Ford
2020-10-01 18:28         ` Tom Rini
2020-10-01 18:42           ` Adam Ford
2020-10-01 18:46             ` Marek Vasut
2020-10-01 18:51               ` Tom Rini
2020-10-01 19:49                 ` Marek Vasut

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.