summaryrefslogtreecommitdiffstats
path: root/common/fdt_support.c
diff options
context:
space:
mode:
authorDan Murphy <dmurphy@ti.com>2013-10-02 14:00:15 -0500
committerTom Rini <trini@ti.com>2014-06-19 11:18:39 -0400
commitb1f49ab8c7bad60426b30c134ae065ef77d2dfc1 (patch)
treebbe6ca20a633bdbeb282d3f66c975c71db2a3beb /common/fdt_support.c
parent2e436467828969b6c9569c21bbe400b2b5b7a27c (diff)
downloadtalos-obmc-uboot-b1f49ab8c7bad60426b30c134ae065ef77d2dfc1.tar.gz
talos-obmc-uboot-b1f49ab8c7bad60426b30c134ae065ef77d2dfc1.zip
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 <dmurphy@ti.com>
Diffstat (limited to 'common/fdt_support.c')
-rw-r--r--common/fdt_support.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c
index fcd252336c..c690768572 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -479,8 +479,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);
OpenPOWER on IntegriCloud