aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTushar Behera <tushar.behera@linaro.org>2014-02-13 16:50:49 +0530
committerTushar Behera <tushar.behera@linaro.org>2014-02-14 11:34:57 +0530
commitd9a734a79abc976209f8f07d33e3642b4a420ec4 (patch)
tree0c5f9e3804e0522e29e370dad0c8e4687a7d8485
parent76760b1475989ce13e4229b036f690bb8f384560 (diff)
asix: Update MAC address from environment
If the MAC address is not udpated properly in SROM, then read the MAC address from environment. Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
-rw-r--r--drivers/usb/eth/asix.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/eth/asix.c b/drivers/usb/eth/asix.c
index 75ec8f788..66fcb758d 100644
--- a/drivers/usb/eth/asix.c
+++ b/drivers/usb/eth/asix.c
@@ -365,6 +365,11 @@ static int asix_read_mac(struct eth_device *eth)
memcpy(eth->enetaddr, buf, ETH_ALEN);
}
+ if (!is_valid_ether_addr(eth->enetaddr)) {
+ eth_parse_enetaddr(getenv("ethaddr"), buf);
+ memcpy(eth->enetaddr, buf, ETH_ALEN);
+ }
+
return 0;
}