Skip to contentSkip to conversation

spi: add support for Mediatek SPI-NAND controller

PATCH Applied Chuanhong Guo 4 participants 14 messages Apr 24, 2022 – Apr 29, 2022

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

v6 cover spi: add support for Mediatek SPI-NAND controller

Mediatek has an extended version of their NAND Flash Interface which has a SPI-NAND mode. In this mode, the controller can perform 1-bit spi-mem ops for up-to 0xa0 bytes and typical SPI-NAND single, dual and quad IO page cache ops with 2-byte address. Additionally, the page cache ops can be performed with ECC and auto data formatting using the ECC engine of the controller.

This patchset implements support of this mode as a separated SPI-MEM driver with pipelined ECC engine.

Changes since v1:
add a blank line between properties in dt binding doc

 rename ecc-engine to nand-ecc-engine for the generic properties

fix warnings/errors from the CI

Changes since v2:
use streamed DMA api to avoid an extra memory copy during read make ECC engine config a per-nand context
take user-requested ECC strength into account

Change since v3:
fix a missed ecc-engine rename in doc from v1

Changes since v4:
fix typo: piplined -> pipelined
fix missing OOB write in snfi driver print page format with dev_dbg instead replace uint*_t copied from vendor driver with u*

Changes since v5:
add missing nfi mode register configuration in probe fix an off-by-one bug in mtk_snand_mac_io

Chuanhong Guo (5):
mtd: nand: make mtk_ecc.c a separated module
spi: add driver for MTK SPI NAND Flash Interface
mtd: nand: mtk-ecc: also parse nand-ecc-engine if available
spi: dt-bindings: add binding doc for spi-mtk-snfi
arm64: dts: mediatek: add mtk-snfi for mt7622

 .../bindings/spi/mediatek,spi-mtk-snfi.yaml   |   88 +
 arch/arm64/boot/dts/mediatek/mt7622.dtsi      |   12 +
 drivers/mtd/nand/Kconfig                      |    7 +
 drivers/mtd/nand/Makefile                     |    1 +
 drivers/mtd/nand/{raw/mtk_ecc.c => ecc-mtk.c} |    8 +-
 drivers/mtd/nand/raw/Kconfig                  |    1 +
 drivers/mtd/nand/raw/Makefile                 |    2 +-
 drivers/mtd/nand/raw/mtk_nand.c               |    2 +-
 drivers/spi/Kconfig                           |   10 +
 drivers/spi/Makefile                          |    1 +
 drivers/spi/spi-mtk-snfi.c                    | 1470 +++++++++++++++++
 .../linux/mtd/nand-ecc-mtk.h                  |    0
 12 files changed, 1597 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/mediatek,spi-mtk-snfi.yaml
 rename drivers/mtd/nand/{raw/mtk_ecc.c => ecc-mtk.c} (98%)
 create mode 100644 drivers/spi/spi-mtk-snfi.c
 rename drivers/mtd/nand/raw/mtk_ecc.h => include/linux/mtd/nand-ecc-mtk.h (100%)
Signature · 1 line
2.35.1
#1 lore raw

PATCH v6 1/5 mtd: nand: make mtk_ecc.c a separated module

this code will be used in mediatek snfi spi-mem controller with pipelined ECC engine.

---

Change since v1:
actually make it a module instead of a part of nandcore.o

Change in v2-v6: None

 drivers/mtd/nand/Kconfig                                   | 7 +++++++
 drivers/mtd/nand/Makefile                                  | 1 +
 drivers/mtd/nand/{raw/mtk_ecc.c => ecc-mtk.c}              | 3 +--
 drivers/mtd/nand/raw/Kconfig                               | 1 +
 drivers/mtd/nand/raw/Makefile                              | 2 +-
 drivers/mtd/nand/raw/mtk_nand.c                            | 2 +-
 .../nand/raw/mtk_ecc.h => include/linux/mtd/nand-ecc-mtk.h | 0
 7 files changed, 12 insertions(+), 4 deletions(-)
 rename drivers/mtd/nand/{raw/mtk_ecc.c => ecc-mtk.c} (99%)
 rename drivers/mtd/nand/raw/mtk_ecc.h => include/linux/mtd/nand-ecc-mtk.h (100%)
drivers/mtd/nand/Kconfig +7 -0
index 9b249826ef93..2f3e02ab72ed 100644
@@ -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
+	tristate "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
drivers/mtd/nand/Makefile +1 -0
index a4e6b7ae0614..19e1291ac4d5 100644
@@ -2,6 +2,7 @@
 
 nandcore-objs := core.o bbt.o
 obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o
+obj-$(CONFIG_MTD_NAND_ECC_MEDIATEK) += ecc-mtk.o
 
 obj-y	+= onenand/
 obj-y	+= raw/
drivers/mtd/nand/ecc-mtk.c renamed from drivers/mtd/nand/raw/mtk_ecc.c +1 -2
similarity index 99%
rename from drivers/mtd/nand/raw/mtk_ecc.c
rename to drivers/mtd/nand/ecc-mtk.c
index 49ab3448b9b1..74ddaa46ba7c 100644
@@ -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)
drivers/mtd/nand/raw/Kconfig +1 -0
index 9b078e78f3fa..8b6d7a515445 100644
@@ -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
drivers/mtd/nand/raw/Makefile +1 -1
index 88a566513c56..fa1d00120310 100644
@@ -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
drivers/mtd/nand/raw/mtk_nand.c +1 -1
index 66f04c693c87..d540454cbbdf 100644
@@ -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)
include/linux/mtd/nand-ecc-mtk.h renamed from drivers/mtd/nand/raw/mtk_ecc.h +0 -0
similarity index 100%
rename from drivers/mtd/nand/raw/mtk_ecc.h
rename to include/linux/mtd/nand-ecc-mtk.h
Signature · 1 line
2.35.1
#2 lore raw

PATCH v6 2/5 spi: add driver for MTK SPI NAND Flash Interface

In reply to Chuanhong Guo

This driver implements support for the SPI-NAND mode of MTK NAND Flash Interface as a SPI-MEM controller with pipelined ECC capability.

---
Change since v1:
fix CI warnings

Changes since v2:
use streamed DMA api to avoid an extra memory copy during read make ECC engine config a per-nand context
take user-requested ECC strength into account

Change since v3: none
Changes since v4:
fix missing OOB write
print page format with dev_dbg
replace uint*_t copied from vendor driver with u*

Changes since v5:
add missing nfi mode register configuration in probe fix an off-by-one bug in mtk_snand_mac_io

 drivers/spi/Kconfig        |   10 +
 drivers/spi/Makefile       |    1 +
 drivers/spi/spi-mtk-snfi.c | 1470 ++++++++++++++++++++++++++++++++++++
 3 files changed, 1481 insertions(+)
 create mode 100644 drivers/spi/spi-mtk-snfi.c
drivers/spi/Kconfig +10 -0
index 6c28ca232444..83c3c2b57a22 100644
@@ -590,6 +590,16 @@ config SPI_MTK_NOR
 	  SPI interface as well as several SPI NOR specific instructions
 	  via SPI MEM interface.
 
+config SPI_MTK_SNFI
+	tristate "MediaTek SPI NAND Flash Interface"
+	depends on ARCH_MEDIATEK || COMPILE_TEST
+	depends on MTD_NAND_ECC_MEDIATEK
+	help
+	  This enables support for SPI-NAND mode on the MediaTek NAND
+	  Flash Interface found on MediaTek ARM SoCs. This controller
+	  is implemented as a SPI-MEM controller with pipelined ECC
+	  capcability.
+
 config SPI_NPCM_FIU
 	tristate "Nuvoton NPCM FLASH Interface Unit"
 	depends on ARCH_NPCM || COMPILE_TEST
drivers/spi/Makefile +1 -0
index 3aa28ed3f761..51541ff17e67 100644
@@ -76,6 +76,7 @@ obj-$(CONFIG_SPI_MPC52xx)		+= spi-mpc52xx.o
 obj-$(CONFIG_SPI_MT65XX)                += spi-mt65xx.o
 obj-$(CONFIG_SPI_MT7621)		+= spi-mt7621.o
 obj-$(CONFIG_SPI_MTK_NOR)		+= spi-mtk-nor.o
+obj-$(CONFIG_SPI_MTK_SNFI)		+= spi-mtk-snfi.o
 obj-$(CONFIG_SPI_MXIC)			+= spi-mxic.o
 obj-$(CONFIG_SPI_MXS)			+= spi-mxs.o
 obj-$(CONFIG_SPI_NPCM_FIU)		+= spi-npcm-fiu.o
drivers/spi/spi-mtk-snfi.c new file +1470 -0

1,470 lines not on this page · raw message

Signature · 1 line
2.35.1
#3 lore raw

PATCH v6 3/5 mtd: nand: mtk-ecc: also parse nand-ecc-engine if available

In reply to Chuanhong Guo

The recently added ECC engine support introduced a generic property named nand-ecc-engine for ecc engine phandle. This patch adds support for this new property.

---
Change since v1:
new patch
Change in v2-v6: None

 drivers/mtd/nand/ecc-mtk.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/mtd/nand/ecc-mtk.c +4 -1
index 74ddaa46ba7c..9f9b201fe706 100644
@@ -279,7 +279,10 @@ struct mtk_ecc *of_mtk_ecc_get(struct device_node *of_node)
 	struct mtk_ecc *ecc = NULL;
 	struct device_node *np;
 
-	np = of_parse_phandle(of_node, "ecc-engine", 0);
+	np = of_parse_phandle(of_node, "nand-ecc-engine", 0);
+	/* for backward compatibility */
+	if (!np)
+		np = of_parse_phandle(of_node, "ecc-engine", 0);
 	if (np) {
 		ecc = mtk_ecc_get(np);
 		of_node_put(np);
Signature · 1 line
2.35.1
#4 lore raw

PATCH v6 4/5 spi: dt-bindings: add binding doc for spi-mtk-snfi

In reply to Chuanhong Guo

Add device-tree binding documentation for Mediatek SPI-NAND Flash Interface.

---
Changes since v1:
1. add a blank line between properties in dt binding doc
2. rename ecc-engine to nand-ecc-engine for the generic properties

Change since v2: none
Change since v3: fix a missing rename in v1
Change since v4: fix typo: piplined -> pipelined
Change since v5: none

 .../bindings/spi/mediatek,spi-mtk-snfi.yaml   | 88 +++++++++++++++++++
 1 file changed, 88 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/mediatek,spi-mtk-snfi.yaml
Documentation/devicetree/bindings/spi/mediatek,spi-mtk-snfi.yaml new file +88 -0
new file mode 100644
index 000000000000..6e6e02c91780
@@ -0,0 +1,88 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/mediatek,spi-mtk-snfi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: SPI-NAND flash controller for MediaTek ARM SoCs
+
+maintainers:
+  - Chuanhong Guo <[email protected]>
+
+description: |
+  The Mediatek SPI-NAND flash controller is an extended version of
+  the Mediatek NAND flash controller. It can perform standard SPI
+  instructions with one continuous write and one read for up-to 0xa0
+  bytes. It also supports typical SPI-NAND page cache operations
+  in single, dual or quad IO mode with pipelined ECC encoding/decoding
+  using the accompanying ECC engine. There should be only one spi
+  slave device following generic spi bindings.
+
+allOf:
+  - $ref: /schemas/spi/spi-controller.yaml#
+
+properties:
+  compatible:
+    enum:
+      - mediatek,mt7622-snand
+      - mediatek,mt7629-snand
+
+  reg:
+    items:
+      - description: core registers
+
+  interrupts:
+    items:
+      - description: NFI interrupt
+
+  clocks:
+    items:
+      - description: clock used for the controller
+      - description: clock used for the SPI bus
+
+  clock-names:
+    items:
+      - const: nfi_clk
+      - const: pad_clk
+
+  nand-ecc-engine:
+    description: device-tree node of the accompanying ECC engine.
+    $ref: /schemas/types.yaml#/definitions/phandle
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - nand-ecc-engine
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/clock/mt7622-clk.h>
+    soc {
+      #address-cells = <2>;
+      #size-cells = <2>;
+      snfi: spi@1100d000 {
+        compatible = "mediatek,mt7622-snand";
+        reg = <0 0x1100d000 0 0x1000>;
+        interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_LOW>;
+        clocks = <&pericfg CLK_PERI_NFI_PD>, <&pericfg CLK_PERI_SNFI_PD>;
+        clock-names = "nfi_clk", "pad_clk";
+        nand-ecc-engine = <&bch>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        flash@0 {
+          compatible = "spi-nand";
+          reg = <0>;
+          spi-tx-bus-width = <4>;
+          spi-rx-bus-width = <4>;
+          nand-ecc-engine = <&snfi>;
+        };
+      };
+    };
Signature · 1 line
2.35.1
#5 lore raw

PATCH v6 5/5 arm64: dts: mediatek: add mtk-snfi for mt7622

In reply to Chuanhong Guo

This patch adds a device-tree node for the MTK SPI-NAND Flash Interface for MT7622 device tree.

---
Changes since v1:
1. use the newly introduced nand-ecc-engine instead
2. reword commit message
Change in v2-v6: none

 arch/arm64/boot/dts/mediatek/mt7622.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/mediatek/mt7622.dtsi +12 -0
index f232f8baf4e8..8c2563a3919a 100644
@@ -545,6 +545,18 @@ nandc: nfi@1100d000 {
 		status = "disabled";
 	};
 
+	snfi: spi@1100d000 {
+		compatible = "mediatek,mt7622-snand";
+		reg = <0 0x1100d000 0 0x1000>;
+		interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_LOW>;
+		clocks = <&pericfg CLK_PERI_NFI_PD>, <&pericfg CLK_PERI_SNFI_PD>;
+		clock-names = "nfi_clk", "pad_clk";
+		nand-ecc-engine = <&bch>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+	};
+
 	bch: ecc@1100e000 {
 		compatible = "mediatek,mt7622-ecc";
 		reg = <0 0x1100e000 0 0x1000>;
Signature · 1 line
2.35.1
maintainer Applied
#6 lore raw

Re: [PATCH v6 5/5] arm64: dts: mediatek: add mtk-snfi for mt7622

Quoted 4 lines · Chuanhong Guo

This patch adds a device-tree node for the MTK SPI-NAND Flash Interface for MT7622 device tree.

Applied, thanks!

Quoted 22 lines

---
Changes since v1:
1. use the newly introduced nand-ecc-engine instead
2. reword commit message
Change in v2-v6: none

  arch/arm64/boot/dts/mediatek/mt7622.dtsi | 12 ++++++++++++
  1 file changed, 12 insertions(+)
arch/arm64/boot/dts/mediatek/mt7622.dtsi +5 -0
index f232f8baf4e8..8c2563a3919a 100644
@@ -545,6 +545,18 @@ nandc: nfi@1100d000 {
  		status = "disabled";
  	};
 
+	snfi: spi@1100d000 {
+		compatible = "mediatek,mt7622-snand";
+		reg = <0 0x1100d000 0 0x1000>;
+		interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_LOW>;
+		clocks = <&pericfg CLK_PERI_NFI_PD>, <&pericfg CLK_PERI_SNFI_PD>;

arch/arm64/boot/dts/mediatek/mt7622.dtsi nandc: nfi@1100d000 { · line 562

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7622.dtsi +7 -0
+		clock-names = "nfi_clk", "pad_clk";
+		nand-ecc-engine = <&bch>;
+		#address-cells = <1>;
+		#size-cells = <0>;
+		status = "disabled";
+	};
+
  	bch: ecc@1100e000 {
  		compatible = "mediatek,mt7622-ecc";
  		reg = <0 0x1100e000 0 0x1000>;

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

maintainer
#7 lore raw
In reply to Chuanhong Guo

Hi Mark,

[email protected] wrote on Sun, 24 Apr 2022 11:25:22 +0800:

Quoted 9 lines

Mediatek has an extended version of their NAND Flash Interface which has a SPI-NAND mode. In this mode, the controller can perform 1-bit spi-mem ops for up-to 0xa0 bytes and typical SPI-NAND single, dual and quad IO page cache ops with 2-byte address. Additionally, the page cache ops can be performed with ECC and auto data formatting using the ECC engine of the controller.

This patchset implements support of this mode as a separated SPI-MEM driver with pipelined ECC engine.

[...]

The patch actually look independent, so if it's fine for you I can take the two mtd patches and let you merge the spi/binding changes.

Would this work for you?

Quoted 16 lines

Chuanhong Guo (5):
mtd: nand: make mtk_ecc.c a separated module
spi: add driver for MTK SPI NAND Flash Interface
mtd: nand: mtk-ecc: also parse nand-ecc-engine if available
spi: dt-bindings: add binding doc for spi-mtk-snfi
arm64: dts: mediatek: add mtk-snfi for mt7622

 .../bindings/spi/mediatek,spi-mtk-snfi.yaml   |   88 +
 arch/arm64/boot/dts/mediatek/mt7622.dtsi      |   12 +
 drivers/mtd/nand/Kconfig                      |    7 +
 drivers/mtd/nand/Makefile                     |    1 +
 drivers/mtd/nand/{raw/mtk_ecc.c => ecc-mtk.c} |    8 +-
 drivers/mtd/nand/raw/Kconfig                  |    1 +
 drivers/mtd/nand/raw/Makefile                 |    2 +-
 drivers/mtd/nand/raw/mtk_nand.c               |    2 +-
 drivers/spi/Kconfig                           |   10 +
Quoted 9 lines
 drivers/spi/Makefile                          |    1 +
 drivers/spi/spi-mtk-snfi.c                    | 1470 +++++++++++++++++
 .../linux/mtd/nand-ecc-mtk.h                  |    0
 12 files changed, 1597 insertions(+), 5 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/mediatek,spi-mtk-snfi.yaml
 rename drivers/mtd/nand/{raw/mtk_ecc.c => ecc-mtk.c} (98%)
 create mode 100644 drivers/spi/spi-mtk-snfi.c
 rename drivers/mtd/nand/raw/mtk_ecc.h => include/linux/mtd/nand-ecc-mtk.h (100%)

Thanks,
Miquèl

_______________________________________________
Linux-mediatek mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-mediatek

maintainer
#8 lore raw
Quoted 4 lines · Miquel Raynal

The patch actually look independent, so if it's fine for you I can take the two mtd patches and let you merge the spi/binding changes.

Would this work for you?

That sounds great.

#9 lore raw
In reply to Miquel Raynal

Hi Miquel!

Quoted 5 lines · Miquel Raynal

[...]

The patch actually look independent, so if it's fine for you I can take the two mtd patches and let you merge the spi/binding changes.

Out of curiosity:
Wouldn't that break the build for spi subsystem? Because...

Quoted 1 line
Quoted 1 line
 rename drivers/mtd/nand/raw/mtk_ecc.h => include/linux/mtd/nand-ecc-mtk.h (100%)

The spi driver needs this header file which is moved in the mtd patch.

Signature · 2 lines
Regards,
Chuanhong Guo
maintainer
#10 lore raw
Quoted 11 lines · Chuanhong Guo
Quoted 2 lines · Miquel Raynal

The patch actually look independent, so if it's fine for you I can take the two mtd patches and let you merge the spi/binding changes.

Out of curiosity:
Wouldn't that break the build for spi subsystem? Because...

Quoted 1 line
Quoted 1 line
 rename drivers/mtd/nand/raw/mtk_ecc.h => include/linux/mtd/nand-ecc-mtk.h (100%)

The spi driver needs this header file which is moved in the mtd patch.

Ah, that'll be an issue indeed - if I could get a signed tag with the dependency in it I can go ahead with the SPI bits?

maintainer
#11 lore raw

Hi Mark,

[email protected] wrote on Wed, 27 Apr 2022 15:13:42 +0100:

Quoted 6 lines · Chuanhong Guo
Quoted 4 lines · Miquel Raynal
Quoted 3 lines

The patch actually look independent, so if it's fine for you I can take the two mtd patches and let you merge the spi/binding changes.

Quoted 6 lines
Quoted 6 lines

Out of curiosity:
Wouldn't that break the build for spi subsystem? Because...

Quoted 1 line
Quoted 1 line
 rename drivers/mtd/nand/raw/mtk_ecc.h => include/linux/mtd/nand-ecc-mtk.h (100%)  

The spi driver needs this header file which is moved in the mtd patch.

Ah, yeah, right.

Quoted 2 lines

Ah, that'll be an issue indeed - if I could get a signed tag with the dependency in it I can go ahead with the SPI bits?

Ok, I'll share an immutable tag.

Thanks,
Miquèl

maintainer
#12 lore raw
In reply to Mark Brown

Hello,

[email protected] wrote on Wed, 27 Apr 2022 15:13:42 +0100:

Quoted 9 lines · Chuanhong Guo
Quoted 7 lines · Miquel Raynal
Quoted 3 lines

The patch actually look independent, so if it's fine for you I can take the two mtd patches and let you merge the spi/binding changes.

Out of curiosity:
Wouldn't that break the build for spi subsystem? Because...

Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Quoted 1 line
 rename drivers/mtd/nand/raw/mtk_ecc.h => include/linux/mtd/nand-ecc-mtk.h (100%)  

The spi driver needs this header file which is moved in the mtd patch.

Ah, that'll be an issue indeed - if I could get a signed tag with the dependency in it I can go ahead with the SPI bits?

I pulled the two patches, here is a tag with these patches for you, Mark.

The following changes since commit 3123109284176b1532874591f7c81f3837bbdc17:

Linux 5.18-rc1 (2022-04-03 14:08:21 -0700)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git tags/mtd/mtk-spi-nand-for-5.19

for you to fetch changes up to 4c5bf4b51c9857e20c5f5e9d74b86aa1bd1def40:

mtd: nand: mtk-ecc: also parse nand-ecc-engine if available (2022-04-27 18:12:43 +0200)

----------------------------------------------------------------
Mediatek ECC changes:
* Also parse the default nand-ecc-engine property if available
* Make mtk_ecc.c a separated module

----------------------------------------------------------------
Chuanhong Guo (2):
mtd: nand: make mtk_ecc.c a separated module
mtd: nand: mtk-ecc: also parse nand-ecc-engine if available

 drivers/mtd/nand/Kconfig                                           | 7 +++++++
 drivers/mtd/nand/Makefile                                          | 1 +
 drivers/mtd/nand/{raw/mtk_ecc.c => ecc-mtk.c}                      | 8 +++++---
 drivers/mtd/nand/raw/Kconfig                                       | 1 +
 drivers/mtd/nand/raw/Makefile                                      | 2 +-
 drivers/mtd/nand/raw/mtk_nand.c                                    | 2 +-
 drivers/mtd/nand/raw/mtk_ecc.h => include/linux/mtd/nand-ecc-mtk.h | 0
 7 files changed, 16 insertions(+), 5 deletions(-)
 rename drivers/mtd/nand/{raw/mtk_ecc.c => ecc-mtk.c} (98%)
 rename drivers/mtd/nand/raw/mtk_ecc.h => include/linux/mtd/nand-ecc-mtk.h (100%)
maintainer
#13 lore raw

Re: (subset) [PATCH v6 0/5] spi: add support for Mediatek SPI-NAND controller

In reply to Chuanhong Guo
Quoted 8 lines · Chuanhong Guo

Mediatek has an extended version of their NAND Flash Interface which has a SPI-NAND mode. In this mode, the controller can perform 1-bit spi-mem ops for up-to 0xa0 bytes and typical SPI-NAND single, dual and quad IO page cache ops with 2-byte address. Additionally, the page cache ops can be performed with ECC and auto data formatting using the ECC engine of the controller.

[...]

Applied to

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[2/5] spi: add driver for MTK SPI NAND Flash Interface

      commit: 764f1b7481645b2b4488eda26c4da7f331697e6b
[4/5] spi: dt-bindings: add binding doc for spi-mtk-snfi
      commit: 69bb9b29bf67e850beece45e9c99ca707eac7e41

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark