diff options
| author | Christian Marangi <[email protected]> | 2025-09-20 18:09:42 +0200 |
|---|---|---|
| committer | Jerome Forissier <[email protected]> | 2025-10-22 11:16:10 +0200 |
| commit | 85f3d070e27c3024c6d2c58ecbfd0ecb2343cc0c (patch) | |
| tree | a1783d8c383f161676c61112f71f26241d7f50ff | |
| parent | 9b2e1079e7db35155710a401eb52007abe449ad7 (diff) | |
net: mediatek: mt7988: restore PHY page on PHY setting exit
On exiting the phy_setting function for MT7988, the PHY page is never
restored to Page 0. This can cause all kind of problem with reading the
status of the PHY at runtime.
Correctly restore PHY page on exiting the PHY setting function.
Signed-off-by: Christian Marangi <[email protected]>
| -rw-r--r-- | drivers/net/mtk_eth/mt7988.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/mtk_eth/mt7988.c b/drivers/net/mtk_eth/mt7988.c index 87b6ed30cd0..06bbe049da3 100644 --- a/drivers/net/mtk_eth/mt7988.c +++ b/drivers/net/mtk_eth/mt7988.c @@ -34,8 +34,10 @@ static void mt7988_phy_setting(struct mt753x_switch_priv *priv) u32 i; for (i = 0; i < MT753X_NUM_PHYS; i++) { - /* Enable HW auto downshift */ + /* Set PHY to PHY page 1 */ mt7531_mii_write(priv, i, 0x1f, 0x1); + + /* Enable HW auto downshift */ val = mt7531_mii_read(priv, i, PHY_EXT_REG_14); val |= PHY_EN_DOWN_SHFIT; mt7531_mii_write(priv, i, PHY_EXT_REG_14, val); @@ -44,6 +46,9 @@ static void mt7988_phy_setting(struct mt753x_switch_priv *priv) val = mt7531_mii_read(priv, i, PHY_EXT_REG_17); val |= PHY_LINKDOWN_POWER_SAVING_EN; mt7531_mii_write(priv, i, PHY_EXT_REG_17, val); + + /* Restore PHY to PHY page 0 */ + mt7531_mii_write(priv, i, 0x1f, 0x0); } } |
