Skip to content
  • Ivan Djelic's avatar
    ARM: OMAP3: gpmc: add BCH ecc api and modes · 8d602cf5
    Ivan Djelic authored
    
    
    This patch adds a simple BCH ecc computation api, similar to the
    existing Hamming ecc api. It is intended to be used by the MTD layer.
    It implements the following features:
    
    - support 4-bit and 8-bit ecc computation
    - do not protect user bytes in spare area, only data area is protected
    - ecc for an erased NAND page (0xFFs) is also a sequence of 0xFFs
    
    This last feature is obtained by adding a constant polynomial to
    the hardware computed ecc. It allows to correct bitflips in blank pages
    and is extremely useful to support filesystems such as UBIFS, which expect
    erased pages to contain only 0xFFs.
    
    This api has been tested on an OMAP3630 board.
    
    Artem: The OMAP maintainer Tony Lindgren gave us his blessing for merging
    this patch via the MTD tree.
    
    Signed-off-by: default avatarIvan Djelic <ivan.djelic@parrot.com>
    Acked-by: default avatarTony Lindgren <tony@atomide.com>
    Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
    Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
    8d602cf5