linux/drivers/mtd/nand/gpmi-nand
Markus Pargmann bd2e778c9e gpmi-nand: Handle ECC Errors in erased pages
ECC is only calculated for written pages. As erased pages are not
actively written the ECC is always invalid. For this purpose the
Hardware BCH unit is able to check for erased pages and does not raise
an ECC error in this case. This behaviour can be influenced using the
BCH_MODE register which sets the number of allowed bitflips in an erased
page. Unfortunately the unit is not capable of fixing the bitflips in
memory.

To avoid complete software checks for erased pages, we can simply check
buffers with uncorrectable ECC errors because we know that any erased
page with errors is uncorrectable by the BCH unit.

This patch adds the generic nand_check_erased_ecc_chunk() to gpmi-nand
to correct erased pages. To have the valid data in the buffer before
using them, this patch moves the read_page_swap_end() call before the
ECC status checking for-loop.

Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
[Squashed patches by Stefan and Boris to check ECC area]
Tested-by: Stefan Christ <s.christ@phytec.de>
Acked-by: Han xu <han.xu@nxp.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
2016-05-05 23:55:15 +02:00
..
bch-regs.h mtd: gpmi: add gpmi support for imx6sx 2014-05-28 16:02:16 -07:00
gpmi-lib.c mtd: nand: gpmi: use the mtd instance embedded in struct nand_chip 2015-12-18 10:54:41 -08:00
gpmi-nand.c gpmi-nand: Handle ECC Errors in erased pages 2016-05-05 23:55:15 +02:00
gpmi-nand.h mtd: nand: gpmi: use the mtd instance embedded in struct nand_chip 2015-12-18 10:54:41 -08:00
gpmi-regs.h mtd: gpmi: decouple the chip select from the DMA channel 2013-11-06 23:33:01 -08:00
Makefile