[RFC,v4,0/5] Add Mediatek SPI Nand controller and convert ECC driver

Xiangsheng Hou xiangsheng.hou at mediatek.com
Tue Nov 30 00:31:57 PST 2021


The Mediatek SPI Nand controller can support multiple SPI protocols,
which can support other SPI device in theory. And the SPI Nand controller
can cowork with the HW ECC engine for high performance at the pipelined
ecc case.

This RFC v4 series fix coding style and move some ecc related code form
snfi driver to the ecc driver based on the RFC v3 comment. And, also try
to resolve the read/write OOB issue in AUTO mode, which can also resolve
the data format issue with Mediatek ECC engine.

The RFC patch v1 and v2 only try to get nand info and ecc status
in spi driver. However, this can be resolved by pipelined ECC design.

The RFC patch v3 realize the HW ECC engine in pipelined case.

Only take mt7622 project for dts node example.

Xiangsheng Hou (5):
  mtd: nand: ecc: Move mediatek ECC driver
  mtd: nand: ecc: mtk: Convert to the ECC infrastructure
  spi: mtk: Add mediatek SPI Nand Flash interface driver
  mtd: spinand: Move set/get OOB databytes to each ECC engines
  arm64: dts: mtk: Add snfi node

 arch/arm64/boot/dts/mediatek/mt7622-rfb1.dts |   16 +
 arch/arm64/boot/dts/mediatek/mt7622.dtsi     |   13 +
 drivers/mtd/nand/Kconfig                     |    9 +
 drivers/mtd/nand/Makefile                    |    1 +
 drivers/mtd/nand/ecc-mtk.c                   | 1207 ++++++++++++++++++
 drivers/mtd/nand/ecc-sw-bch.c                |   71 +-
 drivers/mtd/nand/ecc-sw-hamming.c            |   71 +-
 drivers/mtd/nand/raw/Kconfig                 |    1 +
 drivers/mtd/nand/raw/Makefile                |    2 +-
 drivers/mtd/nand/raw/mtk_ecc.c               |  593 ---------
 drivers/mtd/nand/raw/mtk_ecc.h               |   47 -
 drivers/mtd/nand/raw/mtk_nand.c              |    2 +-
 drivers/mtd/nand/spi/core.c                  |   93 +-
 drivers/spi/Kconfig                          |   11 +
 drivers/spi/Makefile                         |    1 +
 drivers/spi/spi-mtk-snfi.c                   | 1117 ++++++++++++++++
 include/linux/mtd/nand-ecc-mtk.h             |  115 ++
 include/linux/mtd/nand-ecc-sw-bch.h          |    4 +
 include/linux/mtd/nand-ecc-sw-hamming.h      |    4 +
 include/linux/mtd/spinand.h                  |    4 +
 20 files changed, 2691 insertions(+), 691 deletions(-)
 create mode 100644 drivers/mtd/nand/ecc-mtk.c
 delete mode 100644 drivers/mtd/nand/raw/mtk_ecc.c
 delete mode 100644 drivers/mtd/nand/raw/mtk_ecc.h
 create mode 100644 drivers/spi/spi-mtk-snfi.c
 create mode 100644 include/linux/mtd/nand-ecc-mtk.h

-- 
2.25.1




More information about the Linux-mediatek mailing list