summaryrefslogtreecommitdiffstats
path: root/arch/openrisc
diff options
context:
space:
mode:
authorSebastian Macke <sebastian@macke.de>2014-07-20 15:13:31 +0000
committerStafford Horne <shorne@gmail.com>2017-02-25 04:14:35 +0900
commite29d11c6991d078bf2011f25dc8c19a2f38c4c8e (patch)
treec194d4a427c9c1938b7a9df6f3606973e1cf6c8e /arch/openrisc
parent79f8a4d022f2d11d4fc90f785f575ac331e2ef71 (diff)
downloadlinux-e29d11c6991d078bf2011f25dc8c19a2f38c4c8e.tar.gz
linux-e29d11c6991d078bf2011f25dc8c19a2f38c4c8e.tar.xz
openrisc: Initial support for the idle state
This patch adds basic support for the idle state of the cpu. The patch overrides the regular idle function, enables the interupts, checks for the power management unit and enables the cpu doze mode if available. Signed-off-by: Sebastian Macke <sebastian@macke.de> [shorne@gmail.com: Fixed checkpatch, blankline after declarations] Signed-off-by: Stafford Horne <shorne@gmail.com>
Diffstat (limited to 'arch/openrisc')
-rw-r--r--arch/openrisc/kernel/process.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c
index c49350b200e1..6e9d1cb519f2 100644
--- a/arch/openrisc/kernel/process.c
+++ b/arch/openrisc/kernel/process.c
@@ -75,6 +75,17 @@ void machine_power_off(void)
__asm__("l.nop 1");
}
+/*
+ * Send the doze signal to the cpu if available.
+ * Make sure, that all interrupts are enabled
+ */
+void arch_cpu_idle(void)
+{
+ local_irq_enable();
+ if (mfspr(SPR_UPR) & SPR_UPR_PMP)
+ mtspr(SPR_PMR, mfspr(SPR_PMR) | SPR_PMR_DME);
+}
+
void (*pm_power_off) (void) = machine_power_off;
/*