aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/spitz.c
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2006-06-19 14:57:12 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-06-19 14:57:12 -0400
commit74617fb6b825ea370ae72565f7543306bc08ef6e (patch)
treeac6032e0b476f1bf61bf03aba44240e448739d57 /arch/arm/mach-pxa/spitz.c
parentb7408aff2d325581dcafffa5dbcc09c42ae64b5d (diff)
[ARM] 3593/1: Add reboot and shutdown handlers for Zaurus handhelds
Patch from Richard Purdie Add functionality to allow machine specific reboot handlers on ARM. Add machine specific reboot and poweroff handlers for all PXA Zaurus models. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/spitz.c')
-rw-r--r--arch/arm/mach-pxa/spitz.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 44bcb8097c7a..eb9937f6f5cd 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -20,6 +20,7 @@
20#include <linux/fs.h> 20#include <linux/fs.h>
21#include <linux/interrupt.h> 21#include <linux/interrupt.h>
22#include <linux/mmc/host.h> 22#include <linux/mmc/host.h>
23#include <linux/pm.h>
23 24
24#include <asm/setup.h> 25#include <asm/setup.h>
25#include <asm/memory.h> 26#include <asm/memory.h>
@@ -27,6 +28,7 @@
27#include <asm/hardware.h> 28#include <asm/hardware.h>
28#include <asm/irq.h> 29#include <asm/irq.h>
29#include <asm/io.h> 30#include <asm/io.h>
31#include <asm/system.h>
30 32
31#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
32#include <asm/mach/map.h> 34#include <asm/mach/map.h>
@@ -432,8 +434,31 @@ static struct platform_device *devices[] __initdata = {
432 &spitzled_device, 434 &spitzled_device,
433}; 435};
434 436
437static void spitz_poweroff(void)
438{
439 RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
440
441 pxa_gpio_mode(SPITZ_GPIO_ON_RESET | GPIO_OUT);
442 GPSR(SPITZ_GPIO_ON_RESET) = GPIO_bit(SPITZ_GPIO_ON_RESET);
443
444 mdelay(1000);
445 arm_machine_restart('h');
446}
447
448static void spitz_restart(char mode)
449{
450 /* Bootloader magic for a reboot */
451 if((MSC0 & 0xffff0000) == 0x7ff00000)
452 MSC0 = (MSC0 & 0xffff) | 0x7ee00000;
453
454 spitz_poweroff();
455}
456
435static void __init common_init(void) 457static void __init common_init(void)
436{ 458{
459 pm_power_off = spitz_poweroff;
460 arm_pm_restart = spitz_restart;
461
437 PMCR = 0x00; 462 PMCR = 0x00;
438 463
439 /* setup sleep mode values */ 464 /* setup sleep mode values */