linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: "Matthew L. Creech" <mlcreech@gmail.com>
To: linuxppc-dev@ozlabs.org
Subject: [PATCH] net/gianfar: fix RMII mode detection
Date: Thu, 2 Apr 2009 16:02:55 -0400	[thread overview]
Message-ID: <5ee96a840904021302s152a46a4udc61d672acffde45@mail.gmail.com> (raw)

On MPC8313, the TSEC flags ECNTRL_REDUCED_MODE (for RGMII) and
ECNTRL_REDUCED_MII_MODE (for RMII) are mutually exclusive (15-32 of
the 8313 reference manual).  The current gianfar driver only checks
for RMII when RGMII is enabled, so plain RMII is never detected.  This
patch makes the flags independent.

Signed-off-by: Matthew Creech <mlcreech@gmail.com>
---
 gianfar.c |   25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)

diff -purN orig/drivers/net/gianfar.c linux-2.6.29/drivers/net/gianfar.c
--- orig/drivers/net/gianfar.c	2009-04-02 15:36:16.000000000 -0400
+++ linux-2.6.29/drivers/net/gianfar.c	2009-04-02 15:38:18.000000000 -0400
@@ -628,21 +628,20 @@ static phy_interface_t gfar_get_interfac
 			return PHY_INTERFACE_MODE_TBI;
 	}

+	if (ecntrl & ECNTRL_REDUCED_MII_MODE)
+		return PHY_INTERFACE_MODE_RMII;
+
 	if (ecntrl & ECNTRL_REDUCED_MODE) {
-		if (ecntrl & ECNTRL_REDUCED_MII_MODE)
-			return PHY_INTERFACE_MODE_RMII;
-		else {
-			phy_interface_t interface = priv->interface;
-
-			/*
-			 * This isn't autodetected right now, so it must
-			 * be set by the device tree or platform code.
-			 */
-			if (interface == PHY_INTERFACE_MODE_RGMII_ID)
-				return PHY_INTERFACE_MODE_RGMII_ID;
+		phy_interface_t interface = priv->interface;

-			return PHY_INTERFACE_MODE_RGMII;
-		}
+		/*
+		 * This isn't autodetected right now, so it must
+		 * be set by the device tree or platform code.
+		 */
+		if (interface == PHY_INTERFACE_MODE_RGMII_ID)
+			return PHY_INTERFACE_MODE_RGMII_ID;
+
+		return PHY_INTERFACE_MODE_RGMII;
 	}

 	if (priv->device_flags & FSL_GIANFAR_DEV_HAS_GIGABIT)

-- 
Matthew L. Creech

                 reply	other threads:[~2009-04-02 20:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=5ee96a840904021302s152a46a4udc61d672acffde45@mail.gmail.com \
    --to=mlcreech@gmail.com \
    --cc=linuxppc-dev@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;
as well as URLs for NNTP newsgroup(s).