--- fec.c.orig Thu Oct 3 12:33:49 2002 +++ fec.c Thu Oct 3 12:54:33 2002 @@ -1351,6 +1351,40 @@ +/* This interrupt occurs when the PHY detects a link change. +*/ +static void +#ifdef CONFIG_RPXCLASSIC +mii_link_interrupt(void *dev_id) +#else +mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) +#endif +{ + struct net_device *dev = dev_id; + struct fec_enet_private *fep = dev->priv; + +#ifdef CONFIG_M5272 + { + /* Acknowledge the interrupt */ + volatile unsigned long *icrp; + + icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1); + *icrp = (*icrp & 0x77777777) | 0x08000000; + } +#endif + +#if 0 + disable_irq(fep->mii_irq); /* disable now, enable later */ +#endif + + if (fep->phy) { + mii_do_cmd(dev, fep->phy->ack_int); + /* restart and display status */ + mii_do_cmd(dev, phy_cmd_relink); + } + +} + /* Read remainder of PHY ID. */ static void @@ -1369,7 +1403,20 @@ } if (phy_info[i]) + { printk(" -- %s\n", phy_info[i]->name); +#ifdef CONFIG_M5272 + if (request_irq(66, mii_link_interrupt, 0, "fec(MII)", dev) != 0) + printk("FEC: Could not allocate MII IRQ(66)!\n"); + { + /* Unmask interrupts at ColdFire 5272 SIM */ + volatile unsigned long *icrp; + + icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1); + *icrp = (*icrp & 0x70777777) | 0x0d000000; + } +#endif + } else printk(" -- unknown PHY!\n"); @@ -1409,47 +1456,13 @@ /* Disable external MII interface */ fecp->fec_mii_speed = fep->phy_speed = 0; #ifdef CONFIG_M5272 - { - volatile unsigned long *icrp; - icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1); - *icrp = (*icrp & 0x70777777) | 0x08000000; - } -#endif - } -} - -/* This interrupt occurs when the PHY detects a link change. -*/ -static void -#ifdef CONFIG_RPXCLASSIC -mii_link_interrupt(void *dev_id) -#else -mii_link_interrupt(int irq, void * dev_id, struct pt_regs * regs) -#endif -{ - struct net_device *dev = dev_id; - struct fec_enet_private *fep = dev->priv; - -#ifdef CONFIG_M5272 - { - /* Acknowledge the interrupt */ - volatile unsigned long *icrp; - - icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1); - *icrp = (*icrp & 0x77777777) | 0x08000000; - } -#endif - -#if 0 - disable_irq(fep->mii_irq); /* disable now, enable later */ +// { +// volatile unsigned long *icrp; +// icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1); +// *icrp = (*icrp & 0x70777777) | 0x08000000; +// } #endif - - if (fep->phy) { - mii_do_cmd(dev, fep->phy->ack_int); - /* restart and display status */ - mii_do_cmd(dev, phy_cmd_relink); } - } static int @@ -1795,8 +1808,8 @@ printk("FEC: Could not allocate FEC(RC) IRQ(87)!\n"); if (request_irq(88, fec_enet_interrupt, 0, "fec(OTHER)", dev) != 0) printk("FEC: Could not allocate FEC(OTHER) IRQ(88)!\n"); - if (request_irq(66, mii_link_interrupt, 0, "fec(MII)", dev) != 0) - printk("FEC: Could not allocate MII IRQ(66)!\n"); +// if (request_irq(66, mii_link_interrupt, 0, "fec(MII)", dev) != 0) +// printk("FEC: Could not allocate MII IRQ(66)!\n"); /* Unmask interrupts at ColdFire 5272 SIM */ { @@ -1805,8 +1818,8 @@ icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR3); *icrp = 0x00000ddd; - icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1); - *icrp = (*icrp & 0x70777777) | 0x0d000000; +// icrp = (volatile unsigned long *) (MCF_MBAR + MCFSIM_ICR1); +// *icrp = (*icrp & 0x70777777) | 0x0d000000; } #else if (request_8xxirq(FEC_INTERRUPT, fec_enet_interrupt, 0, "fec", dev) != 0)