]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: OMAP3: gpmc: add BCH ecc api and modes
authorIvan Djelic <ivan.djelic@parrot.com>
Thu, 26 Apr 2012 12:17:49 +0000 (14:17 +0200)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 14 May 2012 04:25:42 +0000 (23:25 -0500)
commitbe998b2244dd5b6b502da70252890501f790bce8
tree18636ef99650881a6f0473780ab22fa4f58f4f1d
parentf7a1eeb8d02876cbdd6fb99850947dd9f18bee2a
ARM: OMAP3: gpmc: add BCH ecc api and modes

This patch adds a simple BCH ecc computation api, similar to the
existing Hamming ecc api. It is intended to be used by the MTD layer.
It implements the following features:

- support 4-bit and 8-bit ecc computation
- do not protect user bytes in spare area, only data area is protected
- ecc for an erased NAND page (0xFFs) is also a sequence of 0xFFs

This last feature is obtained by adding a constant polynomial to
the hardware computed ecc. It allows to correct bitflips in blank pages
and is extremely useful to support filesystems such as UBIFS, which expect
erased pages to contain only 0xFFs.

This api has been tested on an OMAP3630 board.

Artem: The OMAP maintainer Tony Lindgren gave us his blessing for merging
this patch via the MTD tree.

Signed-off-by: Ivan Djelic <ivan.djelic@parrot.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
arch/arm/mach-omap2/gpmc.c
arch/arm/plat-omap/include/plat/gpmc.h