aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 14:48:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-18 14:48:03 -0400
commit511c41d9e6665a07aca94eb00983cf6d77dd87ff (patch)
treef9933c61d0bc902c49832bcfc24d65cfe0b34529 /include/linux
parent88ed806abb981cc8ec61ee7fab93ecfe63521ebf (diff)
parent8b3d58e554453ab858bbb169d93b7321bdc628d4 (diff)
Merge tag 'for-linus-20141015' of git://git.infradead.org/linux-mtd
Pull MTD update from Brian Norris: "Sorry for delaying this a bit later than usual. There's one mild regression from 3.16 that was noticed during the 3.17 cycle, and I meant to send a fix for it along with this pull request. I'll probably try to queue it up for a later pull request once I've had a better look at it, hopefully by -rc2 at the latest. Summary for this pull: NAND - Cleanup for Denali driver - Atmel: add support for new page sizes - Atmel: fix up 'raw' mode support - Atmel: miscellaneous cleanups - New timing mode helpers for non-ONFI NAND - OMAP: allow driver to be (properly) built as a module - bcm47xx: RESET support and other cleanups SPI NOR - Miscellaneous cleanups, to prepare framework for wider use (some further work still pending) - Compile-time configuration to select 4K vs. 64K support for flash that support both (necessary for using UBIFS on some SPI NOR) A few scattered code quality fixes, detected by Coverity See the changesets for more" * tag 'for-linus-20141015' of git://git.infradead.org/linux-mtd: (59 commits) mtd: nand: omap: Correct CONFIG_MTD_NAND_OMAP_BCH help message mtd: nand: Force omap_elm to be built as a module if omap2_nand is a module mtd: move support for struct flash_platform_data into m25p80 mtd: spi-nor: add Kconfig option to disable 4K sectors mtd: nand: Move ELM driver and rename as omap_elm nand: omap2: Replace pr_err with dev_err nand: omap2: Remove horrible ifdefs to fix module probe mtd: nand: add Hynix's H27UCG8T2ATR-BC to nand_ids table mtd: nand: support ONFI timing mode retrieval for non-ONFI NANDs mtd: physmap_of: Add non-obsolete map_rom probe mtd: physmap_of: Fix ROM support via OF MAINTAINERS: add l2-mtd.git, 'next' tree for MTD mtd: denali: fix indents and other trivial things mtd: denali: remove unnecessary parentheses mtd: denali: remove another set-but-unused variable mtd: denali: fix include guard and license block of denali.h mtd: nand: don't break long print messages mtd: bcm47xxnflash: replace some magic numbers mtd: bcm47xxnflash: NAND_CMD_RESET support mtd: bcm47xxnflash: add cmd_ctrl handler ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/cfi.h22
-rw-r--r--include/linux/mtd/nand.h12
-rw-r--r--include/linux/platform_data/elm.h16
-rw-r--r--include/linux/platform_data/mtd-nand-omap2.h1
4 files changed, 40 insertions, 11 deletions
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index 37ef6b194089..299d7d31fe53 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -153,7 +153,7 @@ struct cfi_ident {
153 uint16_t MaxBufWriteSize; 153 uint16_t MaxBufWriteSize;
154 uint8_t NumEraseRegions; 154 uint8_t NumEraseRegions;
155 uint32_t EraseRegionInfo[0]; /* Not host ordered */ 155 uint32_t EraseRegionInfo[0]; /* Not host ordered */
156} __attribute__((packed)); 156} __packed;
157 157
158/* Extended Query Structure for both PRI and ALT */ 158/* Extended Query Structure for both PRI and ALT */
159 159
@@ -161,7 +161,7 @@ struct cfi_extquery {
161 uint8_t pri[3]; 161 uint8_t pri[3];
162 uint8_t MajorVersion; 162 uint8_t MajorVersion;
163 uint8_t MinorVersion; 163 uint8_t MinorVersion;
164} __attribute__((packed)); 164} __packed;
165 165
166/* Vendor-Specific PRI for Intel/Sharp Extended Command Set (0x0001) */ 166/* Vendor-Specific PRI for Intel/Sharp Extended Command Set (0x0001) */
167 167
@@ -180,7 +180,7 @@ struct cfi_pri_intelext {
180 uint8_t FactProtRegSize; 180 uint8_t FactProtRegSize;
181 uint8_t UserProtRegSize; 181 uint8_t UserProtRegSize;
182 uint8_t extra[0]; 182 uint8_t extra[0];
183} __attribute__((packed)); 183} __packed;
184 184
185struct cfi_intelext_otpinfo { 185struct cfi_intelext_otpinfo {
186 uint32_t ProtRegAddr; 186 uint32_t ProtRegAddr;
@@ -188,7 +188,7 @@ struct cfi_intelext_otpinfo {
188 uint8_t FactProtRegSize; 188 uint8_t FactProtRegSize;
189 uint16_t UserGroups; 189 uint16_t UserGroups;
190 uint8_t UserProtRegSize; 190 uint8_t UserProtRegSize;
191} __attribute__((packed)); 191} __packed;
192 192
193struct cfi_intelext_blockinfo { 193struct cfi_intelext_blockinfo {
194 uint16_t NumIdentBlocks; 194 uint16_t NumIdentBlocks;
@@ -196,7 +196,7 @@ struct cfi_intelext_blockinfo {
196 uint16_t MinBlockEraseCycles; 196 uint16_t MinBlockEraseCycles;
197 uint8_t BitsPerCell; 197 uint8_t BitsPerCell;
198 uint8_t BlockCap; 198 uint8_t BlockCap;
199} __attribute__((packed)); 199} __packed;
200 200
201struct cfi_intelext_regioninfo { 201struct cfi_intelext_regioninfo {
202 uint16_t NumIdentPartitions; 202 uint16_t NumIdentPartitions;
@@ -205,7 +205,7 @@ struct cfi_intelext_regioninfo {
205 uint8_t NumOpAllowedSimEraMode; 205 uint8_t NumOpAllowedSimEraMode;
206 uint8_t NumBlockTypes; 206 uint8_t NumBlockTypes;
207 struct cfi_intelext_blockinfo BlockTypes[1]; 207 struct cfi_intelext_blockinfo BlockTypes[1];
208} __attribute__((packed)); 208} __packed;
209 209
210struct cfi_intelext_programming_regioninfo { 210struct cfi_intelext_programming_regioninfo {
211 uint8_t ProgRegShift; 211 uint8_t ProgRegShift;
@@ -214,7 +214,7 @@ struct cfi_intelext_programming_regioninfo {
214 uint8_t Reserved2; 214 uint8_t Reserved2;
215 uint8_t ControlInvalid; 215 uint8_t ControlInvalid;
216 uint8_t Reserved3; 216 uint8_t Reserved3;
217} __attribute__((packed)); 217} __packed;
218 218
219/* Vendor-Specific PRI for AMD/Fujitsu Extended Command Set (0x0002) */ 219/* Vendor-Specific PRI for AMD/Fujitsu Extended Command Set (0x0002) */
220 220
@@ -233,7 +233,7 @@ struct cfi_pri_amdstd {
233 uint8_t VppMin; 233 uint8_t VppMin;
234 uint8_t VppMax; 234 uint8_t VppMax;
235 uint8_t TopBottom; 235 uint8_t TopBottom;
236} __attribute__((packed)); 236} __packed;
237 237
238/* Vendor-Specific PRI for Atmel chips (command set 0x0002) */ 238/* Vendor-Specific PRI for Atmel chips (command set 0x0002) */
239 239
@@ -245,18 +245,18 @@ struct cfi_pri_atmel {
245 uint8_t BottomBoot; 245 uint8_t BottomBoot;
246 uint8_t BurstMode; 246 uint8_t BurstMode;
247 uint8_t PageMode; 247 uint8_t PageMode;
248} __attribute__((packed)); 248} __packed;
249 249
250struct cfi_pri_query { 250struct cfi_pri_query {
251 uint8_t NumFields; 251 uint8_t NumFields;
252 uint32_t ProtField[1]; /* Not host ordered */ 252 uint32_t ProtField[1]; /* Not host ordered */
253} __attribute__((packed)); 253} __packed;
254 254
255struct cfi_bri_query { 255struct cfi_bri_query {
256 uint8_t PageModeReadCap; 256 uint8_t PageModeReadCap;
257 uint8_t NumFields; 257 uint8_t NumFields;
258 uint32_t ConfField[1]; /* Not host ordered */ 258 uint32_t ConfField[1]; /* Not host ordered */
259} __attribute__((packed)); 259} __packed;
260 260
261#define P_ID_NONE 0x0000 261#define P_ID_NONE 0x0000
262#define P_ID_INTEL_EXT 0x0001 262#define P_ID_INTEL_EXT 0x0001
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index c300db3ae285..e4d451e4600b 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -587,6 +587,11 @@ struct nand_buffers {
587 * @ecc_step_ds: [INTERN] ECC step required by the @ecc_strength_ds, 587 * @ecc_step_ds: [INTERN] ECC step required by the @ecc_strength_ds,
588 * also from the datasheet. It is the recommended ECC step 588 * also from the datasheet. It is the recommended ECC step
589 * size, if known; if unknown, set to zero. 589 * size, if known; if unknown, set to zero.
590 * @onfi_timing_mode_default: [INTERN] default ONFI timing mode. This field is
591 * either deduced from the datasheet if the NAND
592 * chip is not ONFI compliant or set to 0 if it is
593 * (an ONFI chip is always configured in mode 0
594 * after a NAND reset)
590 * @numchips: [INTERN] number of physical chips 595 * @numchips: [INTERN] number of physical chips
591 * @chipsize: [INTERN] the size of one chip for multichip arrays 596 * @chipsize: [INTERN] the size of one chip for multichip arrays
592 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 597 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
@@ -671,6 +676,7 @@ struct nand_chip {
671 uint8_t bits_per_cell; 676 uint8_t bits_per_cell;
672 uint16_t ecc_strength_ds; 677 uint16_t ecc_strength_ds;
673 uint16_t ecc_step_ds; 678 uint16_t ecc_step_ds;
679 int onfi_timing_mode_default;
674 int badblockpos; 680 int badblockpos;
675 int badblockbits; 681 int badblockbits;
676 682
@@ -766,12 +772,17 @@ struct nand_chip {
766 * @options: stores various chip bit options 772 * @options: stores various chip bit options
767 * @id_len: The valid length of the @id. 773 * @id_len: The valid length of the @id.
768 * @oobsize: OOB size 774 * @oobsize: OOB size
775 * @ecc: ECC correctability and step information from the datasheet.
769 * @ecc.strength_ds: The ECC correctability from the datasheet, same as the 776 * @ecc.strength_ds: The ECC correctability from the datasheet, same as the
770 * @ecc_strength_ds in nand_chip{}. 777 * @ecc_strength_ds in nand_chip{}.
771 * @ecc.step_ds: The ECC step required by the @ecc.strength_ds, same as the 778 * @ecc.step_ds: The ECC step required by the @ecc.strength_ds, same as the
772 * @ecc_step_ds in nand_chip{}, also from the datasheet. 779 * @ecc_step_ds in nand_chip{}, also from the datasheet.
773 * For example, the "4bit ECC for each 512Byte" can be set with 780 * For example, the "4bit ECC for each 512Byte" can be set with
774 * NAND_ECC_INFO(4, 512). 781 * NAND_ECC_INFO(4, 512).
782 * @onfi_timing_mode_default: the default ONFI timing mode entered after a NAND
783 * reset. Should be deduced from timings described
784 * in the datasheet.
785 *
775 */ 786 */
776struct nand_flash_dev { 787struct nand_flash_dev {
777 char *name; 788 char *name;
@@ -792,6 +803,7 @@ struct nand_flash_dev {
792 uint16_t strength_ds; 803 uint16_t strength_ds;
793 uint16_t step_ds; 804 uint16_t step_ds;
794 } ecc; 805 } ecc;
806 int onfi_timing_mode_default;
795}; 807};
796 808
797/** 809/**
diff --git a/include/linux/platform_data/elm.h b/include/linux/platform_data/elm.h
index 780d1e97f620..b8686c00f15f 100644
--- a/include/linux/platform_data/elm.h
+++ b/include/linux/platform_data/elm.h
@@ -42,8 +42,24 @@ struct elm_errorvec {
42 int error_loc[16]; 42 int error_loc[16];
43}; 43};
44 44
45#if IS_ENABLED(CONFIG_MTD_NAND_OMAP_BCH)
45void elm_decode_bch_error_page(struct device *dev, u8 *ecc_calc, 46void elm_decode_bch_error_page(struct device *dev, u8 *ecc_calc,
46 struct elm_errorvec *err_vec); 47 struct elm_errorvec *err_vec);
47int elm_config(struct device *dev, enum bch_ecc bch_type, 48int elm_config(struct device *dev, enum bch_ecc bch_type,
48 int ecc_steps, int ecc_step_size, int ecc_syndrome_size); 49 int ecc_steps, int ecc_step_size, int ecc_syndrome_size);
50#else
51static inline void
52elm_decode_bch_error_page(struct device *dev, u8 *ecc_calc,
53 struct elm_errorvec *err_vec)
54{
55}
56
57static inline int elm_config(struct device *dev, enum bch_ecc bch_type,
58 int ecc_steps, int ecc_step_size,
59 int ecc_syndrome_size)
60{
61 return -ENOSYS;
62}
63#endif /* CONFIG_MTD_NAND_ECC_BCH */
64
49#endif /* __ELM_H */ 65#endif /* __ELM_H */
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h
index 16ec262dfcc8..090bbab0130a 100644
--- a/include/linux/platform_data/mtd-nand-omap2.h
+++ b/include/linux/platform_data/mtd-nand-omap2.h
@@ -71,6 +71,7 @@ struct omap_nand_platform_data {
71 struct mtd_partition *parts; 71 struct mtd_partition *parts;
72 int nr_parts; 72 int nr_parts;
73 bool dev_ready; 73 bool dev_ready;
74 bool flash_bbt;
74 enum nand_io xfer_type; 75 enum nand_io xfer_type;
75 int devsize; 76 int devsize;
76 enum omap_ecc ecc_opt; 77 enum omap_ecc ecc_opt;