Skip to contentSkip to conversation

24xx NAND - Please Test

PATCH In review Komal Shah 2 participants 2 messages Jan 10, 2006

Subsystems (5)
lore
Share & tools
lore

Komal Shah

author
#0 lore raw

PATCH 1/1 24xx NAND - Please Test

Kyungmin Park,

As you have already worked on h4 x-loader, I had cooked up NAND patch for H4, but was not able to test it on EVM, as I got stuck in x-loader and u-boot flashing itself.

You may want to test it and submit it to linux-omap list, as I will not able to work on this anymore. Thanx.

---Komal Shah
http://komalshah.blogspot.com/

__________________________________________
Yahoo! DSL – Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com

MTD: H4 NAND support.

---
commit e638d8a390e39926af0ef430c1bada246be47980
tree 266103817e2358b243f8c22a08fed4023fdadd43
parent 165e0bcd61404f0418fc70f07a6a23124fa0d206
author Komal Shah <[email protected]> Tue, 10 Jan 2006 16:36:35 +0530 committer Komal Shah <[email protected]> Tue, 10 Jan 2006 16:36:35 +0530

 arch/arm/mach-omap2/board-h4.c     |   76 ++++++++++++++++++++++++++++++++----
 arch/arm/mach-omap2/prcm-regs.h    |    2 +
 drivers/mtd/nand/Kconfig           |    8 ++--
 drivers/mtd/nand/omap-nand-flash.c |   47 ++++++++++++++++++----
 4 files changed, 111 insertions(+), 22 deletions(-)
arch/arm/mach-omap2/board-h4.c +67 -9
index 19b498d..3b16517 100644
@@ -15,6 +15,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/mtd/mtd.h>
+#include <linux/mtd/nand.h>
 #include <linux/mtd/partitions.h>
 #include <linux/delay.h>
 
@@ -34,7 +35,7 @@
 #include <asm/io.h>
 #include <asm/delay.h>
 
-static struct mtd_partition h4_partitions[] = {
+static struct mtd_partition h4_nor_partitions[] = {
 	/* bootloader (U-Boot, etc) in first sector */
 	{
 	      .name		= "bootloader",
@@ -65,27 +66,79 @@ static struct mtd_partition h4_partition
 	}
 };
 
-static struct flash_platform_data h4_flash_data = {
+static struct flash_platform_data h4_nor_data = {
 	.map_name	= "cfi_probe",
 	.width		= 2,
-	.parts		= h4_partitions,
-	.nr_parts	= ARRAY_SIZE(h4_partitions),
+	.parts		= h4_nor_partitions,
+	.nr_parts	= ARRAY_SIZE(h4_nor_partitions),
 };
 
-static struct resource h4_flash_resource = {
+static struct resource h4_nor_resource = {
 	.start		= H4_CS0_BASE,
 	.end		= H4_CS0_BASE + SZ_64M - 1,
 	.flags		= IORESOURCE_MEM,
 };
 
-static struct platform_device h4_flash_device = {
+static struct platform_device h4_nor_device = {
 	.name		= "omapflash",
 	.id		= 0,
 	.dev		= {
-		.platform_data	= &h4_flash_data,
+		.platform_data	= &h4_nor_data,
 	},
 	.num_resources	= 1,
-	.resource	= &h4_flash_resource,
+	.resource	= &h4_nor_resource,
+};
+
+static struct mtd_partition h4_nand_partitions[] = {
+	{
+		.name		= "xloader",
+		.offset		= 0,
+		.size		= 256 * 1024,
+		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
+	},
+	{
+		.name		= "bootloader",
+		.offset		= MTDPART_OFS_APPEND,
+		.size		= 256 * 1024,
+		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
+	},
+	{
+		.name		= "params",
+		.offset		= MTDPART_OFS_APPEND,
+		.size		= 192 * 1024,
+	},
+	{
+		.name		= "kernel",
+		.offset		= MTDPART_OFS_APPEND,
+		.size		= 2 * SZ_1M,
+	},
+	{
+	      .name		= "filesystem",
+	      .offset		= MTDPART_OFS_APPEND,
+	      .size		= MTDPART_SIZ_FULL,
+	},
+};
+
+static struct nand_platform_data h4_nand_data = {
+	.options	= NAND_SAMSUNG_LP_OPTIONS,
+	.parts		= h4_nand_partitions,
+	.nr_parts	= ARRAY_SIZE(h4_nand_partitions),
+};
+
+static struct resource h4_nand_resource = {
+	.start		= H4_CS0_BASE,
+	.end		= H4_CS0_BASE + SZ_64M - 1,
+	.flags		= IORESOURCE_MEM,
+};
+
+static struct platform_device h4_nand_device = {
+	.name		= "omapnand",
+	.id		= 0,
+	.dev		= {
+		.platform_data	= &h4_nand_data,
+	},
+	.num_resources	= 1,
+	.resource	= &h4_nand_resource,
 };
 
 static struct resource h4_smc91x_resources[] = {
@@ -110,7 +163,8 @@ static struct platform_device h4_smc91x_
 
 static struct platform_device *h4_devices[] __initdata = {
 	&h4_smc91x_device,
-	&h4_flash_device,
+	&h4_nor_device,
+	&h4_nand_device,
 };
 
 static inline void __init h4_init_smc91x(void)
@@ -174,6 +228,10 @@ static void __init omap_h4_init(void)
 	 * You have to mux them off in device drivers later on
 	 * if not needed.
 	 */
+#if defined(CONFIG_MTD_OMAP_NOR) || defined(CONFIG_MTD_OMAP_NOR_MODULE)
+	GPMC_CONFIG1_0	= 0x00060000;	/* rw wait0 pin monitoring */
+	GPMC_CONFIG	= 0x00000010;	/* write protect off */
+#endif
 	platform_add_devices(h4_devices, ARRAY_SIZE(h4_devices));
 	omap_board_config = h4_config;
 	omap_board_config_size = ARRAY_SIZE(h4_config);
arch/arm/mach-omap2/prcm-regs.h +2 -0
index 72337ca..fb6e12a 100644
@@ -366,6 +366,8 @@
 
 /* GPMC CS1 FPGA ON USER INTERFACE MODULE */
 //#define DEBUG_BOARD_LED_REGISTER 0x04000014
+/* GPMC */
+#define GPMC_CONFIG		GPMC_REG32(0x050)
 
 /* GPMC CS0 */
 #define GPMC_CONFIG1_0		GPMC_REG32(0x060)
drivers/mtd/nand/Kconfig +4 -4
index f4c4e8e..68f6d87 100644
@@ -50,10 +50,10 @@ config MTD_NAND_SPIA
 	  If you had to ask, you don't have one. Say 'N'.
 
 config MTD_NAND_OMAP
-	tristate "NAND Flash device on OMAP H3/H2/P2 boards"
-	depends on ARM && ARCH_OMAP1 && MTD_NAND && (MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_PERSEUS2)
-	help
-	  Support for NAND flash on Texas Instruments H3/H2/P2 platforms.
+	tristate "NAND Flash device on OMAP H4/H3/H2/P2/NETSTAR boards"
+	depends on ARM && (ARCH_OMAP1 || ARCH_OMAP2) && MTD_NAND && (MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_NETSTAR || MACH_OMAP_PERSEUS2 || MACH_OMAP_H4)
+        help
+          Support for NAND flash on Texas Instruments H4/H3/H2/P2/NETSTAR platforms.
 
 config MTD_NAND_TOTO
 	tristate "NAND Flash device on TOTO board"
drivers/mtd/nand/omap-nand-flash.c +38 -9

68 lines not on this page · raw message

#1 lore raw

Hi

Quoted 3 lines

As you have already worked on h4 x-loader, I had cooked up NAND patch for H4, but was not able to test it on EVM, as I got stuck in x-loader and u-boot flashing itself.

No I just test OneNAND not NAND on xloader and I also don't have NAND device on omap24xx.

I don't know we have a plan to make a NAND test board on omap24xx. I will ask the hardware team.

Quoted 6 lines

You may want to test it and submit it to linux-omap list, as I will not
able to work on this anymore. Thanx.

MTD: H4 NAND support.

arch/arm/mach-omap2/board-h4.c +0 -0
index 19b498d..3b16517 100644

+
+static struct resource h4_nand_resource = {
+ .start = H4_CS0_BASE,
+ .end = H4_CS0_BASE + SZ_64M - 1,
+ .flags = IORESOURCE_MEM,
+};

I don't know CS0 is corret address on H4?
If some H4 board don't have NAND device, Is it working?

+#if defined(CONFIG_MTD_OMAP_NOR) || defined(CONFIG_MTD_OMAP_NOR_MODULE)
+ GPMC_CONFIG1_0 = 0x00060000; /* rw wait0 pin monitoring */
+ GPMC_CONFIG = 0x00000010; /* write protect off */
+#endif

Is it right?

GPMC_CONFIG1_0 |= 0x00060000; /* rw wait0 pin monitoring */
GPMC_CONFIG |= 0x00000010; /* write protect off */

Is it more reasonable?

Regards,
Kyungmin Park