m68knommu: set multi-function pins for ethernet when enabled
authorGreg Ungerer <gerg@uclinux.org>
Wed, 12 Aug 2009 06:14:43 +0000 (16:14 +1000)
committerGreg Ungerer <gerg@uclinux.org>
Tue, 15 Sep 2009 23:43:56 +0000 (09:43 +1000)
The ethernet pins on the 532x ColdFire CPU family are multi-function
pins. We need to enable them as ethernet pins when using the FEC
ethernet driver.

Bug report, and older patch, from timothee@manaud.net.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
arch/m68knommu/platform/523x/config.c

index 00f08d2e43b0a675e9f68095c2c9fc946621b7f1..6ba84f2aa397cc639eff61ea38acb9f0e1be903b 100644 (file)
@@ -82,6 +82,20 @@ static struct platform_device *m523x_devices[] __initdata = {
 
 /***************************************************************************/
 
+static void __init m523x_fec_init(void)
+{
+       u16 par;
+       u8 v;
+
+       /* Set multi-function pins to ethernet use */
+       par = readw(MCF_IPSBAR + 0x100082);
+       writew(par | 0xf00, MCF_IPSBAR + 0x100082);
+       v = readb(MCF_IPSBAR + 0x100078);
+       writeb(v | 0xc0, MCF_IPSBAR + 0x100078);
+}
+
+/***************************************************************************/
+
 static void m523x_cpu_reset(void)
 {
        local_irq_disable();
@@ -99,6 +113,7 @@ void __init config_BSP(char *commandp, int size)
 
 static int __init init_BSP(void)
 {
+       m523x_fec_init();
        platform_add_devices(m523x_devices, ARRAY_SIZE(m523x_devices));
        return 0;
 }