diff options
author | Ed Blake <ed.blake@sondrel.com> | 2017-09-26 06:44:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-09-28 13:19:02 -0400 |
commit | 1579f678fb4397f9e439d2e373d4ade036c673b4 (patch) | |
tree | de58ed5329900dae5c1c437edf167533a1da750c | |
parent | 06d7a1b932c26afe2c0a1f4520ddd417d8eeda79 (diff) |
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>
-rw-r--r-- | drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index c4407e8e39a3..2f7d7ec59962 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | |||
@@ -296,6 +296,7 @@ static void dwmac4_pmt(struct mac_device_info *hw, unsigned long mode) | |||
296 | { | 296 | { |
297 | void __iomem *ioaddr = hw->pcsr; | 297 | void __iomem *ioaddr = hw->pcsr; |
298 | unsigned int pmt = 0; | 298 | unsigned int pmt = 0; |
299 | u32 config; | ||
299 | 300 | ||
300 | if (mode & WAKE_MAGIC) { | 301 | if (mode & WAKE_MAGIC) { |
301 | pr_debug("GMAC: WOL Magic frame\n"); | 302 | pr_debug("GMAC: WOL Magic frame\n"); |
@@ -306,6 +307,12 @@ static void dwmac4_pmt(struct mac_device_info *hw, unsigned long mode) | |||
306 | pmt |= power_down | global_unicast | wake_up_frame_en; | 307 | pmt |= power_down | global_unicast | wake_up_frame_en; |
307 | } | 308 | } |
308 | 309 | ||
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 | } | ||
309 | writel(pmt, ioaddr + GMAC_PMT); | 316 | writel(pmt, ioaddr + GMAC_PMT); |
310 | } | 317 | } |
311 | 318 | ||