Skip to content

Commit 1579f67

Browse files
ed-blake1davem330
authored andcommitted
net: stmmac: dwmac4: Re-enable MAC Rx before powering down
Re-enable the MAC receiver by setting CONFIG_RE before powering down, as instructed in section 6.3.5.1 of [1]. Without this the MAC fails to receive WoL packets and never wakes up. [1] DWC Ethernet QoS Databook 4.10a October 2014 Signed-off-by: Ed Blake <ed.blake@sondrel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 06d7a1b commit 1579f67

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ static void dwmac4_pmt(struct mac_device_info *hw, unsigned long mode)
296296
{
297297
void __iomem *ioaddr = hw->pcsr;
298298
unsigned int pmt = 0;
299+
u32 config;
299300

300301
if (mode & WAKE_MAGIC) {
301302
pr_debug("GMAC: WOL Magic frame\n");
@@ -306,6 +307,12 @@ static void dwmac4_pmt(struct mac_device_info *hw, unsigned long mode)
306307
pmt |= power_down | global_unicast | wake_up_frame_en;
307308
}
308309

310+
if (pmt) {
311+
/* The receiver must be enabled for WOL before powering down */
312+
config = readl(ioaddr + GMAC_CONFIG);
313+
config |= GMAC_CONFIG_RE;
314+
writel(config, ioaddr + GMAC_CONFIG);
315+
}
309316
writel(pmt, ioaddr + GMAC_PMT);
310317
}
311318

0 commit comments

Comments
 (0)