aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-06-01 19:55:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-06-01 19:55:42 -0400
commitf5e7e844a571124ffc117d4696787d6afc4fc5ae (patch)
tree26bb17dc94e9536da540c187b00cedb0c1b24664 /include/linux
parent48445159e9ecb44a96a4de06c6ae7c54eb43ba5b (diff)
parent4a43faf54e9173b6acce37cf7f053fc9515a2cdf (diff)
Merge tag 'for-linus-3.5-20120601' of git://git.infradead.org/linux-mtd
Pull mtd update from David Woodhouse: - More robust parsing especially of xattr data in JFFS2 - Updates to mxc_nand and gpmi drivers to support new boards and device tree - Improve consistency of information about ECC strength in NAND devices - Clean up partition handling of plat_nand - Support NAND drivers without dedicated access to OOB area - BCH hardware ECC support for OMAP - Other fixes and cleanups, and a few new device IDs Fixed trivial conflict in drivers/mtd/nand/gpmi-nand/gpmi-nand.c due to added include files next to each other. * tag 'for-linus-3.5-20120601' of git://git.infradead.org/linux-mtd: (75 commits) mtd: mxc_nand: move ecc strengh setup before nand_scan_tail mtd: block2mtd: fix recursive call of mtd_writev mtd: gpmi-nand: define ecc.strength mtd: of_parts: fix breakage in Kconfig mtd: nand: fix scan_read_raw_oob mtd: docg3 fix in-middle of blocks reads mtd: cfi_cmdset_0002: Slight cleanup of fixup messages mtd: add fixup for S29NS512P NOR flash. jffs2: allow to complete xattr integrity check on first GC scan jffs2: allow to discriminate between recoverable and non-recoverable errors mtd: nand: omap: add support for hardware BCH ecc ARM: OMAP3: gpmc: add BCH ecc api and modes mtd: nand: check the return code of 'read_oob/read_oob_raw' mtd: nand: remove 'sndcmd' parameter of 'read_oob/read_oob_raw' mtd: m25p80: Add support for Winbond W25Q80BW jffs2: get rid of jffs2_sync_super jffs2: remove unnecessary GC pass on sync jffs2: remove unnecessary GC pass on umount jffs2: remove lock_super mtd: gpmi: add gpmi support for mx6q ...
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/gpmi-nand.h8
-rw-r--r--include/linux/mtd/mtd.h11
-rw-r--r--include/linux/mtd/nand.h25
3 files changed, 27 insertions, 17 deletions
diff --git a/include/linux/mtd/gpmi-nand.h b/include/linux/mtd/gpmi-nand.h
index 69b6dbf46b5e..ed3c4e09f3d1 100644
--- a/include/linux/mtd/gpmi-nand.h
+++ b/include/linux/mtd/gpmi-nand.h
@@ -23,12 +23,12 @@
23#define GPMI_NAND_RES_SIZE 6 23#define GPMI_NAND_RES_SIZE 6
24 24
25/* Resource names for the GPMI NAND driver. */ 25/* Resource names for the GPMI NAND driver. */
26#define GPMI_NAND_GPMI_REGS_ADDR_RES_NAME "GPMI NAND GPMI Registers" 26#define GPMI_NAND_GPMI_REGS_ADDR_RES_NAME "gpmi-nand"
27#define GPMI_NAND_GPMI_INTERRUPT_RES_NAME "GPMI NAND GPMI Interrupt" 27#define GPMI_NAND_GPMI_INTERRUPT_RES_NAME "GPMI NAND GPMI Interrupt"
28#define GPMI_NAND_BCH_REGS_ADDR_RES_NAME "GPMI NAND BCH Registers" 28#define GPMI_NAND_BCH_REGS_ADDR_RES_NAME "bch"
29#define GPMI_NAND_BCH_INTERRUPT_RES_NAME "GPMI NAND BCH Interrupt" 29#define GPMI_NAND_BCH_INTERRUPT_RES_NAME "bch"
30#define GPMI_NAND_DMA_CHANNELS_RES_NAME "GPMI NAND DMA Channels" 30#define GPMI_NAND_DMA_CHANNELS_RES_NAME "GPMI NAND DMA Channels"
31#define GPMI_NAND_DMA_INTERRUPT_RES_NAME "GPMI NAND DMA Interrupt" 31#define GPMI_NAND_DMA_INTERRUPT_RES_NAME "gpmi-dma"
32 32
33/** 33/**
34 * struct gpmi_nand_platform_data - GPMI NAND driver platform data. 34 * struct gpmi_nand_platform_data - GPMI NAND driver platform data.
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index cf5ea8cdcf8e..63dadc0dfb62 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -157,6 +157,15 @@ struct mtd_info {
157 unsigned int erasesize_mask; 157 unsigned int erasesize_mask;
158 unsigned int writesize_mask; 158 unsigned int writesize_mask;
159 159
160 /*
161 * read ops return -EUCLEAN if max number of bitflips corrected on any
162 * one region comprising an ecc step equals or exceeds this value.
163 * Settable by driver, else defaults to ecc_strength. User can override
164 * in sysfs. N.B. The meaning of the -EUCLEAN return code has changed;
165 * see Documentation/ABI/testing/sysfs-class-mtd for more detail.
166 */
167 unsigned int bitflip_threshold;
168
160 // Kernel-only stuff starts here. 169 // Kernel-only stuff starts here.
161 const char *name; 170 const char *name;
162 int index; 171 int index;
@@ -164,7 +173,7 @@ struct mtd_info {
164 /* ECC layout structure pointer - read only! */ 173 /* ECC layout structure pointer - read only! */
165 struct nand_ecclayout *ecclayout; 174 struct nand_ecclayout *ecclayout;
166 175
167 /* max number of correctible bit errors per writesize */ 176 /* max number of correctible bit errors per ecc step */
168 unsigned int ecc_strength; 177 unsigned int ecc_strength;
169 178
170 /* Data for variable erase regions. If numeraseregions is zero, 179 /* Data for variable erase regions. If numeraseregions is zero,
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 1482340d3d9f..57977c640529 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -161,8 +161,6 @@ typedef enum {
161 * Option constants for bizarre disfunctionality and real 161 * Option constants for bizarre disfunctionality and real
162 * features. 162 * features.
163 */ 163 */
164/* Chip can not auto increment pages */
165#define NAND_NO_AUTOINCR 0x00000001
166/* Buswidth is 16 bit */ 164/* Buswidth is 16 bit */
167#define NAND_BUSWIDTH_16 0x00000002 165#define NAND_BUSWIDTH_16 0x00000002
168/* Device supports partial programming without padding */ 166/* Device supports partial programming without padding */
@@ -207,7 +205,6 @@ typedef enum {
207 (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK) 205 (NAND_NO_PADDING | NAND_CACHEPRG | NAND_COPYBACK)
208 206
209/* Macros to identify the above */ 207/* Macros to identify the above */
210#define NAND_CANAUTOINCR(chip) (!(chip->options & NAND_NO_AUTOINCR))
211#define NAND_MUST_PAD(chip) (!(chip->options & NAND_NO_PADDING)) 208#define NAND_MUST_PAD(chip) (!(chip->options & NAND_NO_PADDING))
212#define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG)) 209#define NAND_HAS_CACHEPROG(chip) ((chip->options & NAND_CACHEPRG))
213#define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK)) 210#define NAND_HAS_COPYBACK(chip) ((chip->options & NAND_COPYBACK))
@@ -216,7 +213,7 @@ typedef enum {
216 && (chip->page_shift > 9)) 213 && (chip->page_shift > 9))
217 214
218/* Mask to zero out the chip options, which come from the id table */ 215/* Mask to zero out the chip options, which come from the id table */
219#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) 216#define NAND_CHIPOPTIONS_MSK 0x0000ffff
220 217
221/* Non chip related options */ 218/* Non chip related options */
222/* This option skips the bbt scan during initialization. */ 219/* This option skips the bbt scan during initialization. */
@@ -363,21 +360,20 @@ struct nand_ecc_ctrl {
363 int (*correct)(struct mtd_info *mtd, uint8_t *dat, uint8_t *read_ecc, 360 int (*correct)(struct mtd_info *mtd, uint8_t *dat, uint8_t *read_ecc,
364 uint8_t *calc_ecc); 361 uint8_t *calc_ecc);
365 int (*read_page_raw)(struct mtd_info *mtd, struct nand_chip *chip, 362 int (*read_page_raw)(struct mtd_info *mtd, struct nand_chip *chip,
366 uint8_t *buf, int page); 363 uint8_t *buf, int oob_required, int page);
367 void (*write_page_raw)(struct mtd_info *mtd, struct nand_chip *chip, 364 void (*write_page_raw)(struct mtd_info *mtd, struct nand_chip *chip,
368 const uint8_t *buf); 365 const uint8_t *buf, int oob_required);
369 int (*read_page)(struct mtd_info *mtd, struct nand_chip *chip, 366 int (*read_page)(struct mtd_info *mtd, struct nand_chip *chip,
370 uint8_t *buf, int page); 367 uint8_t *buf, int oob_required, int page);
371 int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip, 368 int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip,
372 uint32_t offs, uint32_t len, uint8_t *buf); 369 uint32_t offs, uint32_t len, uint8_t *buf);
373 void (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, 370 void (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
374 const uint8_t *buf); 371 const uint8_t *buf, int oob_required);
375 int (*write_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip, 372 int (*write_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip,
376 int page); 373 int page);
377 int (*read_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip, 374 int (*read_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip,
378 int page, int sndcmd); 375 int page);
379 int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page, 376 int (*read_oob)(struct mtd_info *mtd, struct nand_chip *chip, int page);
380 int sndcmd);
381 int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip, 377 int (*write_oob)(struct mtd_info *mtd, struct nand_chip *chip,
382 int page); 378 int page);
383}; 379};
@@ -459,6 +455,8 @@ struct nand_buffers {
459 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 455 * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1
460 * @pagebuf: [INTERN] holds the pagenumber which is currently in 456 * @pagebuf: [INTERN] holds the pagenumber which is currently in
461 * data_buf. 457 * data_buf.
458 * @pagebuf_bitflips: [INTERN] holds the bitflip count for the page which is
459 * currently in data_buf.
462 * @subpagesize: [INTERN] holds the subpagesize 460 * @subpagesize: [INTERN] holds the subpagesize
463 * @onfi_version: [INTERN] holds the chip ONFI version (BCD encoded), 461 * @onfi_version: [INTERN] holds the chip ONFI version (BCD encoded),
464 * non 0 if ONFI supported. 462 * non 0 if ONFI supported.
@@ -505,7 +503,8 @@ struct nand_chip {
505 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, 503 int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state,
506 int status, int page); 504 int status, int page);
507 int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, 505 int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip,
508 const uint8_t *buf, int page, int cached, int raw); 506 const uint8_t *buf, int oob_required, int page,
507 int cached, int raw);
509 508
510 int chip_delay; 509 int chip_delay;
511 unsigned int options; 510 unsigned int options;
@@ -519,6 +518,7 @@ struct nand_chip {
519 uint64_t chipsize; 518 uint64_t chipsize;
520 int pagemask; 519 int pagemask;
521 int pagebuf; 520 int pagebuf;
521 unsigned int pagebuf_bitflips;
522 int subpagesize; 522 int subpagesize;
523 uint8_t cellinfo; 523 uint8_t cellinfo;
524 int badblockpos; 524 int badblockpos;
@@ -654,6 +654,7 @@ struct platform_nand_ctrl {
654 void (*cmd_ctrl)(struct mtd_info *mtd, int dat, unsigned int ctrl); 654 void (*cmd_ctrl)(struct mtd_info *mtd, int dat, unsigned int ctrl);
655 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len); 655 void (*write_buf)(struct mtd_info *mtd, const uint8_t *buf, int len);
656 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len); 656 void (*read_buf)(struct mtd_info *mtd, uint8_t *buf, int len);
657 unsigned char (*read_byte)(struct mtd_info *mtd);
657 void *priv; 658 void *priv;
658}; 659};
659 660