Patchwork [U-Boot,v1,7/8] mtd/fsl_elbc: take NAND_ECC_SOFT_BCH config option into accout

login
register
mail settings
Submitter Valentin Longchamp
Date July 26, 2013, 10:02 a.m.
Message ID <1374832955-4544-8-git-send-email-valentin.longchamp@keymile.com>
Download mbox | patch
Permalink /patch/262106/
State Superseded
Delegated to: York Sun
Headers show

Comments

Valentin Longchamp - July 26, 2013, 10:02 a.m.
NAND_ECC_SOFT was the only option available while the SOFT_BCH option
may also be used.

Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
---
 drivers/mtd/nand/fsl_elbc_nand.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Scott Wood - Aug. 13, 2013, 8:54 p.m.
On Fri, 2013-07-26 at 12:02 +0200, Valentin Longchamp wrote:
> NAND_ECC_SOFT was the only option available while the SOFT_BCH option
> may also be used.
> 
> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
> ---
>  drivers/mtd/nand/fsl_elbc_nand.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)

Acked-by: Scott Wood <scottwood@freescale.com>

Is this for use with http://patchwork.ozlabs.org/patch/168855/ or do you
have a 2K-page NAND that requires more than 1 bit of ECC correction?

-Scott
Valentin Longchamp - Aug. 19, 2013, 3:34 p.m.
On 08/13/2013 10:54 PM, Scott Wood wrote:
> On Fri, 2013-07-26 at 12:02 +0200, Valentin Longchamp wrote:
>> NAND_ECC_SOFT was the only option available while the SOFT_BCH option
>> may also be used.
>>
>> Signed-off-by: Valentin Longchamp <valentin.longchamp@keymile.com>
>> ---
>>  drivers/mtd/nand/fsl_elbc_nand.c | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> Acked-by: Scott Wood <scottwood@freescale.com>
> 
> Is this for use with http://patchwork.ozlabs.org/patch/168855/ or do you
> have a 2K-page NAND that requires more than 1 bit of ECC correction?
> 

We have a 2K-page NAND but we have found out that we need more than 1 bit of ECC
correction otherwise with some suppliers we sometimes see uncorrectable bitflips.

Valentin

Patch

diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index 0fa776a..a023f97 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -771,8 +771,12 @@  static int fsl_elbc_chip_init(int devnum, u8 *addr)
 		nand->ecc.steps = 1;
 		nand->ecc.strength = 1;
 	} else {
-		/* otherwise fall back to default software ECC */
+		/* otherwise fall back to software ECC */
+#if defined(CONFIG_NAND_ECC_BCH)
+		nand->ecc.mode = NAND_ECC_SOFT_BCH;
+#else
 		nand->ecc.mode = NAND_ECC_SOFT;
+#endif
 	}
 
 	ret = nand_scan_ident(mtd, 1, NULL);