aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnson Huang <b20788@freescale.com>2013-08-20 14:14:41 -0400
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 09:01:23 -0400
commit3b000df4e091bab7eb7999243438d50e5294f1f5 (patch)
tree6746a575a6610edef3bca80a4fc1ff93d9de3982
parentc4b48f2fe3c15e63de453e9fa06096f29650db70 (diff)
ENGR00275821-2 ARM: imx: Enable suspend/resume for i.MX6SL
Enable suspend/resume function for i.MX6SL, currently support standby and mem mode. Signed-off-by: Anson Huang <b20788@freescale.com>
-rw-r--r--arch/arm/boot/dts/imx6sl.dtsi6
-rw-r--r--arch/arm/mach-imx/clk-imx6sl.c1
-rw-r--r--arch/arm/mach-imx/mach-imx6sl.c28
-rw-r--r--arch/arm/mach-imx/pm-imx6.c19
4 files changed, 50 insertions, 4 deletions
diff --git a/arch/arm/boot/dts/imx6sl.dtsi b/arch/arm/boot/dts/imx6sl.dtsi
index cb778bed6f12..556a9f182d17 100644
--- a/arch/arm/boot/dts/imx6sl.dtsi
+++ b/arch/arm/boot/dts/imx6sl.dtsi
@@ -546,6 +546,12 @@
546 #reset-cells = <1>; 546 #reset-cells = <1>;
547 }; 547 };
548 548
549 ocram: sram@00900000 {
550 compatible = "mmio-sram";
551 reg = <0x00900000 0x20000>;
552 clocks = <&clks IMX6SL_CLK_OCRAM>;
553 };
554
549 gpc: gpc@020dc000 { 555 gpc: gpc@020dc000 {
550 compatible = "fsl,imx6sl-gpc", "fsl,imx6q-gpc"; 556 compatible = "fsl,imx6sl-gpc", "fsl,imx6q-gpc";
551 reg = <0x020dc000 0x4000>; 557 reg = <0x020dc000 0x4000>;
diff --git a/arch/arm/mach-imx/clk-imx6sl.c b/arch/arm/mach-imx/clk-imx6sl.c
index 11856b6cba13..4c367f4711fc 100644
--- a/arch/arm/mach-imx/clk-imx6sl.c
+++ b/arch/arm/mach-imx/clk-imx6sl.c
@@ -127,6 +127,7 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
127 np = ccm_node; 127 np = ccm_node;
128 base = of_iomap(np, 0); 128 base = of_iomap(np, 0);
129 WARN_ON(!base); 129 WARN_ON(!base);
130 imx6_pm_set_ccm_base(base);
130 131
131 /* name reg shift width parent_names num_parents */ 132 /* name reg shift width parent_names num_parents */
132 clks[IMX6SL_CLK_STEP] = imx_clk_mux("step", base + 0xc, 8, 1, step_sels, ARRAY_SIZE(step_sels)); 133 clks[IMX6SL_CLK_STEP] = imx_clk_mux("step", base + 0xc, 8, 1, step_sels, ARRAY_SIZE(step_sels));
diff --git a/arch/arm/mach-imx/mach-imx6sl.c b/arch/arm/mach-imx/mach-imx6sl.c
index 6042a6943d51..1613c0384811 100644
--- a/arch/arm/mach-imx/mach-imx6sl.c
+++ b/arch/arm/mach-imx/mach-imx6sl.c
@@ -49,6 +49,31 @@ static void __init imx6sl_init_machine(void)
49 of_platform_populate(NULL, of_default_bus_match_table, NULL, parent); 49 of_platform_populate(NULL, of_default_bus_match_table, NULL, parent);
50 50
51 imx6sl_fec_init(); 51 imx6sl_fec_init();
52 imx_anatop_init();
53 imx6_pm_init();
54}
55
56static void __init imx6sl_init_late(void)
57{
58 struct regmap *gpr;
59
60 /*
61 * Need to force IOMUXC irq pending to meet CCM low power mode
62 * restriction, this is recommended by hardware team.
63 */
64 gpr = syscon_regmap_lookup_by_compatible("fsl,imx6sl-iomuxc-gpr");
65 if (!IS_ERR(gpr))
66 regmap_update_bits(gpr, IOMUXC_GPR1,
67 IMX6Q_GPR1_GINT_MASK,
68 IMX6Q_GPR1_GINT_ASSERT);
69 else
70 pr_err("failed to find fsl,imx6sl-iomux-gpr regmap\n");
71}
72
73static void __init imx6sl_map_io(void)
74{
75 debug_ll_io_init();
76 imx6_pm_map_io();
52} 77}
53 78
54static void __init imx6sl_init_irq(void) 79static void __init imx6sl_init_irq(void)
@@ -71,10 +96,11 @@ static const char *imx6sl_dt_compat[] __initdata = {
71}; 96};
72 97
73DT_MACHINE_START(IMX6SL, "Freescale i.MX6 SoloLite (Device Tree)") 98DT_MACHINE_START(IMX6SL, "Freescale i.MX6 SoloLite (Device Tree)")
74 .map_io = debug_ll_io_init, 99 .map_io = imx6sl_map_io,
75 .init_irq = imx6sl_init_irq, 100 .init_irq = imx6sl_init_irq,
76 .init_time = imx6sl_timer_init, 101 .init_time = imx6sl_timer_init,
77 .init_machine = imx6sl_init_machine, 102 .init_machine = imx6sl_init_machine,
103 .init_late = imx6sl_init_late,
78 .dt_compat = imx6sl_dt_compat, 104 .dt_compat = imx6sl_dt_compat,
79 .restart = mxc_restart, 105 .restart = mxc_restart,
80MACHINE_END 106MACHINE_END
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c
index e1c5eb5e03a1..1f75d059a887 100644
--- a/arch/arm/mach-imx/pm-imx6.c
+++ b/arch/arm/mach-imx/pm-imx6.c
@@ -181,7 +181,12 @@ int imx6_set_lpm(enum mxc_cpu_pwr_mode mode)
181 val |= 0x2 << BP_CLPCR_LPM; 181 val |= 0x2 << BP_CLPCR_LPM;
182 val &= ~BM_CLPCR_VSTBY; 182 val &= ~BM_CLPCR_VSTBY;
183 val &= ~BM_CLPCR_SBYOS; 183 val &= ~BM_CLPCR_SBYOS;
184 val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS; 184 if (cpu_is_imx6sl()) {
185 val |= BM_CLPCR_BYPASS_PMIC_READY;
186 val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
187 } else {
188 val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
189 }
185 break; 190 break;
186 case WAIT_UNCLOCKED_POWER_OFF: 191 case WAIT_UNCLOCKED_POWER_OFF:
187 val |= 0x1 << BP_CLPCR_LPM; 192 val |= 0x1 << BP_CLPCR_LPM;
@@ -193,7 +198,12 @@ int imx6_set_lpm(enum mxc_cpu_pwr_mode mode)
193 val |= 0x3 << BP_CLPCR_STBY_COUNT; 198 val |= 0x3 << BP_CLPCR_STBY_COUNT;
194 val |= BM_CLPCR_VSTBY; 199 val |= BM_CLPCR_VSTBY;
195 val |= BM_CLPCR_SBYOS; 200 val |= BM_CLPCR_SBYOS;
196 val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS; 201 if (cpu_is_imx6sl()) {
202 val |= BM_CLPCR_BYPASS_PMIC_READY;
203 val |= BM_CLPCR_BYP_MMDC_CH0_LPM_HS;
204 } else {
205 val |= BM_CLPCR_BYP_MMDC_CH1_LPM_HS;
206 }
197 imx6_enable_wb(true); 207 imx6_enable_wb(true);
198 break; 208 break;
199 default: 209 default:
@@ -237,7 +247,8 @@ static int imx6_pm_enter(suspend_state_t state)
237 imx_set_cpu_jump(0, v7_cpu_resume); 247 imx_set_cpu_jump(0, v7_cpu_resume);
238 /* Zzz ... */ 248 /* Zzz ... */
239 cpu_suspend(0, imx6_suspend_finish); 249 cpu_suspend(0, imx6_suspend_finish);
240 imx_smp_prepare(); 250 if (!cpu_is_imx6sl())
251 imx_smp_prepare();
241 imx_anatop_post_resume(); 252 imx_anatop_post_resume();
242 imx_gpc_post_resume(); 253 imx_gpc_post_resume();
243 imx6_set_cache_lpm_in_wait(true); 254 imx6_set_cache_lpm_in_wait(true);
@@ -330,4 +341,6 @@ void __init imx6_pm_init(void)
330 cpu_type = MXC_CPU_IMX6Q; 341 cpu_type = MXC_CPU_IMX6Q;
331 else if (cpu_is_imx6dl()) 342 else if (cpu_is_imx6dl())
332 cpu_type = MXC_CPU_IMX6DL; 343 cpu_type = MXC_CPU_IMX6DL;
344 else
345 cpu_type = MXC_CPU_IMX6SL;
333} 346}