]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/ucc_geth.c
S2IO: Optimized the delay to wait for command completion
[linux-2.6-omap-h63xx.git] / drivers / net / ucc_geth.c
index abb8611c5a916b7d3e12223cdfbfeeb30920e523..885e73d731c220ef712847afc1ce15a1fcb0ac80 100644 (file)
@@ -1709,75 +1709,13 @@ static void adjust_link(struct net_device *dev)
                if (mii_info->speed != ugeth->oldspeed) {
                        switch (mii_info->speed) {
                        case 1000:
-#ifdef CONFIG_PPC_MPC836x
-/* FIXME: This code is for 100Mbs BUG fixing,
-remove this when it is fixed!!! */
-                               if (ugeth->ug_info->enet_interface ==
-                                   ENET_1000_GMII)
-                               /* Run the commands which initialize the PHY */
-                               {
-                                       tempval =
-                                           (u32) mii_info->mdio_read(ugeth->
-                                               dev, mii_info->mii_id, 0x1b);
-                                       tempval |= 0x000f;
-                                       mii_info->mdio_write(ugeth->dev,
-                                               mii_info->mii_id, 0x1b,
-                                               (u16) tempval);
-                                       tempval =
-                                           (u32) mii_info->mdio_read(ugeth->
-                                               dev, mii_info->mii_id,
-                                               MII_BMCR);
-                                       mii_info->mdio_write(ugeth->dev,
-                                               mii_info->mii_id, MII_BMCR,
-                                               (u16) (tempval | BMCR_RESET));
-                               } else if (ugeth->ug_info->enet_interface ==
-                                          ENET_1000_RGMII)
-                               /* Run the commands which initialize the PHY */
-                               {
-                                       tempval =
-                                           (u32) mii_info->mdio_read(ugeth->
-                                               dev, mii_info->mii_id, 0x1b);
-                                       tempval = (tempval & ~0x000f) | 0x000b;
-                                       mii_info->mdio_write(ugeth->dev,
-                                               mii_info->mii_id, 0x1b,
-                                               (u16) tempval);
-                                       tempval =
-                                           (u32) mii_info->mdio_read(ugeth->
-                                               dev, mii_info->mii_id,
-                                               MII_BMCR);
-                                       mii_info->mdio_write(ugeth->dev,
-                                               mii_info->mii_id, MII_BMCR,
-                                               (u16) (tempval | BMCR_RESET));
-                               }
-                               msleep(4000);
-#endif                         /* CONFIG_MPC8360 */
-                               adjust_enet_interface(ugeth);
+                               ugeth->ug_info->enet_interface = ENET_1000_RGMII;
                                break;
                        case 100:
-                       case 10:
-#ifdef CONFIG_PPC_MPC836x
-/* FIXME: This code is for 100Mbs BUG fixing,
-remove this lines when it will be fixed!!! */
                                ugeth->ug_info->enet_interface = ENET_100_RGMII;
-                               tempval =
-                                   (u32) mii_info->mdio_read(ugeth->dev,
-                                                             mii_info->mii_id,
-                                                             0x1b);
-                               tempval = (tempval & ~0x000f) | 0x000b;
-                               mii_info->mdio_write(ugeth->dev,
-                                                    mii_info->mii_id, 0x1b,
-                                                    (u16) tempval);
-                               tempval =
-                                   (u32) mii_info->mdio_read(ugeth->dev,
-                                                             mii_info->mii_id,
-                                                             MII_BMCR);
-                               mii_info->mdio_write(ugeth->dev,
-                                                    mii_info->mii_id, MII_BMCR,
-                                                    (u16) (tempval |
-                                                           BMCR_RESET));
-                               msleep(4000);
-#endif                         /* CONFIG_MPC8360 */
-                               adjust_enet_interface(ugeth);
+                               break;
+                       case 10:
+                               ugeth->ug_info->enet_interface = ENET_10_RGMII;
                                break;
                        default:
                                ugeth_warn
@@ -1785,6 +1723,7 @@ remove this lines when it will be fixed!!! */
                                     dev->name, mii_info->speed);
                                break;
                        }
+                       adjust_enet_interface(ugeth);
 
                        ugeth_info("%s: Speed %dBT", dev->name,
                                   mii_info->speed);
@@ -4000,8 +3939,8 @@ static void ugeth_phy_startup_timer(unsigned long data)
        /* Grab the PHY interrupt, if necessary/possible */
        if (ugeth->ug_info->board_flags & FSL_UGETH_BRD_HAS_PHY_INTR) {
                if (request_irq(ugeth->ug_info->phy_interrupt,
-                               phy_interrupt,
-                               SA_SHIRQ, "phy_interrupt", mii_info->dev) < 0) {
+                               phy_interrupt, IRQF_SHARED,
+                               "phy_interrupt", mii_info->dev) < 0) {
                        ugeth_err("%s: Can't get IRQ %d (PHY)",
                                  mii_info->dev->name,
                                  ugeth->ug_info->phy_interrupt);
@@ -4133,6 +4072,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
        static int mii_mng_configured = 0;
        const phandle *ph;
        const unsigned int *prop;
+       const void *mac_addr;
 
        ugeth_vdbg("%s: IN", __FUNCTION__);
 
@@ -4258,7 +4198,10 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
 
        ugeth->ug_info = ug_info;
        ugeth->dev = dev;
-       memcpy(dev->dev_addr, get_property(np, "mac-address", NULL), 6);
+
+       mac_addr = of_get_mac_address(np);
+       if (mac_addr)
+               memcpy(dev->dev_addr, mac_addr, 6);
 
        return 0;
 }