linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/8] nand support on omap3 boards
@ 2010-07-09 14:27 Sukumar Ghorai
  2010-07-09 14:27 ` [PATCH v4 1/5] omap3 flash: rename board-sdp-flash.c to be use by other boards Sukumar Ghorai
  2010-08-02 12:52 ` [PATCH v4 0/8] nand support on omap3 boards Tony Lindgren
  0 siblings, 2 replies; 7+ messages in thread
From: Sukumar Ghorai @ 2010-07-09 14:27 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-mtd, linux-arm-kernel, Sukumar Ghorai

   The following set of patches applies on top of for-next branch.
   And these are the patches required to enable nand (nor and onenand for sdp
   only) for different platform.
   
   v4: patch rebase on latest code base; depend on
	http://www.mail-archive.com/linux-omap@vger.kernel.org/msg31950.html
   
   v3:  http://www.mail-archive.com/linux-omap@vger.kernel.org/msg30735.html
	patch rebase on latest nand patch and depend on -
	http://www.mail-archive.com/linux-omap@vger.kernel.org/msg30305.html
   
   v2: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg26479.html
	rework to use full nand in partition table of ZOOM2/3;
	ZOOM1(LDP)support added.
		
   v1: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg22205.html

Sukumar Ghorai (5):
	omap3 flash: rename board-sdp-flash.c to be use by other boards
	omap3: add support for NAND on zoom2 board
	omap3: add support for NAND on zoom3 board
	omap-3630-sdp : Add support for Flash
	omap3: add support for NAND on LDP board

 arch/arm/mach-omap2/Makefile                  |    6 +-
 arch/arm/mach-omap2/board-3430sdp.c           |   16 +++-
 arch/arm/mach-omap2/board-3630sdp.c           |  120 +++++++++++++++++++++++++
 arch/arm/mach-omap2/board-ldp.c               |   35 +++++++
 arch/arm/mach-omap2/board-sdp-flash.c         |   88 ++++++++-----------
 arch/arm/mach-omap2/board-zoom2.c             |   43 +++++++++
 arch/arm/mach-omap2/board-zoom3.c             |   43 +++++++++
 arch/arm/mach-omap2/include/mach/board-sdp.h  |    9 ++-
 arch/arm/mach-omap2/include/mach/board-zoom.h |    6 ++
 9 files changed, 311 insertions(+), 55 deletions(-)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v4 1/5] omap3 flash: rename board-sdp-flash.c to be use by other boards
  2010-07-09 14:27 [PATCH v4 0/8] nand support on omap3 boards Sukumar Ghorai
@ 2010-07-09 14:27 ` Sukumar Ghorai
  2010-07-09 14:27   ` [PATCH v4 2/5] omap3: add support for NAND on zoom2 board Sukumar Ghorai
  2010-08-02 12:52 ` [PATCH v4 0/8] nand support on omap3 boards Tony Lindgren
  1 sibling, 1 reply; 7+ messages in thread
From: Sukumar Ghorai @ 2010-07-09 14:27 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-mtd, linux-arm-kernel, Sukumar Ghorai

rename board-sdp-flash.c(board-flash.c) and board-sdp.h(board-flash.h) to
used by other board e.g. zoom

Signed-off-by: Sukumar Ghorai <s-ghorai@ti.com>
---
 arch/arm/mach-omap2/Makefile                       |    2 +-
 arch/arm/mach-omap2/board-3430sdp.c                |   16 +++-
 .../{board-sdp-flash.c => board-flash.c}           |   88 ++++++++-----------
 .../include/mach/{board-sdp.h => board-flash.h}    |    9 ++-
 4 files changed, 60 insertions(+), 55 deletions(-)
 rename arch/arm/mach-omap2/{board-sdp-flash.c => board-flash.c} (68%)
 rename arch/arm/mach-omap2/include/mach/{board-sdp.h => board-flash.h} (71%)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index f5b4ff4..7820b6e 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -119,7 +119,7 @@ obj-$(CONFIG_MACH_OMAP3_PANDORA)	+= board-omap3pandora.o \
 					   hsmmc.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)		+= board-3430sdp.o \
 					   hsmmc.o \
-					   board-sdp-flash.o
+					   board-flash.o
 obj-$(CONFIG_MACH_NOKIA_N8X0)		+= board-n8x0.o
 obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51.o \
 					   board-rx51-sdram.o \
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c
index e51f8e3..61b5632 100644
--- a/arch/arm/mach-omap2/board-3430sdp.c
+++ b/arch/arm/mach-omap2/board-3430sdp.c
@@ -41,7 +41,7 @@
 #include <plat/control.h>
 #include <plat/gpmc-smc91x.h>
 
-#include <mach/board-sdp.h>
+#include <mach/board-flash.h>
 
 #include "mux.h"
 #include "sdram-qimonda-hyb18m512160af-6.h"
@@ -667,6 +667,18 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux	NULL
 #endif
 
+/*
+ * SDP3430 V2 Board CS organization
+ * Different from SDP3430 V1. Now 4 switches used to specify CS
+ *
+ * See also the Switch S8 settings in the comments.
+ */
+static char chip_sel_3430[][GPMC_CS_NUM] = {
+	{PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */
+	{PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
+	{PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
+};
+
 static struct mtd_partition sdp_nor_partitions[] = {
 	/* bootloader (U-Boot, etc) in first sector */
 	{
@@ -797,7 +809,7 @@ static void __init omap_3430sdp_init(void)
 	omap_serial_init();
 	usb_musb_init(&musb_board_data);
 	board_smc91x_init();
-	sdp_flash_init(sdp_flash_partitions);
+	board_flash_init(sdp_flash_partitions, chip_sel_3430);
 	sdp3430_display_init();
 	enable_board_wakeup_source();
 	usb_ehci_init(&ehci_pdata);
diff --git a/arch/arm/mach-omap2/board-sdp-flash.c b/arch/arm/mach-omap2/board-flash.c
similarity index 68%
rename from arch/arm/mach-omap2/board-sdp-flash.c
rename to arch/arm/mach-omap2/board-flash.c
index 2638c83..ac834aa 100644
--- a/arch/arm/mach-omap2/board-sdp-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -21,7 +21,7 @@
 #include <plat/nand.h>
 #include <plat/onenand.h>
 #include <plat/tc.h>
-#include <mach/board-sdp.h>
+#include <mach/board-flash.h>
 
 #define REG_FPGA_REV			0x10
 #define REG_FPGA_DIP_SWITCH_INPUT2	0x60
@@ -29,72 +29,53 @@
 
 #define DEBUG_BASE		0x08000000 /* debug board */
 
-#define PDC_NOR		1
-#define PDC_NAND	2
-#define PDC_ONENAND	3
-#define DBG_MPDB	4
-
 /* various memory sizes */
 #define FLASH_SIZE_SDPV1	SZ_64M	/* NOR flash (64 Meg aligned) */
 #define FLASH_SIZE_SDPV2	SZ_128M	/* NOR flash (256 Meg aligned) */
 
-/*
- * SDP3430 V2 Board CS organization
- * Different from SDP3430 V1. Now 4 switches used to specify CS
- *
- * See also the Switch S8 settings in the comments.
- *
- * REVISIT: Add support for 2430 SDP
- */
-static const unsigned char chip_sel_sdp[][GPMC_CS_NUM] = {
-	{PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */
-	{PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
-	{PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
-};
-
-static struct physmap_flash_data sdp_nor_data = {
+static struct physmap_flash_data board_nor_data = {
 	.width		= 2,
 };
 
-static struct resource sdp_nor_resource = {
+static struct resource board_nor_resource = {
 	.flags		= IORESOURCE_MEM,
 };
 
-static struct platform_device sdp_nor_device = {
+static struct platform_device board_nor_device = {
 	.name		= "physmap-flash",
 	.id		= 0,
 	.dev		= {
-			.platform_data = &sdp_nor_data,
+			.platform_data = &board_nor_data,
 	},
 	.num_resources	= 1,
-	.resource	= &sdp_nor_resource,
+	.resource	= &board_nor_resource,
 };
 
 static void
-__init board_nor_init(struct flash_partitions sdp_nor_parts, u8 cs)
+__init board_nor_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
 {
 	int err;
 
-	sdp_nor_data.parts	= sdp_nor_parts.parts;
-	sdp_nor_data.nr_parts	= sdp_nor_parts.nr_parts;
+	board_nor_data.parts	= nor_parts;
+	board_nor_data.nr_parts	= nr_parts;
 
 	/* Configure start address and size of NOR device */
 	if (omap_rev() >= OMAP3430_REV_ES1_0) {
 		err = gpmc_cs_request(cs, FLASH_SIZE_SDPV2 - 1,
-				(unsigned long *)&sdp_nor_resource.start);
-		sdp_nor_resource.end = sdp_nor_resource.start
+				(unsigned long *)&board_nor_resource.start);
+		board_nor_resource.end = board_nor_resource.start
 					+ FLASH_SIZE_SDPV2 - 1;
 	} else {
 		err = gpmc_cs_request(cs, FLASH_SIZE_SDPV1 - 1,
-				(unsigned long *)&sdp_nor_resource.start);
-		sdp_nor_resource.end = sdp_nor_resource.start
+				(unsigned long *)&board_nor_resource.start);
+		board_nor_resource.end = board_nor_resource.start
 					+ FLASH_SIZE_SDPV1 - 1;
 	}
 	if (err < 0) {
 		printk(KERN_ERR "NOR: Can't request GPMC CS\n");
 		return;
 	}
-	if (platform_device_register(&sdp_nor_device) < 0)
+	if (platform_device_register(&board_nor_device) < 0)
 		printk(KERN_ERR	"Unable to register NOR device\n");
 }
 
@@ -105,17 +86,18 @@ static struct omap_onenand_platform_data board_onenand_data = {
 };
 
 static void
-__init board_onenand_init(struct flash_partitions sdp_onenand_parts, u8 cs)
+__init board_onenand_init(struct mtd_partition *onenand_parts,
+				u8 nr_parts, u8 cs)
 {
 	board_onenand_data.cs		= cs;
-	board_onenand_data.parts	= sdp_onenand_parts.parts;
-	board_onenand_data.nr_parts	= sdp_onenand_parts.nr_parts;
+	board_onenand_data.parts	= onenand_parts;
+	board_onenand_data.nr_parts	= nr_parts;
 
 	gpmc_onenand_init(&board_onenand_data);
 }
 #else
 static void
-__init board_onenand_init(struct flash_partitions sdp_onenand_parts, u8 cs)
+__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
 {
 }
 #endif /* CONFIG_MTD_ONENAND_OMAP2 || CONFIG_MTD_ONENAND_OMAP2_MODULE */
@@ -147,7 +129,7 @@ static struct gpmc_timings nand_timings = {
 	.wr_data_mux_bus = 0,
 };
 
-static struct omap_nand_platform_data sdp_nand_data = {
+static struct omap_nand_platform_data board_nand_data = {
 	.nand_setup	= NULL,
 	.gpmc_t		= &nand_timings,
 	.dma_channel	= -1,		/* disable DMA in OMAP NAND driver */
@@ -155,18 +137,18 @@ static struct omap_nand_platform_data sdp_nand_data = {
 	.devsize	= 0,	/* '0' for 8-bit, '1' for 16-bit device */
 };
 
-static void
-__init board_nand_init(struct flash_partitions sdp_nand_parts, u8 cs)
+void
+__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs)
 {
-	sdp_nand_data.cs		= cs;
-	sdp_nand_data.parts		= sdp_nand_parts.parts;
-	sdp_nand_data.nr_parts		= sdp_nand_parts.nr_parts;
+	board_nand_data.cs		= cs;
+	board_nand_data.parts		= nand_parts;
+	board_nand_data.nr_parts		= nr_parts;
 
-	gpmc_nand_init(&sdp_nand_data);
+	gpmc_nand_init(&board_nand_data);
 }
 #else
-static void
-__init board_nand_init(struct flash_partitions sdp_nand_parts, u8 cs)
+void
+__init board_nand_init(struct mtd_partition *nand_parts, u8 nr_parts, u8 cs)
 {
 }
 #endif /* CONFIG_MTD_NAND_OMAP2 || CONFIG_MTD_NAND_OMAP2_MODULE */
@@ -210,7 +192,8 @@ unmap:
  *
  * @return - void.
  */
-void __init sdp_flash_init(struct flash_partitions sdp_partition_info[])
+void board_flash_init(struct flash_partitions partition_info[],
+					char chip_sel_board[][GPMC_CS_NUM])
 {
 	u8		cs = 0;
 	u8		norcs = GPMC_CS_NUM + 1;
@@ -227,7 +210,7 @@ void __init sdp_flash_init(struct flash_partitions sdp_partition_info[])
 		printk(KERN_ERR "%s: Invalid chip select: %d\n", __func__, cs);
 		return;
 	}
-	config_sel = (unsigned char *)(chip_sel_sdp[idx]);
+	config_sel = (unsigned char *)(chip_sel_board[idx]);
 
 	while (cs < GPMC_CS_NUM) {
 		switch (config_sel[cs]) {
@@ -251,17 +234,20 @@ void __init sdp_flash_init(struct flash_partitions sdp_partition_info[])
 		printk(KERN_INFO "NOR: Unable to find configuration "
 				"in GPMC\n");
 	else
-		board_nor_init(sdp_partition_info[0], norcs);
+		board_nor_init(partition_info[0].parts,
+				partition_info[0].nr_parts, norcs);
 
 	if (onenandcs > GPMC_CS_NUM)
 		printk(KERN_INFO "OneNAND: Unable to find configuration "
 				"in GPMC\n");
 	else
-		board_onenand_init(sdp_partition_info[1], onenandcs);
+		board_onenand_init(partition_info[1].parts,
+					partition_info[1].nr_parts, onenandcs);
 
 	if (nandcs > GPMC_CS_NUM)
 		printk(KERN_INFO "NAND: Unable to find configuration "
 				"in GPMC\n");
 	else
-		board_nand_init(sdp_partition_info[2], nandcs);
+		board_nand_init(partition_info[2].parts,
+				partition_info[2].nr_parts, nandcs);
 }
diff --git a/arch/arm/mach-omap2/include/mach/board-sdp.h b/arch/arm/mach-omap2/include/mach/board-flash.h
similarity index 71%
rename from arch/arm/mach-omap2/include/mach/board-sdp.h
rename to arch/arm/mach-omap2/include/mach/board-flash.h
index 465169c..b2242ae 100644
--- a/arch/arm/mach-omap2/include/mach/board-sdp.h
+++ b/arch/arm/mach-omap2/include/mach/board-flash.h
@@ -12,10 +12,17 @@
  */
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
+#include <plat/gpmc.h>
+
+#define PDC_NOR		1
+#define PDC_NAND	2
+#define PDC_ONENAND	3
+#define DBG_MPDB	4
 
 struct flash_partitions {
 	struct mtd_partition *parts;
 	int nr_parts;
 };
 
-extern void sdp_flash_init(struct flash_partitions []);
+extern void board_flash_init(struct flash_partitions [],
+				char chip_sel[][GPMC_CS_NUM]);
-- 
1.5.4.7


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v4 2/5] omap3: add support for NAND on zoom2 board
  2010-07-09 14:27 ` [PATCH v4 1/5] omap3 flash: rename board-sdp-flash.c to be use by other boards Sukumar Ghorai
@ 2010-07-09 14:27   ` Sukumar Ghorai
  2010-07-09 14:27     ` [PATCH v4 3/5] omap3: add support for NAND on zoom3 board Sukumar Ghorai
  0 siblings, 1 reply; 7+ messages in thread
From: Sukumar Ghorai @ 2010-07-09 14:27 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-mtd, linux-arm-kernel, Sukumar Ghorai, Vimal Singh

This patch adds NAND support to ZOOM2 board.

Signed-off-by: Sukumar Ghorai <s-ghorai@ti.com>
Signed-off-by: Vimal Singh <vimalsingh@ti.com>
---
 arch/arm/mach-omap2/Makefile                  |    1 +
 arch/arm/mach-omap2/board-zoom2.c             |   43 +++++++++++++++++++++++++
 arch/arm/mach-omap2/include/mach/board-zoom.h |    6 +++
 3 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 7820b6e..81c3b08 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -128,6 +128,7 @@ obj-$(CONFIG_MACH_NOKIA_RX51)		+= board-rx51.o \
 					   hsmmc.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)		+= board-zoom2.o \
 					   board-zoom-peripherals.o \
+					   board-flash.o \
 					   hsmmc.o \
 					   board-zoom-debugboard.o
 obj-$(CONFIG_MACH_OMAP_ZOOM3)		+= board-zoom3.o \
diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c
index bbc7826..a0d88bd 100644
--- a/arch/arm/mach-omap2/board-zoom2.c
+++ b/arch/arm/mach-omap2/board-zoom2.c
@@ -92,10 +92,53 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux	NULL
 #endif
 
+static struct mtd_partition zoom_nand_partitions[] = {
+	/* All the partition sizes are listed in terms of NAND block size */
+	{
+		.name		= "X-Loader-NAND",
+		.offset		= 0,
+		.size		= 4 * (64 * 2048),	/* 512KB, 0x80000 */
+		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
+	},
+	{
+		.name		= "U-Boot-NAND",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x80000 */
+		.size		= 10 * (64 * 2048),	/* 1.25MB, 0x140000 */
+		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
+	},
+	{
+		.name		= "Boot Env-NAND",
+		.offset		= MTDPART_OFS_APPEND,   /* Offset = 0x1c0000 */
+		.size		= 2 * (64 * 2048),	/* 256KB, 0x40000 */
+	},
+	{
+		.name		= "Kernel-NAND",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x0200000*/
+		.size		= 240 * (64 * 2048),	/* 30M, 0x1E00000 */
+	},
+	{
+		.name		= "system",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x2000000 */
+		.size		= 3328 * (64 * 2048),	/* 416M, 0x1A000000 */
+	},
+	{
+		.name		= "userdata",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x1C000000*/
+		.size		= 256 * (64 * 2048),	/* 32M, 0x2000000 */
+	},
+	{
+		.name		= "cache",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x1E000000*/
+		.size		= 256 * (64 * 2048),	/* 32M, 0x2000000 */
+	},
+};
+
 static void __init omap_zoom2_init(void)
 {
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	zoom_peripherals_init();
+	board_nand_init(zoom_nand_partitions,
+			ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS);
 	zoom_debugboard_init();
 }
 
diff --git a/arch/arm/mach-omap2/include/mach/board-zoom.h b/arch/arm/mach-omap2/include/mach/board-zoom.h
index c93b29e..3af69d2 100644
--- a/arch/arm/mach-omap2/include/mach/board-zoom.h
+++ b/arch/arm/mach-omap2/include/mach/board-zoom.h
@@ -1,5 +1,11 @@
 /*
  * Defines for zoom boards
  */
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/partitions.h>
+
+#define ZOOM_NAND_CS    0
+
+extern void __init board_nand_init(struct mtd_partition *, u8 nr_parts, u8 cs);
 extern int __init zoom_debugboard_init(void);
 extern void __init zoom_peripherals_init(void);

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v4 3/5] omap3: add support for NAND on zoom3 board
  2010-07-09 14:27   ` [PATCH v4 2/5] omap3: add support for NAND on zoom2 board Sukumar Ghorai
@ 2010-07-09 14:27     ` Sukumar Ghorai
  2010-07-09 14:27       ` [PATCH v4 4/5] omap-3630-sdp : Add support for Flash Sukumar Ghorai
  0 siblings, 1 reply; 7+ messages in thread
From: Sukumar Ghorai @ 2010-07-09 14:27 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-mtd, linux-arm-kernel, Sukumar Ghorai, Vimal Singh

patch adds NAND support to zoom3 board.

Signed-off-by: Sukumar Ghorai <s-ghorai@ti.com>
Signed-off-by: Vimal Singh <vimalsingh@ti.com>
---
 arch/arm/mach-omap2/Makefile      |    1 +
 arch/arm/mach-omap2/board-zoom3.c |   43 +++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 81c3b08..cbd3458 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -133,6 +133,7 @@ obj-$(CONFIG_MACH_OMAP_ZOOM2)		+= board-zoom2.o \
 					   board-zoom-debugboard.o
 obj-$(CONFIG_MACH_OMAP_ZOOM3)		+= board-zoom3.o \
 					   board-zoom-peripherals.o \
+					   board-flash.o \
 					   hsmmc.o \
 					   board-zoom-debugboard.o
 obj-$(CONFIG_MACH_OMAP_3630SDP)		+= board-3630sdp.o \
diff --git a/arch/arm/mach-omap2/board-zoom3.c b/arch/arm/mach-omap2/board-zoom3.c
index 0c6858b..84f49da 100644
--- a/arch/arm/mach-omap2/board-zoom3.c
+++ b/arch/arm/mach-omap2/board-zoom3.c
@@ -28,6 +28,47 @@
 static struct omap_board_config_kernel zoom_config[] __initdata = {
 };
 
+static struct mtd_partition zoom_nand_partitions[] = {
+	/* All the partition sizes are listed in terms of NAND block size */
+	{
+		.name		= "X-Loader-NAND",
+		.offset		= 0,
+		.size		= 4 * (64 * 2048),	/* 512KB, 0x80000 */
+		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
+	},
+	{
+		.name		= "U-Boot-NAND",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x80000 */
+		.size		= 10 * (64 * 2048),	/* 1.25MB, 0x140000 */
+		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
+	},
+	{
+		.name		= "Boot Env-NAND",
+		.offset		= MTDPART_OFS_APPEND,   /* Offset = 0x1c0000 */
+		.size		= 2 * (64 * 2048),	/* 256KB, 0x40000 */
+	},
+	{
+		.name		= "Kernel-NAND",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x0200000*/
+		.size		= 240 * (64 * 2048),	/* 30M, 0x1E00000 */
+	},
+	{
+		.name		= "system",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x2000000 */
+		.size		= 3328 * (64 * 2048),	/* 416M, 0x1A000000 */
+	},
+	{
+		.name		= "userdata",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x1C000000*/
+		.size		= 256 * (64 * 2048),	/* 32M, 0x2000000 */
+	},
+	{
+		.name		= "cache",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x1E000000*/
+		.size		= 256 * (64 * 2048),	/* 32M, 0x2000000 */
+	},
+};
+
 static void __init omap_zoom_init_irq(void)
 {
 	omap_board_config = zoom_config;
@@ -75,6 +116,8 @@ static void __init omap_zoom_init(void)
 {
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
 	zoom_peripherals_init();
+	board_nand_init(zoom_nand_partitions,
+			 ARRAY_SIZE(zoom_nand_partitions), ZOOM_NAND_CS);
 	zoom_debugboard_init();
 
 	omap_mux_init_gpio(64, OMAP_PIN_OUTPUT);

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v4 4/5] omap-3630-sdp : Add support for Flash
  2010-07-09 14:27     ` [PATCH v4 3/5] omap3: add support for NAND on zoom3 board Sukumar Ghorai
@ 2010-07-09 14:27       ` Sukumar Ghorai
  2010-07-09 14:27         ` [PATCH v4 5/5] omap3: add support for NAND on LDP board Sukumar Ghorai
  0 siblings, 1 reply; 7+ messages in thread
From: Sukumar Ghorai @ 2010-07-09 14:27 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-mtd, linux-arm-kernel, Sukumar Ghorai

add support for NAND, OneNAND, NOR on omap 3630-sdp board.

Signed-off-by: Sukumar Ghorai <s-ghorai@ti.com>
---
 arch/arm/mach-omap2/Makefile        |    1 +
 arch/arm/mach-omap2/board-3630sdp.c |  120 +++++++++++++++++++++++++++++++++++
 2 files changed, 121 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index cbd3458..b55a5d7 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -138,6 +138,7 @@ obj-$(CONFIG_MACH_OMAP_ZOOM3)		+= board-zoom3.o \
 					   board-zoom-debugboard.o
 obj-$(CONFIG_MACH_OMAP_3630SDP)		+= board-3630sdp.o \
 					   board-zoom-peripherals.o \
+					   board-flash.o \
 					   hsmmc.o
 obj-$(CONFIG_MACH_CM_T35)		+= board-cm-t35.o \
 					   hsmmc.o
diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index 8b7c2f9..69cb52b 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -21,6 +21,7 @@
 #include <plat/usb.h>
 
 #include <mach/board-zoom.h>
+#include <mach/board-flash.h>
 
 #include "mux.h"
 #include "sdram-hynix-h8mbx00u0mer-0em.h"
@@ -86,12 +87,131 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux	NULL
 #endif
 
+/*
+ * SDP3630 CS organization
+ * See also the Switch S8 settings in the comments.
+ */
+static char chip_sel_sdp[][GPMC_CS_NUM] = {
+	{PDC_NOR, PDC_NAND, PDC_ONENAND, DBG_MPDB, 0, 0, 0, 0}, /* S8:1111 */
+	{PDC_ONENAND, PDC_NAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1110 */
+	{PDC_NAND, PDC_ONENAND, PDC_NOR, DBG_MPDB, 0, 0, 0, 0}, /* S8:1101 */
+};
+
+static struct mtd_partition sdp_nor_partitions[] = {
+	/* bootloader (U-Boot, etc) in first sector */
+	{
+		.name		= "Bootloader-NOR",
+		.offset		= 0,
+		.size		= SZ_256K,
+		.mask_flags	= MTD_WRITEABLE, /* force read-only */
+	},
+	/* bootloader params in the next sector */
+	{
+		.name		= "Params-NOR",
+		.offset		= MTDPART_OFS_APPEND,
+		.size		= SZ_256K,
+		.mask_flags	= 0,
+	},
+	/* kernel */
+	{
+		.name		= "Kernel-NOR",
+		.offset		= MTDPART_OFS_APPEND,
+		.size		= SZ_2M,
+		.mask_flags	= 0
+	},
+	/* file system */
+	{
+		.name		= "Filesystem-NOR",
+		.offset		= MTDPART_OFS_APPEND,
+		.size		= MTDPART_SIZ_FULL,
+		.mask_flags	= 0
+	}
+};
+
+static struct mtd_partition sdp_onenand_partitions[] = {
+	{
+		.name		= "X-Loader-OneNAND",
+		.offset		= 0,
+		.size		= 4 * (64 * 2048),
+		.mask_flags	= MTD_WRITEABLE  /* force read-only */
+	},
+	{
+		.name		= "U-Boot-OneNAND",
+		.offset		= MTDPART_OFS_APPEND,
+		.size		= 2 * (64 * 2048),
+		.mask_flags	= MTD_WRITEABLE  /* force read-only */
+	},
+	{
+		.name		= "U-Boot Environment-OneNAND",
+		.offset		= MTDPART_OFS_APPEND,
+		.size		= 1 * (64 * 2048),
+	},
+	{
+		.name		= "Kernel-OneNAND",
+		.offset		= MTDPART_OFS_APPEND,
+		.size		= 16 * (64 * 2048),
+	},
+	{
+		.name		= "File System-OneNAND",
+		.offset		= MTDPART_OFS_APPEND,
+		.size		= MTDPART_SIZ_FULL,
+	},
+};
+
+static struct mtd_partition sdp_nand_partitions[] = {
+	/* All the partition sizes are listed in terms of NAND block size */
+	{
+		.name		= "X-Loader-NAND",
+		.offset		= 0,
+		.size		= 4 * (64 * 2048),
+		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
+	},
+	{
+		.name		= "U-Boot-NAND",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x80000 */
+		.size		= 10 * (64 * 2048),
+		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
+	},
+	{
+		.name		= "Boot Env-NAND",
+
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x1c0000 */
+		.size		= 6 * (64 * 2048),
+	},
+	{
+		.name		= "Kernel-NAND",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x280000 */
+		.size		= 40 * (64 * 2048),
+	},
+	{
+		.name		= "File System - NAND",
+		.size		= MTDPART_SIZ_FULL,
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x780000 */
+	},
+};
+
+static struct flash_partitions sdp_flash_partitions[] = {
+	{
+		.parts = sdp_nor_partitions,
+		.nr_parts = ARRAY_SIZE(sdp_nor_partitions),
+	},
+	{
+		.parts = sdp_onenand_partitions,
+		.nr_parts = ARRAY_SIZE(sdp_onenand_partitions),
+	},
+	{
+		.parts = sdp_nand_partitions,
+		.nr_parts = ARRAY_SIZE(sdp_nand_partitions),
+	},
+};
+
 static void __init omap_sdp_init(void)
 {
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBP);
 	omap_serial_init();
 	zoom_peripherals_init();
 	board_smc91x_init();
+	board_flash_init(sdp_flash_partitions, chip_sel_sdp);
 	enable_board_wakeup_source();
 	usb_ehci_init(&ehci_pdata);
 }

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v4 5/5] omap3: add support for NAND on LDP board
  2010-07-09 14:27       ` [PATCH v4 4/5] omap-3630-sdp : Add support for Flash Sukumar Ghorai
@ 2010-07-09 14:27         ` Sukumar Ghorai
  0 siblings, 0 replies; 7+ messages in thread
From: Sukumar Ghorai @ 2010-07-09 14:27 UTC (permalink / raw)
  To: linux-omap; +Cc: linux-mtd, linux-arm-kernel, Sukumar Ghorai, Vimal Singh

patch adds NAND support to LDP board.

Signed-off-by: Vimal Singh <vimalsingh@ti.com>
Signed-off-by: Sukumar Ghorai <s-ghorai@ti.com>
---
 arch/arm/mach-omap2/Makefile    |    1 +
 arch/arm/mach-omap2/board-ldp.c |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index b55a5d7..fc9133f 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -110,6 +110,7 @@ obj-$(CONFIG_MACH_OMAP3_BEAGLE)		+= board-omap3beagle.o \
 obj-$(CONFIG_MACH_DEVKIT8000)     	+= board-devkit8000.o \
                                            hsmmc.o
 obj-$(CONFIG_MACH_OMAP_LDP)		+= board-ldp.o \
+					   board-flash.o \
 					   hsmmc.o
 obj-$(CONFIG_MACH_OVERO)		+= board-overo.o \
 					   hsmmc.o
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c
index 6e3930e..9845995 100644
--- a/arch/arm/mach-omap2/board-ldp.c
+++ b/arch/arm/mach-omap2/board-ldp.c
@@ -38,6 +38,7 @@
 #include <plat/board.h>
 #include <plat/common.h>
 #include <plat/gpmc.h>
+#include <mach/board-zoom.h>
 
 #include <asm/delay.h>
 #include <plat/control.h>
@@ -388,6 +389,38 @@ static struct omap_musb_board_data musb_board_data = {
 	.power			= 100,
 };
 
+static struct mtd_partition ldp_nand_partitions[] = {
+	/* All the partition sizes are listed in terms of NAND block size */
+	{
+		.name		= "X-Loader-NAND",
+		.offset		= 0,
+		.size		= 4 * (64 * 2048),	/* 512KB, 0x80000 */
+		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
+	},
+	{
+		.name		= "U-Boot-NAND",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x80000 */
+		.size		= 10 * (64 * 2048),	/* 1.25MB, 0x140000 */
+		.mask_flags	= MTD_WRITEABLE,	/* force read-only */
+	},
+	{
+		.name		= "Boot Env-NAND",
+		.offset		= MTDPART_OFS_APPEND,   /* Offset = 0x1c0000 */
+		.size		= 2 * (64 * 2048),	/* 256KB, 0x40000 */
+	},
+	{
+		.name		= "Kernel-NAND",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x0200000*/
+		.size		= 240 * (64 * 2048),	/* 30M, 0x1E00000 */
+	},
+	{
+		.name		= "File System - NAND",
+		.offset		= MTDPART_OFS_APPEND,	/* Offset = 0x2000000 */
+		.size		= MTDPART_SIZ_FULL,	/* 96MB, 0x6000000 */
+	},
+
+};
+
 static void __init omap_ldp_init(void)
 {
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -400,6 +433,8 @@ static void __init omap_ldp_init(void)
 	ads7846_dev_init();
 	omap_serial_init();
 	usb_musb_init(&musb_board_data);
+	board_nand_init(ldp_nand_partitions,
+		ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS);
 
 	omap2_hsmmc_init(mmc);
 	/* link regulators to MMC adapters */

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v4 0/8] nand support on omap3 boards
  2010-07-09 14:27 [PATCH v4 0/8] nand support on omap3 boards Sukumar Ghorai
  2010-07-09 14:27 ` [PATCH v4 1/5] omap3 flash: rename board-sdp-flash.c to be use by other boards Sukumar Ghorai
@ 2010-08-02 12:52 ` Tony Lindgren
  1 sibling, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2010-08-02 12:52 UTC (permalink / raw)
  To: Sukumar Ghorai; +Cc: linux-omap, linux-mtd, linux-arm-kernel

* Sukumar Ghorai <s-ghorai@ti.com> [100709 17:21]:
>    The following set of patches applies on top of for-next branch.
>    And these are the patches required to enable nand (nor and onenand for sdp
>    only) for different platform.

Will add this series into omap-for-linus too.

Regards,

Tony

    
>    v4: patch rebase on latest code base; depend on
> 	http://www.mail-archive.com/linux-omap@vger.kernel.org/msg31950.html
>    
>    v3:  http://www.mail-archive.com/linux-omap@vger.kernel.org/msg30735.html
> 	patch rebase on latest nand patch and depend on -
> 	http://www.mail-archive.com/linux-omap@vger.kernel.org/msg30305.html
>    
>    v2: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg26479.html
> 	rework to use full nand in partition table of ZOOM2/3;
> 	ZOOM1(LDP)support added.
> 		
>    v1: http://www.mail-archive.com/linux-omap@vger.kernel.org/msg22205.html
> 
> Sukumar Ghorai (5):
> 	omap3 flash: rename board-sdp-flash.c to be use by other boards
> 	omap3: add support for NAND on zoom2 board
> 	omap3: add support for NAND on zoom3 board
> 	omap-3630-sdp : Add support for Flash
> 	omap3: add support for NAND on LDP board
> 
>  arch/arm/mach-omap2/Makefile                  |    6 +-
>  arch/arm/mach-omap2/board-3430sdp.c           |   16 +++-
>  arch/arm/mach-omap2/board-3630sdp.c           |  120 +++++++++++++++++++++++++
>  arch/arm/mach-omap2/board-ldp.c               |   35 +++++++
>  arch/arm/mach-omap2/board-sdp-flash.c         |   88 ++++++++-----------
>  arch/arm/mach-omap2/board-zoom2.c             |   43 +++++++++
>  arch/arm/mach-omap2/board-zoom3.c             |   43 +++++++++
>  arch/arm/mach-omap2/include/mach/board-sdp.h  |    9 ++-
>  arch/arm/mach-omap2/include/mach/board-zoom.h |    6 ++
>  9 files changed, 311 insertions(+), 55 deletions(-)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-08-02 12:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-09 14:27 [PATCH v4 0/8] nand support on omap3 boards Sukumar Ghorai
2010-07-09 14:27 ` [PATCH v4 1/5] omap3 flash: rename board-sdp-flash.c to be use by other boards Sukumar Ghorai
2010-07-09 14:27   ` [PATCH v4 2/5] omap3: add support for NAND on zoom2 board Sukumar Ghorai
2010-07-09 14:27     ` [PATCH v4 3/5] omap3: add support for NAND on zoom3 board Sukumar Ghorai
2010-07-09 14:27       ` [PATCH v4 4/5] omap-3630-sdp : Add support for Flash Sukumar Ghorai
2010-07-09 14:27         ` [PATCH v4 5/5] omap3: add support for NAND on LDP board Sukumar Ghorai
2010-08-02 12:52 ` [PATCH v4 0/8] nand support on omap3 boards Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).