Commit 8f48c2ac authored by Russell King's avatar Russell King Committed by David S. Miller

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: c9cc1c81 ("net: phy: marvell10g: place in powersave mode at probe")
Reported-by: default avatarMatteo Croce <mcroce@redhat.com>
Tested-by: default avatarMatteo Croce <mcroce@redhat.com>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent dd649b4f
...@@ -75,7 +75,8 @@ enum { ...@@ -75,7 +75,8 @@ enum {
/* Vendor2 MMD registers */ /* Vendor2 MMD registers */
MV_V2_PORT_CTRL = 0xf001, MV_V2_PORT_CTRL = 0xf001,
MV_V2_PORT_CTRL_PWRDOWN = 0x0800, MV_V2_PORT_CTRL_SWRST = BIT(15),
MV_V2_PORT_CTRL_PWRDOWN = BIT(11),
MV_V2_TEMP_CTRL = 0xf08a, MV_V2_TEMP_CTRL = 0xf08a,
MV_V2_TEMP_CTRL_MASK = 0xc000, MV_V2_TEMP_CTRL_MASK = 0xc000,
MV_V2_TEMP_CTRL_SAMPLE = 0x0000, MV_V2_TEMP_CTRL_SAMPLE = 0x0000,
...@@ -239,8 +240,17 @@ static int mv3310_power_down(struct phy_device *phydev) ...@@ -239,8 +240,17 @@ static int mv3310_power_down(struct phy_device *phydev)
static int mv3310_power_up(struct phy_device *phydev) static int mv3310_power_up(struct phy_device *phydev)
{ {
return phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL, struct mv3310_priv *priv = dev_get_drvdata(&phydev->mdio.dev);
int ret;
ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
MV_V2_PORT_CTRL_PWRDOWN); MV_V2_PORT_CTRL_PWRDOWN);
if (priv->firmware_ver < 0x00030000)
return ret;
return phy_set_bits_mmd(phydev, MDIO_MMD_VEND2, MV_V2_PORT_CTRL,
MV_V2_PORT_CTRL_SWRST);
} }
static int mv3310_reset(struct phy_device *phydev, u32 unit) static int mv3310_reset(struct phy_device *phydev, u32 unit)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment