• RogerCC Lin's avatar
    mtd: nand: mtk: Support different MTK NAND flash controller IP · b45ee550
    RogerCC Lin authored
    MT7622 uses an MTK's earlier NAND flash controller IP which support
    different sector size, max spare size per sector and paraity bits...,
    some register's offset and definition also been changed in the NAND
    flash controller, this patch is the preparation to support MT7622
    NAND flash controller.
    
    MT7622 NFC and ECC engine are similar to MT2701's, except below
    differences:
    (1)MT7622 NFC's max sector size(ECC data size) is 512 bytes, and
       MT2701's is 1024, and MT7622's max sector number is 8.
    (2)The parity bit of MT7622 is 13, MT2701 is 14.
    (3)MT7622 ECC supports less ECC strength, max to 16 bit ecc strength.
    (4)MT7622 supports less spare size per sector, max spare size per
       sector is 28 bytes.
    (5)Some register's offset are different, include ECC_ENCIRQ_EN,
       ECC_ENCIRQ_STA, ECC_DECDONE, ECC_DECIRQ_EN and ECC_DECIRQ_STA.
    (6)ENC_MODE of ECC_ENCCNFG register is moved from bit 5-6 to bit 4-5.
    Signed-off-by: default avatarRogerCC Lin <rogercc.lin@mediatek.com>
    Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
    b45ee550
mtk_nand.c 38.6 KB