aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/platform_data
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/platform_data')
-rw-r--r--include/linux/platform_data/mtd-nand-omap2.h41
1 files changed, 29 insertions, 12 deletions
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h
index 1a68c1e5fe5..e1965fe581d 100644
--- a/include/linux/platform_data/mtd-nand-omap2.h
+++ b/include/linux/platform_data/mtd-nand-omap2.h
@@ -8,7 +8,9 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <plat/gpmc.h> 11#ifndef _MTD_NAND_OMAP2_H
12#define _MTD_NAND_OMAP2_H
13
12#include <linux/mtd/partitions.h> 14#include <linux/mtd/partitions.h>
13 15
14enum nand_io { 16enum nand_io {
@@ -18,10 +20,35 @@ enum nand_io {
18 NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */ 20 NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */
19}; 21};
20 22
23enum omap_ecc {
24 /* 1-bit ecc: stored at end of spare area */
25 OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */
26 OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */
27 /* 1-bit ecc: stored at beginning of spare area as romcode */
28 OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */
29 OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */
30 OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */
31};
32
33struct gpmc_nand_regs {
34 void __iomem *gpmc_status;
35 void __iomem *gpmc_nand_command;
36 void __iomem *gpmc_nand_address;
37 void __iomem *gpmc_nand_data;
38 void __iomem *gpmc_prefetch_config1;
39 void __iomem *gpmc_prefetch_config2;
40 void __iomem *gpmc_prefetch_control;
41 void __iomem *gpmc_prefetch_status;
42 void __iomem *gpmc_ecc_config;
43 void __iomem *gpmc_ecc_control;
44 void __iomem *gpmc_ecc_size_config;
45 void __iomem *gpmc_ecc1_result;
46 void __iomem *gpmc_bch_result0;
47};
48
21struct omap_nand_platform_data { 49struct omap_nand_platform_data {
22 int cs; 50 int cs;
23 struct mtd_partition *parts; 51 struct mtd_partition *parts;
24 struct gpmc_timings *gpmc_t;
25 int nr_parts; 52 int nr_parts;
26 bool dev_ready; 53 bool dev_ready;
27 enum nand_io xfer_type; 54 enum nand_io xfer_type;
@@ -30,14 +57,4 @@ struct omap_nand_platform_data {
30 struct gpmc_nand_regs reg; 57 struct gpmc_nand_regs reg;
31}; 58};
32 59
33/* minimum size for IO mapping */
34#define NAND_IO_SIZE 4
35
36#if defined(CONFIG_MTD_NAND_OMAP2) || defined(CONFIG_MTD_NAND_OMAP2_MODULE)
37extern int gpmc_nand_init(struct omap_nand_platform_data *d);
38#else
39static inline int gpmc_nand_init(struct omap_nand_platform_data *d)
40{
41 return 0;
42}
43#endif 60#endif