]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
Xilinx: ARM: net: Program the MAC address to hardware on boot
authorJoe Hershberger <joe.hershberger@ni.com>
Mon, 19 Mar 2012 23:18:26 +0000 (18:18 -0500)
committerJagan <jaganna@xilinx.com>
Thu, 31 May 2012 07:40:19 +0000 (13:10 +0530)
This will allow Linux to not make up a new MAC on each boot and never
keep the same IP address from boot to boot.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
board/xilinx/dfe/xgmac.c

index d64c4a82c3ccd9cb02970508af46ec02ab0773c4..e8453c4348b6859caf1539e07a5695c988723f23 100644 (file)
@@ -490,6 +490,14 @@ int Xgmac_rx(struct eth_device *dev)
        return 1;
 }
 
+static int Xgmac_write_hwaddr(struct eth_device *dev)
+{
+       /* Initialize the first MAC filter with our address */
+       XEmacPss_SetMacAddress((XEmacPss *)dev->priv, dev->enetaddr, 1);
+
+       return 0;
+}
+
 int Xgmac_register(bd_t * bis)
 {
        struct eth_device *dev;
@@ -510,6 +518,7 @@ int Xgmac_register(bd_t * bis)
        dev->halt = Xgmac_halt;
        dev->send = Xgmac_send;
        dev->recv = Xgmac_rx;
+       dev->write_hwaddr = Xgmac_write_hwaddr;
 
        eth_register(dev);