blob: 1a68c1e5fe537a0b0b52c70521ef8672ad66a4ff [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 Ghorai1b0b323c2011-01-28 15:42:04 +053027 enum nand_io xfer_type;
Vimal Singh2f70a1e2010-02-15 10:03:33 -080028 int devsize;
Sukumar Ghoraif3d73f32011-01-28 15:42:08 +053029 enum omap_ecc ecc_opt;
Afzal Mohammedd126d012012-08-30 12:53:22 -070030 struct gpmc_nand_regs reg;
Russell Kinga09e64f2008-08-05 16:14:15 +010031};
Vimal Singh2f70a1e2010-02-15 10:03:33 -080032
Sukumar Ghorai2c01946c2010-07-09 09:14:45 +000033/* minimum size for IO mapping */
34#define NAND_IO_SIZE 4
Vimal Singh2f70a1e2010-02-15 10:03:33 -080035
stanley.miao562468b2010-04-20 06:33:26 +000036#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
Vimal Singh2f70a1e2010-02-15 10:03:33 -080037extern int gpmc_nand_init(struct omap_nand_platform_data *d);
stanley.miao562468b2010-04-20 06:33:26 +000038#else
39static inline int gpmc_nand_init(struct omap_nand_platform_data *d)
40{
41 return 0;
42}
43#endif