[PATCH v3 2/8] omap3: add support for NAND on zoom2 board

2010-06-16 Thread Sukumar Ghorai
This patch adds NAND support to ZOOM2 board.

Signed-off-by: Sukumar Ghorai s-gho...@ti.com
Signed-off-by: Vimal Singh vimalsi...@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 0d854f1..e7159b0 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -126,6 +126,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 803ef14..549f274 100644
--- a/arch/arm/mach-omap2/board-zoom2.c
+++ b/arch/arm/mach-omap2/board-zoom2.c
@@ -77,10 +77,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, 0x8 */
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = U-Boot-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x8 */
+   .size   = 10 * (64 * 2048), /* 1.25MB, 0x14 */
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = Boot Env-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x1c */
+   .size   = 2 * (64 * 2048),  /* 256KB, 0x4 */
+   },
+   {
+   .name   = Kernel-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x020*/
+   .size   = 240 * (64 * 2048),/* 30M, 0x1E0 */
+   },
+   {
+   .name   = system,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x200 */
+   .size   = 3328 * (64 * 2048),   /* 416M, 0x1A00 */
+   },
+   {
+   .name   = userdata,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x1C00*/
+   .size   = 256 * (64 * 2048),/* 32M, 0x200 */
+   },
+   {
+   .name   = cache,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x1E00*/
+   .size   = 256 * (64 * 2048),/* 32M, 0x200 */
+   },
+};
+
 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_CS0
+
+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);
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v3 2/8] omap3: add support for NAND on zoom2 board

2010-04-13 Thread Sukumar Ghorai
This patch adds NAND support to ZOOM2 board.
This uses 'board-zoom-flash.c' for NAND initialization.

Signed-off-by: Sukumar Ghorai s-gho...@ti.com
Signed-off-by: Vimal Singh vimalsi...@ti.com
---
 arch/arm/mach-omap2/Makefile  |1 +
 arch/arm/mach-omap2/board-zoom2.c |   49 +
 2 files changed, 50 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
index 4b9fc57..f8d9a42 100644
--- a/arch/arm/mach-omap2/Makefile
+++ b/arch/arm/mach-omap2/Makefile
@@ -124,6 +124,7 @@ obj-$(CONFIG_MACH_NOKIA_RX51)   += board-rx51.o 
\
   board-rx51-peripherals.o \
   hsmmc.o
 obj-$(CONFIG_MACH_OMAP_ZOOM2)  += board-zoom2.o \
+  board-zoom-flash.o \
   board-zoom-peripherals.o \
   hsmmc.o \
   board-zoom-debugboard.o
diff --git a/arch/arm/mach-omap2/board-zoom2.c 
b/arch/arm/mach-omap2/board-zoom2.c
index 9a26f84..e0f4901 100644
--- a/arch/arm/mach-omap2/board-zoom2.c
+++ b/arch/arm/mach-omap2/board-zoom2.c
@@ -77,10 +77,59 @@ 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, 0x8 */
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = U-Boot-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x8 */
+   .size   = 10 * (64 * 2048), /* 1.25MB, 0x14 */
+   .mask_flags = MTD_WRITEABLE,/* force read-only */
+   },
+   {
+   .name   = Boot Env-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x1c */
+   .size   = 2 * (64 * 2048),  /* 256KB, 0x4 */
+   },
+   {
+   .name   = Kernel-NAND,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x020*/
+   .size   = 240 * (64 * 2048),/* 30M, 0x1E0 */
+   },
+   {
+   .name   = system,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x200 */
+   .size   = 3328 * (64 * 2048),   /* 416M, 0x1A00 */
+   },
+   {
+   .name   = userdata,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x1C00*/
+   .size   = 256 * (64 * 2048),/* 32M, 0x200 */
+   },
+   {
+   .name   = cache,
+   .offset = MTDPART_OFS_APPEND,   /* Offset = 0x1E00*/
+   .size   = 256 * (64 * 2048),/* 32M, 0x200 */
+   },
+};
+
+static struct flash_partitions zoom_flash_partitions[] = {
+   {
+   .parts = zoom_nand_partitions,
+   .nr_parts = ARRAY_SIZE(zoom_nand_partitions),
+   },
+};
+
 static void __init omap_zoom2_init(void)
 {
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
zoom_peripherals_init();
+   zoom_flash_init(zoom_flash_partitions, ZOOM_NAND_CS);
zoom_debugboard_init();
 }
 
--
To unsubscribe from this list: send the line unsubscribe linux-omap in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html