blob: ae5e05383031df36fb9d610c0437ee6e057f96a2 [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
11#include <linux/mtd/partitions.h>
12
Sukumar Ghorai1b0b323c2011-01-28 15:42:04 +053013enum nand_io {
14 NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */
15 NAND_OMAP_POLLED, /* polled mode, without prefetch */
Sukumar Ghorai4e070372011-01-28 15:42:06 +053016 NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */
17 NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */
Sukumar Ghorai1b0b323c2011-01-28 15:42:04 +053018};
19
Russell Kinga09e64f2008-08-05 16:14:15 +010020struct omap_nand_platform_data {
21 unsigned int options;
22 int cs;
23 int gpio_irq;
24 struct mtd_partition *parts;
Vimal Singh2f70a1e2010-02-15 10:03:33 -080025 struct gpmc_timings *gpmc_t;
Russell Kinga09e64f2008-08-05 16:14:15 +010026 int nr_parts;
Vimal Singh2f70a1e2010-02-15 10:03:33 -080027 int (*nand_setup)(void);
Russell Kinga09e64f2008-08-05 16:14:15 +010028 int (*dev_ready)(struct omap_nand_platform_data *);
29 int dma_channel;
Sukumar Ghorai4e070372011-01-28 15:42:06 +053030 int gpmc_irq;
Sukumar Ghorai1b0b323c2011-01-28 15:42:04 +053031 enum nand_io xfer_type;
Vimal Singh2f70a1e2010-02-15 10:03:33 -080032 unsigned long phys_base;
Vimal Singh2f70a1e2010-02-15 10:03:33 -080033 int devsize;
Russell Kinga09e64f2008-08-05 16:14:15 +010034};
Vimal Singh2f70a1e2010-02-15 10:03:33 -080035
Sukumar Ghorai2c01946c2010-07-09 09:14:45 +000036/* minimum size for IO mapping */
37#define NAND_IO_SIZE 4
Vimal Singh2f70a1e2010-02-15 10:03:33 -080038
stanley.miao562468b2010-04-20 06:33:26 +000039#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
Vimal Singh2f70a1e2010-02-15 10:03:33 -080040extern int gpmc_nand_init(struct omap_nand_platform_data *d);
stanley.miao562468b2010-04-20 06:33:26 +000041#else
42static inline int gpmc_nand_init(struct omap_nand_platform_data *d)
43{
44 return 0;
45}
46#endif