public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Xiangsheng Hou <xiangsheng.hou@mediatek.com>
Cc: <broonie@kernel.org>, <benliang.zhao@mediatek.com>,
	<dandan.he@mediatek.com>, <guochun.mao@mediatek.com>,
	<bin.zhang@mediatek.com>, <sanny.chen@mediatek.com>,
	<mao.zhong@mediatek.com>, <yingjoe.chen@mediatek.com>,
	<donghunt@amazon.com>, <rdlee@amazon.com>,
	<linux-mtd@lists.infradead.org>,
	<linux-mediatek@lists.infradead.org>,
	<srv_heupstream@mediatek.com>
Subject: Re: [RFC,v3 1/5] mtd: ecc: move mediatek HW ECC driver
Date: Tue, 9 Nov 2021 12:22:15 +0100	[thread overview]
Message-ID: <20211109122215.1764bd4a@xps13> (raw)
In-Reply-To: <20211022024021.14665-2-xiangsheng.hou@mediatek.com>

Hi Xiangsheng,

xiangsheng.hou@mediatek.com wrote on Fri, 22 Oct 2021 10:40:17 +0800:

> Move Mediatek HW ECC source driver to mtd nand folder and the header
> file to include linux mtd folder.
> The HW ECC driver can be used by Mediatek raw nand and spi nand
> controller.
> 
> Signed-off-by: Xiangsheng Hou <xiangsheng.hou@mediatek.com>
> ---
>  drivers/mtd/nand/Kconfig                              | 9 +++++++++
>  drivers/mtd/nand/Makefile                             | 1 +
>  drivers/mtd/nand/{raw => }/mtk_ecc.c                  | 2 +-
>  drivers/mtd/nand/raw/Kconfig                          | 1 +
>  drivers/mtd/nand/raw/Makefile                         | 2 +-
>  drivers/mtd/nand/raw/mtk_nand.c                       | 2 +-
>  {drivers/mtd/nand/raw => include/linux/mtd}/mtk_ecc.h | 0
>  7 files changed, 14 insertions(+), 3 deletions(-)
>  rename drivers/mtd/nand/{raw => }/mtk_ecc.c (99%)
>  rename {drivers/mtd/nand/raw => include/linux/mtd}/mtk_ecc.h (100%)
> 
> diff --git a/drivers/mtd/nand/Kconfig b/drivers/mtd/nand/Kconfig
> index b40455234cbd..e657823329d2 100644
> --- a/drivers/mtd/nand/Kconfig
> +++ b/drivers/mtd/nand/Kconfig
> @@ -46,6 +46,15 @@ config MTD_NAND_ECC_SW_BCH
>  	  ECC codes. They are used with NAND devices requiring more than 1 bit
>  	  of error correction.
>  
> +config MTD_NAND_ECC_MTK
> +	bool "Mediatek hardware ECC engine"
> +	select MTD_NAND_ECC
> +	help
> +	  This enables support for Mediatek hardware ECC engine which
> +	  used for error correction. This correction strength depends
> +	  on different project. The ECC engine can be used with Mediatek
> +	  raw nand and spi nand controller driver.
> +
>  endmenu
>  
>  endmenu
> diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
> index 1c0b46960eb1..66d1741fe7ff 100644
> --- a/drivers/mtd/nand/Makefile
> +++ b/drivers/mtd/nand/Makefile
> @@ -10,3 +10,4 @@ obj-y	+= spi/
>  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_MTK) += mtk_ecc.o

Please follow the current naming: ecc-mtk.c and ecc-mtk.o

> diff --git a/drivers/mtd/nand/raw/mtk_ecc.c b/drivers/mtd/nand/mtk_ecc.c
> similarity index 99%
> rename from drivers/mtd/nand/raw/mtk_ecc.c
> rename to drivers/mtd/nand/mtk_ecc.c
> index c437d97debb8..ce0f8b491e5d 100644
> --- a/drivers/mtd/nand/raw/mtk_ecc.c
> +++ b/drivers/mtd/nand/mtk_ecc.c
> @@ -16,7 +16,7 @@
>  #include <linux/of_platform.h>
>  #include <linux/mutex.h>
>  
> -#include "mtk_ecc.h"
> +#include <linux/mtd/mtk_ecc.h>
>  
>  #define ECC_IDLE_MASK		BIT(0)
>  #define ECC_IRQ_EN		BIT(0)
> diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
> index 67b7cb67c030..c90bc166034b 100644
> --- a/drivers/mtd/nand/raw/Kconfig
> +++ b/drivers/mtd/nand/raw/Kconfig
> @@ -362,6 +362,7 @@ config MTD_NAND_MTK
>  	tristate "MTK NAND controller"
>  	depends on ARCH_MEDIATEK || COMPILE_TEST
>  	depends on HAS_IOMEM
> +	select MTD_NAND_ECC_MTK
>  	help
>  	  Enables support for NAND controller on MTK SoCs.
>  	  This controller is found on mt27xx, mt81xx, mt65xx SoCs.
> diff --git a/drivers/mtd/nand/raw/Makefile b/drivers/mtd/nand/raw/Makefile
> index 2f97958c3a33..49d3946c166b 100644
> --- a/drivers/mtd/nand/raw/Makefile
> +++ b/drivers/mtd/nand/raw/Makefile
> @@ -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
> diff --git a/drivers/mtd/nand/raw/mtk_nand.c b/drivers/mtd/nand/raw/mtk_nand.c
> index 5c5c92132287..7d8a6b35c102 100644
> --- a/drivers/mtd/nand/raw/mtk_nand.c
> +++ b/drivers/mtd/nand/raw/mtk_nand.c
> @@ -17,7 +17,7 @@
>  #include <linux/iopoll.h>
>  #include <linux/of.h>
>  #include <linux/of_device.h>
> -#include "mtk_ecc.h"
> +#include <linux/mtd/mtk_ecc.h>
>  
>  /* NAND controller register definition */
>  #define NFI_CNFG		(0x00)
> diff --git a/drivers/mtd/nand/raw/mtk_ecc.h b/include/linux/mtd/mtk_ecc.h
> similarity index 100%
> rename from drivers/mtd/nand/raw/mtk_ecc.h
> rename to include/linux/mtd/mtk_ecc.h


Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2021-11-09 11:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-22  2:40 [RFC,v3 0/5] Add driver for Mediatek SPI Nand and HW ECC controller Xiangsheng Hou
2021-10-22  2:40 ` [RFC,v3 1/5] mtd: ecc: move mediatek HW ECC driver Xiangsheng Hou
2021-11-09 11:22   ` Miquel Raynal [this message]
2021-10-22  2:40 ` [RFC,v3 2/5] mtd: ecc: realize Mediatek " Xiangsheng Hou
2021-11-09 12:18   ` Miquel Raynal
2021-11-12  8:40     ` xiangsheng.hou
2021-11-22  8:57       ` Miquel Raynal
2021-10-22  2:40 ` [RFC,v3 3/5] spi: add Mediatek SPI Nand controller driver Xiangsheng Hou
2021-11-09 11:46   ` Miquel Raynal
2021-11-12  8:40     ` xiangsheng.hou
2021-11-22  8:53       ` Miquel Raynal
2021-10-22  2:40 ` [RFC,v3 4/5] arm64: dts: add snfi node for spi nand Xiangsheng Hou
2021-11-09 11:35   ` Miquel Raynal
2021-10-22  2:40 ` [RFC, v3 5/5] mtd: spinand: skip set/get oob data bytes when interleaved case Xiangsheng Hou
2021-11-09 12:05   ` [RFC,v3 " Miquel Raynal
2021-11-12  8:33     ` xiangsheng.hou
2021-11-22  9:01       ` Miquel Raynal
2021-11-26  8:51         ` xiangsheng.hou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211109122215.1764bd4a@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=benliang.zhao@mediatek.com \
    --cc=bin.zhang@mediatek.com \
    --cc=broonie@kernel.org \
    --cc=dandan.he@mediatek.com \
    --cc=donghunt@amazon.com \
    --cc=guochun.mao@mediatek.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mao.zhong@mediatek.com \
    --cc=rdlee@amazon.com \
    --cc=sanny.chen@mediatek.com \
    --cc=srv_heupstream@mediatek.com \
    --cc=xiangsheng.hou@mediatek.com \
    --cc=yingjoe.chen@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox