[PATCH RFC WIP 2/2] net: stmmac: dwmac-rk: add support for PHY wake on LAN

Javier Carrasco javier.carrasco at wolfvision.net
Thu Nov 23 04:14:14 PST 2023


PHY WOL will be used if the rockhip,phy-wol property is defined. MAC WOL
will be preferred otherwise.

Signed-off-by: Javier Carrasco <javier.carrasco at wolfvision.net>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index 382e8de1255d..c543566b4f90 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -1694,6 +1694,11 @@ static struct rk_priv_data *rk_gmac_setup(struct platform_device *pdev,
 	dev_info(dev, "integrated PHY? (%s).\n",
 		 bsp_priv->integrated_phy ? "yes" : "no");
 
+	if (of_property_read_bool(dev->of_node, "rockchip,phy-wol"))
+		plat->flags |= STMMAC_FLAG_USE_PHY_WOL;
+	else
+		plat->flags &= ~STMMAC_FLAG_USE_PHY_WOL;
+
 	bsp_priv->pdev = pdev;
 
 	return bsp_priv;

-- 
2.39.2




More information about the Linux-rockchip mailing list