mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v5 0/6] mtd/spi-mem: Enable DQS control
@ 2026-11-24 14:43 Miquel Raynal
  2026-11-24 14:43 ` [PATCH v5 1/6] spi: spi-mem: Rename the DQS setter and pin field Miquel Raynal
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Miquel Raynal @ 2026-11-24 14:43 UTC (permalink / raw)
  To: Mark Brown, Richard Weinberger, Vignesh Raghavendra, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Pratyush Yadav, Michael Walle,
	Takahiro Kuwano
  Cc: Thomas Petazzoni, praneeth, u-kumar1, p-mantena, a-dutta, s-k6,
	linux-spi, linux-kernel, linux-mtd, devicetree, Miquel Raynal

For his PHY tuning series on the Cadence QSPI controller embedded in TI
SoCs, Santhosh initially needed to access the availability of the DQS
(data strobe) signal. This is a chip dependent capability, which may
sometimes be enabled.

The SPI memory flag already exist but is too vague for it. Let the SPI
NAND core and SPI NOR core set this flag when relevant (per-chip for SPI
NAND, always for SPI NOR until we can do better). SPI controllers now
feature a DQS capability that they need to fill. Manufacturer drivers
and SPI controllers can now query the usability of the feature to use
it/enable it.

I contributed the spi-mem bit in the previous cycle but my changes were
too simple, and a more complex approach was actually needed.

As opposed to v4, this series applies directly on top of v7.4-rc2.

More changes will come on top, especially on the NOR and NAND sides,
plus more Cadence QSPI changes on top of Santhosh's series.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
Changes in v5:
- Drop the dependency on Santhosh's series to make sure the spi-mem
  changes can get in independently. The only conflict there is the fact
  that both of us add a property to the the same binding.
- Kept only the SPI/spi-mem patches.
- Fix my understanding of the Winbond I/O configuration (not sent in this iteration)
- Also fix the location where SPI NAND sets the DQS flag (also not sent in this iteration)
- Link to v4: https://lore.kernel.org/r/20261120-winbond-nand-next-phy-tuning-v4-0-8c21e1f71f41@bootlin.com

Changes in v4:
- Added a spi-dqs-not-wired DT property to describe boards where the DQS
  line is not routed.
- Parsed the property in spi-mem.
- Renamed several helpers to explain what they do more obviously.
- Added a controller DQS capability;
- Expose that DQS is usable only when the memory supports it, the line
  is wired and the controller supports it as well.
- Advertised the DQS capability in the Cadence QSPI driver.
- Advertised the DQS capability before the SSDR/ODTR variants are
  negotiated.
- Only enabled the Winbond DQS output when spi_mem_dqs_is_usable() reports
  it as usable, to avoid useless power consumption.
- Enabled DQS in SPI NOR (always).
- Dropped the already merged spi-mem capability patch from the series.
- Rebased on v7.4-rc2.
- Link to v3: https://lore.kernel.org/r/20260810-winbond-nand-next-phy-tuning-v3-0-a97c3a61e675@bootlin.com

Changes in v3:
- Rebased on top of linux-spi/for-7.3 and dopped all existing
  dependencies on the MTD bits.
- Link to v2: https://lore.kernel.org/r/20260807-winbond-nand-next-phy-tuning-v2-0-73595e89d6e3@bootlin.com

Changes in v2:
- Dropped the RFC prefix.
- Rebased on top of v7.2-rc1.
- Dropped the spi patch for now, just allowing to use DQS on a few
  Winbond SPI NANDs (can be improved later).
- Link to v1: https://lore.kernel.org/r/20260205-winbond-nand-next-phy-tuning-v1-0-5e7d3976f0f1@bootlin.com

---
Miquel Raynal (6):
      spi: spi-mem: Rename the DQS setter and pin field
      spi: spi-mem: Clarify the conditions upon which DQS is usable
      dt-bindings: spi: Document the spi-dqs-not-wired property
      spi: spi-mem: Take the DQS wiring into account
      spi: spi-mem: Take the controller DQS support into account
      spi: cadence-quadspi: Advertise DQS support

 .../bindings/spi/spi-peripheral-props.yaml         | 10 ++++++++
 drivers/spi/spi-cadence-quadspi.c                  |  2 ++
 drivers/spi/spi-mem.c                              | 29 ++++++++++++++--------
 include/linux/spi/spi-mem.h                        | 12 ++++++---
 4 files changed, 38 insertions(+), 15 deletions(-)
---
base-commit: fd9230005e85472b81c1c7c16afe93dd878996b1
change-id: 20260205-winbond-nand-next-phy-tuning-aabefc018032

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


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

* [PATCH v5 1/6] spi: spi-mem: Rename the DQS setter and pin field
  2026-11-24 14:43 [PATCH v5 0/6] mtd/spi-mem: Enable DQS control Miquel Raynal
@ 2026-11-24 14:43 ` Miquel Raynal
  2026-11-24 14:43 ` [PATCH v5 2/6] spi: spi-mem: Clarify the conditions upon which DQS is usable Miquel Raynal
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Miquel Raynal @ 2026-11-24 14:43 UTC (permalink / raw)
  To: Mark Brown, Richard Weinberger, Vignesh Raghavendra, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Pratyush Yadav, Michael Walle,
	Takahiro Kuwano
  Cc: Thomas Petazzoni, praneeth, u-kumar1, p-mantena, a-dutta, s-k6,
	linux-spi, linux-kernel, linux-mtd, devicetree, Miquel Raynal

The current approach was a bit too simple. Using the DQS feature
requires:
1- the chip to feature a DQS pin
2- proper wiring between the host and the chip
3- the controller capability to use it

Rename the helper and the field to reflect that we are talking here
about (1) the chip capability.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-mem.c       | 10 +++++-----
 include/linux/spi/spi-mem.h |  6 +++---
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 8047b7508c8d..65956cf62156 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -546,7 +546,7 @@ const char *spi_mem_get_name(struct spi_mem *mem)
 EXPORT_SYMBOL_GPL(spi_mem_get_name);
 
 /**
- * spi_mem_set_dqs() - Mark DQS as being available
+ * spi_mem_set_dqs_pin_available() - Mark DQS as being available
  * @mem: the SPI memory
  *
  * When reading at high frequencies (> 100MHz), especially when DTR is enabled,
@@ -559,11 +559,11 @@ EXPORT_SYMBOL_GPL(spi_mem_get_name);
  * Set the DQS boolean if the feature is available and configured at the chip
  * level. Controllers may query this value.
  */
-void spi_mem_set_dqs(struct spi_mem *mem)
+void spi_mem_set_dqs_pin_available(struct spi_mem *mem)
 {
-	mem->dqs = true;
+	mem->dqs_pin = true;
 }
-EXPORT_SYMBOL_GPL(spi_mem_set_dqs);
+EXPORT_SYMBOL_GPL(spi_mem_set_dqs_pin_available);
 
 /**
  * spi_mem_has_dqs() - Query whether the DQS is available or not
@@ -573,7 +573,7 @@ EXPORT_SYMBOL_GPL(spi_mem_set_dqs);
  */
 bool spi_mem_has_dqs(struct spi_mem *mem)
 {
-	return mem->dqs;
+	return mem->dqs_pin;
 }
 EXPORT_SYMBOL_GPL(spi_mem_has_dqs);
 
diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
index 0cce6b57242a..55de48c277ac 100644
--- a/include/linux/spi/spi-mem.h
+++ b/include/linux/spi/spi-mem.h
@@ -275,7 +275,7 @@ struct spi_mem_dirmap_desc {
  * @spi: the underlying SPI device
  * @drvpriv: spi_mem_driver private data
  * @name: name of the SPI memory device
- * @dqs: extra data trobe pin available for high frequency read operations
+ * @dqs_pin: the memory provides a DQS pin
  *
  * Extra information that describe the SPI memory device and may be needed by
  * the controller to properly handle this device should be placed here.
@@ -287,7 +287,7 @@ struct spi_mem {
 	struct spi_device *spi;
 	void *drvpriv;
 	const char *name;
-	bool dqs;
+	bool dqs_pin;
 };
 
 /**
@@ -463,7 +463,7 @@ bool spi_mem_default_supports_op(struct spi_mem *mem,
 }
 #endif /* CONFIG_SPI_MEM */
 
-void spi_mem_set_dqs(struct spi_mem *mem);
+void spi_mem_set_dqs_pin_available(struct spi_mem *mem);
 bool spi_mem_has_dqs(struct spi_mem *mem);
 int spi_mem_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op);
 void spi_mem_adjust_op_freq(struct spi_mem *mem, struct spi_mem_op *op);

-- 
2.56.0


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

* [PATCH v5 2/6] spi: spi-mem: Clarify the conditions upon which DQS is usable
  2026-11-24 14:43 [PATCH v5 0/6] mtd/spi-mem: Enable DQS control Miquel Raynal
  2026-11-24 14:43 ` [PATCH v5 1/6] spi: spi-mem: Rename the DQS setter and pin field Miquel Raynal
@ 2026-11-24 14:43 ` Miquel Raynal
  2026-11-24 14:43 ` [PATCH v5 3/6] dt-bindings: spi: Document the spi-dqs-not-wired property Miquel Raynal
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Miquel Raynal @ 2026-11-24 14:43 UTC (permalink / raw)
  To: Mark Brown, Richard Weinberger, Vignesh Raghavendra, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Pratyush Yadav, Michael Walle,
	Takahiro Kuwano
  Cc: Thomas Petazzoni, praneeth, u-kumar1, p-mantena, a-dutta, s-k6,
	linux-spi, linux-kernel, linux-mtd, devicetree, Miquel Raynal

The helper currently only captures the chip capability. Let's rename it
to capture the fact that it is going to reports whether DQS is usable
end-to-end through the upcoming changes.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-mem.c       | 12 ++++++------
 include/linux/spi/spi-mem.h |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 65956cf62156..76674750237e 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -556,8 +556,7 @@ EXPORT_SYMBOL_GPL(spi_mem_get_name);
  * Mitigating this limitation is possible with the addition of a data strobe
  * signal, commonly named DQS.
  *
- * Set the DQS boolean if the feature is available and configured at the chip
- * level. Controllers may query this value.
+ * Set the DQS pin boolean if the feature is available.
  */
 void spi_mem_set_dqs_pin_available(struct spi_mem *mem)
 {
@@ -566,16 +565,17 @@ void spi_mem_set_dqs_pin_available(struct spi_mem *mem)
 EXPORT_SYMBOL_GPL(spi_mem_set_dqs_pin_available);
 
 /**
- * spi_mem_has_dqs() - Query whether the DQS is available or not
+ * spi_mem_dqs_is_usable() - Query whether the DQS is usable or not
  * @mem: the SPI memory
  *
- * Return: a boolean indicating whether the DQS signal is available or not.
+ * Return: a boolean indicating whether the DQS signal is usable or not. DQS is
+ * usable when the memory supports it.
  */
-bool spi_mem_has_dqs(struct spi_mem *mem)
+bool spi_mem_dqs_is_usable(struct spi_mem *mem)
 {
 	return mem->dqs_pin;
 }
-EXPORT_SYMBOL_GPL(spi_mem_has_dqs);
+EXPORT_SYMBOL_GPL(spi_mem_dqs_is_usable);
 
 /**
  * spi_mem_adjust_op_size() - Adjust the data size of a SPI mem operation to
diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
index 55de48c277ac..82c417a661e0 100644
--- a/include/linux/spi/spi-mem.h
+++ b/include/linux/spi/spi-mem.h
@@ -464,7 +464,7 @@ bool spi_mem_default_supports_op(struct spi_mem *mem,
 #endif /* CONFIG_SPI_MEM */
 
 void spi_mem_set_dqs_pin_available(struct spi_mem *mem);
-bool spi_mem_has_dqs(struct spi_mem *mem);
+bool spi_mem_dqs_is_usable(struct spi_mem *mem);
 int spi_mem_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op);
 void spi_mem_adjust_op_freq(struct spi_mem *mem, struct spi_mem_op *op);
 u64 spi_mem_calc_op_duration(struct spi_mem *mem, struct spi_mem_op *op);

-- 
2.56.0


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

* [PATCH v5 3/6] dt-bindings: spi: Document the spi-dqs-not-wired property
  2026-11-24 14:43 [PATCH v5 0/6] mtd/spi-mem: Enable DQS control Miquel Raynal
  2026-11-24 14:43 ` [PATCH v5 1/6] spi: spi-mem: Rename the DQS setter and pin field Miquel Raynal
  2026-11-24 14:43 ` [PATCH v5 2/6] spi: spi-mem: Clarify the conditions upon which DQS is usable Miquel Raynal
@ 2026-11-24 14:43 ` Miquel Raynal
  2026-11-24 15:28   ` Mark Brown
  2026-11-24 18:11   ` Conor Dooley
  2026-11-24 14:43 ` [PATCH v5 4/6] spi: spi-mem: Take the DQS wiring into account Miquel Raynal
                   ` (2 subsequent siblings)
  5 siblings, 2 replies; 9+ messages in thread
From: Miquel Raynal @ 2026-11-24 14:43 UTC (permalink / raw)
  To: Mark Brown, Richard Weinberger, Vignesh Raghavendra, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Pratyush Yadav, Michael Walle,
	Takahiro Kuwano
  Cc: Thomas Petazzoni, praneeth, u-kumar1, p-mantena, a-dutta, s-k6,
	linux-spi, linux-kernel, linux-mtd, devicetree, Miquel Raynal

The DQS line is a data strobe line that is typically driven by flash
memories (NOR and NAND) when the data flows from the peripheral to the
host controller when running at high frequencies in order for the data
bits to be sampled by the host at the right moment. The SPI bus already
features a clock but this clock is driven by the host, which means it is
not accounting for any chip internal delay.

Hardware engineers, if they do not expect the frequency to be configured
above the usual limits (dozens of MHz), may not route the DQS line
between the SPI controller and the peripheral.

Describe this possibility with a new optional property so that the DQS
output can be left disabled on designs where this would be
wasteful. Keeping DQS enabled while it is not routed mostly costs
spectral business and extra power consumption. Hence my proposal to keep
"wired" as a safe default.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 .../devicetree/bindings/spi/spi-peripheral-props.yaml          | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml
index 8f4b4b202e1d..8a6288e6b20b 100644
--- a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml
+++ b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml
@@ -125,6 +125,16 @@ properties:
     description:
       Delay, in microseconds, after a write transfer.
 
+  spi-dqs-not-wired:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      The DQS (data strobe) line of the peripheral is not routed to the
+      controller. This is only meaningful for peripherals that have a DQS
+      pin, typically octal DDR SPI memories. Not routing this line is a
+      possible board design choice, for example to save a pin when the
+      memory is used at lower frequencies. If this property is absent,
+      the DQS line, if relevant, is assumed to be wired.
+
   stacked-memories:
     description: Several SPI memories can be wired in stacked mode.
       This basically means that either a device features several chip

-- 
2.56.0


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

* [PATCH v5 4/6] spi: spi-mem: Take the DQS wiring into account
  2026-11-24 14:43 [PATCH v5 0/6] mtd/spi-mem: Enable DQS control Miquel Raynal
                   ` (2 preceding siblings ...)
  2026-11-24 14:43 ` [PATCH v5 3/6] dt-bindings: spi: Document the spi-dqs-not-wired property Miquel Raynal
@ 2026-11-24 14:43 ` Miquel Raynal
  2026-11-24 14:43 ` [PATCH v5 5/6] spi: spi-mem: Take the controller DQS support " Miquel Raynal
  2026-11-24 14:43 ` [PATCH v5 6/6] spi: cadence-quadspi: Advertise DQS support Miquel Raynal
  5 siblings, 0 replies; 9+ messages in thread
From: Miquel Raynal @ 2026-11-24 14:43 UTC (permalink / raw)
  To: Mark Brown, Richard Weinberger, Vignesh Raghavendra, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Pratyush Yadav, Michael Walle,
	Takahiro Kuwano
  Cc: Thomas Petazzoni, praneeth, u-kumar1, p-mantena, a-dutta, s-k6,
	linux-spi, linux-kernel, linux-mtd, devicetree, Miquel Raynal

The DQS line may not be routed between the memory and the controller.
Parse the spi-dqs-not-wired property when the SPI memory device is
created and only report DQS as available when the memory supports it and
the line is wired.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-mem.c       | 7 +++++--
 include/linux/spi/spi-mem.h | 2 ++
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 76674750237e..9537756e5afc 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -8,6 +8,7 @@
 #include <linux/dmaengine.h>
 #include <linux/iopoll.h>
 #include <linux/pm_runtime.h>
+#include <linux/property.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/spi-mem.h>
 #include <linux/sched/task_stack.h>
@@ -569,11 +570,11 @@ EXPORT_SYMBOL_GPL(spi_mem_set_dqs_pin_available);
  * @mem: the SPI memory
  *
  * Return: a boolean indicating whether the DQS signal is usable or not. DQS is
- * usable when the memory supports it.
+ * usable when the memory supports it and the line is wired.
  */
 bool spi_mem_dqs_is_usable(struct spi_mem *mem)
 {
-	return mem->dqs_pin;
+	return mem->dqs_pin && mem->dqs_wired;
 }
 EXPORT_SYMBOL_GPL(spi_mem_dqs_is_usable);
 
@@ -1089,6 +1090,8 @@ static int spi_mem_probe(struct spi_device *spi)
 		return -ENOMEM;
 
 	mem->spi = spi;
+	mem->dqs_wired = !device_property_read_bool(&spi->dev,
+						    "spi-dqs-not-wired");
 
 	if (ctlr->mem_ops && ctlr->mem_ops->get_name)
 		mem->name = ctlr->mem_ops->get_name(mem);
diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
index 82c417a661e0..ed581a4d4e9a 100644
--- a/include/linux/spi/spi-mem.h
+++ b/include/linux/spi/spi-mem.h
@@ -276,6 +276,7 @@ struct spi_mem_dirmap_desc {
  * @drvpriv: spi_mem_driver private data
  * @name: name of the SPI memory device
  * @dqs_pin: the memory provides a DQS pin
+ * @dqs_wired: the DQS line is routed to the controller
  *
  * Extra information that describe the SPI memory device and may be needed by
  * the controller to properly handle this device should be placed here.
@@ -288,6 +289,7 @@ struct spi_mem {
 	void *drvpriv;
 	const char *name;
 	bool dqs_pin;
+	bool dqs_wired;
 };
 
 /**

-- 
2.56.0


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

* [PATCH v5 5/6] spi: spi-mem: Take the controller DQS support into account
  2026-11-24 14:43 [PATCH v5 0/6] mtd/spi-mem: Enable DQS control Miquel Raynal
                   ` (3 preceding siblings ...)
  2026-11-24 14:43 ` [PATCH v5 4/6] spi: spi-mem: Take the DQS wiring into account Miquel Raynal
@ 2026-11-24 14:43 ` Miquel Raynal
  2026-11-24 14:43 ` [PATCH v5 6/6] spi: cadence-quadspi: Advertise DQS support Miquel Raynal
  5 siblings, 0 replies; 9+ messages in thread
From: Miquel Raynal @ 2026-11-24 14:43 UTC (permalink / raw)
  To: Mark Brown, Richard Weinberger, Vignesh Raghavendra, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Pratyush Yadav, Michael Walle,
	Takahiro Kuwano
  Cc: Thomas Petazzoni, praneeth, u-kumar1, p-mantena, a-dutta, s-k6,
	linux-spi, linux-kernel, linux-mtd, devicetree, Miquel Raynal

Require the controller to advertise DQS support through the new
mem_caps.dqs capability. A controller that cannot use the strobe would
otherwise leave the memory driving a signal that is ignored, which costs
power and EMC pollution.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-mem.c       | 8 ++++++--
 include/linux/spi/spi-mem.h | 2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 9537756e5afc..f6aa46d37f5c 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -570,11 +570,15 @@ EXPORT_SYMBOL_GPL(spi_mem_set_dqs_pin_available);
  * @mem: the SPI memory
  *
  * Return: a boolean indicating whether the DQS signal is usable or not. DQS is
- * usable when the memory supports it and the line is wired.
+ * usable when the memory supports it, the line is wired and the controller is
+ * capable of using it.
  */
 bool spi_mem_dqs_is_usable(struct spi_mem *mem)
 {
-	return mem->dqs_pin && mem->dqs_wired;
+	struct spi_controller *ctlr = mem->spi->controller;
+
+	return mem->dqs_pin && mem->dqs_wired &&
+	       spi_mem_controller_is_capable(ctlr, dqs);
 }
 EXPORT_SYMBOL_GPL(spi_mem_dqs_is_usable);
 
diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
index ed581a4d4e9a..d524b2862e11 100644
--- a/include/linux/spi/spi-mem.h
+++ b/include/linux/spi/spi-mem.h
@@ -394,6 +394,7 @@ struct spi_controller_mem_ops {
  *                   is a pause in the transfer (eg. internal bus contention or
  *                   DMA arbitration on an interconnect). Features such as NAND
  *                   continuous reads shall not be leveraged.
+ * @dqs: The controller can use the DQS signal provided by the memory
  */
 struct spi_controller_mem_caps {
 	bool dtr;
@@ -402,6 +403,7 @@ struct spi_controller_mem_caps {
 	bool per_op_freq;
 	bool secondary_op_tmpl;
 	bool no_cs_assertion;
+	bool dqs;
 };
 
 #define spi_mem_controller_is_capable(ctlr, cap)	\

-- 
2.56.0


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

* [PATCH v5 6/6] spi: cadence-quadspi: Advertise DQS support
  2026-11-24 14:43 [PATCH v5 0/6] mtd/spi-mem: Enable DQS control Miquel Raynal
                   ` (4 preceding siblings ...)
  2026-11-24 14:43 ` [PATCH v5 5/6] spi: spi-mem: Take the controller DQS support " Miquel Raynal
@ 2026-11-24 14:43 ` Miquel Raynal
  5 siblings, 0 replies; 9+ messages in thread
From: Miquel Raynal @ 2026-11-24 14:43 UTC (permalink / raw)
  To: Mark Brown, Richard Weinberger, Vignesh Raghavendra, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Pratyush Yadav, Michael Walle,
	Takahiro Kuwano
  Cc: Thomas Petazzoni, praneeth, u-kumar1, p-mantena, a-dutta, s-k6,
	linux-spi, linux-kernel, linux-mtd, devicetree, Miquel Raynal

The Cadence QSPI controller supports DQS read data capture. Advertise this
capability in the controller memory capabilities so that
spi_mem_dqs_is_usable() reports DQS as usable when the memory supports it
and the DQS line is wired.

This lets memory drivers enable the DQS output only when the controller is
able to make use of it.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/spi/spi-cadence-quadspi.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 44d96b8cf8f0..6b4363466388 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1739,12 +1739,14 @@ static const struct spi_controller_mem_ops cqspi_mem_ops = {
 static const struct spi_controller_mem_caps cqspi_mem_caps = {
 	.dtr = true,
 	.per_op_freq = true,
+	.dqs = true,
 };
 
 static const struct spi_controller_mem_caps cqspi_am654_mem_caps = {
 	.dtr = true,
 	.per_op_freq = true,
 	.no_cs_assertion = true,
+	.dqs = true,
 };
 
 static int cqspi_setup_flash(struct cqspi_st *cqspi)

-- 
2.56.0


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

* Re: [PATCH v5 3/6] dt-bindings: spi: Document the spi-dqs-not-wired property
  2026-11-24 14:43 ` [PATCH v5 3/6] dt-bindings: spi: Document the spi-dqs-not-wired property Miquel Raynal
@ 2026-11-24 15:28   ` Mark Brown
  2026-11-24 18:11   ` Conor Dooley
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Brown @ 2026-11-24 15:28 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Richard Weinberger, Vignesh Raghavendra, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Pratyush Yadav, Michael Walle,
	Takahiro Kuwano, Thomas Petazzoni, praneeth, u-kumar1, p-mantena,
	a-dutta, s-k6, linux-spi, linux-kernel, linux-mtd, devicetree

[-- Attachment #1: Type: text/plain, Size: 806 bytes --]

On Tue, Nov 24, 2026 at 03:43:04PM +0100, Miquel Raynal wrote:
> The DQS line is a data strobe line that is typically driven by flash
> memories (NOR and NAND) when the data flows from the peripheral to the
> host controller when running at high frequencies in order for the data
> bits to be sampled by the host at the right moment. The SPI bus already
> features a clock but this clock is driven by the host, which means it is
> not accounting for any chip internal delay.

Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v5 3/6] dt-bindings: spi: Document the spi-dqs-not-wired property
  2026-11-24 14:43 ` [PATCH v5 3/6] dt-bindings: spi: Document the spi-dqs-not-wired property Miquel Raynal
  2026-11-24 15:28   ` Mark Brown
@ 2026-11-24 18:11   ` Conor Dooley
  1 sibling, 0 replies; 9+ messages in thread
From: Conor Dooley @ 2026-11-24 18:11 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Mark Brown, Richard Weinberger, Vignesh Raghavendra, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Pratyush Yadav, Michael Walle,
	Takahiro Kuwano, Thomas Petazzoni, praneeth, u-kumar1, p-mantena,
	a-dutta, s-k6, linux-spi, linux-kernel, linux-mtd, devicetree

[-- Attachment #1: Type: text/plain, Size: 75 bytes --]

Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

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

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-24 14:43 [PATCH v5 0/6] mtd/spi-mem: Enable DQS control Miquel Raynal
2026-11-24 14:43 ` [PATCH v5 1/6] spi: spi-mem: Rename the DQS setter and pin field Miquel Raynal
2026-11-24 14:43 ` [PATCH v5 2/6] spi: spi-mem: Clarify the conditions upon which DQS is usable Miquel Raynal
2026-11-24 14:43 ` [PATCH v5 3/6] dt-bindings: spi: Document the spi-dqs-not-wired property Miquel Raynal
2026-11-24 15:28   ` Mark Brown
2026-11-24 18:11   ` Conor Dooley
2026-11-24 14:43 ` [PATCH v5 4/6] spi: spi-mem: Take the DQS wiring into account Miquel Raynal
2026-11-24 14:43 ` [PATCH v5 5/6] spi: spi-mem: Take the controller DQS support " Miquel Raynal
2026-11-24 14:43 ` [PATCH v5 6/6] spi: cadence-quadspi: Advertise DQS support Miquel Raynal

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

all inboxes | Powered by JetHome®