From: Xiangsheng Hou <xiangsheng.hou@mediatek.com> To: <miquel.raynal@bootlin.com>, <broonie@kernel.org> Cc: <xiangsheng.hou@mediatek.com>, <benliang.zhao@mediatek.com>, <dandan.he@mediatek.com>, <guochun.mao@mediatek.com>, <bin.zhang@mediatek.com>, <info@bootlin.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: [RFC,v1 0/4] Add a driver for Mediatek SPI Nand controller Date: Mon, 27 Sep 2021 13:36:25 +0800 [thread overview] Message-ID: <20210927053629.17847-1-xiangsheng.hou@mediatek.com> (raw) Add a driver for Mediatek SPI Nand controller Mediatek SPI Nand controller cosists of two parts: on-host HW ECC and snfi(stand for spi nand flash interface). They can cowork with high performance which called ECC nfi mode. The nfi stand for nand flash interfacei(snfi a one part of nfi) which can support SPI Nand flash and raw nand flash. However, the snfi driver in spi subsytem need to be aware of nand parameter(page/spare size) and ecc status(enable/disable) when work at ECC nfi mode. The snfi driver in spi subsystem seems difficult to know these. Therefore, consider two ways to let snfi can get these information. The RFC patch send to review whether they are suitable and which solution maybe better. RFC patch v1: Add nfi register base at bch(ecc) dts node and config nand parameter and ecc status into nfi registers in ecc driver, then parse these information at snfi driver to use. RFC patch v2: Export some function in HW ECC driver and snfi driver. In HW ECC driver, export function include get nand page/spare size, HW ECC status(enable/disable) and fdm(oob free per sector in ooblayout) size. In snfi driver need export empty page status which the nfi can be aware when in ECC nfi mode(the spim framework can not return this information). This series patch is the v1 solution, and only take mt7622 board for dts node example. Xiangsheng Hou (4): mtd: ecc: move mediatek HW ECC driver mtd: ecc: realize Mediatek HW ECC driver spi: add Mediatek SPI Nand controller driver arm64: dts: add snfi node for spi nand arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 16 + arch/arm64/boot/dts/mediatek/mt7622.dtsi | 15 +- drivers/mtd/nand/Kconfig | 9 + drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/core.c | 2 +- drivers/mtd/nand/ecc.c | 19 + drivers/mtd/nand/{raw => }/mtk_ecc.c | 321 ++++- drivers/mtd/nand/raw/Kconfig | 1 + drivers/mtd/nand/raw/Makefile | 2 +- drivers/mtd/nand/raw/mtk_nand.c | 2 +- drivers/spi/Kconfig | 11 + drivers/spi/Makefile | 1 + drivers/spi/spi-mtk-snfi.c | 1043 +++++++++++++++++ .../nand/raw => include/linux/mtd}/mtk_ecc.h | 0 include/linux/mtd/nand.h | 12 + 15 files changed, 1450 insertions(+), 5 deletions(-) rename drivers/mtd/nand/{raw => }/mtk_ecc.c (63%) create mode 100644 drivers/spi/spi-mtk-snfi.c rename {drivers/mtd/nand/raw => include/linux/mtd}/mtk_ecc.h (100%) -- 2.25.1 _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek
WARNING: multiple messages have this Message-ID (diff)
From: Xiangsheng Hou <xiangsheng.hou@mediatek.com> To: <miquel.raynal@bootlin.com>, <broonie@kernel.org> Cc: <xiangsheng.hou@mediatek.com>, <benliang.zhao@mediatek.com>, <dandan.he@mediatek.com>, <guochun.mao@mediatek.com>, <bin.zhang@mediatek.com>, <info@bootlin.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: [RFC,v1 0/4] Add a driver for Mediatek SPI Nand controller Date: Mon, 27 Sep 2021 13:36:25 +0800 [thread overview] Message-ID: <20210927053629.17847-1-xiangsheng.hou@mediatek.com> (raw) Add a driver for Mediatek SPI Nand controller Mediatek SPI Nand controller cosists of two parts: on-host HW ECC and snfi(stand for spi nand flash interface). They can cowork with high performance which called ECC nfi mode. The nfi stand for nand flash interfacei(snfi a one part of nfi) which can support SPI Nand flash and raw nand flash. However, the snfi driver in spi subsytem need to be aware of nand parameter(page/spare size) and ecc status(enable/disable) when work at ECC nfi mode. The snfi driver in spi subsystem seems difficult to know these. Therefore, consider two ways to let snfi can get these information. The RFC patch send to review whether they are suitable and which solution maybe better. RFC patch v1: Add nfi register base at bch(ecc) dts node and config nand parameter and ecc status into nfi registers in ecc driver, then parse these information at snfi driver to use. RFC patch v2: Export some function in HW ECC driver and snfi driver. In HW ECC driver, export function include get nand page/spare size, HW ECC status(enable/disable) and fdm(oob free per sector in ooblayout) size. In snfi driver need export empty page status which the nfi can be aware when in ECC nfi mode(the spim framework can not return this information). This series patch is the v1 solution, and only take mt7622 board for dts node example. Xiangsheng Hou (4): mtd: ecc: move mediatek HW ECC driver mtd: ecc: realize Mediatek HW ECC driver spi: add Mediatek SPI Nand controller driver arm64: dts: add snfi node for spi nand arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts | 16 + arch/arm64/boot/dts/mediatek/mt7622.dtsi | 15 +- drivers/mtd/nand/Kconfig | 9 + drivers/mtd/nand/Makefile | 1 + drivers/mtd/nand/core.c | 2 +- drivers/mtd/nand/ecc.c | 19 + drivers/mtd/nand/{raw => }/mtk_ecc.c | 321 ++++- drivers/mtd/nand/raw/Kconfig | 1 + drivers/mtd/nand/raw/Makefile | 2 +- drivers/mtd/nand/raw/mtk_nand.c | 2 +- drivers/spi/Kconfig | 11 + drivers/spi/Makefile | 1 + drivers/spi/spi-mtk-snfi.c | 1043 +++++++++++++++++ .../nand/raw => include/linux/mtd}/mtk_ecc.h | 0 include/linux/mtd/nand.h | 12 + 15 files changed, 1450 insertions(+), 5 deletions(-) rename drivers/mtd/nand/{raw => }/mtk_ecc.c (63%) create mode 100644 drivers/spi/spi-mtk-snfi.c rename {drivers/mtd/nand/raw => include/linux/mtd}/mtk_ecc.h (100%) -- 2.25.1 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/
next reply other threads:[~2021-09-27 5:37 UTC|newest] Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-09-27 5:36 Xiangsheng Hou [this message] 2021-09-27 5:36 ` [RFC,v1 0/4] Add a driver for Mediatek SPI Nand controller Xiangsheng Hou 2021-09-27 5:36 ` [RFC,v1 1/4] mtd: ecc: move mediatek HW ECC driver Xiangsheng Hou 2021-09-27 5:36 ` Xiangsheng Hou 2021-09-27 5:36 ` [RFC,v1 2/4] mtd: ecc: realize Mediatek " Xiangsheng Hou 2021-09-27 5:36 ` Xiangsheng Hou 2021-09-27 5:36 ` [RFC,v1 3/4] spi: add Mediatek SPI Nand controller driver Xiangsheng Hou 2021-09-27 5:36 ` Xiangsheng Hou 2021-09-27 5:36 ` [RFC,v1 4/4] arm64: dts: add snfi node for spi nand Xiangsheng Hou 2021-09-27 5:36 ` Xiangsheng Hou 2021-10-08 9:20 ` [RFC,v1 0/4] Add a driver for Mediatek SPI Nand controller Miquel Raynal 2021-10-08 9:20 ` Miquel Raynal 2021-10-11 11:31 ` xiangsheng.hou 2021-10-11 11:31 ` xiangsheng.hou 2021-10-11 14:31 ` Miquel Raynal 2021-10-11 14:31 ` Miquel Raynal
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=20210927053629.17847-1-xiangsheng.hou@mediatek.com \ --to=xiangsheng.hou@mediatek.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=info@bootlin.com \ --cc=linux-mediatek@lists.infradead.org \ --cc=linux-mtd@lists.infradead.org \ --cc=mao.zhong@mediatek.com \ --cc=miquel.raynal@bootlin.com \ --cc=rdlee@amazon.com \ --cc=sanny.chen@mediatek.com \ --cc=srv_heupstream@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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.