Comments

chip->ecc.calculate() is used for calculating and fetching of ECC syndrome by
processing the data passed during Read/Write accesses.
All H/W based ECC schemes supported in omap2-nand driver use GPMC controller
to calculate ECC syndrome. But each BCHx_ECC scheme implements its own function
to process and fetch ECC syndrom from GPMC controller.
This patch tries to merges the common code for different BCHx_ECC schemes into
single omap_calculate_ecc_bch(), And adds schemes specific post-possessing
after fetching ECC-syndrome. This removes redundant code and adds scalability
for future ECC-schemes. This patch:
- [un-touched] omap_calculate_ecc(): Used for HAM1_ECC
- [merged] omap3_calculate_ecc_bch4(): Used for BCH4_HW_DETECTION_SW
- [merged] omap3_calculate_ecc_bch8(): Used for BCH8_HW_DETECTION_SW
- [merged] omap3_calculate_ecc_bch(): Used for BCH4_HW and BCH8_HW
- [new] omap_calculate_ecc_bch(): Now used for all BCHx_ECC
Signed-off-by: Pekon Gupta <pekon@ti.com>
---
drivers/mtd/nand/omap2.c | 249 ++++++++++++++++++-----------------------------
1 file changed, 95 insertions(+), 154 deletions(-)