Index: linux-2.6.17/arch/arm/kernel/process.c
===================================================================
--- linux-2.6.17.orig/arch/arm/kernel/process.c	2006-06-18 02:49:35.000000000 +0100
+++ linux-2.6.17/arch/arm/kernel/process.c	2006-06-18 18:25:26.000000000 +0100
@@ -28,6 +28,7 @@
 #include <linux/init.h>
 #include <linux/cpu.h>
 #include <linux/elfcore.h>
+#include <linux/pm.h>
 
 #include <asm/leds.h>
 #include <asm/processor.h>
Index: linux-2.6.17/arch/arm/mach-pxa/pm.c
===================================================================
--- linux-2.6.17.orig/arch/arm/mach-pxa/pm.c	2006-06-18 02:49:35.000000000 +0100
+++ linux-2.6.17/arch/arm/mach-pxa/pm.c	2006-06-18 18:25:57.000000000 +0100
@@ -73,6 +73,8 @@
 	SLEEP_SAVE_SIZE
 };
 
+void (*pxa_mach_reset)(void);
+EXPORT_SYMBOL(pxa_mach_reset);
 
 int pxa_pm_enter(suspend_state_t state)
 {
Index: linux-2.6.17/arch/arm/mach-pxa/spitz.c
===================================================================
--- linux-2.6.17.orig/arch/arm/mach-pxa/spitz.c	2006-06-18 02:49:35.000000000 +0100
+++ linux-2.6.17/arch/arm/mach-pxa/spitz.c	2006-06-18 18:25:26.000000000 +0100
@@ -20,6 +20,7 @@
 #include <linux/fs.h>
 #include <linux/interrupt.h>
 #include <linux/mmc/host.h>
+#include <linux/pm.h>
 
 #include <asm/setup.h>
 #include <asm/memory.h>
@@ -33,6 +34,7 @@
 #include <asm/mach/irq.h>
 
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/system.h>
 #include <asm/arch/irda.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/ohci.h>
@@ -432,8 +434,30 @@
 	&spitzled_device,
 };
 
+static void spitz_poweroff(void)
+{
+	RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
+
+	pxa_gpio_mode(SPITZ_GPIO_ON_RESET | GPIO_OUT);
+	GPSR(SPITZ_GPIO_ON_RESET) = GPIO_bit(SPITZ_GPIO_ON_RESET);
+
+	mdelay(1000);
+}
+
+static void spitz_restart(void)
+{
+	/* Bootloader magic for a reboot */
+	if((MSC0 & 0xffff0000) == 0x7ff00000)
+		MSC0 = (MSC0 & 0xffff) | 0x7ee00000;
+
+	spitz_poweroff();
+}
+
 static void __init common_init(void)
 {
+	pm_power_off = spitz_poweroff;
+	pxa_mach_reset = spitz_restart;
+
 	PMCR = 0x00;
 
 	/* setup sleep mode values */
Index: linux-2.6.17/include/asm-arm/arch-pxa/system.h
===================================================================
--- linux-2.6.17.orig/include/asm-arm/arch-pxa/system.h	2006-06-18 02:49:35.000000000 +0100
+++ linux-2.6.17/include/asm-arm/arch-pxa/system.h	2006-06-18 18:25:26.000000000 +0100
@@ -10,16 +10,18 @@
  * published by the Free Software Foundation.
  */
 
+#include <asm/proc-fns.h>
 #include "hardware.h"
 #include "pxa-regs.h"
 
+extern void (*pxa_mach_reset)(void);
+
 static inline void arch_idle(void)
 {
 	cpu_do_idle();
 }
 
-
-static inline void arch_reset(char mode)
+static inline void pxa_arch_reset(char mode)
 {
 	if (mode == 's') {
 		/* Jump into ROM at address 0 */
@@ -32,3 +34,10 @@
 	}
 }
 
+static inline void arch_reset(char mode)
+{
+	if (pxa_mach_reset)
+		pxa_mach_reset();
+
+	pxa_arch_reset(mode);
+}
Index: linux-2.6.17/arch/arm/mach-pxa/poodle.c
===================================================================
--- linux-2.6.17.orig/arch/arm/mach-pxa/poodle.c	2006-06-18 02:49:35.000000000 +0100
+++ linux-2.6.17/arch/arm/mach-pxa/poodle.c	2006-06-18 18:25:26.000000000 +0100
@@ -18,6 +18,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/fb.h>
+#include <linux/pm.h>
 
 #include <asm/hardware.h>
 #include <asm/mach-types.h>
@@ -29,6 +30,7 @@
 #include <asm/mach/irq.h>
 
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/system.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/udc.h>
 #include <asm/arch/irda.h>
@@ -247,10 +249,19 @@
 	&poodle_scoop_device,
 };
 
+static void poodle_poweroff(void)
+{
+	RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
+	pxa_arch_reset('h');
+}
+
 static void __init poodle_init(void)
 {
 	int ret = 0;
 
+	pm_power_off = poodle_poweroff;
+	pxa_mach_reset = poodle_poweroff;
+
 	/* setup sleep mode values */
 	PWER  = 0x00000002;
 	PFER  = 0x00000000;
Index: linux-2.6.17/arch/arm/mach-pxa/tosa.c
===================================================================
--- linux-2.6.17.orig/arch/arm/mach-pxa/tosa.c	2006-06-18 02:49:35.000000000 +0100
+++ linux-2.6.17/arch/arm/mach-pxa/tosa.c	2006-06-18 18:25:26.000000000 +0100
@@ -19,12 +19,14 @@
 #include <linux/fs.h>
 #include <linux/interrupt.h>
 #include <linux/mmc/host.h>
+#include <linux/pm.h>
 
 #include <asm/setup.h>
 #include <asm/memory.h>
 #include <asm/mach-types.h>
 #include <asm/hardware.h>
 #include <asm/irq.h>
+#include <asm/arch/system.h>
 #include <asm/arch/irda.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/udc.h>
@@ -266,8 +268,30 @@
 	&tosaled_device,
 };
 
+static void tosa_poweroff(void)
+{
+	RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
+
+	pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_OUT);
+	GPSR(TOSA_GPIO_ON_RESET) = GPIO_bit(TOSA_GPIO_ON_RESET);
+
+	mdelay(1000);
+}
+
+static void tosa_restart(void)
+{
+	/* Bootloader magic for a reboot */
+	if((MSC0 & 0xffff0000) == 0x7ff00000)
+		MSC0 = (MSC0 & 0xffff) | 0x7ee00000;
+
+	tosa_poweroff();
+}
+
 static void __init tosa_init(void)
 {
+	pm_power_off = tosa_poweroff;
+	pxa_mach_reset = tosa_restart;
+
 	pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_IN);
 	pxa_gpio_mode(TOSA_GPIO_TC6393_INT | GPIO_IN);
 	pxa_gpio_mode(TOSA_GPIO_USB_IN | GPIO_IN);
Index: linux-2.6.17/arch/arm/mach-pxa/corgi.c
===================================================================
--- linux-2.6.17.orig/arch/arm/mach-pxa/corgi.c	2006-06-18 02:49:35.000000000 +0100
+++ linux-2.6.17/arch/arm/mach-pxa/corgi.c	2006-06-18 18:25:26.000000000 +0100
@@ -19,6 +19,7 @@
 #include <linux/fs.h>
 #include <linux/interrupt.h>
 #include <linux/mmc/host.h>
+#include <linux/pm.h>
 
 #include <asm/setup.h>
 #include <asm/memory.h>
@@ -32,6 +33,7 @@
 #include <asm/mach/irq.h>
 
 #include <asm/arch/pxa-regs.h>
+#include <asm/arch/system.h>
 #include <asm/arch/irda.h>
 #include <asm/arch/mmc.h>
 #include <asm/arch/udc.h>
@@ -310,8 +312,31 @@
 	&corgiled_device,
 };
 
+static void corgi_poweroff(void)
+{
+	RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
+
+	if (!machine_is_corgi())
+		/* Green LED off tells the bootloader to halt */
+		reset_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_LED_GREEN);
+	pxa_arch_reset('h');
+}
+
+static void corgi_restart(void)
+{
+	RCSR = RCSR_HWR | RCSR_WDR | RCSR_SMR | RCSR_GPR;
+
+	if (!machine_is_corgi())
+		/* Green LED on tells the bootloader to reboot */
+		set_scoop_gpio(&corgiscoop_device.dev, CORGI_SCP_LED_GREEN);
+	pxa_arch_reset('h');
+}
+
 static void __init corgi_init(void)
 {
+	pm_power_off = corgi_poweroff;
+	pxa_mach_reset = corgi_restart;
+
 	/* setup sleep mode values */
 	PWER  = 0x00000002;
 	PFER  = 0x00000000;
