[PATCH v2 00/22] drivers: mtd: spi-nand: driver improvements

Mikhail Kshevetskiy mikhail.kshevetskiy at iopsys.eu
Tue Aug 5 00:11:00 CEST 2025


This patch series makes u-boot spinand driver almost the same as spinand
driver from linux-6.16-rc6. This provides the following improvements:

* it becomes easy to port changes from linux kernel
* more flash is supported
* spi drivers can accelerate flash reading/writing using spi-mem dirmap API
* continuous reading mode was supported
* OTP support was added
* add support of special data recovery reading (for some flashes)
* bugfixes
* other minor improvements

The following linux kernel driver features was not implemented

* support of different ECC engines
* per operation spi bus frequency

The patchset also includes fixes for continuous reading mode.
The similar patches were sent to upstream linux kernel.

Changes v2:
 * update patch description
 * add fixes for continuous reading mode

Mikhail Kshevetskiy (22):
  drivers: spi-mem: sync a bit with linux-6.16-rc6
  drivers: mtd: spi-nand: Use the spi-mem dirmap API
  drivers: mtd: spi-nand: Add a NAND page I/O request type
  drivers: mtd: spi-nand: add missed add missed MODULE_DEVICE_TABLE()
  drivers: mtd: spi-nand: simulate behavior of linux's function
    spinand_wait()
  drivers: mtd: spi-nand: more use of spinand_to_{something} helpers
  drivers: mtd: spi-nand: replace enable_ecc variable with disable_ecc
    and update corresponding logic
  drivers: mtd: spi-nand: minor refactoring
  drivers: mtd: spi-nand: more refactoring
  drivers: mtd: spi-nand: sync code with linux-6.10
  drivers: mtd: spi-nand: set bitflip_threshold to 75% of ECC strength
  drivers: mtd: spi-nand: Add support for setting plane select bits
  drivers: mtd: spi-nand: Remove write_enable_op() in markbad()
  drivers: mtd: spi-nand: Introduce a way to avoid raw access
  drivers: mtd: spi-nand: add support of continuous reading mode
  drivers: mtd: spi-nand: Add read retry support
  drivers: mtd: spi-nand: add OTP support
  drivers: mtd: spi-nand: Enhance the logic when picking a variant
  drivers: mtd: spi-nand: sync with linux-6.16-rc6
  drivers: mtd: spi-nand: fix direct mapping creation sizes.
  drivers: mtd: spi-nand: try a regular dirmap if creating a dirmap for
    continuous reading fails
  drivers: mtd: spi-nand: repeat reading in regular mode if continuous
    reading fails

 drivers/mtd/nand/spi/Makefile         |   5 +-
 drivers/mtd/nand/spi/alliancememory.c | 155 +++++
 drivers/mtd/nand/spi/ato.c            |  84 +++
 drivers/mtd/nand/spi/core.c           | 937 +++++++++++++++++++-------
 drivers/mtd/nand/spi/esmt.c           | 123 +++-
 drivers/mtd/nand/spi/foresee.c        | 107 +++
 drivers/mtd/nand/spi/gigadevice.c     |  66 +-
 drivers/mtd/nand/spi/macronix.c       | 289 ++++++--
 drivers/mtd/nand/spi/micron.c         | 180 ++++-
 drivers/mtd/nand/spi/otp.c            | 369 ++++++++++
 drivers/mtd/nand/spi/paragon.c        |  20 +-
 drivers/mtd/nand/spi/skyhigh.c        | 149 ++++
 drivers/mtd/nand/spi/toshiba.c        |  63 +-
 drivers/mtd/nand/spi/winbond.c        | 228 ++++++-
 drivers/mtd/nand/spi/xtx.c            |  20 +-
 drivers/spi/spi-mem.c                 |  45 +-
 include/linux/mtd/nand.h              | 157 ++++-
 include/linux/mtd/spinand.h           | 342 +++++++++-
 include/spi-mem.h                     |  93 ++-
 19 files changed, 2936 insertions(+), 496 deletions(-)
 create mode 100644 drivers/mtd/nand/spi/alliancememory.c
 create mode 100644 drivers/mtd/nand/spi/ato.c
 create mode 100644 drivers/mtd/nand/spi/foresee.c
 create mode 100644 drivers/mtd/nand/spi/otp.c
 create mode 100644 drivers/mtd/nand/spi/skyhigh.c

-- 
2.47.2



More information about the U-Boot mailing list