From 7df64382ae1b36ef0189cfa0b4b4dd05575ce602 Mon Sep 17 00:00:00 2001 From: Dan Murphy Date: Wed, 2 Oct 2013 14:00:15 -0500 Subject: [PATCH] ARM: fdt support: Add usbethaddr as an acceptable MAC 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 --- 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 1f0d8f5fe9..4a823fa757 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);