diff options
author | Gupta, Pekon <pekon@ti.com> | 2013-03-15 08:25:53 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2013-04-05 08:22:59 -0400 |
commit | 837a6ba4f3b6d23026674e6af6b6849a4634fff9 (patch) | |
tree | c13590363e4e146627a0074b2c7efa60386c5a18 /include/linux/mtd/nand.h | |
parent | 4ff6772b5bb17ef40e64abf2c0d5f6aefd104b06 (diff) |
mtd: nand: subpage write support for hardware based ECC schemes
This patch adds support for subpage (partial-page) writes when using
hardware based ECC schemes.
Advantages:
(1) reduces storage overhead when using file-systems like UBIFS, which
store LEB header at page-size granularity.
(2) allows independent subpage writes, thereby increasing NAND storage
efficiency for non-page aligned data.
+ updated cafe_nand and lpc32xx_mlc NAND drivers for change in
chip->write_page interface.
Signed-off-by: Gupta, Pekon <pekon@ti.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include/linux/mtd/nand.h')
-rw-r--r-- | include/linux/mtd/nand.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index ebf970e11428..ab6363443ce8 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -318,6 +318,7 @@ struct nand_hw_control { | |||
318 | * any single ECC step, 0 if bitflips uncorrectable, -EIO hw error | 318 | * any single ECC step, 0 if bitflips uncorrectable, -EIO hw error |
319 | * @read_subpage: function to read parts of the page covered by ECC; | 319 | * @read_subpage: function to read parts of the page covered by ECC; |
320 | * returns same as read_page() | 320 | * returns same as read_page() |
321 | * @write_subpage: function to write parts of the page covered by ECC. | ||
321 | * @write_page: function to write a page according to the ECC generator | 322 | * @write_page: function to write a page according to the ECC generator |
322 | * requirements. | 323 | * requirements. |
323 | * @write_oob_raw: function to write chip OOB data without ECC | 324 | * @write_oob_raw: function to write chip OOB data without ECC |
@@ -349,6 +350,9 @@ struct nand_ecc_ctrl { | |||
349 | uint8_t *buf, int oob_required, int page); | 350 | uint8_t *buf, int oob_required, int page); |
350 | int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip, | 351 | int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip, |
351 | uint32_t offs, uint32_t len, uint8_t *buf); | 352 | uint32_t offs, uint32_t len, uint8_t *buf); |
353 | int (*write_subpage)(struct mtd_info *mtd, struct nand_chip *chip, | ||
354 | uint32_t offset, uint32_t data_len, | ||
355 | const uint8_t *data_buf, int oob_required); | ||
352 | int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, | 356 | int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, |
353 | const uint8_t *buf, int oob_required); | 357 | const uint8_t *buf, int oob_required); |
354 | int (*write_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip, | 358 | int (*write_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip, |
@@ -484,8 +488,8 @@ struct nand_chip { | |||
484 | int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, | 488 | int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, |
485 | int status, int page); | 489 | int status, int page); |
486 | int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, | 490 | int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, |
487 | const uint8_t *buf, int oob_required, int page, | 491 | uint32_t offset, int data_len, const uint8_t *buf, |
488 | int cached, int raw); | 492 | int oob_required, int page, int cached, int raw); |
489 | int (*onfi_set_features)(struct mtd_info *mtd, struct nand_chip *chip, | 493 | int (*onfi_set_features)(struct mtd_info *mtd, struct nand_chip *chip, |
490 | int feature_addr, uint8_t *subfeature_para); | 494 | int feature_addr, uint8_t *subfeature_para); |
491 | int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip, | 495 | int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip, |