aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/board-cm-t3517.c
diff options
context:
space:
mode:
authorIgor Grinberg <grinberg@compulab.co.il>2010-09-21 12:03:12 -0400
committerTony Lindgren <tony@atomide.com>2010-09-27 18:15:21 -0400
commitec34fccd3a8ed4997c38797b49e37535ad387401 (patch)
tree040d1ced9bf9f5720bea989068484cda8acf1d25 /arch/arm/mach-omap2/board-cm-t3517.c
parent525d75b31bc97354870b5991d57b2607d7b88602 (diff)
omap3: cm-t3517: add support for NAND flash
add support for NAND flash. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/board-cm-t3517.c')
-rw-r--r--arch/arm/mach-omap2/board-cm-t3517.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/board-cm-t3517.c b/arch/arm/mach-omap2/board-cm-t3517.c
index 2c7082d6d772..4c26cf53a6e5 100644
--- a/arch/arm/mach-omap2/board-cm-t3517.c
+++ b/arch/arm/mach-omap2/board-cm-t3517.c
@@ -29,6 +29,9 @@
29#include <linux/gpio.h> 29#include <linux/gpio.h>
30#include <linux/leds.h> 30#include <linux/leds.h>
31#include <linux/rtc-v3020.h> 31#include <linux/rtc-v3020.h>
32#include <linux/mtd/mtd.h>
33#include <linux/mtd/nand.h>
34#include <linux/mtd/partitions.h>
32 35
33#include <asm/mach-types.h> 36#include <asm/mach-types.h>
34#include <asm/mach/arch.h> 37#include <asm/mach/arch.h>
@@ -38,6 +41,8 @@
38#include <plat/common.h> 41#include <plat/common.h>
39#include <plat/control.h> 42#include <plat/control.h>
40#include <plat/usb.h> 43#include <plat/usb.h>
44#include <plat/nand.h>
45#include <plat/gpmc.h>
41 46
42#include "mux.h" 47#include "mux.h"
43 48
@@ -143,6 +148,54 @@ static inline int cm_t3517_init_usbh(void)
143} 148}
144#endif 149#endif
145 150
151#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
152#define NAND_BLOCK_SIZE SZ_128K
153
154static struct mtd_partition cm_t3517_nand_partitions[] = {
155 {
156 .name = "xloader",
157 .offset = 0, /* Offset = 0x00000 */
158 .size = 4 * NAND_BLOCK_SIZE,
159 .mask_flags = MTD_WRITEABLE
160 },
161 {
162 .name = "uboot",
163 .offset = MTDPART_OFS_APPEND, /* Offset = 0x80000 */
164 .size = 15 * NAND_BLOCK_SIZE,
165 },
166 {
167 .name = "uboot environment",
168 .offset = MTDPART_OFS_APPEND, /* Offset = 0x260000 */
169 .size = 2 * NAND_BLOCK_SIZE,
170 },
171 {
172 .name = "linux",
173 .offset = MTDPART_OFS_APPEND, /* Offset = 0x280000 */
174 .size = 32 * NAND_BLOCK_SIZE,
175 },
176 {
177 .name = "rootfs",
178 .offset = MTDPART_OFS_APPEND, /* Offset = 0x680000 */
179 .size = MTDPART_SIZ_FULL,
180 },
181};
182
183static struct omap_nand_platform_data cm_t3517_nand_data = {
184 .parts = cm_t3517_nand_partitions,
185 .nr_parts = ARRAY_SIZE(cm_t3517_nand_partitions),
186 .dma_channel = -1, /* disable DMA in OMAP NAND driver */
187 .cs = 0,
188};
189
190static void __init cm_t3517_init_nand(void)
191{
192 if (gpmc_nand_init(&cm_t3517_nand_data) < 0)
193 pr_err("CM-T3517: NAND initialization failed\n");
194}
195#else
196static inline void cm_t3517_init_nand(void) {}
197#endif
198
146static struct omap_board_config_kernel cm_t3517_config[] __initdata = { 199static struct omap_board_config_kernel cm_t3517_config[] __initdata = {
147}; 200};
148 201
@@ -179,6 +232,7 @@ static void __init cm_t3517_init(void)
179 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 232 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
180 omap_serial_init(); 233 omap_serial_init();
181 cm_t3517_init_leds(); 234 cm_t3517_init_leds();
235 cm_t3517_init_nand();
182 cm_t3517_init_rtc(); 236 cm_t3517_init_rtc();
183 cm_t3517_init_usbh(); 237 cm_t3517_init_usbh();
184} 238}