]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: gem: Set mac address in init sequence
authorRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Thu, 12 Mar 2015 09:17:31 +0000 (14:47 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 19 Mar 2015 08:16:00 +0000 (09:16 +0100)
Keep enetaddr and mac hw address in sync.
In default config mismatch in received frame
dest address and mac hw address results
in drop of unicast frames.

This patch will be reverted when mainline version
fix this in the core that's why it is just temporary
solution for now.
http://lists.denx.de/pipermail/u-boot/2015-March/208211.html

Signed-off-by: Radhey Shyam Pandey <radheys@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/zynq_gem.c

index 6b316f0a752bd007f98517583550b289b2436325..2ad16b81da4500d2ee084e8301cc2be34f96cca5 100644 (file)
@@ -455,6 +455,14 @@ static int zynq_gem_init(struct eth_device *dev, bd_t * bis)
        writel(ZYNQ_GEM_NWCFG_INIT | ZYNQ_GEM_NWCFG_SPEED100, &regs->nwcfg);
 #endif
 
+       /* set hardware address because of ... */
+       if (!is_valid_ether_addr(dev->enetaddr)) {
+               printf("%s: mac address is not valid\n", dev->name);
+               return -1;
+       }
+
+       zynq_gem_setup_mac(dev);
+
        setbits_le32(&regs->nwctrl, ZYNQ_GEM_NWCTRL_RXEN_MASK |
                                        ZYNQ_GEM_NWCTRL_TXEN_MASK);