* [PATCH] net/gianfar: fix RMII mode detection
@ 2009-04-02 20:02 Matthew L. Creech
0 siblings, 0 replies; only message in thread
From: Matthew L. Creech @ 2009-04-02 20:02 UTC (permalink / raw)
To: linuxppc-dev
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-04-02 20:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-02 20:02 [PATCH] net/gianfar: fix RMII mode detection Matthew L. Creech
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).