[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <5b17c54142c87ffa262fca7425148e85c07d72bc.1487910170.git.shorne@gmail.com>
Date: Fri, 24 Feb 2017 13:32:33 +0900
From: Stafford Horne <shorne@...il.com>
To: Jonas Bonn <jonas@...thpole.se>,
Stefan Kristiansson <stefan.kristiansson@...nalahti.fi>
Cc: linux@...ck-us.net, openrisc@...ts.librecores.org,
linux-kernel@...r.kernel.org, Sebastian Macke <sebastian@...ke.de>,
Stafford Horne <shorne@...il.com>,
Christian Svensson <blue@....nu>
Subject: [PATCH v4 13/24] openrisc: Initial support for the idle state
From: Sebastian Macke <sebastian@...ke.de>
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@...ke.de>
[shorne@...il.com: Fixed checkpatch, blankline after declarations]
Signed-off-by: Stafford Horne <shorne@...il.com>
---
arch/openrisc/kernel/process.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c
index c49350b..6e9d1cb 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;
/*
--
2.9.3
Powered by blists - more mailing lists