• Boris BREZILLON's avatar
    mtd: nand: gpmi: add proper raw access support · da3bc42c
    Boris BREZILLON authored
    Several MTD users (either in user or kernel space) expect a valid raw
    access support to NAND chip devices.
    This is particularly true for testing tools which are often touching the
    data stored in a NAND chip in raw mode to artificially generate errors.
    
    The GPMI drivers do not implemenent raw access functions, and thus rely on
    default HW_ECC scheme implementation.
    The default implementation consider the data and OOB area as properly
    separated in their respective NAND section, which is not true for the GPMI
    controller.
    In this driver/controller some OOB data are stored at the beginning of the
    NAND data area (these data are called metadata in the driver), then ECC
    bytes are interleaved with data chunk (which is similar to the
    HW_ECC_SYNDROME scheme), and eventually the remaining bytes are used as
    OOB data.
    Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
    Tested-by: default avatarHuang Shijie <shijie8@gmail.com>
    Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
    da3bc42c
gpmi-nand.h 11.2 KB