]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
net: gem: Remove unused nonPHYLIB support
authorMichal Simek <michal.simek@xilinx.com>
Wed, 15 Apr 2015 13:43:03 +0000 (15:43 +0200)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 15 Apr 2015 13:45:50 +0000 (15:45 +0200)
Remove code which is not tested.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/zynq_gem.c

index 2ad16b81da4500d2ee084e8301cc2be34f96cca5..8bc8937b0904d42614336e5f3ad83521908d49bc 100644 (file)
 #include <asm/arch/hardware.h>
 #include <asm/arch/sys_proto.h>
 
+#if !defined(CONFIG_PHYLIB)
+# error XILINX_GEM_ETHERNET requires PHYLIB
+#endif
+
 /* Bit/mask specification */
 #define ZYNQ_GEM_PHYMNTNC_OP_MASK      0x40020000 /* operation mask bits */
 #define ZYNQ_GEM_PHYMNTNC_OP_R_MASK    0x20000000 /* read operation */
@@ -218,29 +222,6 @@ static u32 phywrite(struct eth_device *dev, u32 phy_addr, u32 regnum, u16 data)
                                ZYNQ_GEM_PHYMNTNC_OP_W_MASK, &data);
 }
 
-#ifndef CONFIG_PHYLIB
-static int phy_rst(struct eth_device *dev)
-{
-       struct zynq_gem_priv *priv = dev->priv;
-       u16 tmp;
-
-       puts("Resetting PHY...\n");
-       phyread(dev, priv->phyaddr, 0, &tmp);
-       tmp |= 0x8000;
-       phywrite(dev, priv->phyaddr, 0, tmp);
-
-       phyread(dev, priv->phyaddr, 0, &tmp);
-       while (tmp & 0x8000) {
-               putc('.');
-               if (ctrlc())
-                       return 1;
-               phyread(dev, priv->phyaddr, 0, &tmp);
-       }
-       puts("\nPHY reset complete.\n");
-       return 0;
-}
-#endif
-
 static void phy_detection(struct eth_device *dev)
 {
        int i;
@@ -372,7 +353,6 @@ static int zynq_gem_init(struct eth_device *dev, bd_t * bis)
 #endif
        phy_detection(dev);
 
-#ifdef CONFIG_PHYLIB
        /* interface - look at tsec */
        phydev = phy_connect(priv->bus, priv->phyaddr, dev,
                             PHY_INTERFACE_MODE_MII);
@@ -415,46 +395,6 @@ static int zynq_gem_init(struct eth_device *dev, bd_t * bis)
                                        ZYNQ_GEM_BASEADDR0, clk_rate);
 #endif
 
-#else
-       /* PHY Setup */
-       phywrite(dev, priv->phyaddr, 22, 2);    /* page 2 */
-
-       /* rx clock transition when data stable */
-       phywrite(dev, priv->phyaddr, 21, 0x3030);
-
-       phywrite(dev, priv->phyaddr, 22, 0);    /* page 0 */
-
-       u16 tmp;
-
-       /* link speed advertisement for autonegotiation */
-       phyread(dev, priv->phyaddr, 4, &tmp);
-       tmp |= 0xd80;           /* enable 100Mbps */
-       tmp &= ~0x60;           /* disable 10 Mbps */
-       phywrite(dev, priv->phyaddr, 4, tmp);
-
-       /* *disable* gigabit advertisement */
-       phyread(dev, priv->phyaddr, 9, &tmp);
-       tmp &= ~0x0300;
-       phywrite(dev, priv->phyaddr, 9, tmp);
-
-       /* enable autonegotiation, set 100Mbps, full-duplex, restart aneg */
-       phyread(dev, priv->phyaddr, 0, &tmp);
-       phywrite(dev, priv->phyaddr, 0, 0x3300 | (tmp & 0x1F));
-
-       if (phy_rst(dev))
-               return -1;
-
-       puts("\nWaiting for PHY to complete autonegotiation.");
-       do {
-               phyread(dev, priv->phyaddr, 1, &tmp);
-       } while (tmp & (1 << 5));
-
-       puts("\nPHY claims autonegotiation complete...\n");
-
-       puts("GEM link speed is 100Mbps\n");
-       writel(ZYNQ_GEM_NWCFG_INIT | ZYNQ_GEM_NWCFG_SPEED100, &regs->nwcfg);
-#endif
-
        /* set hardware address because of ... */
        if (!is_valid_ether_addr(dev->enetaddr)) {
                printf("%s: mac address is not valid\n", dev->name);