Hi Richard,

Richard Retanubun wrote:
 From 0bad7aa337cf16bed99f5f71613e587f61068dde Mon Sep 17 00:00:00 2001
From: Richard Retanubun <richardretanu...@ruggedcom.com>
Date: Mon, 9 Feb 2009 10:41:48 -0500
Subject: [PATCH] Fixed GPIO pin initialization for CONFIG_M5271 FEC.
 This processor only have one FEC and its MDIO pins are
 located at a different offset than the code used for
 the current CONFIG_M527x


Signed-off-by: Richard Retanubun <richardretanu...@ruggedcom.com>
---

Looks good. But this good is about change quite substantially in
the next mainline merge window. The fec driver will become a proper
platform driver, and this ColdFire specific code will be moved into
the ColdFire arch platform code.

I can manually merge it over (this code will now be in
arch/m68knommu/platform/m527x/config.c), and submit with same
comments and sign-of, if that is all right with you?

The patch will end up being:

--- linux-2.6.x/arch/m68knommu/platform/527x/config.c.1 2009-03-03 16:59:09.000000000 +1000 +++ linux-2.6.x/arch/m68knommu/platform/527x/config.c 2009-03-03 17:01:37.000000000 +1000
@@ -188,6 +188,13 @@ static void __init m527x_fec_init(void)

        m527x_fec_irq_init(0);

+#ifdef CONFIG_M5271
+       /* Set multi-function pins to ethernet mode for fec0 */
+       v = readb(MCF_IPSBAR + 0x100047);
+       writeb(v | 0xf0, MCF_IPSBAR + 0x100047);
+#endif /* CONFIG_M5271 */
+
+#ifdef CONFIG_M5275
        /* Set multi-function pins to ethernet mode for fec0 */
        par = readw(MCF_IPSBAR + 0x100082);
        writew(par | 0xf00, MCF_IPSBAR + 0x100082);
@@ -203,6 +210,7 @@ static void __init m527x_fec_init(void)
        v = readb(MCF_IPSBAR + 0x100079);
        writeb(v | 0xc0, MCF_IPSBAR + 0x100079);
 #endif
+#endif /* CONFIG_M5275 */
 }


/***************************************************************************/


Regards
Greg




Tesed on M5271EVB eval platform.
Without this patch the FEC driver will report no PHY attached
if the bootloader does not pre-initialize the PAR_FECI2C GPIO register.

 drivers/net/fec.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 2769083..43f29f8 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1402,7 +1402,7 @@ static void __inline__ fec_request_intrs(struct net_device *dev)
     }
 #endif

-#if defined(CONFIG_M527x)
+#if defined(CONFIG_M527x) && !defined(CONFIG_M5271)
     /* Set up gpio outputs for MII lines */
     {
         volatile u8 *gpio_par_fec;
@@ -1423,7 +1423,18 @@ static void __inline__ fec_request_intrs(struct net_device *dev)
         *gpio_par_fec |= 0xc0;
 #endif /* CONFIG_FEC2 */
     }
-#endif /* CONFIG_M527x */
+#endif /* CONFIG_M527x  && !CONFIG_M5271 */
+
+#if defined(CONFIG_M5271)
+    /* Set up gpio outputs for MII lines */
+    {
+        volatile u8 *gpio_par_feci2c;
+
+        /* Set up gpio outputs for FEC0 MII lines */
+        gpio_par_feci2c = (volatile u8 *)(MCF_IPSBAR + 0x100047);
+        *gpio_par_feci2c |= 0xf0;
+    }
+#endif
 }

static void __inline__ fec_set_mii(struct net_device *dev, struct fec_enet_private *fep)

--
------------------------------------------------------------------------
Greg Ungerer  --  Principal Engineer        EMAIL:     g...@snapgear.com
SnapGear, a McAfee Company                  PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to