Freescale UCC_GETH Half Duplex Patch

4 messages, 2 authors, 2008-07-17 · open the first message on its own page

Freescale UCC_GETH Half Duplex Patch

From: Russell McGuire <hidden>
Date: 2008-07-11 00:30:18

Kim, ALL

Here is a fix up for the UCC_GETH driver supporting half duplex mode for
some specific modes.

I have tested this quiet extensively and the link now comes up and works,
however not sure if there are other issues that need to be looked at, since
10BaseT connectivity provides VERY ERRATIC throughput, but at least it works
now with RGMII and GMII modes.

There was a lot more in my patch, but I removed a lot of the code for
submission. Let me know if for any reason this patch file is improperly
formatted.

Russell McGuire
Senior Systems Engineer
rmcguire@videopresence.com
503.888.0968

Re: Freescale UCC_GETH Half Duplex Patch

From: Kim Phillips <hidden>
Date: 2008-07-11 17:46:28

On Thu, 10 Jul 2008 17:23:31 -0700
"Russell McGuire" [off-list ref] wrote:

Hi Russel,
Here is a fix up for the UCC_GETH driver supporting half duplex mode for
some specific modes.

I have tested this quiet extensively and the link now comes up and works,
however not sure if there are other issues that need to be looked at, since
10BaseT connectivity provides VERY ERRATIC throughput, but at least it works
now with RGMII and GMII modes.
good
There was a lot more in my patch, but I removed a lot of the code for
submission. Let me know if for any reason this patch file is improperly
formatted.
It needs to be sent to the netdev mailing list, and see if you can get
rid of the MIME-encoding (see linux-2.6/Documentation/email-clients.txt).

And don't forget to add a signed-off-by line, too.

Kim

Re: Freescale UCC_GETH Half Duplex Patch

From: Kim Phillips <hidden>
Date: 2008-07-17 17:02:03

On Fri, 11 Jul 2008 12:46:04 -0500
Kim Phillips [off-list ref] wrote:
It needs to be sent to the netdev mailing list, and see if you can get
rid of the MIME-encoding (see linux-2.6/Documentation/email-clients.txt).

And don't forget to add a signed-off-by line, too.
Hi Russell, may I have your signed-off-by so that I may submit this to
netdev to be applied on your behalf?  I'll keep the attributions
intact, of course.

Kim

[PATCH]: Freescale UCC_GETH Half Duplex

From: Russell McGuire <hidden>
Date: 2008-07-17 22:01:14

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 <redacted>
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;
 		}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help