[U-Boot] [PATCH] arm: omap: nand: setup sw ecc size using default value

Nikita Kiryanov nikita at compulab.co.il
Thu Dec 12 13:01:01 CET 2013


Commit "mtd: nand: omap: enable BCH ECC scheme using ELM for generic
platform" (d016dc42cedbf6102e100fa9ecb58462edfb14f8) changed the way
software ECC is configured, both during boot, and during ecc switch, in a way
that is not backwards compatible with older systems:

Older version of omap_gpmc.c always assigned ecc.size = 0 when configuring
for software ecc, relying on nand_scan_tail() to select a default for ecc.size
(256), while the new version of omap_gpmc.c assigns ecc.size = pagesize,
which is likely to not be 256.

Since 1 bit hamming sw ecc is only meant to be used by legacy devices, revert
to the original behavior.

Cc: Igor Grinberg <grinberg at compulab.co.il>
Cc: Tom Rini <trini at ti.com>
Cc: Scott Wood <scottwood at freescale.com>
Cc: Pekon Gupta <pekon at ti.com>
Signed-off-by: Nikita Kiryanov <nikita at compulab.co.il>
---
 drivers/mtd/nand/omap_gpmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/omap_gpmc.c b/drivers/mtd/nand/omap_gpmc.c
index 23a961c..e61788f 100644
--- a/drivers/mtd/nand/omap_gpmc.c
+++ b/drivers/mtd/nand/omap_gpmc.c
@@ -774,7 +774,7 @@ static int omap_select_ecc_scheme(struct nand_chip *nand,
 		bch_priv.type		= 0;
 		nand->ecc.mode		= NAND_ECC_SOFT;
 		nand->ecc.layout	= NULL;
-		nand->ecc.size		= pagesize;
+		nand->ecc.size		= 0;
 		bch->ecc_scheme		= OMAP_ECC_HAM1_CODE_SW;
 		break;
 
-- 
1.8.1.2



More information about the U-Boot mailing list