Index: linux-2.6/arch/arm/mach-s3c2410/mach-h1940.c
===================================================================
--- linux-2.6.orig/arch/arm/mach-s3c2410/mach-h1940.c	2006-01-04 23:29:30.000000000 +0100
+++ linux-2.6/arch/arm/mach-s3c2410/mach-h1940.c	2006-01-05 00:10:54.000000000 +0100
@@ -40,6 +40,8 @@
 #include <linux/delay.h>
 
 #include <linux/mmc/protocol.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
@@ -67,6 +69,7 @@
 #include <asm/arch/ts.h>
 #include <asm/arch/lcd.h>
 #include <asm/arch/mmc.h>
+#include <asm/arch/nand.h>
 #include <asm/arch/buttons.h>
 
 #include <linux/serial_core.h>
@@ -165,6 +168,44 @@
 	.ocr_avail	= MMC_VDD_32_33,
 };
 
+static int chip0_map[] = { 0 };
+
+struct mtd_partition h1940_default_nand_part[] = {
+	{
+		.name   = "Whole flash",
+		.offset = 0,
+		.size   = MTDPART_SIZ_FULL,
+		.mask_flags = MTD_WRITEABLE,
+	},
+	{
+		.name   = "Kernel",
+		.offset = 0x50000,
+		.size   = 0x4d0000,
+	},
+	{
+		.name   = "Root",
+		.offset = 0x520000,
+		.size   = MTDPART_SIZ_FULL,
+	},
+};
+
+static struct s3c2410_nand_set h1940_nand_sets[] = {
+	{
+		.name           = "chip0",
+		.nr_chips       = 1,
+		.nr_map         = chip0_map,
+		.nr_partitions  = ARRAY_SIZE(h1940_default_nand_part),
+		.partitions     = h1940_default_nand_part
+	},
+};
+
+static struct s3c2410_platform_nand h1940_nand_info = {
+	.tacls          = 8,
+	.twrph0         = 38,
+	.twrph1         = 16,
+	.nr_sets        = ARRAY_SIZE(h1940_nand_sets),
+	.sets           = h1940_nand_sets,
+};
 
 /**
  * Set lcd on or off
@@ -355,6 +396,12 @@
 	      | (0x02 << S3C2410_PLLCON_PDIVSHIFT)
 	      | (0x03 << S3C2410_PLLCON_SDIVSHIFT);
 	writel(tmp, S3C2410_UPLLCON);
+
+	/* Add nand partitioning */
+	s3c_device_nand.dev.platform_data = &h1940_nand_info;
+	
+	/* Turn on the NAND write support */
+	/*s3c2410_gpio_setpin(S3C2410_GPA0, 1);*/
 }
 
 MACHINE_START(H1940, "IPAQ-H1940")
Index: linux-2.6/drivers/mtd/nand/s3c2410.c
===================================================================
--- linux-2.6.orig/drivers/mtd/nand/s3c2410.c	2006-01-04 22:34:16.000000000 +0100
+++ linux-2.6/drivers/mtd/nand/s3c2410.c	2006-01-05 00:10:13.000000000 +0100
@@ -79,7 +79,7 @@
 static struct nand_oobinfo nand_hw_eccoob = {
 	.useecc		= MTD_NANDECC_AUTOPLACE,
 	.eccbytes	= 3,
-	.eccpos		= {0, 1, 2 },
+	.eccpos		= {8, 9, 10 },
 	.oobfree	= { {8, 8} }
 };
 
