Merge branch 'imx/cpuidle' into late/dt
authorArnd Bergmann <arnd@arndb.de>
Tue, 19 Feb 2013 16:22:34 +0000 (17:22 +0100)
committerArnd Bergmann <arnd@arndb.de>
Tue, 19 Feb 2013 16:22:34 +0000 (17:22 +0100)
This resolves one non-obvious merge conflict between the imx cpuidle
patches and the imx DT changes for 3.9.

Conflicts:
arch/arm/mach-imx/mach-imx6q.c

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
1  2 
arch/arm/mach-imx/Kconfig
arch/arm/mach-imx/clk-imx6q.c
arch/arm/mach-imx/common.h
arch/arm/mach-imx/mach-imx6q.c
arch/arm/mach-imx/platsmp.c

Simple merge
Simple merge
index fa36fb84ab193f2fb8480bf3cc70d68232824844,c04ec845e3a353e50b6e8d8f839e86ae8586f974..6a2d7ac14dceed934787e06f03ae77b1520cdd13
@@@ -139,10 -131,9 +131,10 @@@ 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);
 +extern int imx_cpu_kill(unsigned int cpu);
  
  #ifdef CONFIG_PM
  extern void imx6q_pm_init(void);
index 2f974f5096fdf086d9a259e9dcf4b5c54c30a611,77a3b4bfff2093fc1602556b7ffa85b7a0328024..6fbf871e061dff60a27f60125fa923d318eab8f6
@@@ -12,8 -12,6 +12,7 @@@
  
  #include <linux/clk.h>
  #include <linux/clkdev.h>
- #include <linux/cpuidle.h>
 +#include <linux/cpu.h>
  #include <linux/delay.h>
  #include <linux/export.h>
  #include <linux/init.h>
@@@ -203,80 -200,14 +202,77 @@@ 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,
- };
 +#define OCOTP_CFG3                    0x440
 +#define OCOTP_CFG3_SPEED_SHIFT                16
 +#define OCOTP_CFG3_SPEED_1P2GHZ               0x3
 +
 +static void __init imx6q_opp_check_1p2ghz(struct device *cpu_dev)
 +{
 +      struct device_node *np;
 +      void __iomem *base;
 +      u32 val;
 +
 +      np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-ocotp");
 +      if (!np) {
 +              pr_warn("failed to find ocotp node\n");
 +              return;
 +      }
 +
 +      base = of_iomap(np, 0);
 +      if (!base) {
 +              pr_warn("failed to map ocotp\n");
 +              goto put_node;
 +      }
 +
 +      val = readl_relaxed(base + OCOTP_CFG3);
 +      val >>= OCOTP_CFG3_SPEED_SHIFT;
 +      if ((val & 0x3) != OCOTP_CFG3_SPEED_1P2GHZ)
 +              if (opp_disable(cpu_dev, 1200000000))
 +                      pr_warn("failed to disable 1.2 GHz OPP\n");
 +
 +put_node:
 +      of_node_put(np);
 +}
 +
 +static void __init imx6q_opp_init(struct device *cpu_dev)
 +{
 +      struct device_node *np;
 +
 +      np = of_find_node_by_path("/cpus/cpu@0");
 +      if (!np) {
 +              pr_warn("failed to find cpu0 node\n");
 +              return;
 +      }
 +
 +      cpu_dev->of_node = np;
 +      if (of_init_opp_table(cpu_dev)) {
 +              pr_warn("failed to init OPP table\n");
 +              goto put_node;
 +      }
 +
 +      imx6q_opp_check_1p2ghz(cpu_dev);
 +
 +put_node:
 +      of_node_put(np);
 +}
 +
 +struct platform_device imx6q_cpufreq_pdev = {
 +      .name = "imx6q-cpufreq",
 +};
 +
  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();
 +
 +      if (IS_ENABLED(CONFIG_ARM_IMX6Q_CPUFREQ)) {
 +              imx6q_opp_init(&imx6q_cpufreq_pdev.dev);
 +              platform_device_register(&imx6q_cpufreq_pdev);
 +      }
  }
  
  static void __init imx6q_map_io(void)
Simple merge