Skip to contentSkip to conversation

nand support on omap3 boards

PATCH New Sukumar Ghorai 2 participants 7 messages Jul 9, 2010 – Aug 2, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v4 cover nand support on omap3 boards

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 at vger.kernel.org/msg31950.html

v3: http://www.mail-archive.com/linux-omap at vger.kernel.org/msg30735.html
patch rebase on latest nand patch and depend on -
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg30305.html

v2: http://www.mail-archive.com/linux-omap at 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 at 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(-)
#1 lore raw

PATCH v4 1/5 omap3 flash: rename board-sdp-flash.c to be use by other boards

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

---
 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%)
arch/arm/mach-omap2/Makefile +1 -1
index f5b4ff4..7820b6e 100644
@@ -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 \
arch/arm/mach-omap2/board-3430sdp.c +14 -2
index e51f8e3..61b5632 100644
@@ -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);
arch/arm/mach-omap2/board-flash.c renamed from arch/arm/mach-omap2/board-sdp-flash.c +37 -51

189 lines not on this page · raw message

arch/arm/mach-omap2/include/mach/board-flash.h renamed from arch/arm/mach-omap2/include/mach/board-sdp.h +8 -1
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
@@ -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]);
Signature · 1 line
1.5.4.7
#2 lore raw

PATCH v4 2/5 omap3: add support for NAND on zoom2 board

This patch adds NAND support to ZOOM2 board.

---
 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(-)
arch/arm/mach-omap2/Makefile +1 -0
index 7820b6e..81c3b08 100644
@@ -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 \
arch/arm/mach-omap2/board-zoom2.c +43 -0

53 lines not on this page · raw message

arch/arm/mach-omap2/include/mach/board-zoom.h +6 -0
index c93b29e..3af69d2 100644
@@ -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);
#3 lore raw

PATCH v4 3/5 omap3: add support for NAND on zoom3 board

patch adds NAND support to zoom3 board.

---
 arch/arm/mach-omap2/Makefile      |    1 +
 arch/arm/mach-omap2/board-zoom3.c |   43 +++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/Makefile +1 -0
index 81c3b08..cbd3458 100644
@@ -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 \
arch/arm/mach-omap2/board-zoom3.c +43 -0

55 lines not on this page · raw message

#4 lore raw

PATCH v4 4/5 omap-3630-sdp : Add support for Flash

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

---
 arch/arm/mach-omap2/Makefile        |    1 +
 arch/arm/mach-omap2/board-3630sdp.c |  120 +++++++++++++++++++++++++++++++++++
 2 files changed, 121 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/Makefile +1 -0
index cbd3458..b55a5d7 100644
@@ -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
arch/arm/mach-omap2/board-3630sdp.c +120 -0

138 lines not on this page · raw message

#5 lore raw

PATCH v4 5/5 omap3: add support for NAND on LDP board

patch adds NAND support to LDP board.

---
 arch/arm/mach-omap2/Makefile    |    1 +
 arch/arm/mach-omap2/board-ldp.c |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 0 deletions(-)
arch/arm/mach-omap2/Makefile +1 -0
index b55a5d7..fc9133f 100644
@@ -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
arch/arm/mach-omap2/board-ldp.c +35 -0
index 6e3930e..9845995 100644
@@ -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 */
maintainer
#6 lore raw

v4 cover nand support on omap3 boards

In reply to Sukumar Ghorai
Quoted 3 lines · 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.

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

Regards,

Tony

Quoted 35 lines
   v4: patch rebase on latest code base; depend on
	http://www.mail-archive.com/[email protected]/msg31950.html
   
   v3:  http://www.mail-archive.com/[email protected]/msg30735.html
	patch rebase on latest nand patch and depend on -
	http://www.mail-archive.com/[email protected]/msg30305.html
   
   v2: http://www.mail-archive.com/[email protected]/msg26479.html
	rework to use full nand in partition table of ZOOM2/3;
	ZOOM1(LDP)support added.
		
   v1: http://www.mail-archive.com/[email protected]/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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html