Skip to content

Commit a46e901

Browse files
Revanth Kumar Uppaladavem330
Revanth Kumar Uppala
authored andcommitted
net: stmmac: Power up SERDES after the PHY link
The Tegra MGBE ethernet controller requires that the SERDES link is powered-up after the PHY link is up, otherwise the link fails to become ready following a resume from suspend. Add a variable to indicate that the SERDES link must be powered-up after the PHY link. Signed-off-by: Revanth Kumar Uppala <[email protected]> Signed-off-by: Jon Hunter <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3216349 commit a46e901

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,9 @@ static void stmmac_mac_link_up(struct phylink_config *config,
988988
struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev));
989989
u32 old_ctrl, ctrl;
990990

991+
if (priv->plat->serdes_up_after_phy_linkup && priv->plat->serdes_powerup)
992+
priv->plat->serdes_powerup(priv->dev, priv->plat->bsp_priv);
993+
991994
old_ctrl = readl(priv->ioaddr + MAC_CTRL_REG);
992995
ctrl = old_ctrl & ~priv->hw->link.speed_mask;
993996

@@ -3809,7 +3812,7 @@ static int __stmmac_open(struct net_device *dev,
38093812

38103813
stmmac_reset_queues_param(priv);
38113814

3812-
if (priv->plat->serdes_powerup) {
3815+
if (!priv->plat->serdes_up_after_phy_linkup && priv->plat->serdes_powerup) {
38133816
ret = priv->plat->serdes_powerup(dev, priv->plat->bsp_priv);
38143817
if (ret < 0) {
38153818
netdev_err(priv->dev, "%s: Serdes powerup failed\n",
@@ -7518,7 +7521,7 @@ int stmmac_resume(struct device *dev)
75187521
stmmac_mdio_reset(priv->mii);
75197522
}
75207523

7521-
if (priv->plat->serdes_powerup) {
7524+
if (!priv->plat->serdes_up_after_phy_linkup && priv->plat->serdes_powerup) {
75227525
ret = priv->plat->serdes_powerup(ndev,
75237526
priv->plat->bsp_priv);
75247527

include/linux/stmmac.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,5 +271,6 @@ struct plat_stmmacenet_data {
271271
int msi_tx_base_vec;
272272
bool use_phy_wol;
273273
bool sph_disable;
274+
bool serdes_up_after_phy_linkup;
274275
};
275276
#endif

0 commit comments

Comments
 (0)