LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Russell McGuire" <rmcguire@videopresence.com>
To: "'Kim Phillips'" <kim.phillips@freescale.com>
Cc: chuck@ThePTRGroup.com, linuxppc-embedded@ozlabs.org
Subject: [PATCH]: Freescale UCC_GETH Half Duplex
Date: Thu, 17 Jul 2008 15:01:05 -0700	[thread overview]
Message-ID: <64C0D186E4EA49148AF433F744D72E2D@absolutdaddy> (raw)
In-Reply-To: <20080717120155.efdef031.kim.phillips@freescale.com>

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

      reply	other threads:[~2008-07-17 22:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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     ` Russell McGuire [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64C0D186E4EA49148AF433F744D72E2D@absolutdaddy \
    --to=rmcguire@videopresence.com \
    --cc=chuck@ThePTRGroup.com \
    --cc=kim.phillips@freescale.com \
    --cc=linuxppc-embedded@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox