[package] libpcap: explicitely disable libnl support to prevent different build resul...
[openwrt.git] / target / linux / cns3xxx / patches / 100-laguna_support.patch
index 32becc3..12fe800 100644 (file)
@@ -1,6 +1,6 @@
 --- /dev/null
 +++ b/arch/arm/mach-cns3xxx/laguna.c
-@@ -0,0 +1,671 @@
+@@ -0,0 +1,761 @@
 +/*
 + * Gateworks Corporation Laguna Platform
 + *
@@ -41,9 +41,9 @@
 +#include <asm/mach/arch.h>
 +#include <asm/mach/map.h>
 +#include <asm/mach/time.h>
-+#include <mach/hardware.h>
 +#include <mach/cns3xxx.h>
 +#include <mach/irqs.h>
++#include <mach/platform.h>
 +#include <mach/pm.h>
 +#include "core.h"
 +#include "devices.h"
 +              .name = "user2", /* Red Led */
 +              .gpio = 114,
 +              .active_low = 1,
++      },{
++              .name = "pwr1", /* Green Led */
++              .gpio = 116,
++              .active_low = 1,
++      },{
++              .name = "pwr2", /* Yellow Led */
++              .gpio = 117,
++              .active_low = 1,
++      },{
++              .name = "txd1", /* Green Led */
++              .gpio = 118,
++              .active_low = 1,
++      },{
++              .name = "txd2", /* Yellow Led */
++              .gpio = 119,
++              .active_low = 1,
++      },{
++              .name = "rxd1", /* Green Led */
++              .gpio = 120,
++              .active_low = 1,
++      },{
++              .name = "rxd2", /* Yellow Led */
++              .gpio = 121,
++              .active_low = 1,
++      },{
++              .name = "ser1", /* Green Led */
++              .gpio = 122,
++              .active_low = 1,
++      },{
++              .name = "ser2", /* Yellow Led */
++              .gpio = 123,
++              .active_low = 1,
++      },{
++              .name = "enet1", /* Green Led */
++              .gpio = 124,
++              .active_low = 1,
++      },{
++              .name = "enet2", /* Yellow Led */
++              .gpio = 125,
++              .active_low = 1,
++      },{
++              .name = "sig1_1", /* Green Led */
++              .gpio = 126,
++              .active_low = 1,
++      },{
++              .name = "sig1_2", /* Yellow Led */
++              .gpio = 127,
++              .active_low = 1,
++      },{
++              .name = "sig2_1", /* Green Led */
++              .gpio = 128,
++              .active_low = 1,
++      },{
++              .name = "sig2_2", /* Yellow Led */
++              .gpio = 129,
++              .active_low = 1,
++      },{
++              .name = "sig3_1", /* Green Led */
++              .gpio = 130,
++              .active_low = 1,
++      },{
++              .name = "sig3_2", /* Yellow Led */
++              .gpio = 131,
++              .active_low = 1,
++      },{
++              .name = "net1", /*Green Led */
++              .gpio = 109,
++              .active_low = 1,
++      },{
++              .name = "net2", /* Red Led */
++              .gpio = 110,
++              .active_low = 1,
++      },{
++              .name = "mod1", /* Green Led */
++              .gpio = 111,
++              .active_low = 1,
++      },{
++              .name = "mod2", /* Red Led */
++              .gpio = 112,
++              .active_low = 1,
 +      },
 +};
 +
 +static struct gpio_led_platform_data laguna_gpio_leds_data = {
-+      .num_leds = 2,
++      .num_leds = 22,
 +      .leds = laguna_gpio_leds,
 +};
 +
 +
 +static struct pca953x_platform_data laguna_pca_data = {
 +      .gpio_base = 100,
++      .irq_base = -1,
++};
++
++static struct pca953x_platform_data laguna_pca2_data = {
++      .gpio_base = 116,
++      .irq_base = -1,
 +};
 +
 +static struct i2c_board_info __initdata laguna_i2c_devices[] = {
 +              I2C_BOARD_INFO("pca9555", 0x23),
 +              .platform_data = &laguna_pca_data,
 +      },{
++              I2C_BOARD_INFO("pca9555", 0x27),
++              .platform_data = &laguna_pca2_data,
++      },{
 +              I2C_BOARD_INFO("gsp", 0x29),
 +      },{
 +              I2C_BOARD_INFO ("24c08",0x50),
 + * Watchdog
 + */
 +
-+static struct resource laguna_watchdog_resource[] = {
-+      {
-+              .start = CNS3XXX_TC11MP_TWD_BASE,
-+              .end = CNS3XXX_TC11MP_TWD_BASE + SZ_4K - 1,
-+              .flags = IORESOURCE_MEM,
-+      },{
-+              .start = IRQ_LOCALWDOG,
-+              .end = IRQ_LOCALWDOG,
-+              .flags = IORESOURCE_IRQ,
++static struct resource laguna_watchdog_resources[] = {
++      [0] = {
++              .start  = CNS3XXX_TC11MP_TWD_BASE,
++              .end    = CNS3XXX_TC11MP_TWD_BASE + SZ_4K - 1,
++              .flags  = IORESOURCE_MEM,
++      },
++      [1] = {
++              .start  = IRQ_LOCALWDOG,
++              .end    = IRQ_LOCALWDOG,
++              .flags  = IORESOURCE_IRQ,
 +      }
 +};
 +
 +static struct platform_device laguna_watchdog = {
-+      .name = "mpcore_wdt",
-+      .id = -1,
-+      .num_resources = ARRAY_SIZE(laguna_watchdog_resource),
-+      .resource = laguna_watchdog_resource,
++      .name           = "mpcore_wdt",
++      .id             = -1,
++      .num_resources  = ARRAY_SIZE(laguna_watchdog_resources),
++      .resource       = laguna_watchdog_resources,
 +};
 +
 +/*
 +
 +static void __init laguna_init(void)
 +{
++      cns3xxx_l2x0_init();
++
 +      platform_device_register(&laguna_watchdog);
 +
 +      platform_device_register(&laguna_i2c_controller);
 +      i2c_register_board_info(0, laguna_i2c_devices,
 +                      ARRAY_SIZE(laguna_i2c_devices));
 +
-+
 +      pm_power_off = cns3xxx_power_off;
 +}
 +
 +{
 +      cns3xxx_map_io();
 +      iotable_init(laguna_io_desc, ARRAY_SIZE(laguna_io_desc));
-+
 +      laguna_early_serial_setup();
 +}
 +
-+
 +static int __init laguna_model_setup(void)
 +{
 +      u32 __iomem *mem;
 +              if (laguna_net_data.ports)
 +                      platform_device_register(&laguna_net_device);
 +
-+              if (laguna_info.config_bitmap & (SATA0_LOAD | SATA1_LOAD))
++              if ((laguna_info.config_bitmap & SATA0_LOAD) ||
++                  (laguna_info.config_bitmap & SATA1_LOAD))
 +                      cns3xxx_ahci_init();
 +
 +              if (laguna_info.config_bitmap & (PCIE0_LOAD))
 +                      spi_register_board_info(laguna_spi_devices, ARRAY_SIZE(laguna_spi_devices));
 +              }
 +
-+              if (laguna_info.config_bitmap & (SPI0_LOAD | SPI1_LOAD)) {
++              if ((laguna_info.config_bitmap & SPI0_LOAD) ||
++                  (laguna_info.config_bitmap & SPI1_LOAD))
 +                      platform_device_register(&laguna_spi_controller);
-+              }
 +
 +              /*
 +               * Do any model specific setup not known by the bitmap by matching
 +               */
 +
 +              if (strncmp(laguna_info.model, "GW2388", 6) == 0) {
-+                      platform_device_register(&laguna_gpio_leds_device);
++                      laguna_gpio_leds_data.num_leds = 2;
 +              } else if (strncmp(laguna_info.model, "GW2380", 6) == 0) {
 +                      laguna_gpio_leds[0].gpio = 107;
 +                      laguna_gpio_leds[1].gpio = 106;
 +                      laguna_gpio_leds_data.num_leds = 2;
-+                      platform_device_register(&laguna_gpio_leds_device);
 +              }
++              platform_device_register(&laguna_gpio_leds_device);
 +      } else {
 +              // Do some defaults here, not sure what yet
 +      }
 +MACHINE_END
 --- a/arch/arm/mach-cns3xxx/Kconfig
 +++ b/arch/arm/mach-cns3xxx/Kconfig
-@@ -10,4 +10,13 @@ config MACH_CNS3420VB
+@@ -11,4 +11,14 @@ config MACH_CNS3420VB
          This is a platform with an on-board ARM11 MPCore and has support
          for USB, USB-OTG, MMC/SD/SDIO, SATA, PCI-E, etc.
  
 +config MACH_GW2388
 +      bool "Support for Gateworks Laguna Platform"
++      select HAVE_ARM_SCU if SMP
 +      select MIGHT_HAVE_PCI
 +      help
 +        Include support for the Gateworks Laguna Platform
  #include <asm/mach/irq.h>
  #include <asm/hardware/gic.h>
 +#include <asm/smp_twd.h>
+ #include <asm/hardware/cache-l2x0.h>
  #include <mach/cns3xxx.h>
  #include "core.h"
-@@ -60,11 +61,24 @@ static struct map_desc cns3xxx_io_desc[]
+@@ -61,11 +62,24 @@ static struct map_desc cns3xxx_io_desc[]
                .pfn            = __phys_to_pfn(CNS3XXX_PM_BASE),
                .length         = SZ_4K,
                .type           = MT_DEVICE,
  
 --- a/arch/arm/Kconfig
 +++ b/arch/arm/Kconfig
-@@ -313,6 +313,7 @@ config ARCH_CLPS711X
+@@ -329,6 +329,7 @@ config ARCH_CLPS711X
  config ARCH_CNS3XXX
        bool "Cavium Networks CNS3XXX family"
-       select CPU_V6
+       select CPU_V6K
 +      select ARCH_WANT_OPTIONAL_GPIOLIB
        select GENERIC_CLOCKEVENTS
        select ARM_GIC
 +
 +#include <linux/kernel.h>
 +#include <linux/io.h>
-+#include <mach/hardware.h>
++#include <mach/platform.h>
 +#include <asm-generic/gpio.h>                 /* cansleep wrappers */
 +
 +#define NR_BUILTIN_GPIO 64
  obj-$(CONFIG_SMP)                     += platsmp.o headsmp.o
  obj-$(CONFIG_HOTPLUG_CPU)             += hotplug.o
  obj-$(CONFIG_LOCAL_TIMERS)            += localtimer.o
---- a/arch/arm/tools/mach-types
-+++ b/arch/arm/tools/mach-types
-@@ -438,6 +438,7 @@ icontrol           MACH_ICONTROL           ICONTROL                2624
- qsd8x50a_st1_5                MACH_QSD8X50A_ST1_5     QSD8X50A_ST1_5          2627
- mx23evk                       MACH_MX23EVK            MX23EVK                 2629
- ap4evb                        MACH_AP4EVB             AP4EVB                  2630
-+gw2388                        MACH_GW2388             GW2388                  2635
- mityomapl138          MACH_MITYOMAPL138       MITYOMAPL138            2650
- guruplug              MACH_GURUPLUG           GURUPLUG                2659
- spear310              MACH_SPEAR310           SPEAR310                2660
 --- a/arch/arm/mach-cns3xxx/pcie.c
 +++ b/arch/arm/mach-cns3xxx/pcie.c
 @@ -365,7 +365,7 @@ static int cns3xxx_pcie_abort_handler(un
  {
        int i;
  
-@@ -373,6 +373,9 @@ static int __init cns3xxx_pcie_init(void
+@@ -376,6 +376,9 @@ static int __init cns3xxx_pcie_init(void
                        "imprecise external abort");
  
        for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) {
 +
                iotable_init(cns3xxx_pcie[i].cfg_bases,
                             ARRAY_SIZE(cns3xxx_pcie[i].cfg_bases));
-               cns3xxx_pwr_clk_en(0x1 << PM_CLK_GATE_REG_OFFSET_PCIE(i));
-@@ -386,4 +389,3 @@ static int __init cns3xxx_pcie_init(void
+               cns3xxx_pcie_check_link(&cns3xxx_pcie[i]);
+@@ -387,4 +390,3 @@ static int __init cns3xxx_pcie_init(void
  
        return 0;
  }
 -device_initcall(cns3xxx_pcie_init);
 --- a/arch/arm/mach-cns3xxx/cns3420vb.c
 +++ b/arch/arm/mach-cns3xxx/cns3420vb.c
-@@ -175,6 +175,8 @@ static void __init cns3420_init(void)
+@@ -31,6 +31,7 @@
+ #include <asm/mach/time.h>
+ #include <mach/cns3xxx.h>
+ #include <mach/irqs.h>
++#include <mach/platform.h>
+ #include "core.h"
+ #include "devices.h"
+@@ -198,6 +199,8 @@ static void __init cns3420_init(void)
        cns3xxx_ahci_init();
        cns3xxx_sdhci_init();
  
        pm_power_off = cns3xxx_power_off;
  }
  
---- a/arch/arm/mach-cns3xxx/include/mach/platform.h
-+++ b/arch/arm/mach-cns3xxx/include/mach/platform.h
-@@ -22,5 +22,7 @@ struct cns3xxx_plat_info {
-       u32 phy[3];
- };
+--- a/arch/arm/mach-cns3xxx/core.h
++++ b/arch/arm/mach-cns3xxx/core.h
+@@ -12,6 +12,7 @@
+ #define __CNS3XXX_CORE_H
  
+ extern struct sys_timer cns3xxx_timer;
 +extern int cns3xxx_pcie_init(u8 bitmap);
-+
- #endif /* __ASM_ARCH_PLATFORM_H */
- #endif
+ #ifdef CONFIG_CACHE_L2X0
+ void __init cns3xxx_l2x0_init(void);
This page took 0.036255 seconds and 4 git commands to generate.