diff options
author | Robert Jarzmik <robert.jarzmik@free.fr> | 2015-01-09 08:36:41 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-01-19 09:02:23 +0100 |
commit | 8e876a81052725f7b069e615698902752dee7791 (patch) | |
tree | 07f3742e20cf07225696a9e550e27d79b98cbece | |
parent | 0ebe45422a4b215df50ce1f7b37cc2f69bbb8ef0 (diff) | |
download | barebox-8e876a81052725f7b069e615698902752dee7791.tar.gz barebox-8e876a81052725f7b069e615698902752dee7791.tar.xz |
ARM: pxa: move pxa2xx functionality to SoC specific file
Move reset_source detection and poweroff to pxa2xx.c, to prepare the
incoming pxa3xx reset_source detection.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | arch/arm/mach-pxa/Makefile | 3 | ||||
-rw-r--r-- | arch/arm/mach-pxa/common.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa2xx.c (renamed from arch/arm/mach-pxa/reset_source.c) | 18 |
3 files changed, 20 insertions, 14 deletions
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index 6ddb6e58e5..a09c06082b 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile @@ -4,6 +4,5 @@ obj-y += gpio.o obj-y += devices.o obj-y += sleep.o -obj-$(CONFIG_ARCH_PXA2XX) += mfp-pxa2xx.o +obj-$(CONFIG_ARCH_PXA2XX) += mfp-pxa2xx.o pxa2xx.o obj-$(CONFIG_ARCH_PXA27X) += speed-pxa27x.o -obj-$(CONFIG_RESET_SOURCE) += reset_source.o diff --git a/arch/arm/mach-pxa/common.c b/arch/arm/mach-pxa/common.c index 0c114ed58e..1ed7931d46 100644 --- a/arch/arm/mach-pxa/common.c +++ b/arch/arm/mach-pxa/common.c @@ -27,7 +27,7 @@ #define OWER_WME (1 << 0) /* Watch-dog Match Enable */ #define OSSR_M3 (1 << 3) /* Match status channel 3 */ -extern void pxa_suspend(int mode); +extern void pxa_clear_reset_source(void); void reset_cpu(ulong addr) { @@ -41,14 +41,3 @@ 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(); -} diff --git a/arch/arm/mach-pxa/reset_source.c b/arch/arm/mach-pxa/pxa2xx.c index a90584b1a6..b712b388c8 100644 --- a/arch/arm/mach-pxa/reset_source.c +++ b/arch/arm/mach-pxa/pxa2xx.c @@ -15,8 +15,11 @@ #include <common.h> #include <init.h> #include <reset_source.h> +#include <mach/hardware.h> #include <mach/pxa-regs.h> +extern void pxa_suspend(int mode); + static int pxa_detect_reset_source(void) { u32 reg = RCSR; @@ -38,4 +41,19 @@ static int pxa_detect_reset_source(void) return 0; } +void pxa_clear_reset_source(void) +{ + RCSR = RCSR_GPR | RCSR_SMR | RCSR_WDR | RCSR_HWR; +} + device_initcall(pxa_detect_reset_source); + +void __noreturn poweroff(void) +{ + shutdown_barebox(); + + /* Clear last reset source */ + pxa_clear_reset_source(); + pxa_suspend(PWRMODE_DEEPSLEEP); + unreachable(); +} |