summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/common.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-02-03 09:55:55 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2014-02-03 09:55:55 +0100
commitadbf51abdec9a50ee88a117353441211f1b9d6aa (patch)
treebda741154a075b519ddbbae856d1a048e3f3029d /arch/arm/mach-pxa/common.c
parentada75addeea07e91b6e689894a0ef826b0c176dc (diff)
parent706cef7e5bd9faafeb1ec599bf5270ea07063d56 (diff)
downloadbarebox-adbf51abdec9a50ee88a117353441211f1b9d6aa.tar.gz
barebox-adbf51abdec9a50ee88a117353441211f1b9d6aa.tar.xz
Merge branch 'for-next/pxa'
Diffstat (limited to 'arch/arm/mach-pxa/common.c')
-rw-r--r--arch/arm/mach-pxa/common.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/common.c b/arch/arm/mach-pxa/common.c
index 82e81b75d9..0c114ed58e 100644
--- a/arch/arm/mach-pxa/common.c
+++ b/arch/arm/mach-pxa/common.c
@@ -16,6 +16,7 @@
*/
#include <common.h>
+#include <mach/pxa-regs.h>
#include <asm/io.h>
#define OSMR3 0x40A0000C
@@ -26,8 +27,13 @@
#define OWER_WME (1 << 0) /* Watch-dog Match Enable */
#define OSSR_M3 (1 << 3) /* Match status channel 3 */
+extern void pxa_suspend(int mode);
+
void reset_cpu(ulong addr)
{
+ /* Clear last reset source */
+ RCSR = RCSR_GPR | RCSR_SMR | RCSR_WDR | RCSR_HWR;
+
/* Initialize the watchdog and let it fire */
writel(OWER_WME, OWER);
writel(OSSR_M3, OSSR);
@@ -35,3 +41,14 @@ void reset_cpu(ulong addr)
while (1);
}
+
+void __noreturn poweroff()
+{
+ shutdown_barebox();
+
+ /* Clear last reset source */
+ RCSR = RCSR_GPR | RCSR_SMR | RCSR_WDR | RCSR_HWR;
+
+ pxa_suspend(PWRMODE_DEEPSLEEP);
+ unreachable();
+}