Skip to content

Commit 4fd62f1

Browse files
981213miquelraynal
authored andcommitted
mtd: nand: make mtk_ecc.c a separated module
this code will be used in mediatek snfi spi-mem controller with pipelined ECC engine. Signed-off-by: Chuanhong Guo <gch981213@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20220424032527.673605-2-gch981213@gmail.com
1 parent 3123109 commit 4fd62f1

7 files changed

Lines changed: 12 additions & 4 deletions

File tree

drivers/mtd/nand/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
5663
endmenu
5764

5865
endmenu

drivers/mtd/nand/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
nandcore-objs := core.o bbt.o
44
obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o
5+
obj-$(CONFIG_MTD_NAND_ECC_MEDIATEK) += ecc-mtk.o
56

67
obj-y += onenand/
78
obj-y += raw/
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
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)

drivers/mtd/nand/raw/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ config MTD_NAND_QCOM
374374

375375
config 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

drivers/mtd/nand/raw/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ obj-$(CONFIG_MTD_NAND_SUNXI) += sunxi_nand.o
4848
obj-$(CONFIG_MTD_NAND_HISI504) += hisi504_nand.o
4949
obj-$(CONFIG_MTD_NAND_BRCMNAND) += brcmnand/
5050
obj-$(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
5252
obj-$(CONFIG_MTD_NAND_MXIC) += mxic_nand.o
5353
obj-$(CONFIG_MTD_NAND_TEGRA) += tegra_nand.o
5454
obj-$(CONFIG_MTD_NAND_STM32_FMC2) += stm32_fmc2_nand.o

drivers/mtd/nand/raw/mtk_nand.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
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)

0 commit comments

Comments
 (0)