[lantiq]
[openwrt/svn-archive/archive.git] / target / linux / lantiq / patches / 400-mach-arv45xx.patch
index 643a0f7ae13f2692043b11ee8bd15d73a7f0914d..b778a5bbffc10184a694950e6a78f7176e827982 100644 (file)
@@ -1,12 +1,13 @@
 --- a/arch/mips/include/asm/mach-lantiq/machine.h
 +++ b/arch/mips/include/asm/mach-lantiq/machine.h
-@@ -11,4 +11,7 @@
+@@ -11,4 +11,8 @@
        LANTIQ_MACH_EASY4010,           /* Twinpass evalkit */
        LANTIQ_MACH_EASY50712,          /* Danube evalkit */
        LANTIQ_MACH_EASY50812,          /* AR9 eval board */
 +      LANTIQ_MACH_ARV4518,            /* Airties WAV-221, SMC-7908A-ISP */
 +      LANTIQ_MACH_ARV452,                     /* Airties WAV-281, Arcor EasyboxA800 */
 +      LANTIQ_MACH_ARV4525,            /* Speedport W502V */
++      LANTIQ_MACH_ARV752DPW22,        /* Arcor easybox a803 */
  };
 --- a/arch/mips/lantiq/xway/Kconfig
 +++ b/arch/mips/lantiq/xway/Kconfig
@@ -30,7 +31,7 @@
 +obj-$(CONFIG_LANTIQ_MACH_ARV45XX) += mach-arv45xx.o
 --- /dev/null
 +++ b/arch/mips/lantiq/xway/mach-arv45xx.c
-@@ -0,0 +1,178 @@
+@@ -0,0 +1,268 @@
 +/*
 + *  This program is free software; you can redistribute it and/or modify it
 + *  under the terms of the GNU General Public License version 2 as published
@@ -58,6 +59,7 @@
 +#include "devices.h"
 +
 +#define ARV452_LATCH_SWITCH           (1 << 10)
++#define ARV752DPW22_LATCH_DEFAULT     (2)
 +
 +#ifdef CONFIG_MTD_PARTITIONS
 +static struct mtd_partition arv45xx_partitions[] =
 +#endif
 +};
 +
++static struct mtd_partition arv75xx_partitions[] =
++{
++      {
++              .name   = "uboot",
++              .offset = 0x0,
++              .size   = 0x40000,
++      },
++      {
++              .name   = "uboot_env",
++              .offset = 0x40000,
++              .size   = 0x10000,
++      },
++      {
++              .name   = "linux",
++              .offset = 0x50000,
++              .size   = 0x7a0000,
++      },
++      {
++              .name   = "board_config",
++              .offset = 0x7f0000,
++              .size   = 0x10000,
++      },
++};
++
++static struct physmap_flash_data arv75xx_flash_data = {
++#ifdef CONFIG_MTD_PARTITIONS
++      .nr_parts       = ARRAY_SIZE(arv75xx_partitions),
++      .parts          = arv75xx_partitions,
++#endif
++};
++
 +static struct lq_pci_data lq_pci_data = {
 +      .clock      = PCI_CLOCK_EXT,
-+      .req_mask   = 0xf,
++      .gpio   = PCI_GNT1 | PCI_REQ1,
++      .irq    = {
++              [14] = INT_NUM_IM0_IRL0 + 22,
++      },
 +};
 +
 +static struct lq_eth_data lq_eth_data = {
 +      { .name = "soc:green:online", .gpio = 9, .active_low = 1, },
 +};
 +
++static struct gpio_led
++arv752dpw22_leds_gpio[] __initdata = {
++      { .name = "soc:blue:power", .gpio = 3, .active_low = 1, .default_trigger = "default-on" },
++      { .name = "soc:red:internet", .gpio = 5, .active_low = 1, .default_trigger = "default-on" },
++      { .name = "soc:red:power", .gpio = 6, .active_low = 1, .default_trigger = "default-on" },
++      { .name = "soc:red:wps", .gpio = 8, .active_low = 1, .default_trigger = "default-on" },
++      { .name = "soc:red:fxo", .gpio = 35, .active_low = 1, .default_trigger = "default-on" },
++      { .name = "soc:red:voice", .gpio = 36, .active_low = 1, .default_trigger = "default-on" },
++      { .name = "soc:green:usb", .gpio = 37, .active_low = 1, .default_trigger = "default-on" },
++      { .name = "soc:green:wlan", .gpio = 38, .active_low = 1, .default_trigger = "default-on" },
++      { .name = "soc:green:wlan1", .gpio = 39, .active_low = 1, .default_trigger = "default-on" },
++      { .name = "soc:blue:wlan", .gpio = 40, .active_low = 1, .default_trigger = "default-on" },
++      { .name = "soc:blue:wlan1", .gpio = 41, .active_low = 1, .default_trigger = "default-on" },
++      { .name = "soc:green:eth1", .gpio = 43, .active_low = 1, .default_trigger = "default-on" },
++      { .name = "soc:green:eth2", .gpio = 44, .active_low = 1, .default_trigger = "default-on" },
++      { .name = "soc:green:eth3", .gpio = 45, .active_low = 1, .default_trigger = "default-on" },
++      { .name = "soc:green:eth4", .gpio = 46, .active_low = 1, .default_trigger = "default-on", },
++};
++
 +static void
 +arv45xx_register_ethernet(void)
 +{
 +      lq_register_ethernet(&lq_eth_data);
 +}
 +
++static void
++arv75xx_register_ethernet(void)
++{
++#define ARV75XX_BRN_MAC                       0x7f0016
++      memcpy_fromio(lq_eth_data.mac,
++              (void *)KSEG1ADDR(LQ_FLASH_START + ARV75XX_BRN_MAC), 6);
++      lq_register_ethernet(&lq_eth_data);
++}
++
 +static void __init
 +arv4518_init(void)
 +{
 +                      "ARV4525",
 +                      "ARV4525 - Speedport W502V",
 +                      arv4525_init);
++
++static void __init
++arv752dpw22_init(void)
++{
++      lq_register_gpio();
++      lq_register_gpio_ebu(ARV752DPW22_LATCH_DEFAULT);
++      lq_register_asc(0);
++      lq_register_asc(1);
++      lq_register_gpio_leds(arv752dpw22_leds_gpio, ARRAY_SIZE(arv752dpw22_leds_gpio));
++      lq_register_nor(&arv75xx_flash_data);
++      lq_pci_data.irq[15] = (INT_NUM_IM2_IRL0 + 31);
++      lq_pci_data.gpio |= PCI_EXIN1 | PCI_REQ2;
++      lq_register_pci(&lq_pci_data);
++      lq_register_wdt();
++      arv75xx_register_ethernet();
++      gpio_request(32, "usb-power");
++      gpio_direction_output(32, 0);
++      mdelay(1);
++      __gpio_set_value(32, 1);
++      gpio_request(33, "relay");
++      gpio_direction_output(33, 1);
++}
++
++MIPS_MACHINE(LANTIQ_MACH_ARV752DPW22,
++                      "ARV752DPW22",
++                      "ARV752DPW22 - Arcor A803",
++                      arv752dpw22_init);