diff options
Diffstat (limited to 'arch/arm/mach-pxa/common.c')
-rw-r--r-- | arch/arm/mach-pxa/common.c | 17 |
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(); +} |