atheros[ar231x-eth]: pass phys address of I/O memory via platform res
authorFelix Fietkau <nbd@openwrt.org>
Thu, 17 Jul 2014 16:36:43 +0000 (16:36 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 17 Jul 2014 16:36:43 +0000 (16:36 +0000)
Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
SVN-Revision: 41697

target/linux/atheros/patches-3.10/100-board.patch
target/linux/atheros/patches-3.10/110-ar2313_ethernet.patch
target/linux/atheros/patches-3.10/220-enet_micrel_workaround.patch

index 8fbd250c24e55675315b978b1292dff838cfebab..b9a88a1b1d76045061612e940c156b09b3cffd6c 100644 (file)
 +      .reset_clear = ar5312_device_reset_clear,
 +      .reset_mac = AR531X_RESET_ENET0,
 +      .reset_phy = AR531X_RESET_EPHY0,
-+      .phy_base = KSEG1ADDR(AR531X_ENET0),
++      .phy_base = AR531X_ENET0,
 +      .config = &ar231x_board,
 +};
 +
 +      .reset_clear = ar5312_device_reset_clear,
 +      .reset_mac = AR531X_RESET_ENET1,
 +      .reset_phy = AR531X_RESET_EPHY1,
-+      .phy_base = KSEG1ADDR(AR531X_ENET1),
++      .phy_base = AR531X_ENET1,
 +      .config = &ar231x_board,
 +};
 +
 +      switch (ar231x_devtype) {
 +      case DEV_TYPE_AR5312:
 +              ar5312_eth0_data.macaddr = config->enet0_mac;
-+              ar231x_add_ethernet(0, KSEG1ADDR(AR531X_ENET0),
-+                      AR5312_IRQ_ENET0_INTRS, &ar5312_eth0_data);
++              ar231x_add_ethernet(0, AR531X_ENET0, AR5312_IRQ_ENET0_INTRS,
++                                  &ar5312_eth0_data);
 +
 +              ar5312_eth1_data.macaddr = config->enet1_mac;
-+              ar231x_add_ethernet(1, KSEG1ADDR(AR531X_ENET1),
-+                      AR5312_IRQ_ENET1_INTRS, &ar5312_eth1_data);
++              ar231x_add_ethernet(1, AR531X_ENET1, AR5312_IRQ_ENET1_INTRS,
++                                  &ar5312_eth1_data);
 +
 +              if (!ar231x_board.radio)
 +                      return 0;
 +              ar5312_eth1_data.phy_base = ar5312_eth0_data.phy_base;
 +              ar5312_eth1_data.reset_phy = ar5312_eth0_data.reset_phy;
 +              ar5312_eth1_data.macaddr = config->enet0_mac;
-+              ar231x_add_ethernet(0, KSEG1ADDR(AR531X_ENET1),
++              ar231x_add_ethernet(0, AR531X_ENET1,
 +                      AR5312_IRQ_ENET1_INTRS, &ar5312_eth1_data);
 +
 +              if (!ar231x_board.radio)
 +      .reset_clear = ar2315_device_reset_clear,
 +      .reset_mac = AR2315_RESET_ENET0,
 +      .reset_phy = AR2315_RESET_EPHY0,
-+      .phy_base = KSEG1ADDR(AR2315_ENET0),
++      .phy_base = AR2315_ENET0,
 +      .config = &ar231x_board,
 +};
 +
 +      ar2315_init_gpio_leds();
 +      platform_device_register(&ar2315_wdt);
 +      platform_device_register(&ar2315_spiflash);
-+      ar231x_add_ethernet(0, KSEG1ADDR(AR2315_ENET0), AR2315_IRQ_ENET0_INTRS,
-+              &ar2315_eth_data);
++      ar231x_add_ethernet(0, AR2315_ENET0, AR2315_IRQ_ENET0_INTRS,
++                          &ar2315_eth_data);
 +      ar231x_add_wmac(0, AR2315_WLAN0, AR2315_IRQ_WLAN0_INTRS);
 +
 +      return 0;
index 5f743b433c4511b7348be83ca5741117f7814fe1..0e158d4d015d692d6c52f5b5df28f9dfa82f17c1 100644 (file)
@@ -33,7 +33,7 @@
 +obj-$(CONFIG_NET_AR231X) += ar231x.o
 --- /dev/null
 +++ b/drivers/net/ethernet/atheros/ar231x/ar231x.c
-@@ -0,0 +1,1249 @@
+@@ -0,0 +1,1246 @@
 +/*
 + * ar231x.c: Linux driver for the Atheros AR231x Ethernet device.
 + *
 +      tasklet_init(&sp->rx_tasklet, rx_tasklet_func, (unsigned long) dev);
 +      tasklet_disable(&sp->rx_tasklet);
 +
-+      sp->eth_regs = ioremap_nocache(virt_to_phys(ar_eth_base),
-+                                     sizeof(*sp->eth_regs));
++      sp->eth_regs = ioremap_nocache(ar_eth_base, sizeof(*sp->eth_regs));
 +      if (!sp->eth_regs) {
 +              printk("Can't remap eth registers\n");
 +              return -ENXIO;
 +       * even though the MAC might be on ENET1.
 +       * Needto remap PHY regs separately in this case
 +       */
-+      if (virt_to_phys(ar_eth_base) == virt_to_phys(sp->phy_regs))
++      if (ar_eth_base == sp->cfg->phy_base)
 +              sp->phy_regs = sp->eth_regs;
 +      else {
-+              sp->phy_regs =
-+                      ioremap_nocache(virt_to_phys(sp->cfg->phy_base),
-+                                                      sizeof(*sp->phy_regs));
++              sp->phy_regs = ioremap_nocache(sp->cfg->phy_base,
++                                             sizeof(*sp->phy_regs));
 +              if (!sp->phy_regs) {
 +                      printk("Can't remap phy registers\n");
 +                      return -ENXIO;
 +              }
 +      }
 +
-+      sp->dma_regs =
-+              ioremap_nocache(virt_to_phys(ar_eth_base + 0x1000),
-+                                              sizeof(*sp->dma_regs));
-+      dev->base_addr = (unsigned int) sp->dma_regs;
++      sp->dma_regs = ioremap_nocache(ar_eth_base + 0x1000,
++                                     sizeof(*sp->dma_regs));
 +      if (!sp->dma_regs) {
 +              printk("Can't remap DMA registers\n");
 +              return -ENXIO;
 +      }
++      dev->base_addr = ar_eth_base + 0x1000;
 +
 +      strncpy(sp->name, "Atheros AR231x", sizeof(sp->name) - 1);
 +      sp->name[sizeof(sp->name) - 1] = '\0';
index cc3a74ec51fa3bebaaa30011108cecafa1cd33f2..361b4e34666d371d5e6d9b92d38e1481e793dcc7 100644 (file)
@@ -41,7 +41,7 @@
  int ar231x_probe(struct platform_device *pdev)
  {
        struct net_device *dev;
-@@ -287,6 +314,23 @@ int ar231x_probe(struct platform_device
+@@ -284,6 +311,23 @@ int ar231x_probe(struct platform_device
  
        mdiobus_register(sp->mii_bus);
  
@@ -65,7 +65,7 @@
        if (ar231x_mdiobus_probe(dev) != 0) {
                printk(KERN_ERR "%s: mdiobus_probe failed\n", dev->name);
                rx_tasklet_cleanup(dev);
-@@ -343,8 +387,10 @@ static int ar231x_remove(struct platform
+@@ -340,8 +384,10 @@ static int ar231x_remove(struct platform
        rx_tasklet_cleanup(dev);
        ar231x_init_cleanup(dev);
        unregister_netdev(dev);
@@ -78,7 +78,7 @@
        kfree(dev);
        return 0;
  }
-@@ -1103,6 +1149,9 @@ static int ar231x_ioctl(struct net_devic
+@@ -1100,6 +1146,9 @@ static int ar231x_ioctl(struct net_devic
        struct ar231x_private *sp = netdev_priv(dev);
        int ret;