diff options
Diffstat (limited to 'include/linux/platform_data/mtd-nand-omap2.h')
| -rw-r--r-- | include/linux/platform_data/mtd-nand-omap2.h | 46 |
1 files changed, 34 insertions, 12 deletions
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h index 1a68c1e5fe53..24d32ca34bef 100644 --- a/include/linux/platform_data/mtd-nand-omap2.h +++ b/include/linux/platform_data/mtd-nand-omap2.h | |||
| @@ -8,9 +8,13 @@ | |||
| 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 | ||
| 16 | #define GPMC_BCH_NUM_REMAINDER 8 | ||
| 17 | |||
| 14 | enum nand_io { | 18 | enum nand_io { |
| 15 | NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */ | 19 | NAND_OMAP_PREFETCH_POLLED = 0, /* prefetch polled mode, default */ |
| 16 | NAND_OMAP_POLLED, /* polled mode, without prefetch */ | 20 | NAND_OMAP_POLLED, /* polled mode, without prefetch */ |
| @@ -18,10 +22,38 @@ enum nand_io { | |||
| 18 | NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */ | 22 | NAND_OMAP_PREFETCH_IRQ /* prefetch enabled irq mode */ |
| 19 | }; | 23 | }; |
| 20 | 24 | ||
| 25 | enum omap_ecc { | ||
| 26 | /* 1-bit ecc: stored at end of spare area */ | ||
| 27 | OMAP_ECC_HAMMING_CODE_DEFAULT = 0, /* Default, s/w method */ | ||
| 28 | OMAP_ECC_HAMMING_CODE_HW, /* gpmc to detect the error */ | ||
| 29 | /* 1-bit ecc: stored at beginning of spare area as romcode */ | ||
| 30 | OMAP_ECC_HAMMING_CODE_HW_ROMCODE, /* gpmc method & romcode layout */ | ||
| 31 | OMAP_ECC_BCH4_CODE_HW, /* 4-bit BCH ecc code */ | ||
| 32 | OMAP_ECC_BCH8_CODE_HW, /* 8-bit BCH ecc code */ | ||
| 33 | }; | ||
| 34 | |||
| 35 | struct gpmc_nand_regs { | ||
| 36 | void __iomem *gpmc_status; | ||
| 37 | void __iomem *gpmc_nand_command; | ||
| 38 | void __iomem *gpmc_nand_address; | ||
| 39 | void __iomem *gpmc_nand_data; | ||
| 40 | void __iomem *gpmc_prefetch_config1; | ||
| 41 | void __iomem *gpmc_prefetch_config2; | ||
| 42 | void __iomem *gpmc_prefetch_control; | ||
| 43 | void __iomem *gpmc_prefetch_status; | ||
| 44 | void __iomem *gpmc_ecc_config; | ||
| 45 | void __iomem *gpmc_ecc_control; | ||
| 46 | void __iomem *gpmc_ecc_size_config; | ||
| 47 | void __iomem *gpmc_ecc1_result; | ||
| 48 | void __iomem *gpmc_bch_result0[GPMC_BCH_NUM_REMAINDER]; | ||
| 49 | void __iomem *gpmc_bch_result1[GPMC_BCH_NUM_REMAINDER]; | ||
| 50 | void __iomem *gpmc_bch_result2[GPMC_BCH_NUM_REMAINDER]; | ||
| 51 | void __iomem *gpmc_bch_result3[GPMC_BCH_NUM_REMAINDER]; | ||
| 52 | }; | ||
| 53 | |||
| 21 | struct omap_nand_platform_data { | 54 | struct omap_nand_platform_data { |
| 22 | int cs; | 55 | int cs; |
| 23 | struct mtd_partition *parts; | 56 | struct mtd_partition *parts; |
| 24 | struct gpmc_timings *gpmc_t; | ||
| 25 | int nr_parts; | 57 | int nr_parts; |
| 26 | bool dev_ready; | 58 | bool dev_ready; |
| 27 | enum nand_io xfer_type; | 59 | enum nand_io xfer_type; |
| @@ -30,14 +62,4 @@ struct omap_nand_platform_data { | |||
| 30 | struct gpmc_nand_regs reg; | 62 | struct gpmc_nand_regs reg; |
| 31 | }; | 63 | }; |
| 32 | 64 | ||
| 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) | ||
| 37 | extern int gpmc_nand_init(struct omap_nand_platform_data *d); | ||
| 38 | #else | ||
| 39 | static inline int gpmc_nand_init(struct omap_nand_platform_data *d) | ||
| 40 | { | ||
| 41 | return 0; | ||
| 42 | } | ||
| 43 | #endif | 65 | #endif |
