public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] ARM: fdt support: Add usbethaddr as an acceptable MAC
@ 2013-10-02 19:00 Dan Murphy
  2013-10-02 19:19 ` Tom Rini
  2014-06-19 15:19 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 7+ messages in thread
From: Dan Murphy @ 2013-10-02 19:00 UTC (permalink / raw)
  To: u-boot

A board that has a USB ethernet device only may set the usbetheraddr
and not the ethaddr.
ethaddr will be the default MAC address that is chosen and if that
is not populated then the usbethaddr is looked at.  If neither are set
then then device tree blob is not modified.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
---
 common/fdt_support.c |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/common/fdt_support.c b/common/fdt_support.c
index b034c98..fef7e60 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -450,8 +450,18 @@ void fdt_fixup_ethernet(void *fdt)
 	if (node < 0)
 		return;
 
+	if (!getenv("ethaddr")) {
+		if (getenv("usbethaddr")) {
+			strcpy(mac, "usbethaddr");
+		} else {
+			debug("No ethernet MAC Address defined\n");
+			return;
+		}
+	} else {
+		strcpy(mac, "ethaddr");
+	}
+
 	i = 0;
-	strcpy(mac, "ethaddr");
 	while ((tmp = getenv(mac)) != NULL) {
 		sprintf(enet, "ethernet%d", i);
 		path = fdt_getprop(fdt, node, enet, NULL);
-- 
1.7.9.5

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

end of thread, other threads:[~2014-06-19 15:19 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-02 19:00 [U-Boot] [PATCH] ARM: fdt support: Add usbethaddr as an acceptable MAC Dan Murphy
2013-10-02 19:19 ` Tom Rini
2013-10-02 20:14   ` Dan Murphy
2013-10-02 20:19     ` Tom Rini
2013-10-02 20:21       ` Dan Murphy
2013-10-09 15:04         ` Dan Murphy
2014-06-19 15:19 ` [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