blob: 67fc5060183ea28f137f20862863e62cb99ccf74 [file] [log] [blame]
Russell Kinga09e64f2008-08-05 16:14:15 +01001/*
2 * arch/arm/plat-omap/include/mach/nand.h
3 *
4 * Copyright (C) 2006 Micron Technology Inc.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
Sukumar Ghoraif3d73f32011-01-28 15:42:08 +053011#include <plat/gpmc.h>
Russell Kinga09e64f2008-08-05 16:14:15 +010012#include <linux/mtd/partitions.h>
13
Sukumar Ghorai1b0b323c2011-01-28 15:42:04 +053014enum nand_io {
15 NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */
16 NAND_OMAP_POLLED, /* polled mode, without prefetch */
Sukumar Ghorai4e070372011-01-28 15:42:06 +053017 NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */
18 NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */
Sukumar Ghorai1b0b323c2011-01-28 15:42:04 +053019};
20
Russell Kinga09e64f2008-08-05 16:14:15 +010021struct omap_nand_platform_data {
Russell Kinga09e64f2008-08-05 16:14:15 +010022 int cs;
Russell Kinga09e64f2008-08-05 16:14:15 +010023 struct mtd_partition *parts;
Vimal Singh2f70a1e2010-02-15 10:03:33 -080024 struct gpmc_timings *gpmc_t;
Russell Kinga09e64f2008-08-05 16:14:15 +010025 int nr_parts;
Grazvydas Ignotas7a559c72011-06-03 19:56:33 +000026 bool dev_ready;
Sukumar Ghorai4e070372011-01-28 15:42:06 +053027 int gpmc_irq;
Sukumar Ghorai1b0b323c2011-01-28 15:42:04 +053028 enum nand_io xfer_type;
Vimal Singh2f70a1e2010-02-15 10:03:33 -080029 unsigned long phys_base;
Vimal Singh2f70a1e2010-02-15 10:03:33 -080030 int devsize;
Sukumar Ghoraif3d73f32011-01-28 15:42:08 +053031 enum omap_ecc ecc_opt;
Russell Kinga09e64f2008-08-05 16:14:15 +010032};
Vimal Singh2f70a1e2010-02-15 10:03:33 -080033
Sukumar Ghorai2c01946c2010-07-09 09:14:45 +000034/* minimum size for IO mapping */
35#define NAND_IO_SIZE 4
Vimal Singh2f70a1e2010-02-15 10:03:33 -080036
stanley.miao562468b2010-04-20 06:33:26 +000037#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
Vimal Singh2f70a1e2010-02-15 10:03:33 -080038extern int gpmc_nand_init(struct omap_nand_platform_data *d);
stanley.miao562468b2010-04-20 06:33:26 +000039#else
40static inline int gpmc_nand_init(struct omap_nand_platform_data *d)
41{
42 return 0;
43}
44#endif