Skip to content

Commit 8f48c2a

Browse files
Russell Kingdavem330
authored andcommitted
net: marvell10g: soft-reset the PHY when coming out of low power
Soft-reset the PHY when coming out of low power mode, which seems to be necessary with firmware versions 0.3.3.0 and 0.3.10.0. This depends on ("net: marvell10g: report firmware version") Fixes: c9cc1c8 ("net: phy: marvell10g: place in powersave mode at probe") Reported-by: Matteo Croce <[email protected]> Tested-by: Matteo Croce <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: Russell King <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent dd649b4 commit 8f48c2a

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

drivers/net/phy/marvell10g.c

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ enum {
7575

7676
/* Vendor2 MMD registers */
7777
MV_V2_PORT_CTRL = 0xf001,
78-
MV_V2_PORT_CTRL_PWRDOWN = 0x0800,
78+
MV_V2_PORT_CTRL_SWRST = BIT(15),
79+
MV_V2_PORT_CTRL_PWRDOWN = BIT(11),
7980
MV_V2_TEMP_CTRL = 0xf08a,
8081
MV_V2_TEMP_CTRL_MASK = 0xc000,
8182
MV_V2_TEMP_CTRL_SAMPLE = 0x0000,
@@ -239,8 +240,17 @@ static int mv3310_power_down(struct phy_device *phydev)
239240

240241
static int mv3310_power_up(struct phy_device *phydev)
241242
{
242-
return phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
243-
MV_V2_PORT_CTRL_PWRDOWN);
243+
struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
244+
int ret;
245+
246+
ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
247+
MV_V2_PORT_CTRL_PWRDOWN);
248+
249+
if (priv->firmware_ver < 0x00030000)
250+
return ret;
251+
252+
return phy_set_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
253+
MV_V2_PORT_CTRL_SWRST);
244254
}
245255

246256
static int mv3310_reset(struct phy_device *phydev, u32 unit)

0 commit comments

Comments
 (0)