Skip to content

Commit

Permalink
mtd: nand: make mtk_ecc.c a separated module
Browse files Browse the repository at this point in the history
this code will be used in mediatek snfi spi-mem controller with
pipelined ECC engine.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
  • Loading branch information
981213 authored and intel-lab-lkp committed Apr 3, 2022
1 parent e507188 commit 48656e5
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 4 deletions.
7 changes: 7 additions & 0 deletions drivers/mtd/nand/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ config MTD_NAND_ECC_MXIC
help
This enables support for the hardware ECC engine from Macronix.

config MTD_NAND_ECC_MEDIATEK
bool "Mediatek hardware ECC engine"
depends on HAS_IOMEM
select MTD_NAND_ECC
help
This enables support for the hardware ECC engine from Mediatek.

endmenu

endmenu
1 change: 1 addition & 0 deletions drivers/mtd/nand/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ nandcore-$(CONFIG_MTD_NAND_ECC) += ecc.o
nandcore-$(CONFIG_MTD_NAND_ECC_SW_HAMMING) += ecc-sw-hamming.o
nandcore-$(CONFIG_MTD_NAND_ECC_SW_BCH) += ecc-sw-bch.o
nandcore-$(CONFIG_MTD_NAND_ECC_MXIC) += ecc-mxic.o
nandcore-$(CONFIG_MTD_NAND_ECC_MEDIATEK) += ecc-mtk.o
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/mutex.h>

#include "mtk_ecc.h"
#include <linux/mtd/nand-ecc-mtk.h>

#define ECC_IDLE_MASK BIT(0)
#define ECC_IRQ_EN BIT(0)
Expand Down
1 change: 1 addition & 0 deletions drivers/mtd/nand/raw/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ config MTD_NAND_QCOM

config MTD_NAND_MTK
tristate "MTK NAND controller"
depends on MTD_NAND_ECC_MEDIATEK
depends on ARCH_MEDIATEK || COMPILE_TEST
depends on HAS_IOMEM
help
Expand Down
2 changes: 1 addition & 1 deletion drivers/mtd/nand/raw/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ obj-$(CONFIG_MTD_NAND_SUNXI) += sunxi_nand.o
obj-$(CONFIG_MTD_NAND_HISI504) += hisi504_nand.o
obj-$(CONFIG_MTD_NAND_BRCMNAND) += brcmnand/
obj-$(CONFIG_MTD_NAND_QCOM) += qcom_nandc.o
obj-$(CONFIG_MTD_NAND_MTK) += mtk_ecc.o mtk_nand.o
obj-$(CONFIG_MTD_NAND_MTK) += mtk_nand.o
obj-$(CONFIG_MTD_NAND_MXIC) += mxic_nand.o
obj-$(CONFIG_MTD_NAND_TEGRA) += tegra_nand.o
obj-$(CONFIG_MTD_NAND_STM32_FMC2) += stm32_fmc2_nand.o
Expand Down
2 changes: 1 addition & 1 deletion drivers/mtd/nand/raw/mtk_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include <linux/iopoll.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include "mtk_ecc.h"
#include <linux/mtd/nand-ecc-mtk.h>

/* NAND controller register definition */
#define NFI_CNFG (0x00)
Expand Down
File renamed without changes.

0 comments on commit 48656e5

Please sign in to comment.