---
 arch/arm/mach-s3c2410/Makefile     |    4 	2 +	2 -	0 !
 arch/arm/mach-s3c2410/mach-h1940.c |    8 	8 +	0 -	0 !
 arch/arm/mach-s3c2410/pm-h1940.S   |   33 	33 +	0 -	0 !
 arch/arm/mach-s3c2410/s3c2410-pm.c |   11 	11 +	0 -	0 !
 arch/arm/mm/mmu.c                  |    5 	5 +	0 -	0 !
 5 files changed, 59 insertions(+), 2 deletions(-)

Index: linux-2.6/arch/arm/mm/mmu.c
===================================================================
--- linux-2.6.orig/arch/arm/mm/mmu.c	2006-12-01 01:02:04.000000000 +0100
+++ linux-2.6/arch/arm/mm/mmu.c	2006-12-01 01:02:30.000000000 +0100
@@ -619,6 +619,11 @@ void __init reserve_node_zero(pg_data_t 
 	if (machine_is_p720t())
 		res_size = 0x00014000;
 
+	if (machine_is_h1940()) {
+		reserve_bootmem_node(pgdat, 0x30003000, 0x1000);
+		reserve_bootmem_node(pgdat, 0x30081000, 0x1000);
+	}
+
 #ifdef CONFIG_SA1111
 	/*
 	 * Because of the SA1111 DMA bug, we want to preserve our
Index: linux-2.6/arch/arm/mach-s3c2410/Makefile
===================================================================
--- linux-2.6.orig/arch/arm/mach-s3c2410/Makefile	2006-12-01 01:02:04.000000000 +0100
+++ linux-2.6/arch/arm/mach-s3c2410/Makefile	2006-12-01 01:02:52.000000000 +0100
@@ -77,7 +77,7 @@ obj-$(CONFIG_MACH_AML_M5900)	+= mach-aml
 obj-$(CONFIG_MACH_ANUBIS)	+= mach-anubis.o
 obj-$(CONFIG_MACH_OSIRIS)	+= mach-osiris.o
 obj-$(CONFIG_ARCH_BAST)		+= mach-bast.o usb-simtec.o
-obj-$(CONFIG_ARCH_H1940)	+= mach-h1940.o h1940-bluetooth.o h1940-batt.o h1940-ints.o
+obj-$(CONFIG_ARCH_H1940)	+= mach-h1940.o h1940-bluetooth.o h1940-batt.o h1940-ints.o pm-h1940.o
 obj-$(CONFIG_MACH_N30)		+= mach-n30.o
 obj-$(CONFIG_ARCH_SMDK2410)	+= mach-smdk2410.o
 obj-$(CONFIG_MACH_SMDK2413)	+= mach-smdk2413.o
@@ -88,4 +88,4 @@ obj-$(CONFIG_MACH_OTOM)		+= mach-otom.o
 obj-$(CONFIG_MACH_NEXCODER_2440) += mach-nexcoder.o
 obj-$(CONFIG_MACH_VSTMS)	+= mach-vstms.o
 
-obj-$(CONFIG_MACH_SMDK)		+= common-smdk.o
\ No newline at end of file
+obj-$(CONFIG_MACH_SMDK)		+= common-smdk.o
Index: linux-2.6/arch/arm/mach-s3c2410/mach-h1940.c
===================================================================
--- linux-2.6.orig/arch/arm/mach-s3c2410/mach-h1940.c	2006-12-01 01:02:04.000000000 +0100
+++ linux-2.6/arch/arm/mach-s3c2410/mach-h1940.c	2006-12-01 01:03:54.000000000 +0100
@@ -55,6 +55,7 @@
 #include "clock.h"
 #include "devs.h"
 #include "cpu.h"
+#include "pm.h"
 
 static struct map_desc h1940_iodesc[] __initdata = {
 	[0] = {
@@ -359,12 +360,19 @@ static struct s3c24xx_board h1940_board 
 	.devices_count = ARRAY_SIZE(h1940_devices)
 };
 
+extern void h1940_pm_return(void);
+
 static void __init h1940_map_io(void)
 {
 	s3c24xx_init_io(h1940_iodesc, ARRAY_SIZE(h1940_iodesc));
 	s3c24xx_init_clocks(0);
 	s3c24xx_init_uarts(h1940_uartcfgs, ARRAY_SIZE(h1940_uartcfgs));
 	s3c24xx_set_board(&h1940_board);
+
+	/* setup PM */
+
+	memcpy(phys_to_virt(0x30081000), h1940_pm_return, 1024);
+	s3c2410_pm_init();
 }
 
 static void __init h1940_init_irq(void)
Index: linux-2.6/arch/arm/mach-s3c2410/pm-h1940.S
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ linux-2.6/arch/arm/mach-s3c2410/pm-h1940.S	2006-12-01 01:02:30.000000000 +0100
@@ -0,0 +1,33 @@
+/* linux/arch/arm/mach-s3c2410/pm-h1940.S
+ *
+ * Copyright (c) 2006 Ben Dooks <ben-linux@fluff.org>
+ *
+ * H1940 Suspend to RAM
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+	
+#include <linux/linkage.h>
+#include <asm/assembler.h>
+#include <asm/hardware.h>
+#include <asm/arch/map.h>
+
+#include <asm/arch/regs-gpio.h>
+
+	.text
+	.global	h1940_pm_return
+	
+h1940_pm_return:
+	mov	r0, #S3C2410_PA_GPIO
+	ldr	pc, [ r0, #S3C2410_GSTATUS3 - S3C24XX_VA_GPIO ]
Index: linux-2.6/arch/arm/mach-s3c2410/s3c2410-pm.c
===================================================================
--- linux-2.6.orig/arch/arm/mach-s3c2410/s3c2410-pm.c	2006-12-01 01:02:04.000000000 +0100
+++ linux-2.6/arch/arm/mach-s3c2410/s3c2410-pm.c	2006-12-01 01:02:30.000000000 +0100
@@ -52,6 +52,17 @@ static void s3c2410_pm_prepare(void)
 	DBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3));
 	DBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4));
 
+	if (machine_is_h1940()) {
+		unsigned int *base = phys_to_virt(0x30080000);
+		unsigned int ptr;
+		unsigned int calc = 0;
+
+		for (ptr = 0; ptr < 0x10000; ptr += 0x100)
+			calc = ptr[base];
+
+		__raw_writel(calc, phys_to_virt(0x30003ff8));
+	}
+
 	if ( machine_is_aml_m5900() )
 		s3c2410_gpio_setpin(S3C2410_GPF2, 1);
 
