Linux-Amlogic Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant
@ 2026-11-25 17:51 Miquel Raynal
  2026-11-25 17:51 ` [PATCH RFC 01/16] spi: spi-mem: Handle a corner case while sanitizing ops Miquel Raynal
                   ` (16 more replies)
  0 siblings, 17 replies; 28+ messages in thread
From: Miquel Raynal @ 2026-11-25 17:51 UTC (permalink / raw)
  To: Mark Brown, Liang Yang, Feng Chen, Xianwei Zhao, Han Xu,
	Conor Dooley, Valentina Fernandez, Daire McNamara, Haibo Chen,
	Jyan Chou, Yu-Chun Lin, Maxime Coquelin, Alexandre Torgue,
	Pratyush Yadav, Michael Walle, Takahiro Kuwano,
	Richard Weinberger, Vignesh Raghavendra
  Cc: Thomas Petazzoni, Alvin Zhou, Cheng Ming Lin, linux-spi,
	linux-kernel, linux-amlogic, imx, linux-riscv, linux-stm32,
	linux-arm-kernel, linux-mtd, Miquel Raynal

SPI NOR SFDP data gives dummy cycles. SPI NAND devices express the dummy
phase using cycles as well. Those numbers are converted to bytes, then
passed to the spi and spi-mem controller drivers. A non neglictible
amount of those controller drivers convert bytes into cycles before
programming the registers.

When the conversions are lossless, it is not a big deal, just time
spent. However these silent conversions sometimes hide bugs and
sometimes also prevent using certain chips/configurations, as recently
reported on Macronix 1-1-8 chips requiring 20 cycles. Not all
controllers can do that, but the ones that can, would anyway reject
those chips.

Convert spi-mem, all the trivial spi-mem controller drivers and then
SPI NOR to use dummy cycles instead of dummy bytes. SPI NAND may come
later.

This is only build tested for the moment and sent as an RFC because this
topic has raised a lot of questions, there may be things I have
forgotten about, so I would like all parties to agree on the direction
before I commit into something cleaner. I bet Sashiko will also have
interesting feedback to make...

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
Miquel Raynal (16):
      spi: spi-mem: Handle a corner case while sanitizing ops
      spi: spi-mem: Stop checking the dummy buswidth against board wiring
      spi: spi-mem: Add support for dummy cycles
      spi: amlogic-spifc-a1: Consume dummy cycles directly
      spi: amlogic-spifc-a1: Fix a typo in a macro
      spi: amlogic: spifc-a4: Consume dummy cycles directly
      spi: cadence-qspi: Consume dummy cycles directly
      spi: fsl-qspi: Consume dummy cycles directly
      spi: microchip-core-qspi: Consume dummy cycles directly
      spi: nxp-xspi: Consume dummy cycles directly
      spi: nxp-xspi: Fix a comment
      spi: rtk-nor: Consume dummy cycles directly
      spi: sn-f-ospi: Consume dummy cycles directly
      spi: stm32-ospi: Consume dummy cycles directly
      spi: stm32-qspi: Consume dummy cycles directly
      mtd: spi-nor: Express the dummy phase in cycles

 drivers/mtd/spi-nor/core.c            |  36 ++----
 drivers/mtd/spi-nor/core.h            |   8 +-
 drivers/mtd/spi-nor/micron-st.c       |   2 +-
 drivers/mtd/spi-nor/spansion.c        |   6 +-
 drivers/spi/spi-amlogic-spifc-a1.c    |   9 +-
 drivers/spi/spi-amlogic-spifc-a4.c    |  12 +-
 drivers/spi/spi-cadence-quadspi.c     |  35 ++----
 drivers/spi/spi-fsl-qspi.c            |  12 +-
 drivers/spi/spi-mem.c                 | 216 ++++++++++++++++++++++++++++++----
 drivers/spi/spi-microchip-core-qspi.c |   8 +-
 drivers/spi/spi-nxp-xspi.c            |  14 +--
 drivers/spi/spi-rtk-nor.c             |  28 ++---
 drivers/spi/spi-sn-f-ospi.c           |  13 +-
 drivers/spi/spi-stm32-ospi.c          |  14 ++-
 drivers/spi/spi-stm32-qspi.c          |  12 +-
 include/linux/spi/spi-mem.h           |  36 +++++-
 16 files changed, 303 insertions(+), 158 deletions(-)
---
base-commit: 19d1b4de6d37bccecc3ad9144d279f1baa405eb1
change-id: 20261125-macronix-upstreaming-spi-mem-cycles-103274708fec

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


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2026-11-26 11:09 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25 17:51 [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 01/16] spi: spi-mem: Handle a corner case while sanitizing ops Miquel Raynal
2026-11-25 17:58   ` sashiko-bot
2026-11-25 17:51 ` [PATCH RFC 02/16] spi: spi-mem: Stop checking the dummy buswidth against board wiring Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 03/16] spi: spi-mem: Add support for dummy cycles Miquel Raynal
2026-11-25 18:07   ` sashiko-bot
2026-11-25 17:51 ` [PATCH RFC 04/16] spi: amlogic-spifc-a1: Consume dummy cycles directly Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 05/16] spi: amlogic-spifc-a1: Fix a typo in a macro Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 06/16] spi: amlogic: spifc-a4: Consume dummy cycles directly Miquel Raynal
2026-11-25 17:59   ` sashiko-bot
2026-11-25 17:51 ` [PATCH RFC 07/16] spi: cadence-qspi: " Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 08/16] spi: fsl-qspi: " Miquel Raynal
2026-11-25 17:58   ` sashiko-bot
2026-11-25 17:51 ` [PATCH RFC 09/16] spi: microchip-core-qspi: " Miquel Raynal
2026-11-25 18:06   ` sashiko-bot
2026-11-25 17:51 ` [PATCH RFC 10/16] spi: nxp-xspi: " Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 11/16] spi: nxp-xspi: Fix a comment Miquel Raynal
2026-11-25 17:51 ` [PATCH RFC 12/16] spi: rtk-nor: Consume dummy cycles directly Miquel Raynal
2026-11-25 18:02   ` sashiko-bot
2026-11-25 17:51 ` [PATCH RFC 13/16] spi: sn-f-ospi: " Miquel Raynal
2026-11-25 18:01   ` sashiko-bot
2026-11-25 17:51 ` [PATCH RFC 14/16] spi: stm32-ospi: " Miquel Raynal
2026-11-25 18:12   ` sashiko-bot
2026-11-25 17:51 ` [PATCH RFC 15/16] spi: stm32-qspi: " Miquel Raynal
2026-11-25 18:14   ` sashiko-bot
2026-11-25 17:51 ` [PATCH RFC 16/16] mtd: spi-nor: Express the dummy phase in cycles Miquel Raynal
2026-11-25 18:08   ` sashiko-bot
2026-11-26 11:09 ` [PATCH RFC 00/16] spi: spi-mem: Express the dummy phase using cycles when relevant Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox