aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2013-03-28 17:45:31 -0400
committerTony Lindgren <tony@atomide.com>2013-03-28 17:45:31 -0400
commitc309f7f46167e85d1aae2fd31f23e7d2b5cdfbe0 (patch)
tree130ae74f0178a73302ea47dfb29403c68875f403
parentcdcbdfb290b7b15315bf92fb5c339d0a8b32debf (diff)
parentfd1c07861491abf5e0e9ca06799bb5c48f99b64d (diff)
Merge branch 'for_3.10/omap_generic_cleanup_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/ssantosh/linux into omap-for-v3.10/cleanup-v2
-rw-r--r--arch/arm/mach-omap2/cpuidle34xx.c3
-rw-r--r--arch/arm/mach-omap2/cpuidle44xx.c7
-rw-r--r--arch/arm/mach-omap2/omap-hotplug.c6
-rw-r--r--arch/arm/mach-omap2/omap-smp.c57
-rw-r--r--arch/arm/mach-omap2/omap4-common.c16
-rw-r--r--arch/arm/mach-omap2/omap4-sar-layout.h14
-rw-r--r--arch/arm/mach-omap2/pm24xx.c11
-rw-r--r--arch/arm/mach-omap2/pm34xx.c9
-rw-r--r--arch/arm/mach-omap2/pm44xx.c20
9 files changed, 51 insertions, 92 deletions
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index 80392fca86c6..06f567faf993 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -107,8 +107,6 @@ static int __omap3_enter_idle(struct cpuidle_device *dev,
107{ 107{
108 struct omap3_idle_statedata *cx = &omap3_idle_data[index]; 108 struct omap3_idle_statedata *cx = &omap3_idle_data[index];
109 109
110 local_fiq_disable();
111
112 if (omap_irq_pending() || need_resched()) 110 if (omap_irq_pending() || need_resched())
113 goto return_sleep_time; 111 goto return_sleep_time;
114 112
@@ -143,7 +141,6 @@ static int __omap3_enter_idle(struct cpuidle_device *dev,
143 clkdm_allow_idle(mpu_pd->pwrdm_clkdms[0]); 141 clkdm_allow_idle(mpu_pd->pwrdm_clkdms[0]);
144 142
145return_sleep_time: 143return_sleep_time:
146 local_fiq_enable();
147 144
148 return index; 145 return index;
149} 146}
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index d639aef0deda..944e64aad7e5 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -70,10 +70,7 @@ static int omap4_enter_idle_simple(struct cpuidle_device *dev,
70 struct cpuidle_driver *drv, 70 struct cpuidle_driver *drv,
71 int index) 71 int index)
72{ 72{
73 local_fiq_disable();
74 omap_do_wfi(); 73 omap_do_wfi();
75 local_fiq_enable();
76
77 return index; 74 return index;
78} 75}
79 76
@@ -84,8 +81,6 @@ static int omap4_enter_idle_coupled(struct cpuidle_device *dev,
84 struct omap4_idle_statedata *cx = &omap4_idle_data[index]; 81 struct omap4_idle_statedata *cx = &omap4_idle_data[index];
85 int cpu_id = smp_processor_id(); 82 int cpu_id = smp_processor_id();
86 83
87 local_fiq_disable();
88
89 /* 84 /*
90 * CPU0 has to wait and stay ON until CPU1 is OFF state. 85 * CPU0 has to wait and stay ON until CPU1 is OFF state.
91 * This is necessary to honour hardware recommondation 86 * This is necessary to honour hardware recommondation
@@ -158,8 +153,6 @@ fail:
158 cpuidle_coupled_parallel_barrier(dev, &abort_barrier); 153 cpuidle_coupled_parallel_barrier(dev, &abort_barrier);
159 cpu_done[dev->cpu] = false; 154 cpu_done[dev->cpu] = false;
160 155
161 local_fiq_enable();
162
163 return index; 156 return index;
164} 157}
165 158
diff --git a/arch/arm/mach-omap2/omap-hotplug.c b/arch/arm/mach-omap2/omap-hotplug.c
index e712d1725a8b..458f72f9dc8f 100644
--- a/arch/arm/mach-omap2/omap-hotplug.c
+++ b/arch/arm/mach-omap2/omap-hotplug.c
@@ -19,11 +19,8 @@
19#include <linux/smp.h> 19#include <linux/smp.h>
20#include <linux/io.h> 20#include <linux/io.h>
21 21
22#include <asm/cacheflush.h>
23#include "omap-wakeupgen.h" 22#include "omap-wakeupgen.h"
24
25#include "common.h" 23#include "common.h"
26
27#include "powerdomain.h" 24#include "powerdomain.h"
28 25
29/* 26/*
@@ -35,9 +32,6 @@ void __ref omap4_cpu_die(unsigned int cpu)
35 unsigned int boot_cpu = 0; 32 unsigned int boot_cpu = 0;
36 void __iomem *base = omap_get_wakeupgen_base(); 33 void __iomem *base = omap_get_wakeupgen_base();
37 34
38 flush_cache_all();
39 dsb();
40
41 /* 35 /*
42 * we're ready for shutdown now, so do it 36 * we're ready for shutdown now, so do it
43 */ 37 */
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c
index d9727218dd0a..0cbb677c4df4 100644
--- a/arch/arm/mach-omap2/omap-smp.c
+++ b/arch/arm/mach-omap2/omap-smp.c
@@ -21,7 +21,6 @@
21#include <linux/io.h> 21#include <linux/io.h>
22#include <linux/irqchip/arm-gic.h> 22#include <linux/irqchip/arm-gic.h>
23 23
24#include <asm/cacheflush.h>
25#include <asm/smp_scu.h> 24#include <asm/smp_scu.h>
26 25
27#include "omap-secure.h" 26#include "omap-secure.h"
@@ -103,9 +102,6 @@ static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *
103 else 102 else
104 __raw_writel(0x20, base + OMAP_AUX_CORE_BOOT_0); 103 __raw_writel(0x20, base + OMAP_AUX_CORE_BOOT_0);
105 104
106 flush_cache_all();
107 smp_wmb();
108
109 if (!cpu1_clkdm) 105 if (!cpu1_clkdm)
110 cpu1_clkdm = clkdm_lookup("mpu1_clkdm"); 106 cpu1_clkdm = clkdm_lookup("mpu1_clkdm");
111 107
@@ -168,38 +164,6 @@ static int __cpuinit omap4_boot_secondary(unsigned int cpu, struct task_struct *
168 return 0; 164 return 0;
169} 165}
170 166
171static void __init wakeup_secondary(void)
172{
173 void *startup_addr = omap_secondary_startup;
174 void __iomem *base = omap_get_wakeupgen_base();
175
176 if (cpu_is_omap446x()) {
177 startup_addr = omap_secondary_startup_4460;
178 pm44xx_errata |= PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD;
179 }
180
181 /*
182 * Write the address of secondary startup routine into the
183 * AuxCoreBoot1 where ROM code will jump and start executing
184 * on secondary core once out of WFE
185 * A barrier is added to ensure that write buffer is drained
186 */
187 if (omap_secure_apis_support())
188 omap_auxcoreboot_addr(virt_to_phys(startup_addr));
189 else
190 __raw_writel(virt_to_phys(omap5_secondary_startup),
191 base + OMAP_AUX_CORE_BOOT_1);
192
193 smp_wmb();
194
195 /*
196 * Send a 'sev' to wake the secondary core from WFE.
197 * Drain the outstanding writes to memory
198 */
199 dsb_sev();
200 mb();
201}
202
203/* 167/*
204 * Initialise the CPU possible map early - this describes the CPUs 168 * Initialise the CPU possible map early - this describes the CPUs
205 * which may be present or become present in the system. 169 * which may be present or become present in the system.
@@ -235,6 +199,8 @@ static void __init omap4_smp_init_cpus(void)
235 199
236static void __init omap4_smp_prepare_cpus(unsigned int max_cpus) 200static void __init omap4_smp_prepare_cpus(unsigned int max_cpus)
237{ 201{
202 void *startup_addr = omap_secondary_startup;
203 void __iomem *base = omap_get_wakeupgen_base();
238 204
239 /* 205 /*
240 * Initialise the SCU and wake up the secondary core using 206 * Initialise the SCU and wake up the secondary core using
@@ -242,7 +208,24 @@ static void __init omap4_smp_prepare_cpus(unsigned int max_cpus)
242 */ 208 */
243 if (scu_base) 209 if (scu_base)
244 scu_enable(scu_base); 210 scu_enable(scu_base);
245 wakeup_secondary(); 211
212 if (cpu_is_omap446x()) {
213 startup_addr = omap_secondary_startup_4460;
214 pm44xx_errata |= PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD;
215 }
216
217 /*
218 * Write the address of secondary startup routine into the
219 * AuxCoreBoot1 where ROM code will jump and start executing
220 * on secondary core once out of WFE
221 * A barrier is added to ensure that write buffer is drained
222 */
223 if (omap_secure_apis_support())
224 omap_auxcoreboot_addr(virt_to_phys(startup_addr));
225 else
226 __raw_writel(virt_to_phys(omap5_secondary_startup),
227 base + OMAP_AUX_CORE_BOOT_1);
228
246} 229}
247 230
248struct smp_operations omap4_smp_ops __initdata = { 231struct smp_operations omap4_smp_ops __initdata = {
diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
index 708bb115a27f..20bf3c754bfd 100644
--- a/arch/arm/mach-omap2/omap4-common.c
+++ b/arch/arm/mach-omap2/omap4-common.c
@@ -22,6 +22,7 @@
22#include <linux/of_platform.h> 22#include <linux/of_platform.h>
23#include <linux/export.h> 23#include <linux/export.h>
24#include <linux/irqchip/arm-gic.h> 24#include <linux/irqchip/arm-gic.h>
25#include <linux/of_address.h>
25 26
26#include <asm/hardware/cache-l2x0.h> 27#include <asm/hardware/cache-l2x0.h>
27#include <asm/mach/map.h> 28#include <asm/mach/map.h>
@@ -258,6 +259,21 @@ omap_early_initcall(omap4_sar_ram_init);
258 259
259void __init omap_gic_of_init(void) 260void __init omap_gic_of_init(void)
260{ 261{
262 struct device_node *np;
263
264 /* Extract GIC distributor and TWD bases for OMAP4460 ROM Errata WA */
265 if (!cpu_is_omap446x())
266 goto skip_errata_init;
267
268 np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic");
269 gic_dist_base_addr = of_iomap(np, 0);
270 WARN_ON(!gic_dist_base_addr);
271
272 np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-twd-timer");
273 twd_base = of_iomap(np, 0);
274 WARN_ON(!twd_base);
275
276skip_errata_init:
261 omap_wakeupgen_init(); 277 omap_wakeupgen_init();
262 irqchip_init(); 278 irqchip_init();
263} 279}
diff --git a/arch/arm/mach-omap2/omap4-sar-layout.h b/arch/arm/mach-omap2/omap4-sar-layout.h
index e170fe803b04..6822d0a7324f 100644
--- a/arch/arm/mach-omap2/omap4-sar-layout.h
+++ b/arch/arm/mach-omap2/omap4-sar-layout.h
@@ -20,13 +20,13 @@
20#define SAR_BANK4_OFFSET 0x3000 20#define SAR_BANK4_OFFSET 0x3000
21 21
22/* Scratch pad memory offsets from SAR_BANK1 */ 22/* Scratch pad memory offsets from SAR_BANK1 */
23#define SCU_OFFSET0 0xd00 23#define SCU_OFFSET0 0xfe4
24#define SCU_OFFSET1 0xd04 24#define SCU_OFFSET1 0xfe8
25#define OMAP_TYPE_OFFSET 0xd10 25#define OMAP_TYPE_OFFSET 0xfec
26#define L2X0_SAVE_OFFSET0 0xd14 26#define L2X0_SAVE_OFFSET0 0xff0
27#define L2X0_SAVE_OFFSET1 0xd18 27#define L2X0_SAVE_OFFSET1 0xff4
28#define L2X0_AUXCTRL_OFFSET 0xd1c 28#define L2X0_AUXCTRL_OFFSET 0xff8
29#define L2X0_PREFETCH_CTRL_OFFSET 0xd20 29#define L2X0_PREFETCH_CTRL_OFFSET 0xffc
30 30
31/* CPUx Wakeup Non-Secure Physical Address offsets in SAR_BANK3 */ 31/* CPUx Wakeup Non-Secure Physical Address offsets in SAR_BANK3 */
32#define CPU0_WAKEUP_NS_PA_ADDR_OFFSET 0xa04 32#define CPU0_WAKEUP_NS_PA_ADDR_OFFSET 0xa04
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index b59d93908341..ce956b0a7ba4 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -200,22 +200,17 @@ static int omap2_can_sleep(void)
200 200
201static void omap2_pm_idle(void) 201static void omap2_pm_idle(void)
202{ 202{
203 local_fiq_disable();
204
205 if (!omap2_can_sleep()) { 203 if (!omap2_can_sleep()) {
206 if (omap_irq_pending()) 204 if (omap_irq_pending())
207 goto out; 205 return;
208 omap2_enter_mpu_retention(); 206 omap2_enter_mpu_retention();
209 goto out; 207 return;
210 } 208 }
211 209
212 if (omap_irq_pending()) 210 if (omap_irq_pending())
213 goto out; 211 return;
214 212
215 omap2_enter_full_retention(); 213 omap2_enter_full_retention();
216
217out:
218 local_fiq_enable();
219} 214}
220 215
221static void __init prcm_setup_regs(void) 216static void __init prcm_setup_regs(void)
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 2d93d8b23835..c01859398b54 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -346,19 +346,14 @@ void omap_sram_idle(void)
346 346
347static void omap3_pm_idle(void) 347static void omap3_pm_idle(void)
348{ 348{
349 local_fiq_disable();
350
351 if (omap_irq_pending()) 349 if (omap_irq_pending())
352 goto out; 350 return;
353 351
354 trace_cpu_idle(1, smp_processor_id()); 352 trace_cpu_idle(1, smp_processor_id());
355 353
356 omap_sram_idle(); 354 omap_sram_idle();
357 355
358 trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id()); 356 trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
359
360out:
361 local_fiq_enable();
362} 357}
363 358
364#ifdef CONFIG_SUSPEND 359#ifdef CONFIG_SUSPEND
@@ -757,14 +752,12 @@ int __init omap3_pm_init(void)
757 pr_err("Memory allocation failed when allocating for secure sram context\n"); 752 pr_err("Memory allocation failed when allocating for secure sram context\n");
758 753
759 local_irq_disable(); 754 local_irq_disable();
760 local_fiq_disable();
761 755
762 omap_dma_global_context_save(); 756 omap_dma_global_context_save();
763 omap3_save_secure_ram_context(); 757 omap3_save_secure_ram_context();
764 omap_dma_global_context_restore(); 758 omap_dma_global_context_restore();
765 759
766 local_irq_enable(); 760 local_irq_enable();
767 local_fiq_enable();
768 } 761 }
769 762
770 omap3_save_scratchpad_contents(); 763 omap3_save_scratchpad_contents();
diff --git a/arch/arm/mach-omap2/pm44xx.c b/arch/arm/mach-omap2/pm44xx.c
index ea62e75ef21d..5ba6d888d6ff 100644
--- a/arch/arm/mach-omap2/pm44xx.c
+++ b/arch/arm/mach-omap2/pm44xx.c
@@ -131,11 +131,7 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm, void *unused)
131 */ 131 */
132static void omap_default_idle(void) 132static void omap_default_idle(void)
133{ 133{
134 local_fiq_disable();
135
136 omap_do_wfi(); 134 omap_do_wfi();
137
138 local_fiq_enable();
139} 135}
140 136
141/** 137/**
@@ -147,8 +143,8 @@ static void omap_default_idle(void)
147int __init omap4_pm_init(void) 143int __init omap4_pm_init(void)
148{ 144{
149 int ret; 145 int ret;
150 struct clockdomain *emif_clkdm, *mpuss_clkdm, *l3_1_clkdm, *l4wkup; 146 struct clockdomain *emif_clkdm, *mpuss_clkdm, *l3_1_clkdm;
151 struct clockdomain *ducati_clkdm, *l3_2_clkdm, *l4_per_clkdm; 147 struct clockdomain *ducati_clkdm, *l3_2_clkdm;
152 148
153 if (omap_rev() == OMAP4430_REV_ES1_0) { 149 if (omap_rev() == OMAP4430_REV_ES1_0) {
154 WARN(1, "Power Management not supported on OMAP4430 ES1.0\n"); 150 WARN(1, "Power Management not supported on OMAP4430 ES1.0\n");
@@ -175,27 +171,19 @@ int __init omap4_pm_init(void)
175 * MPUSS -> L4_PER/L3_* and DUCATI -> L3_* doesn't work as 171 * MPUSS -> L4_PER/L3_* and DUCATI -> L3_* doesn't work as
176 * expected. The hardware recommendation is to enable static 172 * expected. The hardware recommendation is to enable static
177 * dependencies for these to avoid system lock ups or random crashes. 173 * dependencies for these to avoid system lock ups or random crashes.
178 * The L4 wakeup depedency is added to workaround the OCP sync hardware
179 * BUG with 32K synctimer which lead to incorrect timer value read
180 * from the 32K counter. The BUG applies for GPTIMER1 and WDT2 which
181 * are part of L4 wakeup clockdomain.
182 */ 174 */
183 mpuss_clkdm = clkdm_lookup("mpuss_clkdm"); 175 mpuss_clkdm = clkdm_lookup("mpuss_clkdm");
184 emif_clkdm = clkdm_lookup("l3_emif_clkdm"); 176 emif_clkdm = clkdm_lookup("l3_emif_clkdm");
185 l3_1_clkdm = clkdm_lookup("l3_1_clkdm"); 177 l3_1_clkdm = clkdm_lookup("l3_1_clkdm");
186 l3_2_clkdm = clkdm_lookup("l3_2_clkdm"); 178 l3_2_clkdm = clkdm_lookup("l3_2_clkdm");
187 l4_per_clkdm = clkdm_lookup("l4_per_clkdm");
188 l4wkup = clkdm_lookup("l4_wkup_clkdm");
189 ducati_clkdm = clkdm_lookup("ducati_clkdm"); 179 ducati_clkdm = clkdm_lookup("ducati_clkdm");
190 if ((!mpuss_clkdm) || (!emif_clkdm) || (!l3_1_clkdm) || (!l4wkup) || 180 if ((!mpuss_clkdm) || (!emif_clkdm) || (!l3_1_clkdm) ||
191 (!l3_2_clkdm) || (!ducati_clkdm) || (!l4_per_clkdm)) 181 (!l3_2_clkdm) || (!ducati_clkdm))
192 goto err2; 182 goto err2;
193 183
194 ret = clkdm_add_wkdep(mpuss_clkdm, emif_clkdm); 184 ret = clkdm_add_wkdep(mpuss_clkdm, emif_clkdm);
195 ret |= clkdm_add_wkdep(mpuss_clkdm, l3_1_clkdm); 185 ret |= clkdm_add_wkdep(mpuss_clkdm, l3_1_clkdm);
196 ret |= clkdm_add_wkdep(mpuss_clkdm, l3_2_clkdm); 186 ret |= clkdm_add_wkdep(mpuss_clkdm, l3_2_clkdm);
197 ret |= clkdm_add_wkdep(mpuss_clkdm, l4_per_clkdm);
198 ret |= clkdm_add_wkdep(mpuss_clkdm, l4wkup);
199 ret |= clkdm_add_wkdep(ducati_clkdm, l3_1_clkdm); 187 ret |= clkdm_add_wkdep(ducati_clkdm, l3_1_clkdm);
200 ret |= clkdm_add_wkdep(ducati_clkdm, l3_2_clkdm); 188 ret |= clkdm_add_wkdep(ducati_clkdm, l3_2_clkdm);
201 if (ret) { 189 if (ret) {