• Pekon Gupta's avatar
    mtd: nand: omap: ecc.correct: omap_elm_correct_data: fix erased-page detection... · 78f43c53
    Pekon Gupta authored
    mtd: nand: omap: ecc.correct: omap_elm_correct_data: fix erased-page detection for BCHx_HW ECC schemes
    
    As erased-pages do not have ECC stored in their OOB area, so they need to be
    seperated out from programmed-pages, before doing BCH ECC correction.
    
    In current implementation of omap_elm_correct_data() which does ECC correction
    for BCHx ECC schemes, this erased-pages are detected based on specific marker
    byte (reserved as 0x00) in ecc-layout.
    However, this approach has some limitation like;
     1) All ecc-scheme layouts do not have such Reserved byte marker to
        differentiate between erased-page v/s programmed-page. Thus this is a
        customized solution.
     2) Reserved marker byte can itself be subjected to bit-flips causing
        erased-page to be misunderstood as programmed-page.
    
    This patch removes dependency on any marker byte in ecc-layout, instead it
    compares calc_ecc[] with pattern of ECC-of-all(0xff). This implicitely
    means that both 'data + oob == all(0xff).
    Signed-off-by: default avatarPekon Gupta <pekon@ti.com>
    Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
    78f43c53
omap2.c 57 KB