[U-Boot] [PATCH] MTD: atmel_nand: support for software BCH ECC
Bo Shen
voice.shen at gmail.com
Wed Aug 28 16:54:26 CEST 2013
Add possible to use software BCH ECC for atmel nand driver
Signed-off-by: Bo Shen <voice.shen at gmail.com>
---
drivers/mtd/nand/atmel_nand.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 96aca00..52efbee 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -1177,7 +1177,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
--
1.7.10.4
More information about the U-Boot
mailing list