aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/tosa.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/tosa.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/tosa.c')
-rw-r--r--arch/arm/mach-pxa/tosa.c25
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
271static 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
282static 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
269static void __init tosa_init(void) 291static 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);