diff options
Diffstat (limited to 'arch/arm/mach-pxa/tosa.c')
-rw-r--r-- | arch/arm/mach-pxa/tosa.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 76c0e7f0a219..afa223b9e7a2 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c | |||
@@ -19,12 +19,14 @@ | |||
19 | #include <linux/fs.h> | 19 | #include <linux/fs.h> |
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | #include <linux/mmc/host.h> | 21 | #include <linux/mmc/host.h> |
22 | #include <linux/pm.h> | ||
22 | 23 | ||
23 | #include <asm/setup.h> | 24 | #include <asm/setup.h> |
24 | #include <asm/memory.h> | 25 | #include <asm/memory.h> |
25 | #include <asm/mach-types.h> | 26 | #include <asm/mach-types.h> |
26 | #include <asm/hardware.h> | 27 | #include <asm/hardware.h> |
27 | #include <asm/irq.h> | 28 | #include <asm/irq.h> |
29 | #include <asm/system.h> | ||
28 | #include <asm/arch/irda.h> | 30 | #include <asm/arch/irda.h> |
29 | #include <asm/arch/mmc.h> | 31 | #include <asm/arch/mmc.h> |
30 | #include <asm/arch/udc.h> | 32 | #include <asm/arch/udc.h> |
@@ -266,8 +268,31 @@ static struct platform_device *devices[] __initdata = { | |||
266 | &tosaled_device, | 268 | &tosaled_device, |
267 | }; | 269 | }; |
268 | 270 | ||
271 | static void tosa_poweroff(void) | ||
272 | { | ||
273 | RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR; | ||
274 | |||
275 | pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_OUT); | ||
276 | GPSR(TOSA_GPIO_ON_RESET) = GPIO_bit(TOSA_GPIO_ON_RESET); | ||
277 | |||
278 | mdelay(1000); | ||
279 | arm_machine_restart('h'); | ||
280 | } | ||
281 | |||
282 | static void tosa_restart(char mode) | ||
283 | { | ||
284 | /* Bootloader magic for a reboot */ | ||
285 | if((MSC0 & 0xffff0000) == 0x7ff00000) | ||
286 | MSC0 = (MSC0 & 0xffff) | 0x7ee00000; | ||
287 | |||
288 | tosa_poweroff(); | ||
289 | } | ||
290 | |||
269 | static void __init tosa_init(void) | 291 | static void __init tosa_init(void) |
270 | { | 292 | { |
293 | pm_power_off = tosa_poweroff; | ||
294 | arm_pm_restart = tosa_restart; | ||
295 | |||
271 | pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_IN); | 296 | pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_IN); |
272 | pxa_gpio_mode(TOSA_GPIO_TC6393_INT | GPIO_IN); | 297 | pxa_gpio_mode(TOSA_GPIO_TC6393_INT | GPIO_IN); |
273 | pxa_gpio_mode(TOSA_GPIO_USB_IN | GPIO_IN); | 298 | pxa_gpio_mode(TOSA_GPIO_USB_IN | GPIO_IN); |