• Pekon Gupta's avatar
    mtd: nand: omap: ecc.calculate: refactor omap_calculate_ecc_bch for BCHx_HW ecc-scheme · f5dc06fb
    Pekon Gupta authored
    OMAP NAND driver supports multiple flavours of BCH4 and BCH8 ECC algorithms.
    +------+------------------------------------+---------------+---------------+
    | Algo | ECC scheme                         |ECC calculation|Error detection|
    +------+------------------------------------+---------------+---------------+
    |      |OMAP_ECC_BCH4_CODE_HW_DETECTION_SW  |H/W (GPMC)     |S/W            |
    | BCH4 |OMAP_ECC_BCH4_CODE_HW               |H/W (GPMC)     |H/W (ELM)      |
    +------+------------------------------------+---------------+---------------+
    |      |OMAP_ECC_BCH8_CODE_HW_DETECTION_SW  |H/W (GPMC)     |S/W            |
    | BCH8 |OMAP_ECC_BCH8_CODE_HW               |H/W (GPMC)     |H/W (ELM)      |
    +------+------------------------------------+---------------+---------------+
    
    This patch refactors omap_calculate_ecc_bch() so that
     - separate out ecc-scheme specific code so that common-code can be reused
       between different implementations of same ECC algorithm.
     - new ecc-schemes can be added with ease in future.
    Tested-by: default avatarStefan Roese <sr@denx.de>
    Signed-off-by: default avatarPekon Gupta <pekon@ti.com>
    Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
    f5dc06fb
omap2.c 57.2 KB