diff options
author | Nicolas Pitre <nicolas.pitre@linaro.org> | 2011-08-02 12:52:48 -0400 |
---|---|---|
committer | Nicolas Pitre <nico@fluxnic.net> | 2012-01-20 18:55:11 -0500 |
commit | 1b7f72fc395d3d2b498fee5ecfb9e46497f55cdd (patch) | |
tree | 8fefa3bde9652f8acb8bda177f3b38149d53a0be /arch/arm/mach-ebsa110 | |
parent | 71e256c54d67f55536bae184bb579c682714a95a (diff) |
ARM: mach-ebsa110: move special idle code out of line
... and hook it to arm_pm_idle.
Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
Diffstat (limited to 'arch/arm/mach-ebsa110')
-rw-r--r-- | arch/arm/mach-ebsa110/core.c | 25 | ||||
-rw-r--r-- | arch/arm/mach-ebsa110/include/mach/system.h | 21 |
2 files changed, 26 insertions, 20 deletions
diff --git a/arch/arm/mach-ebsa110/core.c b/arch/arm/mach-ebsa110/core.c index 294aad07f7a0..804c9122b7b3 100644 --- a/arch/arm/mach-ebsa110/core.c +++ b/arch/arm/mach-ebsa110/core.c | |||
@@ -271,8 +271,33 @@ static struct platform_device *ebsa110_devices[] = { | |||
271 | &am79c961_device, | 271 | &am79c961_device, |
272 | }; | 272 | }; |
273 | 273 | ||
274 | /* | ||
275 | * EBSA110 idling methodology: | ||
276 | * | ||
277 | * We can not execute the "wait for interrupt" instruction since that | ||
278 | * will stop our MCLK signal (which provides the clock for the glue | ||
279 | * logic, and therefore the timer interrupt). | ||
280 | * | ||
281 | * Instead, we spin, polling the IRQ_STAT register for the occurrence | ||
282 | * of any interrupt with core clock down to the memory clock. | ||
283 | */ | ||
284 | static void ebsa110_idle(void) | ||
285 | { | ||
286 | const char *irq_stat = (char *)0xff000000; | ||
287 | |||
288 | /* disable clock switching */ | ||
289 | asm volatile ("mcr p15, 0, ip, c15, c2, 2" : : : "cc"); | ||
290 | |||
291 | /* wait for an interrupt to occur */ | ||
292 | while (!*irq_stat); | ||
293 | |||
294 | /* enable clock switching */ | ||
295 | asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc"); | ||
296 | } | ||
297 | |||
274 | static int __init ebsa110_init(void) | 298 | static int __init ebsa110_init(void) |
275 | { | 299 | { |
300 | arm_pm_idle = ebsa110_idle; | ||
276 | return platform_add_devices(ebsa110_devices, ARRAY_SIZE(ebsa110_devices)); | 301 | return platform_add_devices(ebsa110_devices, ARRAY_SIZE(ebsa110_devices)); |
277 | } | 302 | } |
278 | 303 | ||
diff --git a/arch/arm/mach-ebsa110/include/mach/system.h b/arch/arm/mach-ebsa110/include/mach/system.h index 2e4af65edb6f..b4601699b3be 100644 --- a/arch/arm/mach-ebsa110/include/mach/system.h +++ b/arch/arm/mach-ebsa110/include/mach/system.h | |||
@@ -10,28 +10,9 @@ | |||
10 | #ifndef __ASM_ARCH_SYSTEM_H | 10 | #ifndef __ASM_ARCH_SYSTEM_H |
11 | #define __ASM_ARCH_SYSTEM_H | 11 | #define __ASM_ARCH_SYSTEM_H |
12 | 12 | ||
13 | /* | ||
14 | * EBSA110 idling methodology: | ||
15 | * | ||
16 | * We can not execute the "wait for interrupt" instruction since that | ||
17 | * will stop our MCLK signal (which provides the clock for the glue | ||
18 | * logic, and therefore the timer interrupt). | ||
19 | * | ||
20 | * Instead, we spin, polling the IRQ_STAT register for the occurrence | ||
21 | * of any interrupt with core clock down to the memory clock. | ||
22 | */ | ||
23 | static inline void arch_idle(void) | 13 | static inline void arch_idle(void) |
24 | { | 14 | { |
25 | const char *irq_stat = (char *)0xff000000; | 15 | cpu_do_idle(); |
26 | |||
27 | /* disable clock switching */ | ||
28 | asm volatile ("mcr p15, 0, ip, c15, c2, 2" : : : "cc"); | ||
29 | |||
30 | /* wait for an interrupt to occur */ | ||
31 | while (!*irq_stat); | ||
32 | |||
33 | /* enable clock switching */ | ||
34 | asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc"); | ||
35 | } | 16 | } |
36 | 17 | ||
37 | #endif | 18 | #endif |