Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 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 | |
Sukumar Ghorai | f3d73f3 | 2011-01-28 15:42:08 +0530 | [diff] [blame^] | 11 | #include <plat/gpmc.h> |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 12 | #include <linux/mtd/partitions.h> |
| 13 | |
Sukumar Ghorai | 1b0b323c | 2011-01-28 15:42:04 +0530 | [diff] [blame] | 14 | enum nand_io { |
| 15 | NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */ |
| 16 | NAND_OMAP_POLLED, /* polled mode, without prefetch */ |
Sukumar Ghorai | 4e07037 | 2011-01-28 15:42:06 +0530 | [diff] [blame] | 17 | NAND_OMAP_PREFETCH_DMA, /* prefetch enabled sDMA mode */ |
| 18 | NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */ |
Sukumar Ghorai | 1b0b323c | 2011-01-28 15:42:04 +0530 | [diff] [blame] | 19 | }; |
| 20 | |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 21 | struct omap_nand_platform_data { |
| 22 | unsigned int options; |
| 23 | int cs; |
| 24 | int gpio_irq; |
| 25 | struct mtd_partition *parts; |
Vimal Singh | 2f70a1e | 2010-02-15 10:03:33 -0800 | [diff] [blame] | 26 | struct gpmc_timings *gpmc_t; |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 27 | int nr_parts; |
Vimal Singh | 2f70a1e | 2010-02-15 10:03:33 -0800 | [diff] [blame] | 28 | int (*nand_setup)(void); |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 29 | int (*dev_ready)(struct omap_nand_platform_data *); |
| 30 | int dma_channel; |
Sukumar Ghorai | 4e07037 | 2011-01-28 15:42:06 +0530 | [diff] [blame] | 31 | int gpmc_irq; |
Sukumar Ghorai | 1b0b323c | 2011-01-28 15:42:04 +0530 | [diff] [blame] | 32 | enum nand_io xfer_type; |
Vimal Singh | 2f70a1e | 2010-02-15 10:03:33 -0800 | [diff] [blame] | 33 | unsigned long phys_base; |
Vimal Singh | 2f70a1e | 2010-02-15 10:03:33 -0800 | [diff] [blame] | 34 | int devsize; |
Sukumar Ghorai | f3d73f3 | 2011-01-28 15:42:08 +0530 | [diff] [blame^] | 35 | enum omap_ecc ecc_opt; |
Russell King | a09e64f | 2008-08-05 16:14:15 +0100 | [diff] [blame] | 36 | }; |
Vimal Singh | 2f70a1e | 2010-02-15 10:03:33 -0800 | [diff] [blame] | 37 | |
Sukumar Ghorai | 2c01946c | 2010-07-09 09:14:45 +0000 | [diff] [blame] | 38 | /* minimum size for IO mapping */ |
| 39 | #define NAND_IO_SIZE 4 |
Vimal Singh | 2f70a1e | 2010-02-15 10:03:33 -0800 | [diff] [blame] | 40 | |
stanley.miao | 562468b | 2010-04-20 06:33:26 +0000 | [diff] [blame] | 41 | #if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE) |
Vimal Singh | 2f70a1e | 2010-02-15 10:03:33 -0800 | [diff] [blame] | 42 | extern int gpmc_nand_init(struct omap_nand_platform_data *d); |
stanley.miao | 562468b | 2010-04-20 06:33:26 +0000 | [diff] [blame] | 43 | #else |
| 44 | static inline int gpmc_nand_init(struct omap_nand_platform_data *d) |
| 45 | { |
| 46 | return 0; |
| 47 | } |
| 48 | #endif |