aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mtd
diff options
context:
space:
mode:
authorBoris BREZILLON <boris.brezillon@free-electrons.com>2015-12-30 14:32:04 -0500
committerBrian Norris <computersforpeace@gmail.com>2016-01-06 21:48:20 -0500
commit40cbe6eee97b706f27bcc4c6aa1018bbe4f1e577 (patch)
tree6f35750b4b83b5e709569d3e6fbbae74fb19352b /include/linux/mtd
parent6e9411923b8f4c0e568cbae0f35b7ee4eb989914 (diff)
mtd: nand: use nand_check_erased_ecc_chunk in default ECC read functions
The default NAND read functions are relying on the underlying controller driver to correct bitflips, but some of those controllers cannot properly fix bitflips in erased pages. Check for bitflips in erased pages in default core functions if the driver delegated the this check by setting the NAND_ECC_GENERIC_ERASED_CHECK flag. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Tested-by: Franklin S Cooper Jr. <fcooper@ti.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'include/linux/mtd')
-rw-r--r--include/linux/mtd/nand.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 518958115182..86487dbe7358 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -129,6 +129,14 @@ typedef enum {
129/* Enable Hardware ECC before syndrome is read back from flash */ 129/* Enable Hardware ECC before syndrome is read back from flash */
130#define NAND_ECC_READSYN 2 130#define NAND_ECC_READSYN 2
131 131
132/*
133 * Enable generic NAND 'page erased' check. This check is only done when
134 * ecc.correct() returns -EBADMSG.
135 * Set this flag if your implementation does not fix bitflips in erased
136 * pages and you want to rely on the default implementation.
137 */
138#define NAND_ECC_GENERIC_ERASED_CHECK BIT(0)
139
132/* Bit mask for flags passed to do_nand_read_ecc */ 140/* Bit mask for flags passed to do_nand_read_ecc */
133#define NAND_GET_DEVICE 0x80 141#define NAND_GET_DEVICE 0x80
134 142
@@ -451,6 +459,7 @@ struct nand_hw_control {
451 * @total: total number of ECC bytes per page 459 * @total: total number of ECC bytes per page
452 * @prepad: padding information for syndrome based ECC generators 460 * @prepad: padding information for syndrome based ECC generators
453 * @postpad: padding information for syndrome based ECC generators 461 * @postpad: padding information for syndrome based ECC generators
462 * @options: ECC specific options (see NAND_ECC_XXX flags defined above)
454 * @layout: ECC layout control struct pointer 463 * @layout: ECC layout control struct pointer
455 * @priv: pointer to private ECC control data 464 * @priv: pointer to private ECC control data
456 * @hwctl: function to control hardware ECC generator. Must only 465 * @hwctl: function to control hardware ECC generator. Must only
@@ -500,6 +509,7 @@ struct nand_ecc_ctrl {
500 int strength; 509 int strength;
501 int prepad; 510 int prepad;
502 int postpad; 511 int postpad;
512 unsigned int options;
503 struct nand_ecclayout *layout; 513 struct nand_ecclayout *layout;
504 void *priv; 514 void *priv;
505 void (*hwctl)(struct mtd_info *mtd, int mode); 515 void (*hwctl)(struct mtd_info *mtd, int mode);