linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Freescale UCC_GETH Half Duplex Patch
@ 2008-07-11  0:23 Russell McGuire
  2008-07-11 17:46 ` Kim Phillips
  0 siblings, 1 reply; 4+ messages in thread
From: Russell McGuire @ 2008-07-11  0:23 UTC (permalink / raw)
  To: 'Kim Phillips'; +Cc: linuxppc-embedded

[-- Attachment #1: Type: text/plain, Size: 599 bytes --]

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


[-- Attachment #2: ucc_geth.patch --]
[-- Type: application/octet-stream, Size: 865 bytes --]

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 use 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;
 		}

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Freescale UCC_GETH Half Duplex Patch
  2008-07-11  0:23 Freescale UCC_GETH Half Duplex Patch Russell McGuire
@ 2008-07-11 17:46 ` Kim Phillips
  2008-07-17 17:01   ` Kim Phillips
  0 siblings, 1 reply; 4+ messages in thread
From: Kim Phillips @ 2008-07-11 17:46 UTC (permalink / raw)
  To: rmcguire; +Cc: linuxppc-embedded

On Thu, 10 Jul 2008 17:23:31 -0700
"Russell McGuire" <rmcguire@videopresence.com> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Freescale UCC_GETH Half Duplex Patch
  2008-07-11 17:46 ` Kim Phillips
@ 2008-07-17 17:01   ` Kim Phillips
  2008-07-17 22:01     ` [PATCH]: Freescale UCC_GETH Half Duplex Russell McGuire
  0 siblings, 1 reply; 4+ messages in thread
From: Kim Phillips @ 2008-07-17 17:01 UTC (permalink / raw)
  To: Kim Phillips; +Cc: chuck, rmcguire, linuxppc-embedded

On Fri, 11 Jul 2008 12:46:04 -0500
Kim Phillips <kim.phillips@freescale.com> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH]: Freescale UCC_GETH Half Duplex
  2008-07-17 17:01   ` Kim Phillips
@ 2008-07-17 22:01     ` Russell McGuire
  0 siblings, 0 replies; 4+ messages in thread
From: Russell McGuire @ 2008-07-17 22:01 UTC (permalink / raw)
  To: 'Kim Phillips'; +Cc: chuck, linuxppc-embedded

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@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;
 		}

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-07-17 22:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-11  0:23 Freescale UCC_GETH Half Duplex Patch Russell McGuire
2008-07-11 17:46 ` Kim Phillips
2008-07-17 17:01   ` Kim Phillips
2008-07-17 22:01     ` [PATCH]: Freescale UCC_GETH Half Duplex Russell McGuire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).