Skip to content

Commit e989f9b

Browse files
lunngregkh
authored andcommitted
net: phy: marvell: Limit errata to 88m1101
commit f2899788353c13891412b273fdff5f02d49aa40f 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: 7688467 ("phylib: Add support for Marvell 88e1111S and 88e1145") Reported-by: Daniel Walker <danielwa@cisco.com> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Acked-by: Harini Katakam <harinik@xilinx.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 605b6b2 commit e989f9b

1 file changed

Lines changed: 37 additions & 29 deletions

File tree

drivers/net/phy/marvell.c

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -203,34 +203,6 @@ static int marvell_config_aneg(struct phy_device *phydev)
203203
{
204204
int err;
205205

206-
/* The Marvell PHY has an errata which requires
207-
* that certain registers get written in order
208-
* to restart autonegotiation */
209-
err = phy_write(phydev, MII_BMCR, BMCR_RESET);
210-
211-
if (err < 0)
212-
return err;
213-
214-
err = phy_write(phydev, 0x1d, 0x1f);
215-
if (err < 0)
216-
return err;
217-
218-
err = phy_write(phydev, 0x1e, 0x200c);
219-
if (err < 0)
220-
return err;
221-
222-
err = phy_write(phydev, 0x1d, 0x5);
223-
if (err < 0)
224-
return err;
225-
226-
err = phy_write(phydev, 0x1e, 0);
227-
if (err < 0)
228-
return err;
229-
230-
err = phy_write(phydev, 0x1e, 0x100);
231-
if (err < 0)
232-
return err;
233-
234206
err = marvell_set_polarity(phydev, phydev->mdix);
235207
if (err < 0)
236208
return err;
@@ -264,6 +236,42 @@ static int marvell_config_aneg(struct phy_device *phydev)
264236
return 0;
265237
}
266238

239+
static int m88e1101_config_aneg(struct phy_device *phydev)
240+
{
241+
int err;
242+
243+
/* This Marvell PHY has an errata which requires
244+
* that certain registers get written in order
245+
* to restart autonegotiation
246+
*/
247+
err = phy_write(phydev, MII_BMCR, BMCR_RESET);
248+
249+
if (err < 0)
250+
return err;
251+
252+
err = phy_write(phydev, 0x1d, 0x1f);
253+
if (err < 0)
254+
return err;
255+
256+
err = phy_write(phydev, 0x1e, 0x200c);
257+
if (err < 0)
258+
return err;
259+
260+
err = phy_write(phydev, 0x1d, 0x5);
261+
if (err < 0)
262+
return err;
263+
264+
err = phy_write(phydev, 0x1e, 0);
265+
if (err < 0)
266+
return err;
267+
268+
err = phy_write(phydev, 0x1e, 0x100);
269+
if (err < 0)
270+
return err;
271+
272+
return marvell_config_aneg(phydev);
273+
}
274+
267275
#ifdef CONFIG_OF_MDIO
268276
/*
269277
* Set and/or override some configuration registers based on the
@@ -993,7 +1001,7 @@ static struct phy_driver marvell_drivers[] = {
9931001
.name = "Marvell 88E1101",
9941002
.features = PHY_GBIT_FEATURES,
9951003
.flags = PHY_HAS_INTERRUPT,
996-
.config_aneg = &marvell_config_aneg,
1004+
.config_aneg = &m88e1101_config_aneg,
9971005
.read_status = &genphy_read_status,
9981006
.ack_interrupt = &marvell_ack_interrupt,
9991007
.config_intr = &marvell_config_intr,

0 commit comments

Comments
 (0)