]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: mach-ebsa110: move special idle code out of line
authorNicolas Pitre <nicolas.pitre@linaro.org>
Tue, 2 Aug 2011 16:52:48 +0000 (12:52 -0400)
committerNicolas Pitre <nico@fluxnic.net>
Fri, 20 Jan 2012 23:55:11 +0000 (18:55 -0500)
... and hook it to arm_pm_idle.

Signed-off-by: Nicolas Pitre <nicolas.pitre@linaro.org>
arch/arm/mach-ebsa110/core.c
arch/arm/mach-ebsa110/include/mach/system.h

index 294aad07f7a05eaabcfe9b6fb7ac8d48ca1cfe10..804c9122b7b3626e76eadcd3c950429612e87969 100644 (file)
@@ -271,8 +271,33 @@ static struct platform_device *ebsa110_devices[] = {
        &am79c961_device,
 };
 
+/*
+ * EBSA110 idling methodology:
+ *
+ * We can not execute the "wait for interrupt" instruction since that
+ * will stop our MCLK signal (which provides the clock for the glue
+ * logic, and therefore the timer interrupt).
+ *
+ * Instead, we spin, polling the IRQ_STAT register for the occurrence
+ * of any interrupt with core clock down to the memory clock.
+ */
+static void ebsa110_idle(void)
+{
+       const char *irq_stat = (char *)0xff000000;
+
+       /* disable clock switching */
+       asm volatile ("mcr p15, 0, ip, c15, c2, 2" : : : "cc");
+
+       /* wait for an interrupt to occur */
+       while (!*irq_stat);
+
+       /* enable clock switching */
+       asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc");
+}
+
 static int __init ebsa110_init(void)
 {
+       arm_pm_idle = ebsa110_idle;
        return platform_add_devices(ebsa110_devices, ARRAY_SIZE(ebsa110_devices));
 }
 
index 2e4af65edb6fc0e7efd5336ebb8db59d01c693b4..b4601699b3bee36b19cb41583bea7564712711dd 100644 (file)
 #ifndef __ASM_ARCH_SYSTEM_H
 #define __ASM_ARCH_SYSTEM_H
 
-/*
- * EBSA110 idling methodology:
- *
- * We can not execute the "wait for interrupt" instruction since that
- * will stop our MCLK signal (which provides the clock for the glue
- * logic, and therefore the timer interrupt).
- *
- * Instead, we spin, polling the IRQ_STAT register for the occurrence
- * of any interrupt with core clock down to the memory clock.
- */
 static inline void arch_idle(void)
 {
-       const char *irq_stat = (char *)0xff000000;
-
-       /* disable clock switching */
-       asm volatile ("mcr p15, 0, ip, c15, c2, 2" : : : "cc");
-
-       /* wait for an interrupt to occur */
-       while (!*irq_stat);
-
-       /* enable clock switching */
-       asm volatile ("mcr p15, 0, ip, c15, c1, 2" : : : "cc");
+       cpu_do_idle();
 }
 
 #endif