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