Skip to contentSkip to conversation

phy/marvell: Make non-aneg speed/duplex forcing work for 88E1111 PHYs

PATCH Applied Anton Vorontsov 2 participants 2 messages Sep 10, 2009 – Sep 11, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 phy/marvell: Make non-aneg speed/duplex forcing work for 88E1111 PHYs

According to specs, when auto-negotiation is disabled, Marvell PHYs need a software reset after changing speed/duplex forcing bits. Otherwise, the modified bits have no effect.

---
 drivers/net/phy/marvell.c |   21 ++++++++++++++++++++-
 1 files changed, 20 insertions(+), 1 deletions(-)
drivers/net/phy/marvell.c +20 -1
index dd6f54d..6f69b9b 100644
@@ -155,8 +155,27 @@ static int marvell_config_aneg(struct phy_device *phydev)
 		return err;
 
 	err = genphy_config_aneg(phydev);
+	if (err < 0)
+		return err;
 
-	return err;
+	if (phydev->autoneg != AUTONEG_ENABLE) {
+		int bmcr;
+
+		/*
+		 * A write to speed/duplex bits (that is performed by
+		 * genphy_config_aneg() call above) must be followed by
+		 * a software reset. Otherwise, the write has no effect.
+		 */
+		bmcr = phy_read(phydev, MII_BMCR);
+		if (bmcr < 0)
+			return bmcr;
+
+		err = phy_write(phydev, MII_BMCR, bmcr | BMCR_RESET);
+		if (err < 0)
+			return err;
+	}
+
+	return 0;
 }
 
 static int m88e1121_config_aneg(struct phy_device *phydev)
Signature · 1 line
1.6.3.3
maintainer Applied
#1 lore raw

From: Anton Vorontsov <[email protected]>
Date: Thu, 10 Sep 2009 06:01:30 +0400

Quoted 5 lines

According to specs, when auto-negotiation is disabled, Marvell PHYs need a software reset after changing speed/duplex forcing bits. Otherwise, the modified bits have no effect.

Applied.