summaryrefslogtreecommitdiffstats
path: root/include/linux/mtd/nand.h
diff options
context:
space:
mode:
authorMarkus Pargmann <mpa@pengutronix.de>2015-12-21 15:42:00 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-01-04 10:43:31 +0100
commit142963e9d5f694dd8dfa2d44172bd3ee8933deab (patch)
treecb5b0b3939fd40f4d76e0aa16bb6c83e0775020d /include/linux/mtd/nand.h
parent91adf62feb05559b1f1a1106a998ef4b23a577bf (diff)
downloadbarebox-142963e9d5f694dd8dfa2d44172bd3ee8933deab.tar.gz
barebox-142963e9d5f694dd8dfa2d44172bd3ee8933deab.tar.xz
mtd: nand: Add erased page bitflip check helper functions
This adds the bitflip check helper functions from the kernel. They are used to check for bitflips in erased pages and correct them in the buffer so that UBI can work with it. Unfortunately most nand controllers do not have ECC for erased pages and don't do this on their own. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/linux/mtd/nand.h')
-rw-r--r--include/linux/mtd/nand.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index f126cd9fbf..83d664e7ee 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -46,6 +46,11 @@ extern int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
/* unlocks specified locked blocks */
extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
+extern int nand_check_erased_ecc_chunk(void *data, int datalen,
+ void *ecc, int ecclen,
+ void *extraoob, int extraooblen,
+ int bitflips_threshold);
+
/* The maximum number of NAND chips in an array */
#define NAND_MAX_CHIPS 8