Skip to contentSkip to conversation

stmmac: intel: Enable SERDES PHY rx clk for PSE

PATCH Applied Voon Weifeng 2 participants 2 messages Apr 6, 2021 – Apr 7, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 stmmac: intel: Enable SERDES PHY rx clk for PSE

EHL PSE SGMII mode requires to ungate the SERDES PHY rx clk for power up sequence and vice versa.

---
Changes:
v1 -> v2
-change subject from "net: intel" to "stmmac: intel"

---
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c | 10 ++++++++++
 drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h |  1 +
 2 files changed, 11 insertions(+)
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c +10 -0
index add95e20548d..a4fec5fe0779 100644
@@ -153,6 +153,11 @@ static int intel_serdes_powerup(struct net_device *ndev, void *priv_data)
 		return data;
 	}
 
+	/* PSE only - ungate SGMII PHY Rx Clock */
+	if (intel_priv->is_pse)
+		mdiobus_modify(priv->mii, serdes_phy_addr, SERDES_GCR0,
+			       0, SERDES_PHY_RX_CLK);
+
 	return 0;
 }
 
@@ -168,6 +173,11 @@ static void intel_serdes_powerdown(struct net_device *ndev, void *intel_data)
 
 	serdes_phy_addr = intel_priv->mdio_adhoc_addr;
 
+	/* PSE only - gate SGMII PHY Rx Clock */
+	if (intel_priv->is_pse)
+		mdiobus_modify(priv->mii, serdes_phy_addr, SERDES_GCR0,
+			       SERDES_PHY_RX_CLK, 0);
+
 	/*  move power state to P3 */
 	data = mdiobus_read(priv->mii, serdes_phy_addr, SERDES_GCR0);
 
drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h +1 -0
index e723096c0b15..542acb8ce467 100644
@@ -14,6 +14,7 @@
 
 /* SERDES defines */
 #define SERDES_PLL_CLK		BIT(0)		/* PLL clk valid signal */
+#define SERDES_PHY_RX_CLK	BIT(1)		/* PSE SGMII PHY rx clk */
 #define SERDES_RST		BIT(2)		/* Serdes Reset */
 #define SERDES_PWR_ST_MASK	GENMASK(6, 4)	/* Serdes Power state*/
 #define SERDES_PWR_ST_SHIFT	4
Signature · 1 line
2.17.1
#1 lore raw
This patch was applied to netdev/net-next.git (refs/heads/master):

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

Quoted 10 lines · On Tue, 6 Apr 2021 09:32:50 +0800 you wrote:

EHL PSE SGMII mode requires to ungate the SERDES PHY rx clk for power up sequence and vice versa.

---
Changes:
v1 -> v2
-change subject from "net: intel" to "stmmac: intel"

[...]

Here is the summary with links:
- [v2,net-next] stmmac: intel: Enable SERDES PHY rx clk for PSE

    https://git.kernel.org/netdev/net-next/c/017d6250ad71

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html