]> Git Repo - linux.git/commitdiff
Merge branch 'imx/cpuidle' into late/dt
authorArnd Bergmann <[email protected]>
Tue, 19 Feb 2013 16:22:34 +0000 (17:22 +0100)
committerArnd Bergmann <[email protected]>
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 <[email protected]>
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

index 0a2349dc70184021e268db86ef9c3cb0e966f8a3,5f3f07ee4b2971ba0fd2d66c98fa59fe80318b8f..7b11d3329e81dee99447f87277b7b6309d795354
@@@ -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
        select HAVE_CAN_FLEXCAN if CAN
        select HAVE_IMX_GPC
        select HAVE_IMX_MMDC
 +      select HAVE_IMX_SRC
        select HAVE_SMP
        select MFD_SYSCON
        select PINCTRL
index 905bec2a08a4546fea29223559485e42dd59c099,b30b65a8cce5645c5f946c22f67162164e326396..7b025ee528a517bdb7d584e90cebefc40fb56a48
  #define BM_CLPCR_MASK_SCU_IDLE                (0x1 << 26)
  #define BM_CLPCR_MASK_L2CC_IDLE               (0x1 << 27)
  
+ #define CGPR                          0x64
+ #define BM_CGPR_CHICKEN_BIT           (0x1 << 17)
  static void __iomem *ccm_base;
  
- void __init imx6q_clock_map_io(void) { }
+ void imx6q_set_chicken_bit(void)
+ {
+       u32 val = readl_relaxed(ccm_base + CGPR);
+       val |= BM_CGPR_CHICKEN_BIT;
+       writel_relaxed(val, ccm_base + CGPR);
+ }
  
  int imx6q_set_lpm(enum mxc_cpu_pwr_mode mode)
  {
@@@ -68,6 -77,7 +77,7 @@@
                break;
        case WAIT_UNCLOCKED:
                val |= 0x1 << BP_CLPCR_LPM;
+               val |= BM_CLPCR_ARM_CLK_DIS_ON_LPM;
                break;
        case STOP_POWER_ON:
                val |= 0x2 << BP_CLPCR_LPM;
@@@ -154,8 -164,8 +164,8 @@@ enum mx6q_clks 
        usdhc4, vdo_axi, vpu_axi, cko1, pll1_sys, pll2_bus, pll3_usb_otg,
        pll4_audio, pll5_video, pll8_mlb, pll7_usb_host, pll6_enet, ssi1_ipg,
        ssi2_ipg, ssi3_ipg, rom, usbphy1, usbphy2, ldb_di0_div_3_5, ldb_di1_div_3_5,
 -      sata_ref, sata_ref_100m, pcie_ref, pcie_ref_125m, enet_ref,
 -      clk_max
 +      sata_ref, sata_ref_100m, pcie_ref, pcie_ref_125m, enet_ref, usbphy1_gate,
 +      usbphy2_gate, clk_max
  };
  
  static struct clk *clk[clk_max];
@@@ -208,21 -218,8 +218,21 @@@ int __init mx6q_clocks_init(void
        clk[pll7_usb_host] = imx_clk_pllv3(IMX_PLLV3_USB,       "pll7_usb_host","osc", base + 0x20, 0x3);
        clk[pll8_mlb]      = imx_clk_pllv3(IMX_PLLV3_MLB,       "pll8_mlb",     "osc", base + 0xd0, 0x0);
  
 -      clk[usbphy1] = imx_clk_gate("usbphy1", "pll3_usb_otg", base + 0x10, 6);
 -      clk[usbphy2] = imx_clk_gate("usbphy2", "pll7_usb_host", base + 0x20, 6);
 +      /*
 +       * Bit 20 is the reserved and read-only bit, we do this only for:
 +       * - Do nothing for usbphy clk_enable/disable
 +       * - Keep refcount when do usbphy clk_enable/disable, in that case,
 +       * the clk framework may need to enable/disable usbphy's parent
 +       */
 +      clk[usbphy1] = imx_clk_gate("usbphy1", "pll3_usb_otg", base + 0x10, 20);
 +      clk[usbphy2] = imx_clk_gate("usbphy2", "pll7_usb_host", base + 0x20, 20);
 +
 +      /*
 +       * usbphy*_gate needs to be on after system boots up, and software
 +       * never needs to control it anymore.
 +       */
 +      clk[usbphy1_gate] = imx_clk_gate("usbphy1_gate", "dummy", base + 0x10, 6);
 +      clk[usbphy2_gate] = imx_clk_gate("usbphy2_gate", "dummy", base + 0x20, 6);
  
        clk[sata_ref] = imx_clk_fixed_factor("sata_ref", "pll6_enet", 1, 5);
        clk[pcie_ref] = imx_clk_fixed_factor("pcie_ref", "pll6_enet", 1, 4);
        for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
                clk_prepare_enable(clk[clks_init_on[i]]);
  
 +      if (IS_ENABLED(CONFIG_USB_MXS_PHY)) {
 +              clk_prepare_enable(clk[usbphy1_gate]);
 +              clk_prepare_enable(clk[usbphy2_gate]);
 +      }
 +
 +      /* Set initial power mode */
 +      imx6q_set_lpm(WAIT_CLOCKED);
 +
        np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-gpt");
        base = of_iomap(np, 0);
        WARN_ON(!base);
index fa36fb84ab193f2fb8480bf3cc70d68232824844,c04ec845e3a353e50b6e8d8f839e86ae8586f974..6a2d7ac14dceed934787e06f03ae77b1520cdd13
@@@ -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,27 -105,23 +105,23 @@@ 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);
@@@ -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>
  #include <linux/of_address.h>
  #include <linux/of_irq.h>
  #include <linux/of_platform.h>
 +#include <linux/opp.h>
  #include <linux/phy.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>
  
@@@ -203,87 -200,20 +202,83 @@@ 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)
  {
-       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 = {
index 66fae885c8429f3b9147d4a3c33cd6e739a0ae05,a70b548771918460e27a655419235d39e73f4fc9..adc498db66e1980c8dd5f15e8a00264edcca8ca8
@@@ -20,6 -20,8 +20,8 @@@
  #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)
  {
        /*
@@@ -92,6 -102,5 +102,6 @@@ struct smp_operations  imx_smp_ops __in
        .smp_boot_secondary     = imx_boot_secondary,
  #ifdef CONFIG_HOTPLUG_CPU
        .cpu_die                = imx_cpu_die,
 +      .cpu_kill               = imx_cpu_kill,
  #endif
  };
This page took 0.09035 seconds and 4 git commands to generate.