summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGerlando Falauto <gerlando.falauto@keymile.com>2013-01-15 22:34:28 +0000
committerPrafulla Wadaskar <prafulla@marvell.com>2013-04-12 21:42:01 +0530
commit7070b550bee9341bcb53ceda15f9e0a58df88140 (patch)
tree1b28d99bed7c0d8a7edbdf0efce07cc097166770 /drivers
parentc97b6df1ae92679d67f94c1cfef51323782a506d (diff)
downloadu-boot-imx-7070b550bee9341bcb53ceda15f9e0a58df88140.zip
u-boot-imx-7070b550bee9341bcb53ceda15f9e0a58df88140.tar.gz
u-boot-imx-7070b550bee9341bcb53ceda15f9e0a58df88140.tar.bz2
kirkwood_nand: allow usage of NAND_ECC_SOFT_BCH
If CONFIG_NAND_ECC_BCH is set use 4-bit error correction code instead of the 1-bit error correction code on the NAND device. Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com> Signed-off-by: Holger Brunck <holger.brunck@keymile.com> cc: Valentin Longchamp <valentin.longchamp@keymile.com> cc: Prafulla Wadaskar <prafulla@marvell.com> Acked-by: Prafulla Wadaskar <prafulla@marvell.com> Acked-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/kirkwood_nand.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mtd/nand/kirkwood_nand.c b/drivers/mtd/nand/kirkwood_nand.c
index bdab5aa..0a99a10 100644
--- a/drivers/mtd/nand/kirkwood_nand.c
+++ b/drivers/mtd/nand/kirkwood_nand.c
@@ -74,7 +74,11 @@ void kw_nand_select_chip(struct mtd_info *mtd, int chip)
int board_nand_init(struct nand_chip *nand)
{
nand->options = NAND_COPYBACK | NAND_CACHEPRG | NAND_NO_PADDING;
+#if defined(CONFIG_NAND_ECC_BCH)
+ nand->ecc.mode = NAND_ECC_SOFT_BCH;
+#else
nand->ecc.mode = NAND_ECC_SOFT;
+#endif
nand->cmd_ctrl = kw_nand_hwcontrol;
nand->chip_delay = 40;
nand->select_chip = kw_nand_select_chip;