diff options
Diffstat (limited to 'arch/arm/mach-pxa/spitz.c')
| -rw-r--r-- | arch/arm/mach-pxa/spitz.c | 25 |
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 | ||
| 437 | static 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 | |||
| 448 | static 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 | |||
| 435 | static void __init common_init(void) | 457 | static 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 */ |
