net: mtk_eth_soc: move PHY power up
The PHY power up is common to both configuration paths, so move it into the parent function. We need to do this for all serdes modes. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
12198c3a41
commit
6f38fffe21
@ -45,9 +45,6 @@ static void mtk_pcs_setup_mode_an(struct mtk_pcs *mpcs)
|
|||||||
|
|
||||||
regmap_update_bits(mpcs->regmap, SGMSYS_PCS_CONTROL_1,
|
regmap_update_bits(mpcs->regmap, SGMSYS_PCS_CONTROL_1,
|
||||||
SGMII_AN_RESTART, SGMII_AN_RESTART);
|
SGMII_AN_RESTART, SGMII_AN_RESTART);
|
||||||
|
|
||||||
regmap_update_bits(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL,
|
|
||||||
SGMII_PHYA_PWD, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For 1000BASE-X and 2500BASE-X interface modes, which operate at a
|
/* For 1000BASE-X and 2500BASE-X interface modes, which operate at a
|
||||||
@ -72,10 +69,6 @@ static void mtk_pcs_setup_mode_force(struct mtk_pcs *mpcs,
|
|||||||
regmap_update_bits(mpcs->regmap, SGMSYS_SGMII_MODE,
|
regmap_update_bits(mpcs->regmap, SGMSYS_SGMII_MODE,
|
||||||
SGMII_IF_MODE_MASK & ~SGMII_DUPLEX_FULL,
|
SGMII_IF_MODE_MASK & ~SGMII_DUPLEX_FULL,
|
||||||
SGMII_SPEED_1000);
|
SGMII_SPEED_1000);
|
||||||
|
|
||||||
/* Release PHYA power down state */
|
|
||||||
regmap_update_bits(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL,
|
|
||||||
SGMII_PHYA_PWD, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mtk_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
|
static int mtk_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
|
||||||
@ -91,6 +84,10 @@ static int mtk_pcs_config(struct phylink_pcs *pcs, unsigned int mode,
|
|||||||
else if (phylink_autoneg_inband(mode))
|
else if (phylink_autoneg_inband(mode))
|
||||||
mtk_pcs_setup_mode_an(mpcs);
|
mtk_pcs_setup_mode_an(mpcs);
|
||||||
|
|
||||||
|
/* Release PHYA power down state */
|
||||||
|
regmap_update_bits(mpcs->regmap, SGMSYS_QPHY_PWR_STATE_CTRL,
|
||||||
|
SGMII_PHYA_PWD, 0);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user