The network controller mac resets hardware address stored in MAC_HI and MAC_LO
registers if mac is resetted. So, hw mac address needs to be restored in case
mac is explicitly resetted from driver.
Signed-off-by: Vipin Kumar <vipin.kumar@st.com>
Signed-off-by: Amit Virdi <amit.virdi@st.com>
if (mac_reset(dev) < 0)
return -1;
+ /* Resore the HW MAC address as it has been lost during MAC reset */
+ dw_write_hwaddr(dev);
+
writel(FIXEDBURST | PRIORXTX_41 | BURST_16,
&dma_p->busmode);
writel(miiaddr | MII_CLKRANGE_150_250M | MII_BUSY, &mac_p->miiaddr);
do {
- if (!(readl(&mac_p->miiaddr) & MII_BUSY))
+ if (!(readl(&mac_p->miiaddr) & MII_BUSY)) {
ret = 0;
+ break;
+ }
udelay(1000);
} while (timeout--);