From: Radhey Shyam Pandey Date: Thu, 12 Mar 2015 09:17:31 +0000 (+0530) Subject: net: gem: Set mac address in init sequence X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=37a0944bcecc8efde371368c870a982c972565fd;p=thirdparty%2Fu-boot.git net: gem: Set mac address in init sequence 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 Signed-off-by: Michal Simek --- diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index 6b316f0a752..2ad16b81da4 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -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, ®s->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(®s->nwctrl, ZYNQ_GEM_NWCTRL_RXEN_MASK | ZYNQ_GEM_NWCTRL_TXEN_MASK);