[PATCH v2 00/27] mtd: spinand: Octal DTR support

Miquel Raynal posted 27 patches 1 month ago
drivers/mtd/nand/spi/core.c       | 387 +++++++++++++++++++++++++++++++++-----
drivers/mtd/nand/spi/esmt.c       |   4 +-
drivers/mtd/nand/spi/gigadevice.c |   8 +-
drivers/mtd/nand/spi/macronix.c   |  49 ++++-
drivers/mtd/nand/spi/micron.c     |   8 +-
drivers/mtd/nand/spi/toshiba.c    |   3 +-
drivers/mtd/nand/spi/winbond.c    | 129 +++++++++----
drivers/spi/spi-mem.c             |  15 +-
include/linux/mtd/spinand.h       | 161 ++++++++++++++--
include/linux/spi/spi-mem.h       |  14 +-
10 files changed, 651 insertions(+), 127 deletions(-)
[PATCH v2 00/27] mtd: spinand: Octal DTR support
Posted by Miquel Raynal 1 month ago
Hello,

This series adds support for 8D-8D-8D in SPI NAND, which can already be
leveraged without any SPI changes as controllers already have this
support for some SPI NOR devices.

The series is a bit long because many preparation patches were needed
in order to have a clean 8D-8D-8D introduction (one of the last
patches), but I believe the split is worth it.

Among the few spi-mem patches, they are needed for building the SPI NAND
changes (especially the ODTR introduction at the end) and therefore an
immutable tag will be needed for merging in the MTD tree (unless all the
series goes through MTD directly ofc).

There is a benchmark in the last Winbond patch, we get +55% read speed
and +26% write speed with this series, at 25MHz!

    1S-8S-8S:
    
       # flash_speed /dev/mtd0 -c1 -d
       eraseblock write speed is 7529 KiB/s
       eraseblock read speed is 15058 KiB/s
    
    8D-8D-8D:
    
       # flash_speed /dev/mtd0 -c1 -d
       eraseblock write speed is 9481 KiB/s
       eraseblock read speed is 23272 KiB/s

I am excited to see this finally upstream! Next step will be to see TI's
PHY tuning series from Santhosh in conjunction with this one to operate at
maximum speed.

Thanks!
Miquèl

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
Changes in v2:
- Rebased on v6.19-rc1.
- Collected tags.
- Fixed commit logs as reported.
- Removed inline functions and turned them into proper functions in a C
  file as suggested by Tudor.
- Squashed patches 10 and 11 as suggested by Tudor.
- Link to v1: https://lore.kernel.org/r/20251031-winbond-v6-17-rc1-oddr-v1-0-be42de23ebf1@bootlin.com

---
Miquel Raynal (27):
      spi: spi-mem: Make the DTR command operation macro more suitable
      spi: spi-mem: Create a repeated address operation
      spi: spi-mem: Limit octal DTR constraints to octal DTR situations
      mtd: spinand: Fix kernel doc
      mtd: spinand: Add missing check
      mtd: spinand: Remove stale definitions
      mtd: spinand: Use standard return values
      mtd: spinand: Decouple write enable and write disable operations
      mtd: spinand: Create an array of operation templates
      mtd: spinand: Make use of the operation templates through SPINAND_OP()
      mtd: spinand: macronix: Convert vendor specific operation to SPINAND_OP()
      mtd: spinand: winbond: Convert W25N specific operation to SPINAND_OP()
      mtd: spinand: winbond: Convert W35N specific operation to SPINAND_OP()
      mtd: spinand: List vendor specific operations and make sure they are supported
      mtd: spinand: macronix: Register vendor specific operation
      mtd: spinand: winbond: Register W25N vendor specific operation
      mtd: spinand: winbond: Register W35N vendor specific operation
      mtd: spinand: winbond: Fix style
      mtd: spinand: winbond: Rename IO_MODE register macro
      mtd: spinand: winbond: Configure the IO mode after the dummy cycles
      mtd: spinand: Gather all the bus interface steps in one single function
      mtd: spinand: Add support for setting a bus interface
      mtd: spinand: Propagate the bus interface across core helpers
      mtd: spinand: Give the bus interface to the configuration helper
      mtd: spinand: Warn if using SSDR-only vendor commands in a non SSDR mode
      mtd: spinand: Add octal DTR support
      mtd: spinand: winbond: W35N octal DTR support

 drivers/mtd/nand/spi/core.c       | 387 +++++++++++++++++++++++++++++++++-----
 drivers/mtd/nand/spi/esmt.c       |   4 +-
 drivers/mtd/nand/spi/gigadevice.c |   8 +-
 drivers/mtd/nand/spi/macronix.c   |  49 ++++-
 drivers/mtd/nand/spi/micron.c     |   8 +-
 drivers/mtd/nand/spi/toshiba.c    |   3 +-
 drivers/mtd/nand/spi/winbond.c    | 129 +++++++++----
 drivers/spi/spi-mem.c             |  15 +-
 include/linux/mtd/spinand.h       | 161 ++++++++++++++--
 include/linux/spi/spi-mem.h       |  14 +-
 10 files changed, 651 insertions(+), 127 deletions(-)
---
base-commit: f7fae19731779c45416e3961fa7127ca225554a0
change-id: 20251031-winbond-v6-17-rc1-oddr-385f04684ad9

Best regards,
-- 
Miquel Raynal <miquel.raynal@bootlin.com>

Re: [PATCH v2 00/27] mtd: spinand: Octal DTR support
Posted by Mark Brown 3 weeks, 4 days ago
On Fri, Jan 09, 2026 at 06:17:58PM +0100, Miquel Raynal wrote:

> This series adds support for 8D-8D-8D in SPI NAND, which can already be
> leveraged without any SPI changes as controllers already have this
> support for some SPI NOR devices.

The following changes since commit 0f61b1860cc3f52aef9036d7235ed1f017632193:

  Linux 6.19-rc5 (2026-01-11 17:03:14 -1000)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git tags/spi-octal-dtr

for you to fetch changes up to 8618271887ca10ac5108fe7e1d82ba8f1b152cf9:

  spi: spi-mem: Limit octal DTR constraints to octal DTR situations (2026-01-12 12:40:30 +0000)

----------------------------------------------------------------
spi: Octal DTR support

This series adds support for 8D-8D-8D in SPI NAND, which can already be
leveraged without any SPI changes as controllers already have this
support for some SPI NOR devices.

Among the few spi-mem patches, they are needed for building the SPI NAND
changes (especially the ODTR introduction at the end) and therefore an
immutable tag will be needed for merging in the MTD tree (unless all the
series goes through MTD directly ofc).

----------------------------------------------------------------
Miquel Raynal (3):
      spi: spi-mem: Make the DTR command operation macro more suitable
      spi: spi-mem: Create a repeated address operation
      spi: spi-mem: Limit octal DTR constraints to octal DTR situations

 drivers/spi/spi-mem.c       | 15 +++++++++++++--
 include/linux/spi/spi-mem.h | 14 +++++++++++---
 2 files changed, 24 insertions(+), 5 deletions(-)
Re: [PATCH v2 00/27] mtd: spinand: Octal DTR support
Posted by Miquel Raynal 1 week, 3 days ago
Hello all,

> The following changes since commit 0f61b1860cc3f52aef9036d7235ed1f017632193:
>
>   Linux 6.19-rc5 (2026-01-11 17:03:14 -1000)
>
> are available in the Git repository at:
>
>   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git tags/spi-octal-dtr
>
> for you to fetch changes up to 8618271887ca10ac5108fe7e1d82ba8f1b152cf9:
>
>   spi: spi-mem: Limit octal DTR constraints to octal DTR situations
>   (2026-01-12 12:40:30 +0000)

Pulled in nand/next!

I then applied the rest of the series on top of it.

Thanks,
Miquèl
Re: [PATCH v2 00/27] mtd: spinand: Octal DTR support
Posted by Miquel Raynal 3 weeks, 4 days ago
Hi Mark,

>> This series adds support for 8D-8D-8D in SPI NAND, which can already be
>> leveraged without any SPI changes as controllers already have this
>> support for some SPI NOR devices.
>
> The following changes since commit 0f61b1860cc3f52aef9036d7235ed1f017632193:
>
>   Linux 6.19-rc5 (2026-01-11 17:03:14 -1000)
>
> are available in the Git repository at:
>
>   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git tags/spi-octal-dtr
>
> for you to fetch changes up to 8618271887ca10ac5108fe7e1d82ba8f1b152cf9:
>
>   spi: spi-mem: Limit octal DTR constraints to octal DTR situations (2026-01-12 12:40:30 +0000)

Thanks you very much! I will wait a bit more and eventually merge it in
mtd/next before applying the rest of the series.

Thanks,
Miquèl
Re: (subset) [PATCH v2 00/27] mtd: spinand: Octal DTR support
Posted by Mark Brown 3 weeks, 5 days ago
On Fri, 09 Jan 2026 18:17:58 +0100, Miquel Raynal wrote:
> This series adds support for 8D-8D-8D in SPI NAND, which can already be
> leveraged without any SPI changes as controllers already have this
> support for some SPI NOR devices.
> 
> The series is a bit long because many preparation patches were needed
> in order to have a clean 8D-8D-8D introduction (one of the last
> patches), but I believe the split is worth it.
> 
> [...]

Applied to

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

Thanks!

[01/27] spi: spi-mem: Make the DTR command operation macro more suitable
        commit: 0196932f539e306e122b6edf24c9f5e30d1f73ee
[02/27] spi: spi-mem: Create a repeated address operation
        commit: af4b2dc4810380a469dcd7508923b70892c2996a
[03/27] spi: spi-mem: Limit octal DTR constraints to octal DTR situations
        commit: 8618271887ca10ac5108fe7e1d82ba8f1b152cf9

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