fec_mxc: set ethaddr if fuses burned and not previously set
authorEric Nelson <eric.nelson@boundarydevices.com>
Fri, 2 Aug 2013 17:37:00 +0000 (10:37 -0700)
committerStefano Babic <sbabic@denx.de>
Wed, 21 Aug 2013 17:20:28 +0000 (19:20 +0200)
Without this change, the following message is generated:
Warning: FEC using MAC address from net device

See doc/README.enetaddr for details.

Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
drivers/net/fec_mxc.c

index e14a3598ca3e91465cafd2d613a84d807ca1ffd1..690e5724b4e57418c50a17306d8b340857ec15a0 100644 (file)
@@ -980,6 +980,8 @@ static int fec_probe(bd_t *bd, int dev_id, uint32_t base_addr,
        if (fec_get_hwaddr(edev, dev_id, ethaddr) == 0) {
                debug("got MAC%d address from fuse: %pM\n", dev_id, ethaddr);
                memcpy(edev->enetaddr, ethaddr, 6);
+               if (!getenv("ethaddr"))
+                       eth_setenv_enetaddr("ethaddr", ethaddr);
        }
        return ret;
 err3: