diff options
author | Gupta, Pekon <pekon@ti.com> | 2013-03-15 17:55:53 +0530 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2013-04-05 13:22:59 +0100 |
commit | 837a6ba4f3b6d23026674e6af6b6849a4634fff9 (patch) | |
tree | c13590363e4e146627a0074b2c7efa60386c5a18 /include/linux/mtd | |
parent | 4ff6772b5bb17ef40e64abf2c0d5f6aefd104b06 (diff) | |
download | linux-stable-837a6ba4f3b6d23026674e6af6b6849a4634fff9.tar.gz linux-stable-837a6ba4f3b6d23026674e6af6b6849a4634fff9.tar.bz2 linux-stable-837a6ba4f3b6d23026674e6af6b6849a4634fff9.zip |
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')
-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 { * any single ECC step, 0 if bitflips uncorrectable, -EIO hw error * @read_subpage: function to read parts of the page covered by ECC; * returns same as read_page() + * @write_subpage: function to write parts of the page covered by ECC. * @write_page: function to write a page according to the ECC generator * requirements. * @write_oob_raw: function to write chip OOB data without ECC @@ -349,6 +350,9 @@ struct nand_ecc_ctrl { uint8_t *buf, int oob_required, int page); int (*read_subpage)(struct mtd_info *mtd, struct nand_chip *chip, uint32_t offs, uint32_t len, uint8_t *buf); + int (*write_subpage)(struct mtd_info *mtd, struct nand_chip *chip, + uint32_t offset, uint32_t data_len, + const uint8_t *data_buf, int oob_required); int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, const uint8_t *buf, int oob_required); int (*write_oob_raw)(struct mtd_info *mtd, struct nand_chip *chip, @@ -484,8 +488,8 @@ struct nand_chip { int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, - const uint8_t *buf, int oob_required, int page, - int cached, int raw); + uint32_t offset, int data_len, const uint8_t *buf, + int oob_required, int page, int cached, int raw); int (*onfi_set_features)(struct mtd_info *mtd, struct nand_chip *chip, int feature_addr, uint8_t *subfeature_para); int (*onfi_get_features)(struct mtd_info *mtd, struct nand_chip *chip, |