diff options
author | Jakub Kicinski <kuba@kernel.org> | 2022-01-05 10:30:31 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-01-05 10:30:32 -0800 |
commit | aa298b557bdeb5690e0fc51dac87e55b086ede0c (patch) | |
tree | 8e3714a58d7b06d512d846b7012c6abbe59275b3 /drivers | |
parent | 2d6ec25539b0e7a4b4ad670abbcb3ec27b33e8ce (diff) | |
parent | f22725c95ececb703c3f741e8f946d23705630b7 (diff) | |
download | linux-stable-aa298b557bdeb5690e0fc51dac87e55b086ede0c.tar.gz linux-stable-aa298b557bdeb5690e0fc51dac87e55b086ede0c.tar.bz2 linux-stable-aa298b557bdeb5690e0fc51dac87e55b086ede0c.zip |
Merge branch 'fix-rgmii-delays-for-88e1118'
Russell King says:
====================
Fix RGMII delays for 88E1118
This series fixes the RGMII delays for 88E1118 Marvell PHYs, after
a report by Corentin Labbe that the Marvell driver fails to work.
Patch 1 cleans up the paged register accesses in m88e1118_config_init()
and patch 2 adds the RGMII delay configuration.
This comes with an element of risk as existing DT may need to be fixed
for this in a similar way as we have done in the recent past for other
PHY drivers that have misinterpreted the RGMII interface modes.
====================
Link: https://lore.kernel.org/r/YdR3wYFkm4eJApwb@shell.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/phy/marvell.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/phy/marvell.c b/drivers/net/phy/marvell.c index 4fcfca4e1702..739859c0dfb1 100644 --- a/drivers/net/phy/marvell.c +++ b/drivers/net/phy/marvell.c @@ -1225,28 +1225,28 @@ static int m88e1118_config_aneg(struct phy_device *phydev) static int m88e1118_config_init(struct phy_device *phydev) { + u16 leds; int err; - /* Change address */ - err = marvell_set_page(phydev, MII_MARVELL_MSCR_PAGE); - if (err < 0) - return err; - /* Enable 1000 Mbit */ - err = phy_write(phydev, 0x15, 0x1070); + err = phy_write_paged(phydev, MII_MARVELL_MSCR_PAGE, + MII_88E1121_PHY_MSCR_REG, 0x1070); if (err < 0) return err; - /* Change address */ - err = marvell_set_page(phydev, MII_MARVELL_LED_PAGE); - if (err < 0) - return err; + if (phy_interface_is_rgmii(phydev)) { + err = m88e1121_config_aneg_rgmii_delays(phydev); + if (err < 0) + return err; + } /* Adjust LED Control */ if (phydev->dev_flags & MARVELL_PHY_M1118_DNS323_LEDS) - err = phy_write(phydev, 0x10, 0x1100); + leds = 0x1100; else - err = phy_write(phydev, 0x10, 0x021e); + leds = 0x021e; + + err = phy_write_paged(phydev, MII_MARVELL_LED_PAGE, 0x10, leds); if (err < 0) return err; @@ -1254,7 +1254,7 @@ static int m88e1118_config_init(struct phy_device *phydev) if (err < 0) return err; - /* Reset address */ + /* Reset page register */ err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); if (err < 0) return err; |