mtd: nand: mediatek: add support for different MTK NAND FLASH Controller IP
authorXiaolei Li <xiaolei.li@mediatek.com>
Wed, 31 May 2017 08:26:40 +0000 (16:26 +0800)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Thu, 1 Jun 2017 08:09:37 +0000 (10:09 +0200)
commit7ec4a37c5d71f0a0bfeb1346d4e832a090ca292d
tree3f1a297efbb185dfdb76aefefbd77c304a493f97
parent582212ceb9bcd9ef0808497a8e066c4eef442e19
mtd: nand: mediatek: add support for different MTK NAND FLASH Controller IP

ECC strength and spare size supported may be different among MTK NAND
FLASH Controller IPs.

This patch contains changes as following:
(1) add new struct mtk_nfc_caps to support different spare size.
(2) add new struct mtk_ecc_caps to support different ecc strength.
(3) remove ECC_CNFG_xBIT define, use a for loop to do ecc strength config.
(4) remove PAGEFMT_SPARE_ define, use a for loop to do spare format config.
(5) malloc ecc->eccdata buffer according to max ecc strength of this IP.

Signed-off-by: Xiaolei Li <xiaolei.li@mediatek.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/mtk_ecc.c
drivers/mtd/nand/mtk_ecc.h
drivers/mtd/nand/mtk_nand.c