]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/net/fec_mxc.c
net: fec_mxc: don't write to reserved register on i.MX6UL
[karo-tx-uboot.git] / drivers / net / fec_mxc.c
index 1ef3456630e0dd335b44ec20cdd5ed406de52d88..ee6822af323df3dd2970cc2341ce9f23d37e33e7 100644 (file)
@@ -531,8 +531,6 @@ static int fec_open(struct eth_device *edev)
 static int fec_init(struct eth_device *dev, bd_t* bd)
 {
        struct fec_priv *fec = dev->priv;
-       uint32_t *mib_ptr = (uint32_t *)&fec->eth->rmon_t_drop;
-       int i;
 
        /* Initialize MAC address */
        fec_set_hwaddr(dev);
@@ -561,14 +559,11 @@ static int fec_init(struct eth_device *dev, bd_t* bd)
        writel(0x00000000, &fec->eth->gaddr1);
        writel(0x00000000, &fec->eth->gaddr2);
 
-
-       /* clear MIB RAM */
-       for (i = 0; i <= 0xfc >> 2; i++)
-               writel(0, &mib_ptr[i]);
-
+       /* Do not access reserved register for i.MX6UL */
+#ifndef CONFIG_SOC_MX6UL
        /* FIFO receive start register */
        writel(0x520, &fec->eth->r_fstart);
-
+#endif
        /* size and address of each buffer */
        writel(FEC_MAX_PKT_SIZE, &fec->eth->emrbr);
        writel((uint32_t)fec->tbd_base, &fec->eth->etdsr);
@@ -724,6 +719,7 @@ static int fec_send(struct eth_device *dev, void *packet, int length)
        while (--timeout) {
                if (!(readl(&fec->eth->x_des_active) & FEC_X_DES_ACTIVE_TDAR))
                        break;
+               udelay(1);
        }
 
        if (!timeout) {
@@ -751,6 +747,7 @@ static int fec_send(struct eth_device *dev, void *packet, int length)
                if (!(readw(&fec->tbd_base[fec->tbd_index].status) &
                    FEC_TBD_READY))
                        break;
+               udelay(1);
        }
 
        if (!timeout)
@@ -1106,7 +1103,8 @@ int fecmxc_initialize_multi(bd_t *bd, int dev_id, int phy_id, uint32_t addr)
        if (!bus)
                return -ENOMEM;
 #ifdef CONFIG_PHYLIB
-       phydev = phy_find_by_mask(bus, 1 << phy_id, PHY_INTERFACE_MODE_RGMII);
+       phydev = phy_find_by_mask(bus, phy_id < 0 ? 0xff : (1 << phy_id),
+                               PHY_INTERFACE_MODE_RGMII);
        if (!phydev) {
                free(bus);
                return -ENOMEM;