[net,1/3] net: lan743x: disable WOL upon resume to restore full data path operation

Message ID 20240226080934.46003-2-Raju.Lakkaraju@microchip.com
State New
Headers
Series net: lan743x: Fixes for multiple WOL related issues |

Commit Message

Raju Lakkaraju Feb. 26, 2024, 8:09 a.m. UTC
  In order for datapath to be restored to normal functionality after resume
we disable all wakeup events. Additionally we clear all W1C status bits by
writing 1's to them.

Fixes: 4d94282afd95 ("lan743x: Add power management support")
Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>
---
 drivers/net/ethernet/microchip/lan743x_main.c | 24 ++++++++++++++++++-
 drivers/net/ethernet/microchip/lan743x_main.h | 24 +++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)
  

Comments

Horatiu Vultur Feb. 26, 2024, 8:27 a.m. UTC | #1
The 02/26/2024 13:39, Raju Lakkaraju wrote:
> In order for datapath to be restored to normal functionality after resume
> we disable all wakeup events. Additionally we clear all W1C status bits by
> writing 1's to them.

Have you run get_maintainer.pl before sending this?
To me it seems that Eric and Paolo are missing from the email list.

> 
> Fixes: 4d94282afd95 ("lan743x: Add power management support")
> Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>
> ---
>  drivers/net/ethernet/microchip/lan743x_main.c | 24 ++++++++++++++++++-
>  drivers/net/ethernet/microchip/lan743x_main.h | 24 +++++++++++++++++++
>  2 files changed, 47 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
> index 45e209a7d083..5641b466d70d 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.c
> +++ b/drivers/net/ethernet/microchip/lan743x_main.c
> @@ -3550,7 +3550,7 @@ static void lan743x_pm_set_wol(struct lan743x_adapter *adapter)
>  
>  	/* clear wake settings */
>  	pmtctl = lan743x_csr_read(adapter, PMT_CTL);
> -	pmtctl |= PMT_CTL_WUPS_MASK_;
> +	pmtctl |= PMT_CTL_WUPS_MASK_ | PMT_CTL_RES_CLR_WKP_MASK_;
>  	pmtctl &= ~(PMT_CTL_GPIO_WAKEUP_EN_ | PMT_CTL_EEE_WAKEUP_EN_ |
>  		PMT_CTL_WOL_EN_ | PMT_CTL_MAC_D3_RX_CLK_OVR_ |
>  		PMT_CTL_RX_FCT_RFE_D3_CLK_OVR_ | PMT_CTL_ETH_PHY_WAKE_EN_);
> @@ -3685,6 +3685,7 @@ static int lan743x_pm_resume(struct device *dev)
>  	struct pci_dev *pdev = to_pci_dev(dev);
>  	struct net_device *netdev = pci_get_drvdata(pdev);
>  	struct lan743x_adapter *adapter = netdev_priv(netdev);
> +	int data;
>  	int ret;
>  
>  	pci_set_power_state(pdev, PCI_D0);
> @@ -3715,6 +3716,27 @@ static int lan743x_pm_resume(struct device *dev)
>  	netif_info(adapter, drv, adapter->netdev,
>  		   "Wakeup source : 0x%08X\n", ret);
>  
> +	/* Clear the wol configuration and status bits when system
> +	 * events occurs.
> +	 * The status bits are "Write One to Clear (W1C)"
> +	 */
> +	data = MAC_WUCSR_EEE_TX_WAKE_ | MAC_WUCSR_EEE_RX_WAKE_ |
> +	       MAC_WUCSR_RFE_WAKE_FR_ | MAC_WUCSR_PFDA_FR_ | MAC_WUCSR_WUFR_ |
> +	       MAC_WUCSR_MPR_ | MAC_WUCSR_BCAST_FR_;
> +	lan743x_csr_write(adapter, MAC_WUCSR, data);
> +
> +	data = MAC_WUCSR2_NS_RCD_ | MAC_WUCSR2_ARP_RCD_ |
> +	       MAC_WUCSR2_IPV6_TCPSYN_RCD_ | MAC_WUCSR2_IPV4_TCPSYN_RCD_;
> +	lan743x_csr_write(adapter, MAC_WUCSR2, data);
> +
> +	data = MAC_WK_SRC_ETH_PHY_WK_ | MAC_WK_SRC_IPV6_TCPSYN_RCD_WK_ |
> +	       MAC_WK_SRC_IPV4_TCPSYN_RCD_WK_ | MAC_WK_SRC_EEE_TX_WK_ |
> +	       MAC_WK_SRC_EEE_RX_WK_ | MAC_WK_SRC_RFE_FR_WK_ |
> +	       MAC_WK_SRC_PFDA_FR_WK_ | MAC_WK_SRC_MP_FR_WK_ |
> +	       MAC_WK_SRC_BCAST_FR_WK_ | MAC_WK_SRC_WU_FR_WK_ |
> +	       MAC_WK_SRC_WK_FR_SAVED_;
> +	lan743x_csr_write(adapter, MAC_WK_SRC, data);
> +
>  	return 0;
>  }
>  
> diff --git a/drivers/net/ethernet/microchip/lan743x_main.h b/drivers/net/ethernet/microchip/lan743x_main.h
> index be79cb0ae5af..77fc3abc1428 100644
> --- a/drivers/net/ethernet/microchip/lan743x_main.h
> +++ b/drivers/net/ethernet/microchip/lan743x_main.h
> @@ -60,6 +60,7 @@
>  #define PMT_CTL_RX_FCT_RFE_D3_CLK_OVR_		BIT(18)
>  #define PMT_CTL_GPIO_WAKEUP_EN_			BIT(15)
>  #define PMT_CTL_EEE_WAKEUP_EN_			BIT(13)
> +#define PMT_CTL_RES_CLR_WKP_MASK_		GENMASK(9, 8)
>  #define PMT_CTL_READY_				BIT(7)
>  #define PMT_CTL_ETH_PHY_RST_			BIT(4)
>  #define PMT_CTL_WOL_EN_				BIT(3)
> @@ -226,12 +227,31 @@
>  #define MAC_WUCSR				(0x140)
>  #define MAC_MP_SO_EN_				BIT(21)
>  #define MAC_WUCSR_RFE_WAKE_EN_			BIT(14)
> +#define MAC_WUCSR_EEE_TX_WAKE_			BIT(13)
> +#define MAC_WUCSR_EEE_RX_WAKE_			BIT(11)
> +#define MAC_WUCSR_RFE_WAKE_FR_			BIT(9)
> +#define MAC_WUCSR_PFDA_FR_			BIT(7)
> +#define MAC_WUCSR_WUFR_				BIT(6)
> +#define MAC_WUCSR_MPR_				BIT(5)
> +#define MAC_WUCSR_BCAST_FR_			BIT(4)
>  #define MAC_WUCSR_PFDA_EN_			BIT(3)
>  #define MAC_WUCSR_WAKE_EN_			BIT(2)
>  #define MAC_WUCSR_MPEN_				BIT(1)
>  #define MAC_WUCSR_BCST_EN_			BIT(0)
>  
>  #define MAC_WK_SRC				(0x144)
> +#define MAC_WK_SRC_ETH_PHY_WK_			BIT(17)
> +#define MAC_WK_SRC_IPV6_TCPSYN_RCD_WK_		BIT(16)
> +#define MAC_WK_SRC_IPV4_TCPSYN_RCD_WK_		BIT(15)
> +#define MAC_WK_SRC_EEE_TX_WK_			BIT(14)
> +#define MAC_WK_SRC_EEE_RX_WK_			BIT(13)
> +#define MAC_WK_SRC_RFE_FR_WK_			BIT(12)
> +#define MAC_WK_SRC_PFDA_FR_WK_			BIT(11)
> +#define MAC_WK_SRC_MP_FR_WK_			BIT(10)
> +#define MAC_WK_SRC_BCAST_FR_WK_			BIT(9)
> +#define MAC_WK_SRC_WU_FR_WK_			BIT(8)
> +#define MAC_WK_SRC_WK_FR_SAVED_			BIT(7)
> +
>  #define MAC_MP_SO_HI				(0x148)
>  #define MAC_MP_SO_LO				(0x14C)
>  
> @@ -294,6 +314,10 @@
>  #define RFE_INDX(index)			(0x580 + (index << 2))
>  
>  #define MAC_WUCSR2			(0x600)
> +#define MAC_WUCSR2_NS_RCD_		BIT(7)
> +#define MAC_WUCSR2_ARP_RCD_		BIT(6)
> +#define MAC_WUCSR2_IPV6_TCPSYN_RCD_	BIT(5)
> +#define MAC_WUCSR2_IPV4_TCPSYN_RCD_	BIT(4)
>  
>  #define SGMII_ACC			(0x720)
>  #define SGMII_ACC_SGMII_BZY_		BIT(31)
> -- 
> 2.34.1
>
  
Andrew Lunn Feb. 27, 2024, 1:38 a.m. UTC | #2
On Mon, Feb 26, 2024 at 01:39:32PM +0530, Raju Lakkaraju wrote:
> In order for datapath to be restored to normal functionality after resume
> we disable all wakeup events. Additionally we clear all W1C status bits by
> writing 1's to them.

Just to make sure i'm understanding this correctly, you are just
clearing that there was been a WoL wakeup. The WoL configuration is
not cleared, so i could suspend the device again and wake it up with
WoL. There is no need for me to use ethtool, the WoL configuration is
preserved.

	Andrew
  
Raju Lakkaraju Feb. 29, 2024, 4:51 a.m. UTC | #3
Hi Horatiu,

Thank you for review comments.

> -----Original Message-----
> From: Horatiu Vultur - M31836 <Horatiu.Vultur@microchip.com>
> Sent: Monday, February 26, 2024 1:57 PM
> To: Raju Lakkaraju - I30499 <Raju.Lakkaraju@microchip.com>
> Cc: netdev@vger.kernel.org; davem@davemloft.net; kuba@kernel.org; linux-
> kernel@vger.kernel.org; Bryan Whitehead - C21958
> <Bryan.Whitehead@microchip.com>; richardcochran@gmail.com;
> UNGLinuxDriver <UNGLinuxDriver@microchip.com>
> Subject: Re: [PATCH net 1/3] net: lan743x: disable WOL upon resume to
> restore full data path operation
> 
> The 02/26/2024 13:39, Raju Lakkaraju wrote:
> > In order for datapath to be restored to normal functionality after
> > resume we disable all wakeup events. Additionally we clear all W1C
> > status bits by writing 1's to them.
> 
> Have you run get_maintainer.pl before sending this?
> To me it seems that Eric and Paolo are missing from the email list.
> 

I did not notice. 
Sure. I will add missing members in my next mail.

> >
> > Fixes: 4d94282afd95 ("lan743x: Add power management support")
> > Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microchip.com>
> > ---
> >  drivers/net/ethernet/microchip/lan743x_main.c | 24
> > ++++++++++++++++++-  drivers/net/ethernet/microchip/lan743x_main.h |
> > 24 +++++++++++++++++++
> >  2 files changed, 47 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/microchip/lan743x_main.c
> > b/drivers/net/ethernet/microchip/lan743x_main.c
> > index 45e209a7d083..5641b466d70d 100644
> > --- a/drivers/net/ethernet/microchip/lan743x_main.c
> > +++ b/drivers/net/ethernet/microchip/lan743x_main.c
> > @@ -3550,7 +3550,7 @@ static void lan743x_pm_set_wol(struct
> > lan743x_adapter *adapter)
> >
> >  	/* clear wake settings */
> >  	pmtctl = lan743x_csr_read(adapter, PMT_CTL);
> > -	pmtctl |= PMT_CTL_WUPS_MASK_;
> > +	pmtctl |= PMT_CTL_WUPS_MASK_ |
> PMT_CTL_RES_CLR_WKP_MASK_;
> >  	pmtctl &= ~(PMT_CTL_GPIO_WAKEUP_EN_ |
> PMT_CTL_EEE_WAKEUP_EN_ |
> >  		PMT_CTL_WOL_EN_ | PMT_CTL_MAC_D3_RX_CLK_OVR_ |
> >  		PMT_CTL_RX_FCT_RFE_D3_CLK_OVR_ |
> PMT_CTL_ETH_PHY_WAKE_EN_); @@
> > -3685,6 +3685,7 @@ static int lan743x_pm_resume(struct device *dev)
> >  	struct pci_dev *pdev = to_pci_dev(dev);
> >  	struct net_device *netdev = pci_get_drvdata(pdev);
> >  	struct lan743x_adapter *adapter = netdev_priv(netdev);
> > +	int data;
> >  	int ret;
> >
> >  	pci_set_power_state(pdev, PCI_D0);
> > @@ -3715,6 +3716,27 @@ static int lan743x_pm_resume(struct device
> *dev)
> >  	netif_info(adapter, drv, adapter->netdev,
> >  		   "Wakeup source : 0x%08X\n", ret);
> >
> > +	/* Clear the wol configuration and status bits when system
> > +	 * events occurs.
> > +	 * The status bits are "Write One to Clear (W1C)"
> > +	 */
> > +	data = MAC_WUCSR_EEE_TX_WAKE_ |
> MAC_WUCSR_EEE_RX_WAKE_ |
> > +	       MAC_WUCSR_RFE_WAKE_FR_ | MAC_WUCSR_PFDA_FR_ |
> MAC_WUCSR_WUFR_ |
> > +	       MAC_WUCSR_MPR_ | MAC_WUCSR_BCAST_FR_;
> > +	lan743x_csr_write(adapter, MAC_WUCSR, data);
> > +
> > +	data = MAC_WUCSR2_NS_RCD_ | MAC_WUCSR2_ARP_RCD_ |
> > +	       MAC_WUCSR2_IPV6_TCPSYN_RCD_ |
> MAC_WUCSR2_IPV4_TCPSYN_RCD_;
> > +	lan743x_csr_write(adapter, MAC_WUCSR2, data);
> > +
> > +	data = MAC_WK_SRC_ETH_PHY_WK_ |
> MAC_WK_SRC_IPV6_TCPSYN_RCD_WK_ |
> > +	       MAC_WK_SRC_IPV4_TCPSYN_RCD_WK_ |
> MAC_WK_SRC_EEE_TX_WK_ |
> > +	       MAC_WK_SRC_EEE_RX_WK_ | MAC_WK_SRC_RFE_FR_WK_ |
> > +	       MAC_WK_SRC_PFDA_FR_WK_ | MAC_WK_SRC_MP_FR_WK_ |
> > +	       MAC_WK_SRC_BCAST_FR_WK_ | MAC_WK_SRC_WU_FR_WK_ |
> > +	       MAC_WK_SRC_WK_FR_SAVED_;
> > +	lan743x_csr_write(adapter, MAC_WK_SRC, data);
> > +
> >  	return 0;
> >  }
> >
> > diff --git a/drivers/net/ethernet/microchip/lan743x_main.h
> > b/drivers/net/ethernet/microchip/lan743x_main.h
> > index be79cb0ae5af..77fc3abc1428 100644
> > --- a/drivers/net/ethernet/microchip/lan743x_main.h
> > +++ b/drivers/net/ethernet/microchip/lan743x_main.h
> > @@ -60,6 +60,7 @@
> >  #define PMT_CTL_RX_FCT_RFE_D3_CLK_OVR_		BIT(18)
> >  #define PMT_CTL_GPIO_WAKEUP_EN_			BIT(15)
> >  #define PMT_CTL_EEE_WAKEUP_EN_			BIT(13)
> > +#define PMT_CTL_RES_CLR_WKP_MASK_		GENMASK(9, 8)
> >  #define PMT_CTL_READY_				BIT(7)
> >  #define PMT_CTL_ETH_PHY_RST_			BIT(4)
> >  #define PMT_CTL_WOL_EN_				BIT(3)
> > @@ -226,12 +227,31 @@
> >  #define MAC_WUCSR				(0x140)
> >  #define MAC_MP_SO_EN_				BIT(21)
> >  #define MAC_WUCSR_RFE_WAKE_EN_			BIT(14)
> > +#define MAC_WUCSR_EEE_TX_WAKE_			BIT(13)
> > +#define MAC_WUCSR_EEE_RX_WAKE_			BIT(11)
> > +#define MAC_WUCSR_RFE_WAKE_FR_			BIT(9)
> > +#define MAC_WUCSR_PFDA_FR_			BIT(7)
> > +#define MAC_WUCSR_WUFR_				BIT(6)
> > +#define MAC_WUCSR_MPR_				BIT(5)
> > +#define MAC_WUCSR_BCAST_FR_			BIT(4)
> >  #define MAC_WUCSR_PFDA_EN_			BIT(3)
> >  #define MAC_WUCSR_WAKE_EN_			BIT(2)
> >  #define MAC_WUCSR_MPEN_				BIT(1)
> >  #define MAC_WUCSR_BCST_EN_			BIT(0)
> >
> >  #define MAC_WK_SRC				(0x144)
> > +#define MAC_WK_SRC_ETH_PHY_WK_			BIT(17)
> > +#define MAC_WK_SRC_IPV6_TCPSYN_RCD_WK_		BIT(16)
> > +#define MAC_WK_SRC_IPV4_TCPSYN_RCD_WK_		BIT(15)
> > +#define MAC_WK_SRC_EEE_TX_WK_			BIT(14)
> > +#define MAC_WK_SRC_EEE_RX_WK_			BIT(13)
> > +#define MAC_WK_SRC_RFE_FR_WK_			BIT(12)
> > +#define MAC_WK_SRC_PFDA_FR_WK_			BIT(11)
> > +#define MAC_WK_SRC_MP_FR_WK_			BIT(10)
> > +#define MAC_WK_SRC_BCAST_FR_WK_			BIT(9)
> > +#define MAC_WK_SRC_WU_FR_WK_			BIT(8)
> > +#define MAC_WK_SRC_WK_FR_SAVED_			BIT(7)
> > +
> >  #define MAC_MP_SO_HI				(0x148)
> >  #define MAC_MP_SO_LO				(0x14C)
> >
> > @@ -294,6 +314,10 @@
> >  #define RFE_INDX(index)			(0x580 + (index << 2))
> >
> >  #define MAC_WUCSR2			(0x600)
> > +#define MAC_WUCSR2_NS_RCD_		BIT(7)
> > +#define MAC_WUCSR2_ARP_RCD_		BIT(6)
> > +#define MAC_WUCSR2_IPV6_TCPSYN_RCD_	BIT(5)
> > +#define MAC_WUCSR2_IPV4_TCPSYN_RCD_	BIT(4)
> >
> >  #define SGMII_ACC			(0x720)
> >  #define SGMII_ACC_SGMII_BZY_		BIT(31)
> > --
> > 2.34.1
> >
> 
> --
> /Horatiu

Thanks,
Raju
  
Raju Lakkaraju Feb. 29, 2024, 4:57 a.m. UTC | #4
Hi Andrew,

Thank you for review comments.

> -----Original Message-----
> From: Andrew Lunn <andrew@lunn.ch>
> Sent: Tuesday, February 27, 2024 7:09 AM
> To: Raju Lakkaraju - I30499 <Raju.Lakkaraju@microchip.com>
> Cc: netdev@vger.kernel.org; davem@davemloft.net; kuba@kernel.org; linux-
> kernel@vger.kernel.org; Bryan Whitehead - C21958
> <Bryan.Whitehead@microchip.com>; richardcochran@gmail.com;
> UNGLinuxDriver <UNGLinuxDriver@microchip.com>
> Subject: Re: [PATCH net 1/3] net: lan743x: disable WOL upon resume to
> restore full data path operation
> 
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
> 
> On Mon, Feb 26, 2024 at 01:39:32PM +0530, Raju Lakkaraju wrote:
> > In order for datapath to be restored to normal functionality after
> > resume we disable all wakeup events. Additionally we clear all W1C
> > status bits by writing 1's to them.
> 
> Just to make sure i'm understanding this correctly, you are just clearing that
> there was been a WoL wakeup. The WoL configuration is not cleared, so i
> could suspend the device again and wake it up with WoL. There is no need for
> me to use ethtool, the WoL configuration is preserved.

Yes. Your understanding is correct.
WoL configuration is not cleared. 
This clean-up helps us when resume from sleep due to system events.
There is no need to use ethtool's configure WOL again.

> 
>         Andrew

Thanks,
Raju
  

Patch

diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index 45e209a7d083..5641b466d70d 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -3550,7 +3550,7 @@  static void lan743x_pm_set_wol(struct lan743x_adapter *adapter)
 
 	/* clear wake settings */
 	pmtctl = lan743x_csr_read(adapter, PMT_CTL);
-	pmtctl |= PMT_CTL_WUPS_MASK_;
+	pmtctl |= PMT_CTL_WUPS_MASK_ | PMT_CTL_RES_CLR_WKP_MASK_;
 	pmtctl &= ~(PMT_CTL_GPIO_WAKEUP_EN_ | PMT_CTL_EEE_WAKEUP_EN_ |
 		PMT_CTL_WOL_EN_ | PMT_CTL_MAC_D3_RX_CLK_OVR_ |
 		PMT_CTL_RX_FCT_RFE_D3_CLK_OVR_ | PMT_CTL_ETH_PHY_WAKE_EN_);
@@ -3685,6 +3685,7 @@  static int lan743x_pm_resume(struct device *dev)
 	struct pci_dev *pdev = to_pci_dev(dev);
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct lan743x_adapter *adapter = netdev_priv(netdev);
+	int data;
 	int ret;
 
 	pci_set_power_state(pdev, PCI_D0);
@@ -3715,6 +3716,27 @@  static int lan743x_pm_resume(struct device *dev)
 	netif_info(adapter, drv, adapter->netdev,
 		   "Wakeup source : 0x%08X\n", ret);
 
+	/* Clear the wol configuration and status bits when system
+	 * events occurs.
+	 * The status bits are "Write One to Clear (W1C)"
+	 */
+	data = MAC_WUCSR_EEE_TX_WAKE_ | MAC_WUCSR_EEE_RX_WAKE_ |
+	       MAC_WUCSR_RFE_WAKE_FR_ | MAC_WUCSR_PFDA_FR_ | MAC_WUCSR_WUFR_ |
+	       MAC_WUCSR_MPR_ | MAC_WUCSR_BCAST_FR_;
+	lan743x_csr_write(adapter, MAC_WUCSR, data);
+
+	data = MAC_WUCSR2_NS_RCD_ | MAC_WUCSR2_ARP_RCD_ |
+	       MAC_WUCSR2_IPV6_TCPSYN_RCD_ | MAC_WUCSR2_IPV4_TCPSYN_RCD_;
+	lan743x_csr_write(adapter, MAC_WUCSR2, data);
+
+	data = MAC_WK_SRC_ETH_PHY_WK_ | MAC_WK_SRC_IPV6_TCPSYN_RCD_WK_ |
+	       MAC_WK_SRC_IPV4_TCPSYN_RCD_WK_ | MAC_WK_SRC_EEE_TX_WK_ |
+	       MAC_WK_SRC_EEE_RX_WK_ | MAC_WK_SRC_RFE_FR_WK_ |
+	       MAC_WK_SRC_PFDA_FR_WK_ | MAC_WK_SRC_MP_FR_WK_ |
+	       MAC_WK_SRC_BCAST_FR_WK_ | MAC_WK_SRC_WU_FR_WK_ |
+	       MAC_WK_SRC_WK_FR_SAVED_;
+	lan743x_csr_write(adapter, MAC_WK_SRC, data);
+
 	return 0;
 }
 
diff --git a/drivers/net/ethernet/microchip/lan743x_main.h b/drivers/net/ethernet/microchip/lan743x_main.h
index be79cb0ae5af..77fc3abc1428 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.h
+++ b/drivers/net/ethernet/microchip/lan743x_main.h
@@ -60,6 +60,7 @@ 
 #define PMT_CTL_RX_FCT_RFE_D3_CLK_OVR_		BIT(18)
 #define PMT_CTL_GPIO_WAKEUP_EN_			BIT(15)
 #define PMT_CTL_EEE_WAKEUP_EN_			BIT(13)
+#define PMT_CTL_RES_CLR_WKP_MASK_		GENMASK(9, 8)
 #define PMT_CTL_READY_				BIT(7)
 #define PMT_CTL_ETH_PHY_RST_			BIT(4)
 #define PMT_CTL_WOL_EN_				BIT(3)
@@ -226,12 +227,31 @@ 
 #define MAC_WUCSR				(0x140)
 #define MAC_MP_SO_EN_				BIT(21)
 #define MAC_WUCSR_RFE_WAKE_EN_			BIT(14)
+#define MAC_WUCSR_EEE_TX_WAKE_			BIT(13)
+#define MAC_WUCSR_EEE_RX_WAKE_			BIT(11)
+#define MAC_WUCSR_RFE_WAKE_FR_			BIT(9)
+#define MAC_WUCSR_PFDA_FR_			BIT(7)
+#define MAC_WUCSR_WUFR_				BIT(6)
+#define MAC_WUCSR_MPR_				BIT(5)
+#define MAC_WUCSR_BCAST_FR_			BIT(4)
 #define MAC_WUCSR_PFDA_EN_			BIT(3)
 #define MAC_WUCSR_WAKE_EN_			BIT(2)
 #define MAC_WUCSR_MPEN_				BIT(1)
 #define MAC_WUCSR_BCST_EN_			BIT(0)
 
 #define MAC_WK_SRC				(0x144)
+#define MAC_WK_SRC_ETH_PHY_WK_			BIT(17)
+#define MAC_WK_SRC_IPV6_TCPSYN_RCD_WK_		BIT(16)
+#define MAC_WK_SRC_IPV4_TCPSYN_RCD_WK_		BIT(15)
+#define MAC_WK_SRC_EEE_TX_WK_			BIT(14)
+#define MAC_WK_SRC_EEE_RX_WK_			BIT(13)
+#define MAC_WK_SRC_RFE_FR_WK_			BIT(12)
+#define MAC_WK_SRC_PFDA_FR_WK_			BIT(11)
+#define MAC_WK_SRC_MP_FR_WK_			BIT(10)
+#define MAC_WK_SRC_BCAST_FR_WK_			BIT(9)
+#define MAC_WK_SRC_WU_FR_WK_			BIT(8)
+#define MAC_WK_SRC_WK_FR_SAVED_			BIT(7)
+
 #define MAC_MP_SO_HI				(0x148)
 #define MAC_MP_SO_LO				(0x14C)
 
@@ -294,6 +314,10 @@ 
 #define RFE_INDX(index)			(0x580 + (index << 2))
 
 #define MAC_WUCSR2			(0x600)
+#define MAC_WUCSR2_NS_RCD_		BIT(7)
+#define MAC_WUCSR2_ARP_RCD_		BIT(6)
+#define MAC_WUCSR2_IPV6_TCPSYN_RCD_	BIT(5)
+#define MAC_WUCSR2_IPV4_TCPSYN_RCD_	BIT(4)
 
 #define SGMII_ACC			(0x720)
 #define SGMII_ACC_SGMII_BZY_		BIT(31)