From: Gerlando Falauto Date: Tue, 15 Jan 2013 22:34:28 +0000 (+0000) Subject: kirkwood_nand: allow usage of NAND_ECC_SOFT_BCH X-Git-Tag: v2013.04-rc3~1^2~16 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7070b550bee9341bcb53ceda15f9e0a58df88140;p=oweals%2Fu-boot.git 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 Signed-off-by: Holger Brunck cc: Valentin Longchamp cc: Prafulla Wadaskar Acked-by: Prafulla Wadaskar Acked-by: Scott Wood --- diff --git a/drivers/mtd/nand/kirkwood_nand.c b/drivers/mtd/nand/kirkwood_nand.c index bdab5aa795..0a99a10de1 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;