Merge git://git.kernel.org/pub/scm/linux/kernel/git/nico/orion
authorRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 7 Nov 2010 16:10:56 +0000 (16:10 +0000)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 7 Nov 2010 16:10:56 +0000 (16:10 +0000)
1  2 
arch/arm/mach-kirkwood/common.c
arch/arm/mach-kirkwood/d2net_v2-setup.c
arch/arm/mach-kirkwood/netspace_v2-setup.c
arch/arm/mach-kirkwood/netxbig_v2-setup.c
arch/arm/mach-kirkwood/ts41x-setup.c
arch/arm/mach-orion5x/ts78xx-setup.c

@@@ -854,10 -854,9 +854,9 @@@ int __init kirkwood_find_tclk(void
  
        kirkwood_pcie_id(&dev, &rev);
  
-       if ((dev == MV88F6281_DEV_ID && (rev == MV88F6281_REV_A0 ||
-                                       rev == MV88F6281_REV_A1)) ||
-           (dev == MV88F6282_DEV_ID))
-               return 200000000;
+       if (dev == MV88F6281_DEV_ID || dev == MV88F6282_DEV_ID)
+               if (((readl(SAMPLE_AT_RESET) >> 21) & 1) == 0)
+                       return 200000000;
  
        return 166666667;
  }
@@@ -903,16 -902,10 +902,16 @@@ static struct platform_device kirkwood_
        },
  };
  
 +static struct platform_device kirkwood_pcm_device = {
 +      .name           = "kirkwood-pcm-audio",
 +      .id             = -1,
 +};
 +
  void __init kirkwood_audio_init(void)
  {
        kirkwood_clk_ctrl |= CGC_AUDIO;
        platform_device_register(&kirkwood_i2s_device);
 +      platform_device_register(&kirkwood_pcm_device);
  }
  
  /*****************************************************************************
@@@ -221,9 -221,11 +221,9 @@@ static void __init d2net_v2_init(void
  }
  
  MACHINE_START(D2NET_V2, "LaCie d2 Network v2")
 -      .phys_io        = KIRKWOOD_REGS_PHYS_BASE,
 -      .io_pg_offst    = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
        .init_machine   = d2net_v2_init,
        .map_io         = kirkwood_map_io,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &lacie_v2_timer,
+       .timer          = &kirkwood_timer,
  MACHINE_END
@@@ -30,7 -30,6 +30,7 @@@
  #include <linux/gpio.h>
  #include <linux/gpio_keys.h>
  #include <linux/leds.h>
 +#include <linux/gpio-fan.h>
  #include <asm/mach-types.h>
  #include <asm/mach/arch.h>
  #include <mach/kirkwood.h>
@@@ -137,46 -136,6 +137,46 @@@ static struct platform_device netspace_
        },
  };
  
 +/*****************************************************************************
 + * GPIO fan
 + ****************************************************************************/
 +
 +/* Designed for fan 40x40x16: ADDA AD0412LB-D50 6000rpm@12v */
 +static struct gpio_fan_speed netspace_max_v2_fan_speed[] = {
 +      {    0,  0 },
 +      { 1500, 15 },
 +      { 1700, 14 },
 +      { 1800, 13 },
 +      { 2100, 12 },
 +      { 3100, 11 },
 +      { 3300, 10 },
 +      { 4300,  9 },
 +      { 5500,  8 },
 +};
 +
 +static unsigned netspace_max_v2_fan_ctrl[] = { 22, 7, 33, 23 };
 +
 +static struct gpio_fan_alarm netspace_max_v2_fan_alarm = {
 +      .gpio           = 25,
 +      .active_low     = 1,
 +};
 +
 +static struct gpio_fan_platform_data netspace_max_v2_fan_data = {
 +      .num_ctrl       = ARRAY_SIZE(netspace_max_v2_fan_ctrl),
 +      .ctrl           = netspace_max_v2_fan_ctrl,
 +      .alarm          = &netspace_max_v2_fan_alarm,
 +      .num_speed      = ARRAY_SIZE(netspace_max_v2_fan_speed),
 +      .speed          = netspace_max_v2_fan_speed,
 +};
 +
 +static struct platform_device netspace_max_v2_gpio_fan = {
 +      .name   = "gpio-fan",
 +      .id     = -1,
 +      .dev    = {
 +              .platform_data  = &netspace_max_v2_fan_data,
 +      },
 +};
 +
  /*****************************************************************************
   * General Setup
   ****************************************************************************/
@@@ -246,8 -205,6 +246,8 @@@ static void __init netspace_v2_init(voi
        platform_device_register(&netspace_v2_leds);
        platform_device_register(&netspace_v2_gpio_leds);
        platform_device_register(&netspace_v2_gpio_buttons);
 +      if (machine_is_netspace_max_v2())
 +              platform_device_register(&netspace_max_v2_gpio_fan);
  
        if (gpio_request(NETSPACE_V2_GPIO_POWER_OFF, "power-off") == 0 &&
            gpio_direction_output(NETSPACE_V2_GPIO_POWER_OFF, 0) == 0)
  
  #ifdef CONFIG_MACH_NETSPACE_V2
  MACHINE_START(NETSPACE_V2, "LaCie Network Space v2")
 -      .phys_io        = KIRKWOOD_REGS_PHYS_BASE,
 -      .io_pg_offst    = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
        .init_machine   = netspace_v2_init,
        .map_io         = kirkwood_map_io,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &lacie_v2_timer,
+       .timer          = &kirkwood_timer,
  MACHINE_END
  #endif
  
  #ifdef CONFIG_MACH_INETSPACE_V2
  MACHINE_START(INETSPACE_V2, "LaCie Internet Space v2")
 -      .phys_io        = KIRKWOOD_REGS_PHYS_BASE,
 -      .io_pg_offst    = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
        .init_machine   = netspace_v2_init,
        .map_io         = kirkwood_map_io,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &lacie_v2_timer,
+       .timer          = &kirkwood_timer,
  MACHINE_END
  #endif
  
  #ifdef CONFIG_MACH_NETSPACE_MAX_V2
  MACHINE_START(NETSPACE_MAX_V2, "LaCie Network Space Max v2")
 -      .phys_io        = KIRKWOOD_REGS_PHYS_BASE,
 -      .io_pg_offst    = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
        .init_machine   = netspace_v2_init,
        .map_io         = kirkwood_map_io,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &lacie_v2_timer,
+       .timer          = &kirkwood_timer,
  MACHINE_END
  #endif
@@@ -399,20 -399,24 +399,20 @@@ static void __init netxbig_v2_init(void
  
  #ifdef CONFIG_MACH_NET2BIG_V2
  MACHINE_START(NET2BIG_V2, "LaCie 2Big Network v2")
 -      .phys_io        = KIRKWOOD_REGS_PHYS_BASE,
 -      .io_pg_offst    = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
        .init_machine   = netxbig_v2_init,
        .map_io         = kirkwood_map_io,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &lacie_v2_timer,
+       .timer          = &kirkwood_timer,
  MACHINE_END
  #endif
  
  #ifdef CONFIG_MACH_NET5BIG_V2
  MACHINE_START(NET5BIG_V2, "LaCie 5Big Network v2")
 -      .phys_io        = KIRKWOOD_REGS_PHYS_BASE,
 -      .io_pg_offst    = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
        .init_machine   = netxbig_v2_init,
        .map_io         = kirkwood_map_io,
        .init_irq       = kirkwood_init_irq,
-       .timer          = &lacie_v2_timer,
+       .timer          = &kirkwood_timer,
  MACHINE_END
  #endif
  #include "mpp.h"
  #include "tsx1x-common.h"
  
+ /* for the PCIe reset workaround */
+ #include <plat/pcie.h>
  #define QNAP_TS41X_JUMPER_JP1 45
  
  static struct i2c_board_info __initdata qnap_ts41x_i2c_rtc = {
@@@ -140,8 -144,16 +144,16 @@@ static void __init qnap_ts41x_init(void
  
  static int __init ts41x_pci_init(void)
  {
-       if (machine_is_ts41x())
+       if (machine_is_ts41x()) {
+               /*
+                * Without this explicit reset, the PCIe SATA controller
+                * (Marvell 88sx7042/sata_mv) is known to stop working
+                * after a few minutes.
+                */
+               orion_pcie_reset((void __iomem *)PCIE_VIRT_BASE);
                kirkwood_pcie_init(KW_PCIE0);
+       }
  
     return 0;
  }
@@@ -149,6 -161,8 +161,6 @@@ subsys_initcall(ts41x_pci_init)
  
  MACHINE_START(TS41X, "QNAP TS-41x")
        /* Maintainer: Martin Michlmayr <tbm@cyrius.com> */
 -      .phys_io        = KIRKWOOD_REGS_PHYS_BASE,
 -      .io_pg_offst    = ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
        .boot_params    = 0x00000100,
        .init_machine   = qnap_ts41x_init,
        .map_io         = kirkwood_map_io,
@@@ -239,7 -239,7 +239,7 @@@ static struct platform_nand_data ts78xx
  static struct resource ts78xx_ts_nand_resources = {
        .start          = TS_NAND_DATA,
        .end            = TS_NAND_DATA + 4,
-       .flags          = IORESOURCE_IO,
+       .flags          = IORESOURCE_MEM,
  };
  
  static struct platform_device ts78xx_ts_nand_device = {
@@@ -550,6 -550,8 +550,6 @@@ static void __init ts78xx_init(void
  
  MACHINE_START(TS78XX, "Technologic Systems TS-78xx SBC")
        /* Maintainer: Alexander Clouter <alex@digriz.org.uk> */
 -      .phys_io        = ORION5X_REGS_PHYS_BASE,
 -      .io_pg_offst    = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
        .boot_params    = 0x00000100,
        .init_machine   = ts78xx_init,
        .map_io         = ts78xx_map_io,