summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ebsa110/core.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-03-27 11:30:31 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-03-27 11:30:31 +0100
commitb0df89868006517417251e02cc4ce5d4b0165885 (patch)
tree6800388c633a13f64fd1f7845ce026ca2606522f /arch/arm/mach-ebsa110/core.c
parent4ba21e868f4b6e2ce5432055e206edadc6319533 (diff)
parent6c634726352f0d796a4b5e6aa9849ee5b45712ce (diff)
downloadtalos-obmc-linux-b0df89868006517417251e02cc4ce5d4b0165885.tar.gz
talos-obmc-linux-b0df89868006517417251e02cc4ce5d4b0165885.zip
Merge branch 'devel-stable' into for-linus
Conflicts: arch/arm/Kconfig.debug arch/arm/plat-versatile/Kconfig Merge fixes: arch/arm/mach-integrator/Kconfig drivers/clocksource/Kconfig
Diffstat (limited to 'arch/arm/mach-ebsa110/core.c')
-rw-r--r--arch/arm/mach-ebsa110/core.c25
1 files changed, 25 insertions, 0 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[] = {
&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));
}
OpenPOWER on IntegriCloud