mtd: nand: add software BCH ECC support
authorIvan Djelic <ivan.djelic@parrot.com>
Fri, 11 Mar 2011 10:05:33 +0000 (11:05 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 11 Mar 2011 17:49:08 +0000 (17:49 +0000)
commit193bd40026443835e1b96c79d5efe559d01509ae
tree979bace7cd9806753c95867c6df89fe2de98fc73
parent89d8d32060de17c23f761df74799c7c07b79dd01
mtd: nand: add software BCH ECC support

This patch adds software BCH ECC support to mtd, in order to handle recent
NAND device ecc requirements (4 bits or more).

It does so by adding a new ecc mode (NAND_ECC_SOFT_BCH) for use by board
drivers, and a new Kconfig option to enable BCH support. It relies on the
generic BCH library introduced in a previous patch.

When a board driver uses mode NAND_ECC_SOFT_BCH, it should also set fields
chip->ecc.size and chip->ecc.bytes to select BCH ecc data size and required
error correction capability. See nand_bch_init() documentation for details.

It has been tested on the following platforms using mtd-utils, UBI and
UBIFS: x86 (with nandsim), arm926ejs.

Signed-off-by: Ivan Djelic <ivan.djelic@parrot.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/Kconfig
drivers/mtd/nand/Makefile
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/nand_bch.c [new file with mode: 0644]
include/linux/mtd/nand.h
include/linux/mtd/nand_bch.h [new file with mode: 0644]