File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,13 @@ config MTD_NAND_ECC_MXIC
5353 help
5454 This enables support for the hardware ECC engine from Macronix.
5555
56+ config MTD_NAND_ECC_MEDIATEK
57+ tristate "Mediatek hardware ECC engine"
58+ depends on HAS_IOMEM
59+ select MTD_NAND_ECC
60+ help
61+ This enables support for the hardware ECC engine from Mediatek.
62+
5663endmenu
5764
5865endmenu
Original file line number Diff line number Diff line change 22
33nandcore-objs := core.o bbt.o
44obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o
5+ obj-$(CONFIG_MTD_NAND_ECC_MEDIATEK) += ecc-mtk.o
56
67obj-y += onenand/
78obj-y += raw/
Original file line number Diff line number Diff line change 1515#include <linux/of.h>
1616#include <linux/of_platform.h>
1717#include <linux/mutex.h>
18-
19- #include "mtk_ecc.h"
18+ #include <linux/mtd/nand-ecc-mtk.h>
2019
2120#define ECC_IDLE_MASK BIT(0)
2221#define ECC_IRQ_EN BIT(0)
@@ -279,7 +278,10 @@ struct mtk_ecc *of_mtk_ecc_get(struct device_node *of_node)
279278 struct mtk_ecc * ecc = NULL ;
280279 struct device_node * np ;
281280
282- np = of_parse_phandle (of_node , "ecc-engine" , 0 );
281+ np = of_parse_phandle (of_node , "nand-ecc-engine" , 0 );
282+ /* for backward compatibility */
283+ if (!np )
284+ np = of_parse_phandle (of_node , "ecc-engine" , 0 );
283285 if (np ) {
284286 ecc = mtk_ecc_get (np );
285287 of_node_put (np );
Original file line number Diff line number Diff line change @@ -374,6 +374,7 @@ config MTD_NAND_QCOM
374374
375375config MTD_NAND_MTK
376376 tristate "MTK NAND controller"
377+ depends on MTD_NAND_ECC_MEDIATEK
377378 depends on ARCH_MEDIATEK || COMPILE_TEST
378379 depends on HAS_IOMEM
379380 help
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ obj-$(CONFIG_MTD_NAND_SUNXI) += sunxi_nand.o
4848obj-$(CONFIG_MTD_NAND_HISI504) += hisi504_nand.o
4949obj-$(CONFIG_MTD_NAND_BRCMNAND) += brcmnand/
5050obj-$(CONFIG_MTD_NAND_QCOM) += qcom_nandc.o
51- obj-$(CONFIG_MTD_NAND_MTK) += mtk_ecc.o mtk_nand.o
51+ obj-$(CONFIG_MTD_NAND_MTK) += mtk_nand.o
5252obj-$(CONFIG_MTD_NAND_MXIC) += mxic_nand.o
5353obj-$(CONFIG_MTD_NAND_TEGRA) += tegra_nand.o
5454obj-$(CONFIG_MTD_NAND_STM32_FMC2) += stm32_fmc2_nand.o
Original file line number Diff line number Diff line change 1717#include <linux/iopoll.h>
1818#include <linux/of.h>
1919#include <linux/of_device.h>
20- #include "mtk_ecc.h"
20+ #include <linux/mtd/nand-ecc-mtk.h>
2121
2222/* NAND controller register definition */
2323#define NFI_CNFG (0x00)
File renamed without changes.
You can’t perform that action at this time.
0 commit comments