diff options
Diffstat (limited to 'include/linux/mtd/nand.h')
-rw-r--r-- | include/linux/mtd/nand.h | 25 |
1 files changed, 13 insertions, 12 deletions
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 | ||