atheros: v3.18: rearrange code between patches
[openwrt/svn-archive/archive.git] / target / linux / atheros / patches-3.18 / 100-board.patch
index 7dd0b7aa368bb8624c06575ae577cba8993ebfbe..643014f6887bb3720fc53de484e4231630198f62 100644 (file)
@@ -1,6 +1,6 @@
 --- a/arch/mips/Kconfig
 +++ b/arch/mips/Kconfig
 --- a/arch/mips/Kconfig
 +++ b/arch/mips/Kconfig
-@@ -96,6 +96,20 @@ config AR7
+@@ -96,6 +96,19 @@ config AR7
          Support for the Texas Instruments AR7 System-on-a-Chip
          family: TNETD7100, 7200 and 7300.
  
          Support for the Texas Instruments AR7 System-on-a-Chip
          family: TNETD7100, 7200 and 7300.
  
 +      select SYS_HAS_CPU_MIPS32_R1
 +      select SYS_SUPPORTS_BIG_ENDIAN
 +      select SYS_SUPPORTS_32BIT_KERNEL
 +      select SYS_HAS_CPU_MIPS32_R1
 +      select SYS_SUPPORTS_BIG_ENDIAN
 +      select SYS_SUPPORTS_32BIT_KERNEL
-+      select ARCH_REQUIRE_GPIOLIB
 +      help
 +        Support for AR231x and AR531x based boards
 +
  config ATH79
        bool "Atheros AR71XX/AR724X/AR913X based boards"
        select ARCH_REQUIRE_GPIOLIB
 +      help
 +        Support for AR231x and AR531x based boards
 +
  config ATH79
        bool "Atheros AR71XX/AR724X/AR913X based boards"
        select ARCH_REQUIRE_GPIOLIB
-@@ -834,6 +848,7 @@ config MIPS_PARAVIRT
+@@ -834,6 +847,7 @@ config MIPS_PARAVIRT
  
  endchoice
  
  
  endchoice
  
 +}
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/ath25_platform.h
 +}
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/ath25_platform.h
-@@ -0,0 +1,84 @@
+@@ -0,0 +1,73 @@
 +#ifndef __ASM_MACH_ATH25_PLATFORM_H
 +#define __ASM_MACH_ATH25_PLATFORM_H
 +
 +#ifndef __ASM_MACH_ATH25_PLATFORM_H
 +#define __ASM_MACH_ATH25_PLATFORM_H
 +
 +      const char *radio;
 +};
 +
 +      const char *radio;
 +};
 +
-+/*
-+ * Platform device information for the Ethernet MAC
-+ */
-+struct ar231x_eth {
-+      void (*reset_set)(u32);
-+      void (*reset_clear)(u32);
-+      u32 reset_mac;
-+      u32 reset_phy;
-+      char *macaddr;
-+};
-+
 +#endif /* __ASM_MACH_ATH25_PLATFORM_H */
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/cpu-feature-overrides.h
 +#endif /* __ASM_MACH_ATH25_PLATFORM_H */
 --- /dev/null
 +++ b/arch/mips/include/asm/mach-ath25/cpu-feature-overrides.h
 +#endif /* __ASM_MACH_ATH25_WAR_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar2315_regs.h
 +#endif /* __ASM_MACH_ATH25_WAR_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar2315_regs.h
-@@ -0,0 +1,479 @@
+@@ -0,0 +1,471 @@
 +/*
 + * Register definitions for AR2315+
 + *
 +/*
 + * Register definitions for AR2315+
 + *
 +#define AR2315_PCI_EXT_BASE   0x80000000      /* PCI external */
 +#define AR2315_PCI_EXT_SIZE   0x40000000
 +
 +#define AR2315_PCI_EXT_BASE   0x80000000      /* PCI external */
 +#define AR2315_PCI_EXT_SIZE   0x40000000
 +
-+/* MII registers offset inside Ethernet MMR region */
-+#define AR2315_ENET0_MII_BASE (AR2315_ENET0_BASE + 0x14)
-+
 +/*
 + * Cold reset register
 + */
 +/*
 + * Cold reset register
 + */
 +#define AR2315_AMBACLK_CLK_DIV_M      0x0000000c
 +#define AR2315_AMBACLK_CLK_DIV_S      2
 +
 +#define AR2315_AMBACLK_CLK_DIV_M      0x0000000c
 +#define AR2315_AMBACLK_CLK_DIV_S      2
 +
-+/* GPIO MMR base address */
-+#define AR2315_GPIO                   0x0088
-+
-+#define AR2315_RESET_GPIO       5
-+
 +/*
 + *  PCI Clock Control
 + */
 +/*
 + *  PCI Clock Control
 + */
 +#endif /* __ASM_MACH_ATH25_AR2315_REGS_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar5312_regs.h
 +#endif /* __ASM_MACH_ATH25_AR2315_REGS_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar5312_regs.h
-@@ -0,0 +1,229 @@
+@@ -0,0 +1,225 @@
 +/*
 + * 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
 +/*
 + * 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
 +#define AR5312_AR5312_REV7      0x0057          /* AR5312 WMAC (AP30-040) */
 +#define AR5312_AR2313_REV8      0x0058          /* AR2313 WMAC (AP43-030) */
 +
 +#define AR5312_AR5312_REV7      0x0057          /* AR5312 WMAC (AP30-040) */
 +#define AR5312_AR2313_REV8      0x0058          /* AR2313 WMAC (AP43-030) */
 +
-+/* MII registers offset inside Ethernet MMR region */
-+#define AR5312_ENET0_MII_BASE (AR5312_ENET0_BASE + 0x14)
-+#define AR5312_ENET1_MII_BASE (AR5312_ENET1_BASE + 0x14)
-+
 +/* Reset/Timer Block Address Map */
 +#define AR5312_TIMER          0x0000 /* countdown timer */
 +#define AR5312_RELOAD         0x0004 /* timer reload value */
 +/* Reset/Timer Block Address Map */
 +#define AR5312_TIMER          0x0000 /* countdown timer */
 +#define AR5312_RELOAD         0x0004 /* timer reload value */
 +#endif        /* __ASM_MACH_ATH25_AR5312_REGS_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar5312.c
 +#endif        /* __ASM_MACH_ATH25_AR5312_REGS_H */
 --- /dev/null
 +++ b/arch/mips/ath25/ar5312.c
-@@ -0,0 +1,492 @@
+@@ -0,0 +1,401 @@
 +/*
 + * 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
 +/*
 + * 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
 +#include <linux/bitops.h>
 +#include <linux/irqdomain.h>
 +#include <linux/reboot.h>
 +#include <linux/bitops.h>
 +#include <linux/irqdomain.h>
 +#include <linux/reboot.h>
-+#include <linux/leds.h>
-+#include <linux/gpio.h>
 +#include <asm/bootinfo.h>
 +#include <asm/reboot.h>
 +#include <asm/time.h>
 +#include <asm/bootinfo.h>
 +#include <asm/reboot.h>
 +#include <asm/time.h>
 +
 +      if (pending & CAUSEF_IP2)
 +              do_IRQ(AR5312_IRQ_WLAN0);
 +
 +      if (pending & CAUSEF_IP2)
 +              do_IRQ(AR5312_IRQ_WLAN0);
-+      else if (pending & CAUSEF_IP3)
-+              do_IRQ(AR5312_IRQ_ENET0);
-+      else if (pending & CAUSEF_IP4)
-+              do_IRQ(AR5312_IRQ_ENET1);
 +      else if (pending & CAUSEF_IP5)
 +              do_IRQ(AR5312_IRQ_WLAN1);
 +      else if (pending & CAUSEF_IP6)
 +      else if (pending & CAUSEF_IP5)
 +              do_IRQ(AR5312_IRQ_WLAN1);
 +      else if (pending & CAUSEF_IP6)
 +      ar5312_misc_irq_domain = domain;
 +}
 +
 +      ar5312_misc_irq_domain = domain;
 +}
 +
-+static void ar5312_device_reset_set(u32 mask)
-+{
-+      u32 val;
-+
-+      val = ar5312_rst_reg_read(AR5312_RESET);
-+      ar5312_rst_reg_write(AR5312_RESET, val | mask);
-+}
-+
-+static void ar5312_device_reset_clear(u32 mask)
-+{
-+      u32 val;
-+
-+      val = ar5312_rst_reg_read(AR5312_RESET);
-+      ar5312_rst_reg_write(AR5312_RESET, val & ~mask);
-+}
-+
 +static struct physmap_flash_data ar5312_flash_data = {
 +      .width = 2,
 +};
 +static struct physmap_flash_data ar5312_flash_data = {
 +      .width = 2,
 +};
 +      .flags = IORESOURCE_MEM,
 +};
 +
 +      .flags = IORESOURCE_MEM,
 +};
 +
-+static struct ar231x_eth ar5312_eth0_data = {
-+      .reset_set = ar5312_device_reset_set,
-+      .reset_clear = ar5312_device_reset_clear,
-+      .reset_mac = AR5312_RESET_ENET0,
-+      .reset_phy = AR5312_RESET_EPHY0,
-+};
-+
-+static struct ar231x_eth ar5312_eth1_data = {
-+      .reset_set = ar5312_device_reset_set,
-+      .reset_clear = ar5312_device_reset_clear,
-+      .reset_mac = AR5312_RESET_ENET1,
-+      .reset_phy = AR5312_RESET_EPHY1,
-+};
-+
 +static struct platform_device ar5312_physmap_flash = {
 +      .name = "physmap-flash",
 +      .id = 0,
 +static struct platform_device ar5312_physmap_flash = {
 +      .name = "physmap-flash",
 +      .id = 0,
 +      .num_resources = 1,
 +};
 +
 +      .num_resources = 1,
 +};
 +
-+#ifdef CONFIG_LEDS_GPIO
-+static struct gpio_led ar5312_leds[] = {
-+      { .name = "wlan", .gpio = 0, .active_low = 1, },
-+};
-+
-+static const struct gpio_led_platform_data ar5312_led_data = {
-+      .num_leds = ARRAY_SIZE(ar5312_leds),
-+      .leds = (void *)ar5312_leds,
-+};
-+
-+static struct platform_device ar5312_gpio_leds = {
-+      .name = "leds-gpio",
-+      .id = -1,
-+      .dev.platform_data = (void *)&ar5312_led_data,
-+};
-+#endif
-+
 +static void __init ar5312_flash_init(void)
 +{
 +      void __iomem *flashctl_base;
 +static void __init ar5312_flash_init(void)
 +{
 +      void __iomem *flashctl_base;
 +void __init ar5312_init_devices(void)
 +{
 +      struct ath25_boarddata *config;
 +void __init ar5312_init_devices(void)
 +{
 +      struct ath25_boarddata *config;
-+      u8 *c;
 +
 +      ar5312_flash_init();
 +
 +
 +      ar5312_flash_init();
 +
 +
 +      platform_device_register(&ar5312_physmap_flash);
 +
 +
 +      platform_device_register(&ar5312_physmap_flash);
 +
-+#ifdef CONFIG_LEDS_GPIO
-+      ar5312_leds[0].gpio = config->sys_led_gpio;
-+      platform_device_register(&ar5312_gpio_leds);
-+#endif
-+
-+      /* Fix up MAC addresses if necessary */
-+      if (is_broadcast_ether_addr(config->enet0_mac))
-+              ether_addr_copy(config->enet0_mac, config->enet1_mac);
-+
-+      /* If ENET0 and ENET1 have the same mac address,
-+       * increment the one from ENET1 */
-+      if (ether_addr_equal(config->enet0_mac, config->enet1_mac)) {
-+              c = config->enet1_mac + 5;
-+              while ((c >= config->enet1_mac) && !(++(*c)))
-+                      c--;
-+      }
-+
 +      switch (ath25_soc) {
 +      case ATH25_SOC_AR5312:
 +      switch (ath25_soc) {
 +      case ATH25_SOC_AR5312:
-+              ar5312_eth0_data.macaddr = config->enet0_mac;
-+              ath25_add_ethernet(0, AR5312_ENET0_BASE, "eth0_mii",
-+                                 AR5312_ENET0_MII_BASE, AR5312_IRQ_ENET0,
-+                                 &ar5312_eth0_data);
-+
-+              ar5312_eth1_data.macaddr = config->enet1_mac;
-+              ath25_add_ethernet(1, AR5312_ENET1_BASE, "eth1_mii",
-+                                 AR5312_ENET1_MII_BASE, AR5312_IRQ_ENET1,
-+                                 &ar5312_eth1_data);
-+
 +              if (!ath25_board.radio)
 +                      return;
 +
 +              if (!ath25_board.radio)
 +                      return;
 +
 +
 +              ath25_add_wmac(0, AR5312_WLAN0_BASE, AR5312_IRQ_WLAN0);
 +              break;
 +
 +              ath25_add_wmac(0, AR5312_WLAN0_BASE, AR5312_IRQ_WLAN0);
 +              break;
-+      /*
-+       * AR2312/3 ethernet uses the PHY of ENET0, but the MAC
-+       * of ENET1. Atheros calls it 'twisted' for a reason :)
-+       */
 +      case ATH25_SOC_AR2312:
 +      case ATH25_SOC_AR2313:
 +      case ATH25_SOC_AR2312:
 +      case ATH25_SOC_AR2313:
-+              ar5312_eth1_data.reset_phy = ar5312_eth0_data.reset_phy;
-+              ar5312_eth1_data.macaddr = config->enet0_mac;
-+              ath25_add_ethernet(1, AR5312_ENET1_BASE, "eth0_mii",
-+                                 AR5312_ENET0_MII_BASE, AR5312_IRQ_ENET1,
-+                                 &ar5312_eth1_data);
-+
 +              if (!ath25_board.radio)
 +                      return;
 +              break;
 +              if (!ath25_board.radio)
 +                      return;
 +              break;
 +}
 --- /dev/null
 +++ b/arch/mips/ath25/ar2315.c
 +}
 --- /dev/null
 +++ b/arch/mips/ath25/ar2315.c
-@@ -0,0 +1,438 @@
+@@ -0,0 +1,312 @@
 +/*
 + * 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
 +/*
 + * 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
 +#include <linux/bitops.h>
 +#include <linux/irqdomain.h>
 +#include <linux/reboot.h>
 +#include <linux/bitops.h>
 +#include <linux/irqdomain.h>
 +#include <linux/reboot.h>
-+#include <linux/delay.h>
-+#include <linux/leds.h>
-+#include <linux/gpio.h>
 +#include <asm/bootinfo.h>
 +#include <asm/reboot.h>
 +#include <asm/time.h>
 +#include <asm/bootinfo.h>
 +#include <asm/reboot.h>
 +#include <asm/time.h>
 +
 +      if (pending & CAUSEF_IP3)
 +              do_IRQ(AR2315_IRQ_WLAN0);
 +
 +      if (pending & CAUSEF_IP3)
 +              do_IRQ(AR2315_IRQ_WLAN0);
-+      else if (pending & CAUSEF_IP4)
-+              do_IRQ(AR2315_IRQ_ENET0);
 +      else if (pending & CAUSEF_IP2)
 +              do_IRQ(AR2315_IRQ_MISC);
 +      else if (pending & CAUSEF_IP7)
 +      else if (pending & CAUSEF_IP2)
 +              do_IRQ(AR2315_IRQ_MISC);
 +      else if (pending & CAUSEF_IP7)
 +      ar2315_misc_irq_domain = domain;
 +}
 +
 +      ar2315_misc_irq_domain = domain;
 +}
 +
-+static void ar2315_device_reset_set(u32 mask)
-+{
-+      u32 val;
-+
-+      val = ar2315_rst_reg_read(AR2315_RESET);
-+      ar2315_rst_reg_write(AR2315_RESET, val | mask);
-+}
-+
-+static void ar2315_device_reset_clear(u32 mask)
-+{
-+      u32 val;
-+
-+      val = ar2315_rst_reg_read(AR2315_RESET);
-+      ar2315_rst_reg_write(AR2315_RESET, val & ~mask);
-+}
-+
-+static struct ar231x_eth ar2315_eth_data = {
-+      .reset_set = ar2315_device_reset_set,
-+      .reset_clear = ar2315_device_reset_clear,
-+      .reset_mac = AR2315_RESET_ENET0,
-+      .reset_phy = AR2315_RESET_EPHY0,
-+};
-+
-+static struct resource ar2315_spiflash_res[] = {
-+      {
-+              .name = "spiflash_read",
-+              .flags = IORESOURCE_MEM,
-+              .start = AR2315_SPI_READ_BASE,
-+              .end = AR2315_SPI_READ_BASE + AR2315_SPI_READ_SIZE - 1,
-+      },
-+      {
-+              .name = "spiflash_mmr",
-+              .flags = IORESOURCE_MEM,
-+              .start = AR2315_SPI_MMR_BASE,
-+              .end = AR2315_SPI_MMR_BASE + AR2315_SPI_MMR_SIZE - 1,
-+      },
-+};
-+
-+static struct platform_device ar2315_spiflash = {
-+      .id = 0,
-+      .name = "ar2315-spiflash",
-+      .resource = ar2315_spiflash_res,
-+      .num_resources = ARRAY_SIZE(ar2315_spiflash_res)
-+};
-+
-+static struct resource ar2315_wdt_res[] = {
-+      {
-+              .flags = IORESOURCE_MEM,
-+              .start = AR2315_RST_BASE + AR2315_WDT_TIMER,
-+              .end = AR2315_RST_BASE + AR2315_WDT_TIMER + 8 - 1,
-+      },
-+      {
-+              .flags = IORESOURCE_IRQ,
-+      }
-+};
-+
-+static struct platform_device ar2315_wdt = {
-+      .id = 0,
-+      .name = "ar2315-wdt",
-+      .resource = ar2315_wdt_res,
-+      .num_resources = ARRAY_SIZE(ar2315_wdt_res)
-+};
-+
-+#ifdef CONFIG_LEDS_GPIO
-+static struct gpio_led ar2315_leds[6];
-+static struct gpio_led_platform_data ar2315_led_data = {
-+      .leds = (void *)ar2315_leds,
-+};
-+
-+static struct platform_device ar2315_gpio_leds = {
-+      .name = "leds-gpio",
-+      .id = -1,
-+      .dev = {
-+              .platform_data = (void *)&ar2315_led_data,
-+      }
-+};
-+
-+static void __init ar2315_init_gpio_leds(void)
-+{
-+      static char led_names[6][6];
-+      int i, led = 0;
-+
-+      ar2315_led_data.num_leds = 0;
-+      for (i = 1; i < 8; i++) {
-+              if ((i == AR2315_RESET_GPIO) ||
-+                  (i == ath25_board.config->reset_config_gpio))
-+                      continue;
-+
-+              if (i == ath25_board.config->sys_led_gpio)
-+                      strcpy(led_names[led], "wlan");
-+              else
-+                      sprintf(led_names[led], "gpio%d", i);
-+
-+              ar2315_leds[led].name = led_names[led];
-+              ar2315_leds[led].gpio = i;
-+              ar2315_leds[led].active_low = 0;
-+              led++;
-+      }
-+      ar2315_led_data.num_leds = led;
-+      platform_device_register(&ar2315_gpio_leds);
-+}
-+#else
-+static inline void ar2315_init_gpio_leds(void)
-+{
-+}
-+#endif
-+
 +void __init ar2315_init_devices(void)
 +{
 +      /* Find board configuration */
 +      ath25_find_config(AR2315_SPI_READ_BASE, AR2315_SPI_READ_SIZE);
 +void __init ar2315_init_devices(void)
 +{
 +      /* Find board configuration */
 +      ath25_find_config(AR2315_SPI_READ_BASE, AR2315_SPI_READ_SIZE);
-+      ar2315_eth_data.macaddr = ath25_board.config->enet0_mac;
-+
-+      ar2315_init_gpio_leds();
-+
-+      ar2315_wdt_res[1].start = irq_create_mapping(ar2315_misc_irq_domain,
-+                                                   AR2315_MISC_IRQ_WATCHDOG);
-+      ar2315_wdt_res[1].end = ar2315_wdt_res[1].start;
-+      platform_device_register(&ar2315_wdt);
-+
-+      platform_device_register(&ar2315_spiflash);
-+
-+      ath25_add_ethernet(0, AR2315_ENET0_BASE, "eth0_mii",
-+                         AR2315_ENET0_MII_BASE, AR2315_IRQ_ENET0,
-+                         &ar2315_eth_data);
 +
 +      ath25_add_wmac(0, AR2315_WLAN0_BASE, AR2315_IRQ_WLAN0);
 +}
 +
 +      ath25_add_wmac(0, AR2315_WLAN0_BASE, AR2315_IRQ_WLAN0);
 +}
 +      /* Cold reset does not work on the AR2315/6, use the GPIO reset bits
 +       * a workaround. Give it some time to attempt a gpio based hardware
 +       * reset (atheros reference design workaround) */
 +      /* Cold reset does not work on the AR2315/6, use the GPIO reset bits
 +       * a workaround. Give it some time to attempt a gpio based hardware
 +       * reset (atheros reference design workaround) */
-+      gpio_request_one(AR2315_RESET_GPIO, GPIOF_OUT_INIT_LOW, "Reset");
-+      mdelay(100);
++
++      /* TODO: implement the GPIO reset workaround */
 +
 +      /* Some boards (e.g. Senao EOC-2610) don't implement the reset logic
 +       * workaround. Attempt to jump to the mips reset location -
 +
 +      /* Some boards (e.g. Senao EOC-2610) don't implement the reset logic
 +       * workaround. Attempt to jump to the mips reset location -
 +#endif
 --- /dev/null
 +++ b/arch/mips/ath25/devices.h
 +#endif
 --- /dev/null
 +++ b/arch/mips/ath25/devices.h
-@@ -0,0 +1,45 @@
+@@ -0,0 +1,41 @@
 +#ifndef __ATH25_DEVICES_H
 +#define __ATH25_DEVICES_H
 +
 +#ifndef __ATH25_DEVICES_H
 +#define __ATH25_DEVICES_H
 +
-+#define AR231X_GPIO_IRQ_BASE          0x30
-+
 +#define ATH25_REG_MS(_val, _field)    (((_val) & _field##_M) >> _field##_S)
 +
 +#define ATH25_IRQ_CPU_CLOCK   (MIPS_CPU_IRQ_BASE + 7) /* C0_CAUSE: 0x8000 */
 +#define ATH25_REG_MS(_val, _field)    (((_val) & _field##_M) >> _field##_S)
 +
 +#define ATH25_IRQ_CPU_CLOCK   (MIPS_CPU_IRQ_BASE + 7) /* C0_CAUSE: 0x8000 */
 +extern void (*ath25_irq_dispatch)(void);
 +
 +int ath25_find_config(phys_addr_t offset, unsigned long size);
 +extern void (*ath25_irq_dispatch)(void);
 +
 +int ath25_find_config(phys_addr_t offset, unsigned long size);
-+int ath25_add_ethernet(int nr, u32 base, const char *mii_name, u32 mii_base,
-+                     int irq, void *pdata);
 +void ath25_serial_setup(u32 mapbase, int irq, unsigned int uartclk);
 +int ath25_add_wmac(int nr, u32 base, int irq);
 +
 +void ath25_serial_setup(u32 mapbase, int irq, unsigned int uartclk);
 +int ath25_add_wmac(int nr, u32 base, int irq);
 +
 +#endif
 --- /dev/null
 +++ b/arch/mips/ath25/devices.c
 +#endif
 --- /dev/null
 +++ b/arch/mips/ath25/devices.c
-@@ -0,0 +1,191 @@
+@@ -0,0 +1,127 @@
 +#include <linux/kernel.h>
 +#include <linux/init.h>
 +#include <linux/serial.h>
 +#include <linux/kernel.h>
 +#include <linux/init.h>
 +#include <linux/serial.h>
 +struct ar231x_board_config ath25_board;
 +enum ath25_soc_type ath25_soc = ATH25_SOC_UNKNOWN;
 +
 +struct ar231x_board_config ath25_board;
 +enum ath25_soc_type ath25_soc = ATH25_SOC_UNKNOWN;
 +
-+static struct resource ath25_eth0_res[] = {
-+      {
-+              .name = "eth0_membase",
-+              .flags = IORESOURCE_MEM,
-+      },
-+      {
-+              .name = "eth0_mii",
-+              .flags = IORESOURCE_MEM,
-+      },
-+      {
-+              .name = "eth0_irq",
-+              .flags = IORESOURCE_IRQ,
-+      }
-+};
-+
-+static struct resource ath25_eth1_res[] = {
-+      {
-+              .name = "eth1_membase",
-+              .flags = IORESOURCE_MEM,
-+      },
-+      {
-+              .name = "eth1_mii",
-+              .flags = IORESOURCE_MEM,
-+      },
-+      {
-+              .name = "eth1_irq",
-+              .flags = IORESOURCE_IRQ,
-+      }
-+};
-+
-+static struct platform_device ath25_eth[] = {
-+      {
-+              .id = 0,
-+              .name = "ar231x-eth",
-+              .resource = ath25_eth0_res,
-+              .num_resources = ARRAY_SIZE(ath25_eth0_res)
-+      },
-+      {
-+              .id = 1,
-+              .name = "ar231x-eth",
-+              .resource = ath25_eth1_res,
-+              .num_resources = ARRAY_SIZE(ath25_eth1_res)
-+      }
-+};
-+
 +static struct resource ath25_wmac0_res[] = {
 +      {
 +              .name = "wmac0_membase",
 +static struct resource ath25_wmac0_res[] = {
 +      {
 +              .name = "wmac0_membase",
 +      return soc_type_strings[ath25_soc];
 +}
 +
 +      return soc_type_strings[ath25_soc];
 +}
 +
-+int __init ath25_add_ethernet(int nr, u32 base, const char *mii_name,
-+                            u32 mii_base, int irq, void *pdata)
-+{
-+      struct resource *res;
-+
-+      ath25_eth[nr].dev.platform_data = pdata;
-+      res = &ath25_eth[nr].resource[0];
-+      res->start = base;
-+      res->end = base + 0x2000 - 1;
-+      res++;
-+      res->name = mii_name;
-+      res->start = mii_base;
-+      res->end = mii_base + 8 - 1;
-+      res++;
-+      res->start = irq;
-+      res->end = irq;
-+      return platform_device_register(&ath25_eth[nr]);
-+}
-+
 +void __init ath25_serial_setup(u32 mapbase, int irq, unsigned int uartclk)
 +{
 +      struct uart_port s;
 +void __init ath25_serial_setup(u32 mapbase, int irq, unsigned int uartclk)
 +{
 +      struct uart_port s;