blob: d86d1ecf0068a70c0aff69410f7498cb5ee85c64 [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 {
22 unsigned int options;
23 int cs;
24 int gpio_irq;
25 struct mtd_partition *parts;
Vimal Singh2f70a1e2010-02-15 10:03:33 -080026 struct gpmc_timings *gpmc_t;
Russell Kinga09e64f2008-08-05 16:14:15 +010027 int nr_parts;
Vimal Singh2f70a1e2010-02-15 10:03:33 -080028 int (*nand_setup)(void);
Russell Kinga09e64f2008-08-05 16:14:15 +010029 int (*dev_ready)(struct omap_nand_platform_data *);
30 int dma_channel;
Sukumar Ghorai4e070372011-01-28 15:42:06 +053031 int gpmc_irq;
Sukumar Ghorai1b0b323c2011-01-28 15:42:04 +053032 enum nand_io xfer_type;
Vimal Singh2f70a1e2010-02-15 10:03:33 -080033 unsigned long phys_base;
Vimal Singh2f70a1e2010-02-15 10:03:33 -080034 int devsize;
Sukumar Ghoraif3d73f32011-01-28 15:42:08 +053035 enum omap_ecc ecc_opt;
Russell Kinga09e64f2008-08-05 16:14:15 +010036};
Vimal Singh2f70a1e2010-02-15 10:03:33 -080037
Sukumar Ghorai2c01946c2010-07-09 09:14:45 +000038/* minimum size for IO mapping */
39#define NAND_IO_SIZE 4
Vimal Singh2f70a1e2010-02-15 10:03:33 -080040
stanley.miao562468b2010-04-20 06:33:26 +000041#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
Vimal Singh2f70a1e2010-02-15 10:03:33 -080042extern int gpmc_nand_init(struct omap_nand_platform_data *d);
stanley.miao562468b2010-04-20 06:33:26 +000043#else
44static inline int gpmc_nand_init(struct omap_nand_platform_data *d)
45{
46 return 0;
47}
48#endif