mtd: nand: omap: add support for BCH16_ECC - NAND driver updates
authorpekon gupta <pekon@ti.com>
Mon, 24 Mar 2014 11:20:05 +0000 (16:50 +0530)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 21 May 2014 00:52:15 +0000 (17:52 -0700)
commit9748fff96484cfc8bb382ef1436823aefe065c9c
treed036ed4f1f6b0cd564fbf7276201d4e89e60413a
parent2be589e4b28457f148640dc6addf6da24af64b7f
mtd: nand: omap: add support for BCH16_ECC - NAND driver updates

This patch add support for BCH16 ecc-scheme in OMAP NAND driver, by extending
following functions:
 - omap_enable_hwecc (nand_chip->ecc.hwctl): configure GPMC controller
 - omap_calculate_ecc_bch (nand_chip->ecc.calculate): fetch ECC signature from GPMC controller
 - omap_elm_correct_data (nand_chip->ecc.correct): detect and correct ECC errors using ELM

(a) BCH16 ecc-scheme can detect and correct 16 bit-flips per 512Bytes of data.
(b) BCH16 ecc-scheme generates 26-bytes of ECC syndrome / 512B.
Due to (b) this scheme can only be used with NAND devices which have enough
OOB to satisfy the relation: "OOBsize per page >= 26 * (page-size / 512)"

Signed-off-by: Pekon Gupta <pekon@ti.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/omap2.c