+}
--- /dev/null
+++ b/arch/mips/include/asm/mach-ar231x/ar231x_platform.h
-@@ -0,0 +1,83 @@
+@@ -0,0 +1,84 @@
+#ifndef __AR531X_PLATFORM_H
+#define __AR531X_PLATFORM_H
+
+ * Platform device information for the Ethernet MAC
+ */
+struct ar231x_eth {
-+ u32 reset_base;
++ void (*reset_set)(u32);
++ void (*reset_clear)(u32);
+ u32 reset_mac;
+ u32 reset_phy;
+ u32 phy_base;
+
--- /dev/null
+++ b/arch/mips/ar231x/ar5312.c
-@@ -0,0 +1,582 @@
+@@ -0,0 +1,600 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+
+/* end of gpiolib */
+
++static void ar5312_device_reset_set(u32 mask)
++{
++ u32 val;
++
++ val = ar231x_read_reg(AR531X_RESET);
++ ar231x_write_reg(AR531X_RESET, val | mask);
++}
++
++static void ar5312_device_reset_clear(u32 mask)
++{
++ u32 val;
++
++ val = ar231x_read_reg(AR531X_RESET);
++ ar231x_write_reg(AR531X_RESET, val & ~mask);
++}
++
+static struct physmap_flash_data ar5312_flash_data = {
+ .width = 2,
+};
+};
+
+static struct ar231x_eth ar5312_eth0_data = {
-+ .reset_base = AR531X_RESET,
++ .reset_set = ar5312_device_reset_set,
++ .reset_clear = ar5312_device_reset_clear,
+ .reset_mac = AR531X_RESET_ENET0,
+ .reset_phy = AR531X_RESET_EPHY0,
+ .phy_base = KSEG1ADDR(AR531X_ENET0),
+};
+
+static struct ar231x_eth ar5312_eth1_data = {
-+ .reset_base = AR531X_RESET,
++ .reset_set = ar5312_device_reset_set,
++ .reset_clear = ar5312_device_reset_clear,
+ .reset_mac = AR531X_RESET_ENET1,
+ .reset_phy = AR531X_RESET_EPHY1,
+ .phy_base = KSEG1ADDR(AR531X_ENET1),
+
--- /dev/null
+++ b/arch/mips/ar231x/ar2315.c
-@@ -0,0 +1,639 @@
+@@ -0,0 +1,655 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+
+/* end of gpiolib */
+
++static void ar2315_device_reset_set(u32 mask)
++{
++ u32 val;
++
++ val = ar231x_read_reg(AR2315_RESET);
++ ar231x_write_reg(AR2315_RESET, val | mask);
++}
++
++static void ar2315_device_reset_clear(u32 mask)
++{
++ u32 val;
++
++ val = ar231x_read_reg(AR2315_RESET);
++ ar231x_write_reg(AR2315_RESET, val & ~mask);
++}
+
+static struct ar231x_eth ar2315_eth_data = {
-+ .reset_base = AR2315_RESET,
++ .reset_set = ar2315_device_reset_set,
++ .reset_clear = ar2315_device_reset_clear,
+ .reset_mac = AR2315_RESET_ENET0,
+ .reset_phy = AR2315_RESET_EPHY0,
+ .phy_base = KSEG1ADDR(AR2315_ENET0),
+obj-$(CONFIG_NET_VENDOR_AR231X) += ar231x.o
--- /dev/null
+++ b/drivers/net/ethernet/ar231x/ar231x.c
-@@ -0,0 +1,1254 @@
+@@ -0,0 +1,1249 @@
+/*
+ * ar231x.c: Linux driver for the Atheros AR231x Ethernet device.
+ *
+ return -ENXIO;
+ }
+
-+ sp->int_regs = ioremap_nocache(virt_to_phys(sp->cfg->reset_base), 4);
-+ if (!sp->int_regs) {
-+ printk("Can't remap INTERRUPT registers\n");
-+ return -ENXIO;
-+ }
-+
+ strncpy(sp->name, "Atheros AR231x", sizeof(sp->name) - 1);
+ sp->name[sizeof(sp->name) - 1] = '\0';
+ memcpy(dev->dev_addr, sp->cfg->macaddr, 6);
+ unsigned int ethsal, ethsah;
+ unsigned int flags;
+
-+ *sp->int_regs |= sp->cfg->reset_mac;
++ sp->cfg->reset_set(sp->cfg->reset_mac);
+ mdelay(10);
-+ *sp->int_regs &= ~sp->cfg->reset_mac;
++ sp->cfg->reset_clear(sp->cfg->reset_mac);
+ mdelay(10);
-+ *sp->int_regs |= sp->cfg->reset_phy;
++ sp->cfg->reset_set(sp->cfg->reset_phy);
+ mdelay(10);
-+ *sp->int_regs &= ~sp->cfg->reset_phy;
++ sp->cfg->reset_clear(sp->cfg->reset_phy);
+ mdelay(10);
+
+ sp->dma_regs->bus_mode = (DMA_BUS_MODE_SWR);
+ sp->dma_regs->bus_mode = DMA_BUS_MODE_SWR;
+
+ /* place phy and MAC in reset */
-+ *sp->int_regs |= (sp->cfg->reset_mac | sp->cfg->reset_phy);
++ sp->cfg->reset_set(sp->cfg->reset_mac);
++ sp->cfg->reset_set(sp->cfg->reset_phy);
+
+ /* free buffers on tx ring */
+ for (j = 0; j < AR2313_DESCR_ENTRIES; j++) {
+ * the irq is gone forever ! When bond0 is made 'up' again,
+ * the ar231x_open () does not call request_irq (). Worse,
+ * the call to ar231x_halt() generates a WDOG reset due to
-+ * the write to 'sp->int_regs' and the box reboots.
++ * the write to reset register and the box reboots.
+ * Commenting this out is good since it allows the
+ * system to resume when bond0 is made up again.
+ */
+
--- /dev/null
+++ b/drivers/net/ethernet/ar231x/ar231x.h
-@@ -0,0 +1,288 @@
+@@ -0,0 +1,287 @@
+/*
+ * ar231x.h: Linux driver for the Atheros AR231x Ethernet device.
+ *
+ volatile ETHERNET_STRUCT *phy_regs;
+ volatile ETHERNET_STRUCT *eth_regs;
+ volatile DMA *dma_regs;
-+ volatile u32 *int_regs;
+ struct ar231x_eth *cfg;
+
+ spinlock_t lock; /* Serialise access to device */
int ar231x_probe(struct platform_device *pdev)
{
struct net_device *dev;
-@@ -293,6 +320,23 @@ int ar231x_probe(struct platform_device
+@@ -287,6 +314,23 @@ int ar231x_probe(struct platform_device
mdiobus_register(sp->mii_bus);
if (ar231x_mdiobus_probe(dev) != 0) {
printk(KERN_ERR "%s: mdiobus_probe failed\n", dev->name);
rx_tasklet_cleanup(dev);
-@@ -349,8 +393,10 @@ static int ar231x_remove(struct platform
+@@ -343,8 +387,10 @@ static int ar231x_remove(struct platform
rx_tasklet_cleanup(dev);
ar231x_init_cleanup(dev);
unregister_netdev(dev);
kfree(dev);
return 0;
}
-@@ -1108,6 +1154,9 @@ static int ar231x_ioctl(struct net_devic
+@@ -1103,6 +1149,9 @@ static int ar231x_ioctl(struct net_devic
struct ar231x_private *sp = netdev_priv(dev);
int ret;