summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-08-26 14:35:01 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-08-28 12:06:00 +0200
commitb3f6d0f4dcbb46eaadf0e1c47d97b5c5d25fd0b4 (patch)
tree2ec1c4c31b13eb3d2afe8bca75f25694511fe86c /include
parent8230e408d200a46f83131120f0a190727e890078 (diff)
downloadbarebox-b3f6d0f4dcbb46eaadf0e1c47d97b5c5d25fd0b4.tar.gz
barebox-b3f6d0f4dcbb46eaadf0e1c47d97b5c5d25fd0b4.tar.xz
mtd: nand: gpmc: Add BCH16 support
This adds support for BCH16 ECC encoding. The support is mostly taken from Linux-5.3-rc6. One major change is the different wrap mode used. The Kernel uses wrapmode 1, which means "pass all data through the BCH engine". Still the Kernel has to skip the OOB marker which is done by reading all user data, then use NAND_CMD_RNDOUT to position right behind the OOB marker and then read the ECC data. Instead of doing this we use wrap mode 4 which allows us to bypass the OOB marker from the BCH engine automatically. This explains bch_wrapmode = 1, eccsize0 = 0, eccsize1 = 52 vs. bch_wrapmode = 4, eccsize0 = 4, eccsize1 = 52 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/mtd-abi.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/mtd/mtd-abi.h b/include/linux/mtd/mtd-abi.h
index 9bca9b5e06..dfcb3554fb 100644
--- a/include/linux/mtd/mtd-abi.h
+++ b/include/linux/mtd/mtd-abi.h
@@ -137,7 +137,7 @@ struct nand_oobfree {
};
#define MTD_MAX_OOBFREE_ENTRIES_LARGE 32
-#define MTD_MAX_ECCPOS_ENTRIES_LARGE 128 /* FIXME : understand why 448 is not working */
+#define MTD_MAX_ECCPOS_ENTRIES_LARGE 640
/*
* ECC layout control structure. Exported to userspace for
* diagnosis and to allow creation of raw images