Skip to content

Commit

Permalink
stmmac: intel: Enable SERDES PHY rx clk for PSE
Browse files Browse the repository at this point in the history
EHL PSE SGMII mode requires to ungate the SERDES PHY rx clk for power up
sequence and vice versa.

Signed-off-by: Voon Weifeng <weifeng.voon@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
wvoon authored and davem330 committed Apr 7, 2021
1 parent 56f15e2 commit 017d625
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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);

Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/stmicro/stmmac/dwmac-intel.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 017d625

Please sign in to comment.