MTD: atmel_nand: support for software BCH ECC
authorBo Shen <voice.shen@gmail.com>
Wed, 28 Aug 2013 14:54:26 +0000 (14:54 +0000)
committerScott Wood <scottwood@freescale.com>
Wed, 13 Nov 2013 23:20:26 +0000 (17:20 -0600)
Add possible to use software BCH ECC for atmel nand driver

Signed-off-by: Bo Shen <voice.shen@gmail.com>
drivers/mtd/nand/atmel_nand.c

index da83f06e4734d186eb3661f8938bcad039e871a2..10011c6a8f4f20ea6fbc623898bd76befbfa0f6e 100644 (file)
@@ -1178,7 +1178,11 @@ int atmel_nand_chip_init(int devnum, ulong base_addr)
        mtd->priv = nand;
        nand->IO_ADDR_R = nand->IO_ADDR_W = (void  __iomem *)base_addr;
 
+#ifdef CONFIG_NAND_ECC_BCH
+       nand->ecc.mode = NAND_ECC_SOFT_BCH;
+#else
        nand->ecc.mode = NAND_ECC_SOFT;
+#endif
 #ifdef CONFIG_SYS_NAND_DBW_16
        nand->options = NAND_BUSWIDTH_16;
 #endif