Merge tag 'imx6q-cpudile-3.9' of git://git.linaro.org/people/shawnguo/linux-2.6 into...
authorOlof Johansson <olof@lixom.net>
Tue, 5 Feb 2013 06:24:20 +0000 (22:24 -0800)
committerOlof Johansson <olof@lixom.net>
Tue, 5 Feb 2013 06:24:20 +0000 (22:24 -0800)
From Shawn Guo:
imx6q cpuidle support for 3.9

 - It's based on imx-cleanup-3.9 to avoid conflicts.

* tag 'imx6q-cpudile-3.9' of git://git.linaro.org/people/shawnguo/linux-2.6:
  ARM: imx6q: support WAIT mode using cpuidle
  ARM: imx: move imx6q_cpuidle_driver into a separate file
  ARM: imx: mask gpc interrupts initially
  ARM: imx: return zero in case next event gets a large increment
  ARM: imx: Remove mx508 support
  ARM: imx: Remove mach-mx51_3ds board
  ARM: imx: use debug_ll_io_init() for imx6q
  ARM: imx: remove unused imx6q_clock_map_io()
  ARM: mach-imx: Kconfig: Do not select Babbage for MACH_IMX51_DT

Signed-off-by: Olof Johansson <olof@lixom.net>
Still, two delete/change conflicts caused by imx/cleanup:

arch/arm/mach-imx/mach-mx50_rdp.c
arch/arm/mach-imx/mach-mx51_3ds.c

1  2 
arch/arm/Kconfig.debug
arch/arm/configs/imx_v6_v7_defconfig
arch/arm/mach-imx/Kconfig
arch/arm/mach-imx/common.h
arch/arm/mach-imx/gpc.c
arch/arm/mach-imx/mach-imx6q.c
arch/arm/mach-imx/platsmp.c
arch/arm/mach-imx/time.c

diff --combined arch/arm/Kconfig.debug
index af3987cb9e4d92a1a1f648f50c65b010a9af8261,1dceb8e316183acc8a751323c0c0a916449616fa..0cc8e3652b0eb566adfe7f8a470b16b6b2c11c43
@@@ -219,12 -219,12 +219,12 @@@ choic
                  Say Y here if you want kernel low-level debugging support
                  on i.MX51.
  
-       config DEBUG_IMX50_IMX53_UART
-               bool "i.MX50 and i.MX53 Debug UART"
-               depends on SOC_IMX50 || SOC_IMX53
+       config DEBUG_IMX53_UART
+               bool "i.MX53 Debug UART"
+               depends on SOC_IMX53
                help
                  Say Y here if you want kernel low-level debugging support
-                 on i.MX50 or i.MX53.
+                 on i.MX53.
  
        config DEBUG_IMX6Q_UART
                bool "i.MX6Q Debug UART"
                  Say Y here if you want kernel low-level debugging support
                  on Tegra based platforms.
  
 +      config DEBUG_SIRFPRIMA2_UART1
 +              bool "Kernel low-level debugging messages via SiRFprimaII UART1"
 +              depends on ARCH_PRIMA2
 +              help
 +                Say Y here if you want the debug print routines to direct
 +                their output to the uart1 port on SiRFprimaII devices.
 +
 +      config DEBUG_SIRFMARCO_UART1
 +              bool "Kernel low-level debugging messages via SiRFmarco UART1"
 +              depends on ARCH_MARCO
 +              help
 +                Say Y here if you want the debug print routines to direct
 +                their output to the uart1 port on SiRFmarco devices.
 +
        config DEBUG_VEXPRESS_UART0_DETECT
                bool "Autodetect UART0 on Versatile Express Cortex-A core tiles"
                depends on ARCH_VEXPRESS && CPU_CP15_MMU
                  of the tiles using the RS1 memory map, including all new A-class
                  core tiles, FPGA-based SMMs and software models.
  
 +      config DEBUG_VT8500_UART0
 +              bool "Use UART0 on VIA/Wondermedia SoCs"
 +              depends on ARCH_VT8500
 +              help
 +                This option selects UART0 on VIA/Wondermedia System-on-a-chip
 +                devices, including VT8500, WM8505, WM8650 and WM8850.
 +
        config DEBUG_LL_UART_NONE
                bool "No low-level debugging UART"
                depends on !ARCH_MULTIPLATFORM
@@@ -518,7 -497,7 +518,7 @@@ config DEBUG_LL_INCLUD
                                 DEBUG_IMX21_IMX27_UART || \
                                 DEBUG_IMX31_IMX35_UART || \
                                 DEBUG_IMX51_UART || \
-                                DEBUG_IMX50_IMX53_UART ||\
+                                DEBUG_IMX53_UART ||\
                                 DEBUG_IMX6Q_UART
        default "debug/highbank.S" if DEBUG_HIGHBANK_UART
        default "debug/mvebu.S" if DEBUG_MVEBU_UART
        default "debug/sunxi.S" if DEBUG_SUNXI_UART0 || DEBUG_SUNXI_UART1
        default "debug/vexpress.S" if DEBUG_VEXPRESS_UART0_DETECT || \
                DEBUG_VEXPRESS_UART0_CA9 || DEBUG_VEXPRESS_UART0_RS1
 +      default "debug/vt8500.S" if DEBUG_VT8500_UART0
        default "debug/tegra.S" if DEBUG_TEGRA_UART
        default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1
        default "mach/debug-macro.S"
index 31e143224142b80019366d14033a84247057eac6,6dddbf877b0ce5a4a22583f3d77e319fe80b8bbe..d946372c4300c2a1b74728e12d031207fa8d8120
@@@ -19,7 -19,6 +19,7 @@@ CONFIG_MODULE_SRCVERSION_ALL=
  CONFIG_ARCH_MXC=y
  CONFIG_ARCH_MULTI_V6=y
  CONFIG_ARCH_MULTI_V7=y
 +CONFIG_MACH_IMX31_DT=y
  CONFIG_MACH_MX31LILLY=y
  CONFIG_MACH_MX31LITE=y
  CONFIG_MACH_PCM037=y
@@@ -33,7 -32,6 +33,6 @@@ CONFIG_MACH_PCM043=
  CONFIG_MACH_MX35_3DS=y
  CONFIG_MACH_VPR200=y
  CONFIG_MACH_IMX51_DT=y
- CONFIG_MACH_MX51_3DS=y
  CONFIG_MACH_EUKREA_CPUIMX51SD=y
  CONFIG_SOC_IMX53=y
  CONFIG_SOC_IMX6Q=y
index 3e628fd7a674d3b5f6b4782b32ef03f7548c43a2,5f3f07ee4b2971ba0fd2d66c98fa59fe80318b8f..74abf01ab9e3583b9026b44e149db9dd6ff0ab58
@@@ -95,9 -95,6 +95,6 @@@ config MACH_MX2
  config ARCH_MX5
        bool
  
- config ARCH_MX50
-       bool
  config ARCH_MX51
        bool
  
@@@ -164,11 -161,6 +161,6 @@@ config SOC_IMX
        select CPU_V7
        select MXC_TZIC
  
- config SOC_IMX50
-       bool
-       select ARCH_MX50
-       select SOC_IMX5
  config        SOC_IMX51
        bool
        select ARCH_MX5
@@@ -738,25 -730,10 +730,10 @@@ endi
  
  if ARCH_MULTI_V7
  
- comment "i.MX5 platforms:"
- config MACH_MX50_RDP
-       bool "Support MX50 reference design platform"
-       depends on BROKEN
-       select IMX_HAVE_PLATFORM_IMX_I2C
-       select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
-       select IMX_HAVE_PLATFORM_SPI_IMX
-       select SOC_IMX50
-       help
-         Include support for MX50 reference design platform (RDP) board. This
-         includes specific configurations for the board and its peripherals.
  comment "i.MX51 machines:"
  
  config MACH_IMX51_DT
        bool "Support i.MX51 platforms from device tree"
-       select MACH_MX51_BABBAGE
        select SOC_IMX51
        help
          Include support for Freescale i.MX51 based platforms
@@@ -777,19 -754,6 +754,6 @@@ config MACH_MX51_BABBAG
          u-boot. This includes specific configurations for the board and its
          peripherals.
  
- config MACH_MX51_3DS
-       bool "Support MX51PDK (3DS)"
-       select IMX_HAVE_PLATFORM_IMX2_WDT
-       select IMX_HAVE_PLATFORM_IMX_KEYPAD
-       select IMX_HAVE_PLATFORM_IMX_UART
-       select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
-       select IMX_HAVE_PLATFORM_SPI_IMX
-       select MXC_DEBUG_BOARD
-       select SOC_IMX51
-       help
-         Include support for MX51PDK (3DS) platform. This includes specific
-         configurations for the board and its peripherals.
  config MACH_EUKREA_CPUIMX51SD
        bool "Support Eukrea CPUIMX51SD module"
        select IMX_HAVE_PLATFORM_FSL_USB2_UDC
@@@ -841,6 -805,8 +805,6 @@@ config SOC_IMX6
        select ARCH_HAS_CPUFREQ
        select ARCH_HAS_OPP
        select ARM_CPU_SUSPEND if PM
 -      select ARM_ERRATA_743622
 -      select ARM_ERRATA_751472
        select ARM_ERRATA_754322
        select ARM_ERRATA_764369 if SMP
        select ARM_ERRATA_775420
index b0164da63b0cde603eb55eb1f46a3c5ff47f25ed,c04ec845e3a353e50b6e8d8f839e86ae8586f974..166e6d5ce42a8c589820567e77a577f9704c9c04
@@@ -21,7 -21,6 +21,6 @@@ extern void mx25_map_io(void)
  extern void mx27_map_io(void);
  extern void mx31_map_io(void);
  extern void mx35_map_io(void);
- extern void mx50_map_io(void);
  extern void mx51_map_io(void);
  extern void mx53_map_io(void);
  extern void imx1_init_early(void);
@@@ -30,7 -29,6 +29,6 @@@ extern void imx25_init_early(void)
  extern void imx27_init_early(void);
  extern void imx31_init_early(void);
  extern void imx35_init_early(void);
- extern void imx50_init_early(void);
  extern void imx51_init_early(void);
  extern void imx53_init_early(void);
  extern void mxc_init_irq(void __iomem *);
@@@ -41,7 -39,6 +39,6 @@@ extern void mx25_init_irq(void)
  extern void mx27_init_irq(void);
  extern void mx31_init_irq(void);
  extern void mx35_init_irq(void);
- extern void mx50_init_irq(void);
  extern void mx51_init_irq(void);
  extern void mx53_init_irq(void);
  extern void imx1_soc_init(void);
@@@ -50,7 -47,6 +47,6 @@@ extern void imx25_soc_init(void)
  extern void imx27_soc_init(void);
  extern void imx31_soc_init(void);
  extern void imx35_soc_init(void);
- extern void imx50_soc_init(void);
  extern void imx51_soc_init(void);
  extern void imx51_init_late(void);
  extern void imx53_init_late(void);
@@@ -109,26 -105,23 +105,22 @@@ void tzic_handle_irq(struct pt_regs *)
  #define imx27_handle_irq avic_handle_irq
  #define imx31_handle_irq avic_handle_irq
  #define imx35_handle_irq avic_handle_irq
- #define imx50_handle_irq tzic_handle_irq
  #define imx51_handle_irq tzic_handle_irq
  #define imx53_handle_irq tzic_handle_irq
 -#define imx6q_handle_irq gic_handle_irq
  
  extern void imx_enable_cpu(int cpu, bool enable);
  extern void imx_set_cpu_jump(int cpu, void *jump_addr);
- #ifdef CONFIG_DEBUG_LL
- extern void imx_lluart_map_io(void);
- #else
- static inline void imx_lluart_map_io(void) {}
- #endif
  extern void v7_cpu_resume(void);
  extern u32 *pl310_get_save_ptr(void);
  #ifdef CONFIG_SMP
  extern void v7_secondary_startup(void);
  extern void imx_scu_map_io(void);
  extern void imx_smp_prepare(void);
+ extern void imx_scu_standby_enable(void);
  #else
  static inline void imx_scu_map_io(void) {}
  static inline void imx_smp_prepare(void) {}
+ static inline void imx_scu_standby_enable(void) {}
  #endif
  extern void imx_enable_cpu(int cpu, bool enable);
  extern void imx_set_cpu_jump(int cpu, void *jump_addr);
@@@ -138,7 -131,7 +130,7 @@@ extern void imx_gpc_init(void)
  extern void imx_gpc_pre_suspend(void);
  extern void imx_gpc_post_resume(void);
  extern int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode);
- extern void imx6q_clock_map_io(void);
+ extern void imx6q_set_chicken_bit(void);
  
  extern void imx_cpu_die(unsigned int cpu);
  
diff --combined arch/arm/mach-imx/gpc.c
index ff24920699e45d9afa1f4c2554a98fde6ee5284f,722e5df7e44ed4b8b9f07c78eb8fcd2ecc20e67d..a96ccc7f50123ad5470be6af6d4e2f6edb0e4920
@@@ -15,7 -15,7 +15,7 @@@
  #include <linux/of.h>
  #include <linux/of_address.h>
  #include <linux/of_irq.h>
 -#include <asm/hardware/gic.h>
 +#include <linux/irqchip/arm-gic.h>
  
  #define GPC_IMR1              0x008
  #define GPC_PGC_CPU_PDN               0x2a0
@@@ -101,11 -101,16 +101,16 @@@ static void imx_gpc_irq_mask(struct irq
  void __init imx_gpc_init(void)
  {
        struct device_node *np;
+       int i;
  
        np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpc");
        gpc_base = of_iomap(np, 0);
        WARN_ON(!gpc_base);
  
+       /* Initially mask all interrupts */
+       for (i = 0; i < IMR_NUM; i++)
+               writel_relaxed(~0, gpc_base + GPC_IMR1 + i * 4);
        /* Register GPC as the secondary interrupt controller behind GIC */
        gic_arch_extn.irq_mask = imx_gpc_irq_mask;
        gic_arch_extn.irq_unmask = imx_gpc_irq_unmask;
index 8d3d06e0e8a19a527e89ffedf75ba50ecd652477,77a3b4bfff2093fc1602556b7ffa85b7a0328024..1786b2d1257eb0f77b92564f93f07f17b8fbdf65
  
  #include <linux/clk.h>
  #include <linux/clkdev.h>
- #include <linux/cpuidle.h>
  #include <linux/delay.h>
  #include <linux/export.h>
  #include <linux/init.h>
  #include <linux/io.h>
  #include <linux/irq.h>
 +#include <linux/irqchip.h>
  #include <linux/of.h>
  #include <linux/of_address.h>
  #include <linux/of_irq.h>
  #include <linux/regmap.h>
  #include <linux/micrel_phy.h>
  #include <linux/mfd/syscon.h>
- #include <asm/cpuidle.h>
  #include <asm/smp_twd.h>
  #include <asm/hardware/cache-l2x0.h>
 -#include <asm/hardware/gic.h>
  #include <asm/mach/arch.h>
+ #include <asm/mach/map.h>
  #include <asm/mach/time.h>
  #include <asm/system_misc.h>
  
@@@ -201,32 -200,33 +200,28 @@@ static void __init imx6q_init_machine(v
        imx6q_1588_init();
  }
  
- static struct cpuidle_driver imx6q_cpuidle_driver = {
-       .name                   = "imx6q_cpuidle",
-       .owner                  = THIS_MODULE,
-       .en_core_tk_irqen       = 1,
-       .states[0]              = ARM_CPUIDLE_WFI_STATE,
-       .state_count            = 1,
- };
  static void __init imx6q_init_late(void)
  {
-       imx_cpuidle_init(&imx6q_cpuidle_driver);
+       /*
+        * WAIT mode is broken on TO 1.0 and 1.1, so there is no point
+        * to run cpuidle on them.
+        */
+       if (imx6q_revision() > IMX_CHIP_REVISION_1_1)
+               imx6q_cpuidle_init();
  }
  
  static void __init imx6q_map_io(void)
  {
-       imx_lluart_map_io();
+       debug_ll_io_init();
        imx_scu_map_io();
-       imx6q_clock_map_io();
  }
  
 -static const struct of_device_id imx6q_irq_match[] __initconst = {
 -      { .compatible = "arm,cortex-a9-gic", .data = gic_of_init, },
 -      { /* sentinel */ }
 -};
 -
  static void __init imx6q_init_irq(void)
  {
        l2x0_of_init(0, ~0UL);
        imx_src_init();
        imx_gpc_init();
 -      of_irq_init(imx6q_irq_match);
 +      irqchip_init();
  }
  
  static void __init imx6q_timer_init(void)
        imx_print_silicon_rev("i.MX6Q", imx6q_revision());
  }
  
 -static struct sys_timer imx6q_timer = {
 -      .init = imx6q_timer_init,
 -};
 -
  static const char *imx6q_dt_compat[] __initdata = {
        "fsl,imx6q",
        NULL,
@@@ -245,7 -249,8 +240,7 @@@ DT_MACHINE_START(IMX6Q, "Freescale i.MX
        .smp            = smp_ops(imx_smp_ops),
        .map_io         = imx6q_map_io,
        .init_irq       = imx6q_init_irq,
 -      .handle_irq     = imx6q_handle_irq,
 -      .timer          = &imx6q_timer,
 +      .init_time      = imx6q_timer_init,
        .init_machine   = imx6q_init_machine,
        .init_late      = imx6q_init_late,
        .dt_compat      = imx6q_dt_compat,
index d35693117991365fcc9d30438b23e5fe48323ebd,a70b548771918460e27a655419235d39e73f4fc9..0f7e6db1e3289c7752475f6b612f7b2ce98ddfed
  
  #include <linux/init.h>
  #include <linux/smp.h>
 +#include <linux/irqchip/arm-gic.h>
  #include <asm/page.h>
  #include <asm/smp_scu.h>
 -#include <asm/hardware/gic.h>
  #include <asm/mach/map.h>
  
  #include "common.h"
  #include "hardware.h"
  
+ #define SCU_STANDBY_ENABLE    (1 << 5)
  static void __iomem *scu_base;
  
  static struct map_desc scu_io_desc __initdata = {
@@@ -42,6 -44,14 +44,14 @@@ void __init imx_scu_map_io(void
        scu_base = IMX_IO_ADDRESS(base);
  }
  
+ void imx_scu_standby_enable(void)
+ {
+       u32 val = readl_relaxed(scu_base);
+       val |= SCU_STANDBY_ENABLE;
+       writel_relaxed(val, scu_base);
+ }
  static void __cpuinit imx_secondary_init(unsigned int cpu)
  {
        /*
@@@ -71,6 -81,8 +81,6 @@@ static void __init imx_smp_init_cpus(vo
  
        for (i = 0; i < ncores; i++)
                set_cpu_possible(i, true);
 -
 -      set_smp_cross_call(gic_raise_softirq);
  }
  
  void imx_smp_prepare(void)
diff --combined arch/arm/mach-imx/time.c
index 62769df36db129d7f27508fa6c3d0d10800c42cf,5d7eb482efd327d06de0fcc8b59601d8b151eb21..fea91313678b25efb17e7342afb45013c2fa156f
@@@ -152,7 -152,8 +152,8 @@@ static int v2_set_next_event(unsigned l
  
        __raw_writel(tcmp, timer_base + V2_TCMP);
  
-       return (int)(tcmp - __raw_readl(timer_base + V2_TCN)) < 0 ?
+       return evt < 0x7fffffff &&
+               (int)(tcmp - __raw_readl(timer_base + V2_TCN)) < 0 ?
                                -ETIME : 0;
  }
  
@@@ -256,6 -257,7 +257,6 @@@ static struct irqaction mxc_timer_irq 
  static struct clock_event_device clockevent_mxc = {
        .name           = "mxc_timer1",
        .features       = CLOCK_EVT_FEAT_ONESHOT,
 -      .shift          = 32,
        .set_mode       = mxc_set_mode,
        .set_next_event = mx1_2_set_next_event,
        .rating         = 200,
  
  static int __init mxc_clockevent_init(struct clk *timer_clk)
  {
 -      unsigned int c = clk_get_rate(timer_clk);
 -
        if (timer_is_v2())
                clockevent_mxc.set_next_event = v2_set_next_event;
  
 -      clockevent_mxc.mult = div_sc(c, NSEC_PER_SEC,
 -                                      clockevent_mxc.shift);
 -      clockevent_mxc.max_delta_ns =
 -                      clockevent_delta2ns(0xfffffffe, &clockevent_mxc);
 -      clockevent_mxc.min_delta_ns =
 -                      clockevent_delta2ns(0xff, &clockevent_mxc);
 -
        clockevent_mxc.cpumask = cpumask_of(0);
 -
 -      clockevents_register_device(&clockevent_mxc);
 +      clockevents_config_and_register(&clockevent_mxc,
 +                                      clk_get_rate(timer_clk),
 +                                      0xff, 0xfffffffe);
  
        return 0;
  }