Commit 1579f678 authored by Ed Blake's avatar Ed Blake Committed by David S. Miller

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: default avatarEd Blake <ed.blake@sondrel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 06d7a1b9
...@@ -296,6 +296,7 @@ static void dwmac4_pmt(struct mac_device_info *hw, unsigned long mode) ...@@ -296,6 +296,7 @@ static void dwmac4_pmt(struct mac_device_info *hw, unsigned long mode)
{ {
void __iomem *ioaddr = hw->pcsr; void __iomem *ioaddr = hw->pcsr;
unsigned int pmt = 0; unsigned int pmt = 0;
u32 config;
if (mode & WAKE_MAGIC) { if (mode & WAKE_MAGIC) {
pr_debug("GMAC: WOL Magic frame\n"); pr_debug("GMAC: WOL Magic frame\n");
...@@ -306,6 +307,12 @@ static void dwmac4_pmt(struct mac_device_info *hw, unsigned long mode) ...@@ -306,6 +307,12 @@ static void dwmac4_pmt(struct mac_device_info *hw, unsigned long mode)
pmt |= power_down | global_unicast | wake_up_frame_en; pmt |= power_down | global_unicast | wake_up_frame_en;
} }
if (pmt) {
/* The receiver must be enabled for WOL before powering down */
config = readl(ioaddr + GMAC_CONFIG);
config |= GMAC_CONFIG_RE;
writel(config, ioaddr + GMAC_CONFIG);
}
writel(pmt, ioaddr + GMAC_PMT); writel(pmt, ioaddr + GMAC_PMT);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment