Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-arm
[pandora-kernel.git] / arch / arm / plat-omap / include / plat / nand.h
1 /*
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 <plat/gpmc.h>
12 #include <linux/mtd/partitions.h>
13
14 enum nand_io {
15         NAND_OMAP_PREFETCH_POLLED = 0,  /* prefetch polled mode, default */
16         NAND_OMAP_POLLED,               /* polled mode, without prefetch */
17         NAND_OMAP_PREFETCH_DMA,         /* prefetch enabled sDMA mode */
18         NAND_OMAP_PREFETCH_IRQ          /* prefetch enabled irq mode */
19 };
20
21 struct omap_nand_platform_data {
22         unsigned int            options;
23         int                     cs;
24         int                     gpio_irq;
25         struct mtd_partition    *parts;
26         struct gpmc_timings     *gpmc_t;
27         int                     nr_parts;
28         int                     (*nand_setup)(void);
29         int                     (*dev_ready)(struct omap_nand_platform_data *);
30         int                     dma_channel;
31         int                     gpmc_irq;
32         enum nand_io            xfer_type;
33         unsigned long           phys_base;
34         int                     devsize;
35         enum omap_ecc           ecc_opt;
36 };
37
38 /* minimum size for IO mapping */
39 #define NAND_IO_SIZE    4
40
41 #if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
42 extern int gpmc_nand_init(struct omap_nand_platform_data *d);
43 #else
44 static inline int gpmc_nand_init(struct omap_nand_platform_data *d)
45 {
46         return 0;
47 }
48 #endif