[PATCH]: Freescale UCC_GETH Half Duplex

Russell McGuire rmcguire at videopresence.com
Fri Jul 18 08:01:05 EST 2008


All,

This fix is for UCC_GETH, in the manual only TWO modes allow half duplex
setting, and this is for MII and RMII.  All other modes are disallowed
because it is not supported in the Freescale MAC interface, and will throw
the QE engines into unknown states. 

For all other modes other than MII and RMII, this doesn't mean that half
duplex doesn't work, it just means the bit can't be set, apparently <though
unclear in the manual>?, in Gigabit modes, like RGMII and GMII the MAC will
auto-detect if half duplex is in effect. Hence why we leave it set to dull
duplex.


Signed-off-by: Russell McGuire <rmcguire at videopresence.com>

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 9a38dfe..5900847 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -1533,10 +1698,17 @@ static void adjust_link(struct net_device *dev)
 		 * If not, we operate in half-duplex mode. */
 		if (phydev->duplex != ugeth->oldduplex) {
 			new_state = 1;
-			if (!(phydev->duplex))
-				tempval &= ~(MACCFG2_FDX);
-			else
-				tempval |= MACCFG2_FDX;
+			/* Can only set half duplex for these two modes!! */
+			if ((ugeth->phy_interface == PHY_INTERFACE_MODE_MII)
||
+			  (ugeth->phy_interface == PHY_INTERFACE_MODE_RMII))
{
+				if (!(phydev->duplex))
+					tempval &= ~(MACCFG2_FDX);
+				else
+					tempval |= MACCFG2_FDX;
+			} else {
+				/* Always set for other modes */
+				tempval |= MACCFG2_FDX; 
+			}
 			ugeth->oldduplex = phydev->duplex;
 		}



More information about the Linuxppc-embedded mailing list