diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-17 14:15:30 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-17 14:15:30 -0500 |
commit | ab2020f2f11fc7fb81e6c71298b0830d85412011 (patch) | |
tree | c9a6342063461dcf31278d65585bca73bdda4a84 /include/linux | |
parent | 235646a486d10891bd86af28d8eac75d9f22bd2d (diff) | |
parent | 154bf89f5e3e3dc59666926f27ca4a0866f39157 (diff) |
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (59 commits)
mtd: mtdpart: disallow reading OOB past the end of the partition
mtd: pxa3xx_nand: NULL dereference in pxa3xx_nand_probe
UBI: use mtd->writebufsize to set minimal I/O unit size
mtd: initialize writebufsize in the MTD object of a partition
mtd: onenand: add mtd->writebufsize initialization
mtd: nand: add mtd->writebufsize initialization
mtd: cfi: add writebufsize initialization
mtd: add writebufsize field to mtd_info struct
mtd: OneNAND: OMAP2/3: prevent regulator sleeping while OneNAND is in use
mtd: OneNAND: add enable / disable methods to onenand_chip
mtd: m25p80: Fix JEDEC ID for AT26DF321
mtd: txx9ndfmc: limit transfer bytes to 512 (ECC provides 6 bytes max)
mtd: cfi_cmdset_0002: add support for Samsung K8D3x16UxC NOR chips
mtd: cfi_cmdset_0002: add support for Samsung K8D6x16UxM NOR chips
mtd: nand: ams-delta: drop omap_read/write, use ioremap
mtd: m25p80: add debugging trace in sst_write
mtd: nand: ams-delta: select for built-in by default
mtd: OneNAND: lighten scary initial bad block messages
mtd: OneNAND: OMAP2/3: add support for command line partitioning
mtd: nand: rearrange ONFI revision checking, add ONFI 2.3
...
Fix up trivial conflict in drivers/mtd/Kconfig as per DavidW.
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/mtd/cfi.h | 3 | ||||
-rw-r--r-- | include/linux/mtd/fsmc.h | 26 | ||||
-rw-r--r-- | include/linux/mtd/mtd.h | 11 | ||||
-rw-r--r-- | include/linux/mtd/nand.h | 2 | ||||
-rw-r--r-- | include/linux/mtd/onenand.h | 14 | ||||
-rw-r--r-- | include/linux/mtd/partitions.h | 2 |
6 files changed, 33 insertions, 25 deletions
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h index 4dd0c2cd7659..a9baee6864af 100644 --- a/include/linux/mtd/cfi.h +++ b/include/linux/mtd/cfi.h | |||
@@ -527,8 +527,7 @@ struct cfi_extquery *cfi_read_pri(struct map_info *map, uint16_t adr, uint16_t s | |||
527 | struct cfi_fixup { | 527 | struct cfi_fixup { |
528 | uint16_t mfr; | 528 | uint16_t mfr; |
529 | uint16_t id; | 529 | uint16_t id; |
530 | void (*fixup)(struct mtd_info *mtd, void* param); | 530 | void (*fixup)(struct mtd_info *mtd); |
531 | void* param; | ||
532 | }; | 531 | }; |
533 | 532 | ||
534 | #define CFI_MFR_ANY 0xFFFF | 533 | #define CFI_MFR_ANY 0xFFFF |
diff --git a/include/linux/mtd/fsmc.h b/include/linux/mtd/fsmc.h index 5d2556700ec2..6987995ad3cf 100644 --- a/include/linux/mtd/fsmc.h +++ b/include/linux/mtd/fsmc.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #ifndef __MTD_FSMC_H | 16 | #ifndef __MTD_FSMC_H |
17 | #define __MTD_FSMC_H | 17 | #define __MTD_FSMC_H |
18 | 18 | ||
19 | #include <linux/io.h> | ||
19 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
20 | #include <linux/mtd/physmap.h> | 21 | #include <linux/mtd/physmap.h> |
21 | #include <linux/types.h> | 22 | #include <linux/types.h> |
@@ -27,7 +28,7 @@ | |||
27 | 28 | ||
28 | /* | 29 | /* |
29 | * The placement of the Command Latch Enable (CLE) and | 30 | * The placement of the Command Latch Enable (CLE) and |
30 | * Address Latch Enable (ALE) is twised around in the | 31 | * Address Latch Enable (ALE) is twisted around in the |
31 | * SPEAR310 implementation. | 32 | * SPEAR310 implementation. |
32 | */ | 33 | */ |
33 | #if defined(CONFIG_MACH_SPEAR310) | 34 | #if defined(CONFIG_MACH_SPEAR310) |
@@ -62,7 +63,7 @@ struct fsmc_nor_bank_regs { | |||
62 | 63 | ||
63 | /* ctrl_tim register definitions */ | 64 | /* ctrl_tim register definitions */ |
64 | 65 | ||
65 | struct fsms_nand_bank_regs { | 66 | struct fsmc_nand_bank_regs { |
66 | uint32_t pc; | 67 | uint32_t pc; |
67 | uint32_t sts; | 68 | uint32_t sts; |
68 | uint32_t comm; | 69 | uint32_t comm; |
@@ -78,7 +79,7 @@ struct fsms_nand_bank_regs { | |||
78 | struct fsmc_regs { | 79 | struct fsmc_regs { |
79 | struct fsmc_nor_bank_regs nor_bank_regs[FSMC_MAX_NOR_BANKS]; | 80 | struct fsmc_nor_bank_regs nor_bank_regs[FSMC_MAX_NOR_BANKS]; |
80 | uint8_t reserved_1[0x40 - 0x20]; | 81 | uint8_t reserved_1[0x40 - 0x20]; |
81 | struct fsms_nand_bank_regs bank_regs[FSMC_MAX_NAND_BANKS]; | 82 | struct fsmc_nand_bank_regs bank_regs[FSMC_MAX_NAND_BANKS]; |
82 | uint8_t reserved_2[0xfe0 - 0xc0]; | 83 | uint8_t reserved_2[0xfe0 - 0xc0]; |
83 | uint32_t peripid0; /* 0xfe0 */ | 84 | uint32_t peripid0; /* 0xfe0 */ |
84 | uint32_t peripid1; /* 0xfe4 */ | 85 | uint32_t peripid1; /* 0xfe4 */ |
@@ -114,25 +115,6 @@ struct fsmc_regs { | |||
114 | #define FSMC_THOLD_4 (4 << 16) | 115 | #define FSMC_THOLD_4 (4 << 16) |
115 | #define FSMC_THIZ_1 (1 << 24) | 116 | #define FSMC_THIZ_1 (1 << 24) |
116 | 117 | ||
117 | /* peripid2 register definitions */ | ||
118 | #define FSMC_REVISION_MSK (0xf) | ||
119 | #define FSMC_REVISION_SHFT (0x4) | ||
120 | |||
121 | #define FSMC_VER1 1 | ||
122 | #define FSMC_VER2 2 | ||
123 | #define FSMC_VER3 3 | ||
124 | #define FSMC_VER4 4 | ||
125 | #define FSMC_VER5 5 | ||
126 | #define FSMC_VER6 6 | ||
127 | #define FSMC_VER7 7 | ||
128 | #define FSMC_VER8 8 | ||
129 | |||
130 | static inline uint32_t get_fsmc_version(struct fsmc_regs *regs) | ||
131 | { | ||
132 | return (readl(®s->peripid2) >> FSMC_REVISION_SHFT) & | ||
133 | FSMC_REVISION_MSK; | ||
134 | } | ||
135 | |||
136 | /* | 118 | /* |
137 | * There are 13 bytes of ecc for every 512 byte block in FSMC version 8 | 119 | * There are 13 bytes of ecc for every 512 byte block in FSMC version 8 |
138 | * and it has to be read consecutively and immediately after the 512 | 120 | * and it has to be read consecutively and immediately after the 512 |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index fe8d77ebec13..9d5306bad117 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -144,6 +144,17 @@ struct mtd_info { | |||
144 | */ | 144 | */ |
145 | uint32_t writesize; | 145 | uint32_t writesize; |
146 | 146 | ||
147 | /* | ||
148 | * Size of the write buffer used by the MTD. MTD devices having a write | ||
149 | * buffer can write multiple writesize chunks at a time. E.g. while | ||
150 | * writing 4 * writesize bytes to a device with 2 * writesize bytes | ||
151 | * buffer the MTD driver can (but doesn't have to) do 2 writesize | ||
152 | * operations, but not 4. Currently, all NANDs have writebufsize | ||
153 | * equivalent to writesize (NAND page size). Some NOR flashes do have | ||
154 | * writebufsize greater than writesize. | ||
155 | */ | ||
156 | uint32_t writebufsize; | ||
157 | |||
147 | uint32_t oobsize; // Amount of OOB data per block (e.g. 16) | 158 | uint32_t oobsize; // Amount of OOB data per block (e.g. 16) |
148 | uint32_t oobavail; // Available OOB bytes per block | 159 | uint32_t oobavail; // Available OOB bytes per block |
149 | 160 | ||
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 63e17d01fde9..1f489b247a29 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -448,6 +448,8 @@ struct nand_buffers { | |||
448 | * See the defines for further explanation. | 448 | * See the defines for further explanation. |
449 | * @badblockpos: [INTERN] position of the bad block marker in the oob | 449 | * @badblockpos: [INTERN] position of the bad block marker in the oob |
450 | * area. | 450 | * area. |
451 | * @badblockbits: [INTERN] number of bits to left-shift the bad block | ||
452 | * number | ||
451 | * @cellinfo: [INTERN] MLC/multichip data from chip ident | 453 | * @cellinfo: [INTERN] MLC/multichip data from chip ident |
452 | * @numchips: [INTERN] number of physical chips | 454 | * @numchips: [INTERN] number of physical chips |
453 | * @chipsize: [INTERN] the size of one chip for multichip arrays | 455 | * @chipsize: [INTERN] the size of one chip for multichip arrays |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 0c8815bfae1c..ae418e41d8f5 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -118,6 +118,8 @@ struct onenand_chip { | |||
118 | int (*chip_probe)(struct mtd_info *mtd); | 118 | int (*chip_probe)(struct mtd_info *mtd); |
119 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); | 119 | int (*block_markbad)(struct mtd_info *mtd, loff_t ofs); |
120 | int (*scan_bbt)(struct mtd_info *mtd); | 120 | int (*scan_bbt)(struct mtd_info *mtd); |
121 | int (*enable)(struct mtd_info *mtd); | ||
122 | int (*disable)(struct mtd_info *mtd); | ||
121 | 123 | ||
122 | struct completion complete; | 124 | struct completion complete; |
123 | int irq; | 125 | int irq; |
@@ -137,6 +139,14 @@ struct onenand_chip { | |||
137 | void *bbm; | 139 | void *bbm; |
138 | 140 | ||
139 | void *priv; | 141 | void *priv; |
142 | |||
143 | /* | ||
144 | * Shows that the current operation is composed | ||
145 | * of sequence of commands. For example, cache program. | ||
146 | * Such command status OnGo bit is checked at the end of | ||
147 | * sequence. | ||
148 | */ | ||
149 | unsigned int ongoing; | ||
140 | }; | 150 | }; |
141 | 151 | ||
142 | /* | 152 | /* |
@@ -171,6 +181,9 @@ struct onenand_chip { | |||
171 | #define ONENAND_IS_2PLANE(this) (0) | 181 | #define ONENAND_IS_2PLANE(this) (0) |
172 | #endif | 182 | #endif |
173 | 183 | ||
184 | #define ONENAND_IS_CACHE_PROGRAM(this) \ | ||
185 | (this->options & ONENAND_HAS_CACHE_PROGRAM) | ||
186 | |||
174 | /* Check byte access in OneNAND */ | 187 | /* Check byte access in OneNAND */ |
175 | #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) | 188 | #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) |
176 | 189 | ||
@@ -181,6 +194,7 @@ struct onenand_chip { | |||
181 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) | 194 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) |
182 | #define ONENAND_HAS_2PLANE (0x0004) | 195 | #define ONENAND_HAS_2PLANE (0x0004) |
183 | #define ONENAND_HAS_4KB_PAGE (0x0008) | 196 | #define ONENAND_HAS_4KB_PAGE (0x0008) |
197 | #define ONENAND_HAS_CACHE_PROGRAM (0x0010) | ||
184 | #define ONENAND_SKIP_UNLOCK_CHECK (0x0100) | 198 | #define ONENAND_SKIP_UNLOCK_CHECK (0x0100) |
185 | #define ONENAND_PAGEBUF_ALLOC (0x1000) | 199 | #define ONENAND_PAGEBUF_ALLOC (0x1000) |
186 | #define ONENAND_OOBBUF_ALLOC (0x2000) | 200 | #define ONENAND_OOBBUF_ALLOC (0x2000) |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 2b54316591d2..4a0a8ba90a72 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -89,7 +89,7 @@ static inline int mtd_has_cmdlinepart(void) { return 1; } | |||
89 | static inline int mtd_has_cmdlinepart(void) { return 0; } | 89 | static inline int mtd_has_cmdlinepart(void) { return 0; } |
90 | #endif | 90 | #endif |
91 | 91 | ||
92 | int mtd_is_master(struct mtd_info *mtd); | 92 | int mtd_is_partition(struct mtd_info *mtd); |
93 | int mtd_add_partition(struct mtd_info *master, char *name, | 93 | int mtd_add_partition(struct mtd_info *master, char *name, |
94 | long long offset, long long length); | 94 | long long offset, long long length); |
95 | int mtd_del_partition(struct mtd_info *master, int partno); | 95 | int mtd_del_partition(struct mtd_info *master, int partno); |