Commit a2e7af73 authored by Andrew Lunn's avatar Andrew Lunn Committed by Ben Hutchings

net: phy: marvell: Limit errata to 88m1101

commit f2899788 upstream.

The 88m1101 has an errata when configuring autoneg. However, it was
being applied to many other Marvell PHYs as well. Limit its scope to
just the 88m1101.

Fixes: 76884679 ("phylib: Add support for Marvell 88e1111S and 88e1145")
Reported-by: default avatarDaniel Walker <danielwa@cisco.com>
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Acked-by: default avatarHarini Katakam <harinik@xilinx.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent a9a659c9
...@@ -126,34 +126,6 @@ static int marvell_config_aneg(struct phy_device *phydev) ...@@ -126,34 +126,6 @@ static int marvell_config_aneg(struct phy_device *phydev)
{ {
int err; int err;
/* The Marvell PHY has an errata which requires
* that certain registers get written in order
* to restart autonegotiation */
err = phy_write(phydev, MII_BMCR, BMCR_RESET);
if (err < 0)
return err;
err = phy_write(phydev, 0x1d, 0x1f);
if (err < 0)
return err;
err = phy_write(phydev, 0x1e, 0x200c);
if (err < 0)
return err;
err = phy_write(phydev, 0x1d, 0x5);
if (err < 0)
return err;
err = phy_write(phydev, 0x1e, 0);
if (err < 0)
return err;
err = phy_write(phydev, 0x1e, 0x100);
if (err < 0)
return err;
err = phy_write(phydev, MII_M1011_PHY_SCR, err = phy_write(phydev, MII_M1011_PHY_SCR,
MII_M1011_PHY_SCR_AUTO_CROSS); MII_M1011_PHY_SCR_AUTO_CROSS);
if (err < 0) if (err < 0)
...@@ -188,6 +160,42 @@ static int marvell_config_aneg(struct phy_device *phydev) ...@@ -188,6 +160,42 @@ static int marvell_config_aneg(struct phy_device *phydev)
return 0; return 0;
} }
static int m88e1101_config_aneg(struct phy_device *phydev)
{
int err;
/* This Marvell PHY has an errata which requires
* that certain registers get written in order
* to restart autonegotiation
*/
err = phy_write(phydev, MII_BMCR, BMCR_RESET);
if (err < 0)
return err;
err = phy_write(phydev, 0x1d, 0x1f);
if (err < 0)
return err;
err = phy_write(phydev, 0x1e, 0x200c);
if (err < 0)
return err;
err = phy_write(phydev, 0x1d, 0x5);
if (err < 0)
return err;
err = phy_write(phydev, 0x1e, 0);
if (err < 0)
return err;
err = phy_write(phydev, 0x1e, 0x100);
if (err < 0)
return err;
return marvell_config_aneg(phydev);
}
#ifdef CONFIG_OF_MDIO #ifdef CONFIG_OF_MDIO
/* /*
* Set and/or override some configuration registers based on the * Set and/or override some configuration registers based on the
...@@ -722,7 +730,7 @@ static struct phy_driver marvell_drivers[] = { ...@@ -722,7 +730,7 @@ static struct phy_driver marvell_drivers[] = {
.name = "Marvell 88E1101", .name = "Marvell 88E1101",
.features = PHY_GBIT_FEATURES, .features = PHY_GBIT_FEATURES,
.flags = PHY_HAS_INTERRUPT, .flags = PHY_HAS_INTERRUPT,
.config_aneg = &marvell_config_aneg, .config_aneg = &m88e1101_config_aneg,
.read_status = &genphy_read_status, .read_status = &genphy_read_status,
.ack_interrupt = &marvell_ack_interrupt, .ack_interrupt = &marvell_ack_interrupt,
.config_intr = &marvell_config_intr, .config_intr = &marvell_config_intr,
......
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