summaryrefslogtreecommitdiffstats
path: root/drivers/net/dm9000x.c
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2013-11-25 10:42:19 -0500
committerTom Rini <trini@ti.com>2013-11-25 10:42:19 -0500
commit1a1326d2da9b2904bc90fb2990f829cb1ecef312 (patch)
tree79b47ce3f6bbc48974d305eedebd0e473dc9a33d /drivers/net/dm9000x.c
parentfaca8ff55f4a2cf45fb906cc37f44601149fc00e (diff)
parent2287286be4e268d3d4ec3c0347bf31479dbd1f05 (diff)
downloadtalos-obmc-uboot-1a1326d2da9b2904bc90fb2990f829cb1ecef312.tar.gz
talos-obmc-uboot-1a1326d2da9b2904bc90fb2990f829cb1ecef312.zip
Merge branch 'master' of git://git.denx.de/u-boot-net
Diffstat (limited to 'drivers/net/dm9000x.c')
-rw-r--r--drivers/net/dm9000x.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c
index f7170e0554..b68d808c74 100644
--- a/drivers/net/dm9000x.c
+++ b/drivers/net/dm9000x.c
@@ -342,6 +342,15 @@ static int dm9000_init(struct eth_device *dev, bd_t *bd)
DM9000_iow(DM9000_ISR, ISR_ROOS | ISR_ROS | ISR_PTS | ISR_PRS);
printf("MAC: %pM\n", dev->enetaddr);
+ if (!is_valid_ether_addr(dev->enetaddr)) {
+#ifdef CONFIG_RANDOM_MACADDR
+ printf("Bad MAC address (uninitialized EEPROM?), randomizing\n");
+ eth_random_enetaddr(dev->enetaddr);
+ printf("MAC: %pM\n", dev->enetaddr);
+#else
+ printf("WARNING: Bad MAC address (uninitialized EEPROM?)\n");
+#endif
+ }
/* fill device MAC address registers */
for (i = 0, oft = DM9000_PAR; i < 6; i++, oft++)
OpenPOWER on IntegriCloud