• P
    mtd: nand: omap: ecc.calculate: refactor omap_calculate_ecc_bch for BCHx_HW ecc-scheme · f5dc06fb
    Pekon Gupta 提交于
    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: NStefan Roese <sr@denx.de>
    Signed-off-by: NPekon Gupta <pekon@ti.com>
    Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
    f5dc06fb
omap2.c 57.2 KB