Patchwork mtd: fsl_ifc_nand: fix eccstrength for ecc8

login
register
mail settings
Submitter Scott Wood
Date May 28, 2013, 11:45 p.m.
Message ID <20130528234534.GA22340@home.buserror.net>
Download mbox | patch
Permalink /patch/247057/
State New
Headers show

Comments

Scott Wood - May 28, 2013, 11:45 p.m.
Commit 44df4d11b8f573e9efcba94d63e6a1ad148c76d0 ("mtd: nand: fix
incorrect ecc strength values") set eccstrength to 4 for IFC, but it is
8 in one configuration.

Signed-off-by: Scott Wood <scottwood@freescale.com>
---
 drivers/mtd/nand/fsl_ifc_nand.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Mike Dunn - May 29, 2013, 6:14 p.m.
On 05/28/2013 04:45 PM, Scott Wood wrote:
> Commit 44df4d11b8f573e9efcba94d63e6a1ad148c76d0 ("mtd: nand: fix
> incorrect ecc strength values") set eccstrength to 4 for IFC, but it is
> 8 in one configuration.
> 
> Signed-off-by: Scott Wood <scottwood@freescale.com>


Acked-by: Mike Dunn <mikedunn@newsguy.com>

Missed that... Sorry about that Scott.

Thanks,
Mike

Patch

diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c
index f1f7f12..3469e5d 100644
--- a/drivers/mtd/nand/fsl_ifc_nand.c
+++ b/drivers/mtd/nand/fsl_ifc_nand.c
@@ -843,7 +843,6 @@  static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv)
 	/* Hardware generates ECC per 512 Bytes */
 	chip->ecc.size = 512;
 	chip->ecc.bytes = 8;
-	chip->ecc.strength = 4;
 
 	switch (csor & CSOR_NAND_PGS_MASK) {
 	case CSOR_NAND_PGS_512:
@@ -857,11 +856,13 @@  static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv)
 			bbt_mirror_descr.offs = 0;
 		}
 
+		chip->ecc.strength = 4;
 		priv->bufnum_mask = 15;
 		break;
 
 	case CSOR_NAND_PGS_2K:
 		layout = &oob_2048_ecc4;
+		chip->ecc.strength = 4;
 		priv->bufnum_mask = 3;
 		break;
 
@@ -869,8 +870,10 @@  static int fsl_ifc_chip_init(struct fsl_ifc_mtd *priv)
 		if ((csor & CSOR_NAND_ECC_MODE_MASK) ==
 		    CSOR_NAND_ECC_MODE_4) {
 			layout = &oob_4096_ecc4;
+			chip->ecc.strength = 4;
 		} else {
 			layout = &oob_4096_ecc8;
+			chip->ecc.strength = 8;
 			chip->ecc.bytes = 16;
 		}