* [PATCH v3 01/17] spi: dt-bindings: cdns,qspi-nor: Remove duplicated constraints
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:04 ` Miquel Raynal (Schneider Electric)
2026-01-21 22:14 ` Rob Herring
2026-01-21 17:04 ` [PATCH v3 02/17] spi: dt-bindings: cdns,qspi-nor: Drop label in example Miquel Raynal (Schneider Electric)
` (15 subsequent siblings)
16 siblings, 1 reply; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:04 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
The if/then/else block sets the restrictions in all cases for
resets/reset-names, very much like it does for other properties as well
such as cdns,fifo-depth. Drop the constraints from the place where these
constraints are simply ignored.
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
index 53a52fb8b819..b85dba351822 100644
--- a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
+++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
@@ -136,15 +136,8 @@ properties:
power-domains:
maxItems: 1
- resets:
- minItems: 2
- maxItems: 3
-
- reset-names:
- minItems: 2
- maxItems: 3
- items:
- enum: [ qspi, qspi-ocp, rstc_ref ]
+ resets: true
+ reset-names: true
patternProperties:
"^flash@[0-9a-f]+$":
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* Re: [PATCH v3 01/17] spi: dt-bindings: cdns,qspi-nor: Remove duplicated constraints
2026-01-21 17:04 ` [PATCH v3 01/17] spi: dt-bindings: cdns,qspi-nor: Remove duplicated constraints Miquel Raynal (Schneider Electric)
@ 2026-01-21 22:14 ` Rob Herring
2026-01-22 14:21 ` Miquel Raynal
0 siblings, 1 reply; 27+ messages in thread
From: Rob Herring @ 2026-01-21 22:14 UTC (permalink / raw)
To: Miquel Raynal (Schneider Electric)
Cc: Mark Brown, Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Magnus Damm, Vaishnav Achath, Thomas Petazzoni, Hervé Codina,
Wolfram Sang, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Pascal Eberhard, linux-spi, devicetree,
linux-kernel, linux-renesas-soc
On Wed, Jan 21, 2026 at 06:04:57PM +0100, Miquel Raynal (Schneider Electric) wrote:
> The if/then/else block sets the restrictions in all cases for
> resets/reset-names, very much like it does for other properties as well
> such as cdns,fifo-depth. Drop the constraints from the place where these
> constraints are simply ignored.
But they aren't.
> Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
> ---
> Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml | 11 ++---------
> 1 file changed, 2 insertions(+), 9 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
> index 53a52fb8b819..b85dba351822 100644
> --- a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
> +++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
> @@ -136,15 +136,8 @@ properties:
> power-domains:
> maxItems: 1
>
> - resets:
> - minItems: 2
> - maxItems: 3
> -
> - reset-names:
> - minItems: 2
> - maxItems: 3
> - items:
> - enum: [ qspi, qspi-ocp, rstc_ref ]
The primary reason to keep this is to prevent making up other names. If
the names are only in if/then schemas then anything is allowed and it's
not visible in reviews.
Rob
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH v3 01/17] spi: dt-bindings: cdns,qspi-nor: Remove duplicated constraints
2026-01-21 22:14 ` Rob Herring
@ 2026-01-22 14:21 ` Miquel Raynal
0 siblings, 0 replies; 27+ messages in thread
From: Miquel Raynal @ 2026-01-22 14:21 UTC (permalink / raw)
To: Rob Herring
Cc: Mark Brown, Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Magnus Damm, Vaishnav Achath, Thomas Petazzoni, Hervé Codina,
Wolfram Sang, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Pascal Eberhard, linux-spi, devicetree,
linux-kernel, linux-renesas-soc
On 21/01/2026 at 16:14:00 -06, Rob Herring <robh@kernel.org> wrote:
> On Wed, Jan 21, 2026 at 06:04:57PM +0100, Miquel Raynal (Schneider Electric) wrote:
>> The if/then/else block sets the restrictions in all cases for
>> resets/reset-names, very much like it does for other properties as well
>> such as cdns,fifo-depth. Drop the constraints from the place where these
>> constraints are simply ignored.
>
> But they aren't.
I looked deeper. Indeed the two constraints are applied, and it works
because the constraints in "if" blocks must be subsets of what is
already a constraint in the main body.
...
>> - resets:
>> - minItems: 2
>> - maxItems: 3
>> -
>> - reset-names:
>> - minItems: 2
>> - maxItems: 3
>> - items:
>> - enum: [ qspi, qspi-ocp, rstc_ref ]
>
> The primary reason to keep this is to prevent making up other names. If
> the names are only in if/then schemas then anything is allowed and it's
> not visible in reviews.
Makes sense. I will drop this patch.
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH v3 02/17] spi: dt-bindings: cdns,qspi-nor: Drop label in example
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
2026-01-21 17:04 ` [PATCH v3 01/17] spi: dt-bindings: cdns,qspi-nor: Remove duplicated constraints Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:04 ` Miquel Raynal (Schneider Electric)
2026-01-21 22:14 ` Rob Herring (Arm)
2026-01-21 17:04 ` [PATCH v3 03/17] spi: dt-bindings: cdns,qspi-nor: Add examples for testing the specific cases Miquel Raynal (Schneider Electric)
` (14 subsequent siblings)
16 siblings, 1 reply; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:04 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
The label is useless here. Plus, if there are several examples with the
same label, we'll get very useless yet annoying warnings.
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
index b85dba351822..123caef8f61e 100644
--- a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
+++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
@@ -165,7 +165,7 @@ unevaluatedProperties: false
examples:
- |
- qspi: spi@ff705000 {
+ spi@ff705000 {
compatible = "intel,socfpga-qspi", "cdns,qspi-nor";
#address-cells = <1>;
#size-cells = <0>;
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* Re: [PATCH v3 02/17] spi: dt-bindings: cdns,qspi-nor: Drop label in example
2026-01-21 17:04 ` [PATCH v3 02/17] spi: dt-bindings: cdns,qspi-nor: Drop label in example Miquel Raynal (Schneider Electric)
@ 2026-01-21 22:14 ` Rob Herring (Arm)
0 siblings, 0 replies; 27+ messages in thread
From: Rob Herring (Arm) @ 2026-01-21 22:14 UTC (permalink / raw)
To: Miquel Raynal (Schneider Electric)
Cc: Pratyush Yadav, linux-spi, Vaishnav Achath, Krzysztof Kozlowski,
Thomas Petazzoni, Vignesh Raghavendra, devicetree, Magnus Damm,
linux-renesas-soc, Santhosh Kumar K, Pascal Eberhard,
Wolfram Sang, Geert Uytterhoeven, Hervé Codina, Mark Brown,
Conor Dooley, linux-kernel
On Wed, 21 Jan 2026 18:04:58 +0100, Miquel Raynal (Schneider Electric) wrote:
> The label is useless here. Plus, if there are several examples with the
> same label, we'll get very useless yet annoying warnings.
>
> Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
> ---
> Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH v3 03/17] spi: dt-bindings: cdns,qspi-nor: Add examples for testing the specific cases
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
2026-01-21 17:04 ` [PATCH v3 01/17] spi: dt-bindings: cdns,qspi-nor: Remove duplicated constraints Miquel Raynal (Schneider Electric)
2026-01-21 17:04 ` [PATCH v3 02/17] spi: dt-bindings: cdns,qspi-nor: Drop label in example Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:04 ` Miquel Raynal (Schneider Electric)
2026-01-21 23:07 ` Rob Herring
2026-01-21 17:05 ` [PATCH v3 04/17] spi: dt-bindings: cdns,qspi-nor: Add Renesas RZ/N1D400 to the list Miquel Raynal (Schneider Electric)
` (13 subsequent siblings)
16 siblings, 1 reply; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:04 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
It is very painful to modify this file because the core IP described is
so common, it has been implemented in many SoCs from different
architectures. Both `dtbs_check` and `dt_binding_check` are rather long
commands, even when restricted to a single schema files, and letting
this file evolve without risking to break other DTSs is painful, because
there are arm, arm64 and riscv platforms impacted and no way to check
all of them at the same time.
Instead, we can identify the few specific cases which may need extra
testing, and fill the examples section to cover them all.
Add examples to cover the Starfive (resets) and Pensando (fifo-depth)
cases.
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
.../devicetree/bindings/spi/cdns,qspi-nor.yaml | 35 ++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
index 123caef8f61e..62b97ab607f3 100644
--- a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
+++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
@@ -189,3 +189,38 @@ examples:
cdns,tslch-ns = <60>;
};
};
+
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/reset/starfive,jh7110-crg.h>
+ #include <dt-bindings/clock/starfive,jh7110-crg.h>
+ spi@13010000 {
+ compatible = "starfive,jh7110-qspi", "cdns,qspi-nor";
+ reg = <0x13010000 0x10000>, <0x21000000 0x400000>;
+ interrupts = <25>;
+ clocks = <&syscrg JH7110_SYSCLK_QSPI_REF>, <&syscrg JH7110_SYSCLK_QSPI_AHB>,
+ <&syscrg JH7110_SYSCLK_QSPI_APB>;
+ clock-names = "ref", "ahb", "apb";
+ resets = <&syscrg JH7110_SYSRST_QSPI_APB>, <&syscrg JH7110_SYSRST_QSPI_AHB>,
+ <&syscrg JH7110_SYSRST_QSPI_REF>;
+ reset-names = "qspi", "qspi-ocp", "rstc_ref";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ cdns,fifo-depth = <256>;
+ cdns,fifo-width = <4>;
+ cdns,trigger-address = <0x0>;
+ };
+
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ spi@2400 {
+ compatible = "amd,pensando-elba-qspi", "cdns,qspi-nor";
+ reg = <0x2400 0x400>, <0x7fff0000 0x1000>;
+ interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&flash_clk>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ cdns,fifo-depth = <1024>;
+ cdns,fifo-width = <4>;
+ cdns,trigger-address = <0x7fff0000>;
+ };
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* Re: [PATCH v3 03/17] spi: dt-bindings: cdns,qspi-nor: Add examples for testing the specific cases
2026-01-21 17:04 ` [PATCH v3 03/17] spi: dt-bindings: cdns,qspi-nor: Add examples for testing the specific cases Miquel Raynal (Schneider Electric)
@ 2026-01-21 23:07 ` Rob Herring
2026-01-22 14:35 ` Miquel Raynal
0 siblings, 1 reply; 27+ messages in thread
From: Rob Herring @ 2026-01-21 23:07 UTC (permalink / raw)
To: Miquel Raynal (Schneider Electric)
Cc: Mark Brown, Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Magnus Damm, Vaishnav Achath, Thomas Petazzoni, Hervé Codina,
Wolfram Sang, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Pascal Eberhard, linux-spi, devicetree,
linux-kernel, linux-renesas-soc
On Wed, Jan 21, 2026 at 06:04:59PM +0100, Miquel Raynal (Schneider Electric) wrote:
> It is very painful to modify this file because the core IP described is
> so common, it has been implemented in many SoCs from different
> architectures. Both `dtbs_check` and `dt_binding_check` are rather long
> commands, even when restricted to a single schema files, and letting
> this file evolve without risking to break other DTSs is painful, because
> there are arm, arm64 and riscv platforms impacted and no way to check
> all of them at the same time.
OTOH, examples aren't meant to be exhaustive test cases of all
possibilities. If it was me, I'd actually just get rid of all the
examples. They are generally just a copy from some .dts we already have.
> Instead, we can identify the few specific cases which may need extra
> testing, and fill the examples section to cover them all.
>
> Add examples to cover the Starfive (resets) and Pensando (fifo-depth)
> cases.
>
> Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
> ---
> .../devicetree/bindings/spi/cdns,qspi-nor.yaml | 35 ++++++++++++++++++++++
> 1 file changed, 35 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
> index 123caef8f61e..62b97ab607f3 100644
> --- a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
> +++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
> @@ -189,3 +189,38 @@ examples:
> cdns,tslch-ns = <60>;
> };
> };
> +
> + - |
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + #include <dt-bindings/reset/starfive,jh7110-crg.h>
> + #include <dt-bindings/clock/starfive,jh7110-crg.h>
> + spi@13010000 {
> + compatible = "starfive,jh7110-qspi", "cdns,qspi-nor";
> + reg = <0x13010000 0x10000>, <0x21000000 0x400000>;
> + interrupts = <25>;
> + clocks = <&syscrg JH7110_SYSCLK_QSPI_REF>, <&syscrg JH7110_SYSCLK_QSPI_AHB>,
> + <&syscrg JH7110_SYSCLK_QSPI_APB>;
> + clock-names = "ref", "ahb", "apb";
> + resets = <&syscrg JH7110_SYSRST_QSPI_APB>, <&syscrg JH7110_SYSRST_QSPI_AHB>,
> + <&syscrg JH7110_SYSRST_QSPI_REF>;
> + reset-names = "qspi", "qspi-ocp", "rstc_ref";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + cdns,fifo-depth = <256>;
> + cdns,fifo-width = <4>;
> + cdns,trigger-address = <0x0>;
> + };
> +
> + - |
> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> + spi@2400 {
> + compatible = "amd,pensando-elba-qspi", "cdns,qspi-nor";
> + reg = <0x2400 0x400>, <0x7fff0000 0x1000>;
> + interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&flash_clk>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> + cdns,fifo-depth = <1024>;
> + cdns,fifo-width = <4>;
> + cdns,trigger-address = <0x7fff0000>;
This one really just looks like a subset of the others.
Rob
^ permalink raw reply [flat|nested] 27+ messages in thread* Re: [PATCH v3 03/17] spi: dt-bindings: cdns,qspi-nor: Add examples for testing the specific cases
2026-01-21 23:07 ` Rob Herring
@ 2026-01-22 14:35 ` Miquel Raynal
2026-01-22 15:32 ` Rob Herring
0 siblings, 1 reply; 27+ messages in thread
From: Miquel Raynal @ 2026-01-22 14:35 UTC (permalink / raw)
To: Rob Herring
Cc: Mark Brown, Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Magnus Damm, Vaishnav Achath, Thomas Petazzoni, Hervé Codina,
Wolfram Sang, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Pascal Eberhard, linux-spi, devicetree,
linux-kernel, linux-renesas-soc
Hi Rob,
On 21/01/2026 at 17:07:59 -06, Rob Herring <robh@kernel.org> wrote:
> On Wed, Jan 21, 2026 at 06:04:59PM +0100, Miquel Raynal (Schneider Electric) wrote:
>> It is very painful to modify this file because the core IP described is
>> so common, it has been implemented in many SoCs from different
>> architectures. Both `dtbs_check` and `dt_binding_check` are rather long
>> commands, even when restricted to a single schema files, and letting
>> this file evolve without risking to break other DTSs is painful, because
>> there are arm, arm64 and riscv platforms impacted and no way to check
>> all of them at the same time.
>
> OTOH, examples aren't meant to be exhaustive test cases of all
> possibilities. If it was me, I'd actually just get rid of all the
> examples. They are generally just a copy from some .dts we already
> have.
I will align with this idea the day `make dtbs_check` (or something
similarly simple) is exhaustive and cross platform :-)
Maybe cdns,qspi-nor is an exception, but it impacts different
architectures, which means the output of `make dtbs_check` is
meaningless because it only covers a subset of the possible cases. Hence
my attempt to gather all specific cases in the bindings, so I could run
all the meaningful checks I wanted more easily.
I think this patch has its usefulness, but I don't mind dropping it.
>> + - |
>> + #include <dt-bindings/interrupt-controller/arm-gic.h>
>> + #include <dt-bindings/reset/starfive,jh7110-crg.h>
>> + #include <dt-bindings/clock/starfive,jh7110-crg.h>
>> + spi@13010000 {
>> + compatible = "starfive,jh7110-qspi", "cdns,qspi-nor";
>> + reg = <0x13010000 0x10000>, <0x21000000 0x400000>;
>> + interrupts = <25>;
>> + clocks = <&syscrg JH7110_SYSCLK_QSPI_REF>, <&syscrg JH7110_SYSCLK_QSPI_AHB>,
>> + <&syscrg JH7110_SYSCLK_QSPI_APB>;
>> + clock-names = "ref", "ahb", "apb";
>> + resets = <&syscrg JH7110_SYSRST_QSPI_APB>, <&syscrg JH7110_SYSRST_QSPI_AHB>,
>> + <&syscrg JH7110_SYSRST_QSPI_REF>;
>> + reset-names = "qspi", "qspi-ocp", "rstc_ref";
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> + cdns,fifo-depth = <256>;
>> + cdns,fifo-width = <4>;
>> + cdns,trigger-address = <0x0>;
>> + };
>> +
>> + - |
>> + #include <dt-bindings/interrupt-controller/arm-gic.h>
>> + spi@2400 {
>> + compatible = "amd,pensando-elba-qspi", "cdns,qspi-nor";
>> + reg = <0x2400 0x400>, <0x7fff0000 0x1000>;
>> + interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
>> + clocks = <&flash_clk>;
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> + cdns,fifo-depth = <1024>;
>> + cdns,fifo-width = <4>;
>> + cdns,trigger-address = <0x7fff0000>;
>
> This one really just looks like a subset of the others.
The fifo-depth possibilities are extended just for this
compatible. Basically I captured in the examples every specific case
covered with an 'if' schema.
Miquèl
^ permalink raw reply [flat|nested] 27+ messages in thread* Re: [PATCH v3 03/17] spi: dt-bindings: cdns,qspi-nor: Add examples for testing the specific cases
2026-01-22 14:35 ` Miquel Raynal
@ 2026-01-22 15:32 ` Rob Herring
0 siblings, 0 replies; 27+ messages in thread
From: Rob Herring @ 2026-01-22 15:32 UTC (permalink / raw)
To: Miquel Raynal
Cc: Mark Brown, Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
Magnus Damm, Vaishnav Achath, Thomas Petazzoni, Hervé Codina,
Wolfram Sang, Vignesh Raghavendra, Santhosh Kumar K,
Pratyush Yadav, Pascal Eberhard, linux-spi, devicetree,
linux-kernel, linux-renesas-soc
On Thu, Jan 22, 2026 at 8:35 AM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Rob,
>
> On 21/01/2026 at 17:07:59 -06, Rob Herring <robh@kernel.org> wrote:
>
> > On Wed, Jan 21, 2026 at 06:04:59PM +0100, Miquel Raynal (Schneider Electric) wrote:
> >> It is very painful to modify this file because the core IP described is
> >> so common, it has been implemented in many SoCs from different
> >> architectures. Both `dtbs_check` and `dt_binding_check` are rather long
> >> commands, even when restricted to a single schema files, and letting
> >> this file evolve without risking to break other DTSs is painful, because
> >> there are arm, arm64 and riscv platforms impacted and no way to check
> >> all of them at the same time.
> >
> > OTOH, examples aren't meant to be exhaustive test cases of all
> > possibilities. If it was me, I'd actually just get rid of all the
> > examples. They are generally just a copy from some .dts we already
> > have.
>
> I will align with this idea the day `make dtbs_check` (or something
> similarly simple) is exhaustive and cross platform :-)
Note that you should be able to build DTBs without $ARCH
cross-compiler. So it's less trouble than building kernels for each
arch.
> Maybe cdns,qspi-nor is an exception, but it impacts different
> architectures, which means the output of `make dtbs_check` is
> meaningless because it only covers a subset of the possible cases. Hence
> my attempt to gather all specific cases in the bindings, so I could run
> all the meaningful checks I wanted more easily.
I used to run this on all patches, but with existing warnings it was
too noisy. Once we get arm64 warning free, I can look at doing that
again. We're at about 300 unique warnings left and over half of those
are 3 platform families.
> I think this patch has its usefulness, but I don't mind dropping it.
I'm okay with adding the first example.
> >> + - |
> >> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> >> + #include <dt-bindings/reset/starfive,jh7110-crg.h>
> >> + #include <dt-bindings/clock/starfive,jh7110-crg.h>
> >> + spi@13010000 {
> >> + compatible = "starfive,jh7110-qspi", "cdns,qspi-nor";
> >> + reg = <0x13010000 0x10000>, <0x21000000 0x400000>;
> >> + interrupts = <25>;
> >> + clocks = <&syscrg JH7110_SYSCLK_QSPI_REF>, <&syscrg JH7110_SYSCLK_QSPI_AHB>,
> >> + <&syscrg JH7110_SYSCLK_QSPI_APB>;
> >> + clock-names = "ref", "ahb", "apb";
> >> + resets = <&syscrg JH7110_SYSRST_QSPI_APB>, <&syscrg JH7110_SYSRST_QSPI_AHB>,
> >> + <&syscrg JH7110_SYSRST_QSPI_REF>;
> >> + reset-names = "qspi", "qspi-ocp", "rstc_ref";
> >> + #address-cells = <1>;
> >> + #size-cells = <0>;
> >> + cdns,fifo-depth = <256>;
> >> + cdns,fifo-width = <4>;
> >> + cdns,trigger-address = <0x0>;
> >> + };
> >> +
> >> + - |
> >> + #include <dt-bindings/interrupt-controller/arm-gic.h>
> >> + spi@2400 {
> >> + compatible = "amd,pensando-elba-qspi", "cdns,qspi-nor";
> >> + reg = <0x2400 0x400>, <0x7fff0000 0x1000>;
> >> + interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
> >> + clocks = <&flash_clk>;
> >> + #address-cells = <1>;
> >> + #size-cells = <0>;
> >> + cdns,fifo-depth = <1024>;
> >> + cdns,fifo-width = <4>;
> >> + cdns,trigger-address = <0x7fff0000>;
> >
> > This one really just looks like a subset of the others.
>
> The fifo-depth possibilities are extended just for this
> compatible. Basically I captured in the examples every specific case
> covered with an 'if' schema.
I get that, but with that argument we should have an example for every
if schema.
Rob
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH v3 04/17] spi: dt-bindings: cdns,qspi-nor: Add Renesas RZ/N1D400 to the list
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
` (2 preceding siblings ...)
2026-01-21 17:04 ` [PATCH v3 03/17] spi: dt-bindings: cdns,qspi-nor: Add examples for testing the specific cases Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:05 ` Miquel Raynal (Schneider Electric)
2026-01-21 23:09 ` Rob Herring (Arm)
2026-01-21 17:05 ` [PATCH v3 05/17] spi: cadence-qspi: Align definitions Miquel Raynal (Schneider Electric)
` (12 subsequent siblings)
16 siblings, 1 reply; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:05 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
Add support for the Renesas RZ/N1D400 QSPI controller.
This SoC is identified in the bindings with its other name: r9a06g032.
It is part of the RZ/N1 family, which contains a "D" and a "S"
variant. IPs in this SoC are typically described using 2 compatibles:
the SoC specific compatible and the family compatible. The original
Cadence IP compatible is dropped because it is unusable on its own.
Indirect accesses are not supported by this flavour of the Cadence IP,
which means several properties have no meaning in the scope of the
Renesas compatible. Let's make sure they are no longer expected nor
mandatory.
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
.../devicetree/bindings/spi/cdns,qspi-nor.yaml | 33 ++++++++++++++++++++--
1 file changed, 31 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
index 62b97ab607f3..fdb25d16a8fb 100644
--- a/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
+++ b/Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
@@ -61,6 +61,20 @@ allOf:
cdns,fifo-depth:
enum: [ 128, 256 ]
default: 128
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: renesas,rzn1-qspi
+ then:
+ properties:
+ cdns,trigger-address: false
+ cdns,fifo-depth: false
+ cdns,fifo-width: false
+ else:
+ required:
+ - cdns,trigger-address
+ - cdns,fifo-depth
properties:
compatible:
@@ -80,6 +94,9 @@ properties:
# controllers are meant to be used with flashes of all kinds,
# ie. also NAND flashes, not only NOR flashes.
- const: cdns,qspi-nor
+ - items:
+ - const: renesas,r9a06g032-qspi
+ - const: renesas,rzn1-qspi
- const: cdns,qspi-nor
deprecated: true
@@ -156,8 +173,6 @@ required:
- reg
- interrupts
- clocks
- - cdns,fifo-width
- - cdns,trigger-address
- '#address-cells'
- '#size-cells'
@@ -224,3 +239,17 @@ examples:
cdns,fifo-width = <4>;
cdns,trigger-address = <0x7fff0000>;
};
+
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/clock/r9a06g032-sysctrl.h>
+ spi@40005000 {
+ compatible = "renesas,r9a06g032-qspi", "renesas,rzn1-qspi";
+ reg = <0x40005000 0x1000>, <0x10000000 0x10000000>;
+ interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&sysctrl R9A06G032_CLK_QSPI0>, <&sysctrl R9A06G032_HCLK_QSPI0>,
+ <&sysctrl R9A06G032_HCLK_QSPI0>;
+ clock-names = "ref", "ahb", "apb";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ };
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* Re: [PATCH v3 04/17] spi: dt-bindings: cdns,qspi-nor: Add Renesas RZ/N1D400 to the list
2026-01-21 17:05 ` [PATCH v3 04/17] spi: dt-bindings: cdns,qspi-nor: Add Renesas RZ/N1D400 to the list Miquel Raynal (Schneider Electric)
@ 2026-01-21 23:09 ` Rob Herring (Arm)
0 siblings, 0 replies; 27+ messages in thread
From: Rob Herring (Arm) @ 2026-01-21 23:09 UTC (permalink / raw)
To: Miquel Raynal (Schneider Electric)
Cc: Vignesh Raghavendra, linux-kernel, Conor Dooley,
Krzysztof Kozlowski, Santhosh Kumar K, linux-renesas-soc,
Vaishnav Achath, Pascal Eberhard, Magnus Damm, devicetree,
Wolfram Sang, Mark Brown, Hervé Codina, Geert Uytterhoeven,
linux-spi, Thomas Petazzoni, Pratyush Yadav
On Wed, 21 Jan 2026 18:05:00 +0100, Miquel Raynal (Schneider Electric) wrote:
> Add support for the Renesas RZ/N1D400 QSPI controller.
>
> This SoC is identified in the bindings with its other name: r9a06g032.
> It is part of the RZ/N1 family, which contains a "D" and a "S"
> variant. IPs in this SoC are typically described using 2 compatibles:
> the SoC specific compatible and the family compatible. The original
> Cadence IP compatible is dropped because it is unusable on its own.
>
> Indirect accesses are not supported by this flavour of the Cadence IP,
> which means several properties have no meaning in the scope of the
> Renesas compatible. Let's make sure they are no longer expected nor
> mandatory.
>
> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
> ---
> .../devicetree/bindings/spi/cdns,qspi-nor.yaml | 33 ++++++++++++++++++++--
> 1 file changed, 31 insertions(+), 2 deletions(-)
>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH v3 05/17] spi: cadence-qspi: Align definitions
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
` (3 preceding siblings ...)
2026-01-21 17:05 ` [PATCH v3 04/17] spi: dt-bindings: cdns,qspi-nor: Add Renesas RZ/N1D400 to the list Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:05 ` Miquel Raynal (Schneider Electric)
2026-01-21 17:05 ` [PATCH v3 06/17] spi: cadence-qspi: Fix style and improve readability Miquel Raynal (Schneider Electric)
` (11 subsequent siblings)
16 siblings, 0 replies; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:05 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
Fix alignment on the #defines.
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
drivers/spi/spi-cadence-quadspi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index b1cf182d6566..cc28da7fc686 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -40,7 +40,7 @@ static_assert(CQSPI_MAX_CHIPSELECT <= SPI_DEVICE_CS_CNT_MAX);
#define CQSPI_DISABLE_DAC_MODE BIT(1)
#define CQSPI_SUPPORT_EXTERNAL_DMA BIT(2)
#define CQSPI_NO_SUPPORT_WR_COMPLETION BIT(3)
-#define CQSPI_SLOW_SRAM BIT(4)
+#define CQSPI_SLOW_SRAM BIT(4)
#define CQSPI_NEEDS_APB_AHB_HAZARD_WAR BIT(5)
#define CQSPI_RD_NO_IRQ BIT(6)
#define CQSPI_DMA_SET_MASK BIT(7)
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 06/17] spi: cadence-qspi: Fix style and improve readability
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
` (4 preceding siblings ...)
2026-01-21 17:05 ` [PATCH v3 05/17] spi: cadence-qspi: Align definitions Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:05 ` Miquel Raynal (Schneider Electric)
2026-01-21 17:05 ` [PATCH v3 07/17] spi: cadence-qspi: Fix ORing style and alignments Miquel Raynal (Schneider Electric)
` (10 subsequent siblings)
16 siblings, 0 replies; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:05 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
It took me several seconds to correctly understand this block. I
understand the goal: showing that we are in the if, or in one of the two
other cases. Improve the organization of the code to both improve
readability and fix the style.
Suggested-by: Pratyush Yadav <pratyush@kernel.org>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
drivers/spi/spi-cadence-quadspi.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index cc28da7fc686..c0a507953c58 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -374,17 +374,12 @@ static irqreturn_t cqspi_irq_handler(int this_irq, void *dev)
/* Clear interrupt */
writel(irq_status, cqspi->iobase + CQSPI_REG_IRQSTATUS);
- if (cqspi->use_dma_read && ddata && ddata->get_dma_status) {
- if (ddata->get_dma_status(cqspi)) {
- complete(&cqspi->transfer_complete);
- return IRQ_HANDLED;
- }
- }
-
- else if (!cqspi->slow_sram)
- irq_status &= CQSPI_IRQ_MASK_RD | CQSPI_IRQ_MASK_WR;
- else
+ if (cqspi->use_dma_read && ddata && ddata->get_dma_status)
+ irq_status = ddata->get_dma_status(cqspi);
+ else if (cqspi->slow_sram)
irq_status &= CQSPI_IRQ_MASK_RD_SLOW_SRAM | CQSPI_IRQ_MASK_WR;
+ else
+ irq_status &= CQSPI_IRQ_MASK_RD | CQSPI_IRQ_MASK_WR;
if (irq_status)
complete(&cqspi->transfer_complete);
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 07/17] spi: cadence-qspi: Fix ORing style and alignments
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
` (5 preceding siblings ...)
2026-01-21 17:05 ` [PATCH v3 06/17] spi: cadence-qspi: Fix style and improve readability Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:05 ` Miquel Raynal (Schneider Electric)
2026-01-21 17:05 ` [PATCH v3 08/17] spi: cadence-qspi: Remove an useless operation Miquel Raynal (Schneider Electric)
` (9 subsequent siblings)
16 siblings, 0 replies; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:05 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
These definitions do not follow the standard patterns. Alignments are
incoherent and the logical OR symbols '|' are misplaced. Reorganize
these definitions.
There is no functional change.
Acked-by: Pratyush Yadav <pratyush@kernel.org>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
drivers/spi/spi-cadence-quadspi.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index c0a507953c58..8eb80b4b76eb 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -2130,26 +2130,23 @@ static const struct cqspi_driver_platdata intel_lgm_qspi = {
};
static const struct cqspi_driver_platdata socfpga_qspi = {
- .quirks = CQSPI_DISABLE_DAC_MODE
- | CQSPI_NO_SUPPORT_WR_COMPLETION
- | CQSPI_SLOW_SRAM
- | CQSPI_DISABLE_STIG_MODE
- | CQSPI_DISABLE_RUNTIME_PM,
+ .quirks = CQSPI_DISABLE_DAC_MODE | CQSPI_NO_SUPPORT_WR_COMPLETION |
+ CQSPI_SLOW_SRAM | CQSPI_DISABLE_STIG_MODE |
+ CQSPI_DISABLE_RUNTIME_PM,
};
static const struct cqspi_driver_platdata versal_ospi = {
.hwcaps_mask = CQSPI_SUPPORTS_OCTAL,
- .quirks = CQSPI_DISABLE_DAC_MODE | CQSPI_SUPPORT_EXTERNAL_DMA
- | CQSPI_DMA_SET_MASK,
+ .quirks = CQSPI_DISABLE_DAC_MODE | CQSPI_SUPPORT_EXTERNAL_DMA |
+ CQSPI_DMA_SET_MASK,
.indirect_read_dma = cqspi_versal_indirect_read_dma,
.get_dma_status = cqspi_get_versal_dma_status,
};
static const struct cqspi_driver_platdata versal2_ospi = {
.hwcaps_mask = CQSPI_SUPPORTS_OCTAL,
- .quirks = CQSPI_DISABLE_DAC_MODE | CQSPI_SUPPORT_EXTERNAL_DMA
- | CQSPI_DMA_SET_MASK
- | CQSPI_SUPPORT_DEVICE_RESET,
+ .quirks = CQSPI_DISABLE_DAC_MODE | CQSPI_SUPPORT_EXTERNAL_DMA |
+ CQSPI_DMA_SET_MASK | CQSPI_SUPPORT_DEVICE_RESET,
.indirect_read_dma = cqspi_versal_indirect_read_dma,
.get_dma_status = cqspi_get_versal_dma_status,
};
@@ -2166,7 +2163,7 @@ static const struct cqspi_driver_platdata pensando_cdns_qspi = {
static const struct cqspi_driver_platdata mobileye_eyeq5_ospi = {
.hwcaps_mask = CQSPI_SUPPORTS_OCTAL,
.quirks = CQSPI_DISABLE_DAC_MODE | CQSPI_NO_SUPPORT_WR_COMPLETION |
- CQSPI_RD_NO_IRQ,
+ CQSPI_RD_NO_IRQ,
};
static const struct of_device_id cqspi_dt_ids[] = {
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 08/17] spi: cadence-qspi: Remove an useless operation
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
` (6 preceding siblings ...)
2026-01-21 17:05 ` [PATCH v3 07/17] spi: cadence-qspi: Fix ORing style and alignments Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:05 ` Miquel Raynal (Schneider Electric)
2026-01-21 17:05 ` [PATCH v3 09/17] spi: cadence-qspi: Make sure we filter out unsupported ops Miquel Raynal (Schneider Electric)
` (8 subsequent siblings)
16 siblings, 0 replies; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:05 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
Right above writing the register value back based on 'div' value, there
is the following check:
if (div > CQSPI_REG_CONFIG_BAUD_MASK)
div = CQSPI_REG_CONFIG_BAUD_MASK;
which means div does not need to be AND'ed against the bitfield mask.
Remove this redundant operation.
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
drivers/spi/spi-cadence-quadspi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 8eb80b4b76eb..06f6c5979229 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1258,7 +1258,7 @@ static void cqspi_config_baudrate_div(struct cqspi_st *cqspi)
reg = readl(reg_base + CQSPI_REG_CONFIG);
reg &= ~(CQSPI_REG_CONFIG_BAUD_MASK << CQSPI_REG_CONFIG_BAUD_LSB);
- reg |= (div & CQSPI_REG_CONFIG_BAUD_MASK) << CQSPI_REG_CONFIG_BAUD_LSB;
+ reg |= div << CQSPI_REG_CONFIG_BAUD_LSB;
writel(reg, reg_base + CQSPI_REG_CONFIG);
}
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 09/17] spi: cadence-qspi: Make sure we filter out unsupported ops
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
` (7 preceding siblings ...)
2026-01-21 17:05 ` [PATCH v3 08/17] spi: cadence-qspi: Remove an useless operation Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:05 ` Miquel Raynal (Schneider Electric)
2026-01-21 17:05 ` [PATCH v3 10/17] spi: cadence-qspi: Fix probe error path and remove Miquel Raynal (Schneider Electric)
` (7 subsequent siblings)
16 siblings, 0 replies; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:05 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
The Cadence driver does not support anything else than repeating the
command opcode twice while in octal DTR mode. Make this clear by
checking for this in the ->supports_op() hook.
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
drivers/spi/spi-cadence-quadspi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 06f6c5979229..fc9f6e8dd549 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1531,6 +1531,10 @@ static bool cqspi_supports_mem_op(struct spi_mem *mem,
return false;
if (op->data.nbytes && op->data.buswidth != 8)
return false;
+
+ /* A single opcode is supported, it will be repeated */
+ if ((op->cmd.opcode >> 8) != (op->cmd.opcode & 0xFF))
+ return false;
} else if (!all_false) {
/* Mixed DTR modes are not supported. */
return false;
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 10/17] spi: cadence-qspi: Fix probe error path and remove
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
` (8 preceding siblings ...)
2026-01-21 17:05 ` [PATCH v3 09/17] spi: cadence-qspi: Make sure we filter out unsupported ops Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:05 ` Miquel Raynal (Schneider Electric)
2026-01-21 17:05 ` [PATCH v3 11/17] spi: cadence-qspi: Try hard to disable the clocks Miquel Raynal (Schneider Electric)
` (6 subsequent siblings)
16 siblings, 0 replies; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:05 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
The probe has been modified by many different users, it is hard to track
history, but for sure its current state is partially broken. One easy
rule to follow is to drop/free/release the resources in the opposite
order they have been queried.
Fix the labels, the order for freeing the resources, and add the
missing DMA channel step. Replicate these changes in the remove path as
well.
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
drivers/spi/spi-cadence-quadspi.c | 44 ++++++++++++++++++++++-----------------
1 file changed, 25 insertions(+), 19 deletions(-)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index fc9f6e8dd549..4bfe65af458e 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1890,7 +1890,7 @@ static int cqspi_probe(struct platform_device *pdev)
ret = clk_prepare_enable(cqspi->clk);
if (ret) {
dev_err(dev, "Cannot enable QSPI clock.\n");
- goto probe_clk_failed;
+ goto disable_rpm;
}
/* Obtain QSPI reset control */
@@ -1898,14 +1898,14 @@ static int cqspi_probe(struct platform_device *pdev)
if (IS_ERR(rstc)) {
ret = PTR_ERR(rstc);
dev_err(dev, "Cannot get QSPI reset.\n");
- goto probe_reset_failed;
+ goto disable_clk;
}
rstc_ocp = devm_reset_control_get_optional_exclusive(dev, "qspi-ocp");
if (IS_ERR(rstc_ocp)) {
ret = PTR_ERR(rstc_ocp);
dev_err(dev, "Cannot get QSPI OCP reset.\n");
- goto probe_reset_failed;
+ goto disable_clk;
}
if (of_device_is_compatible(pdev->dev.of_node, "starfive,jh7110-qspi")) {
@@ -1913,7 +1913,7 @@ static int cqspi_probe(struct platform_device *pdev)
if (IS_ERR(rstc_ref)) {
ret = PTR_ERR(rstc_ref);
dev_err(dev, "Cannot get QSPI REF reset.\n");
- goto probe_reset_failed;
+ goto disable_clk;
}
reset_control_assert(rstc_ref);
reset_control_deassert(rstc_ref);
@@ -1955,7 +1955,7 @@ static int cqspi_probe(struct platform_device *pdev)
if (ddata->jh7110_clk_init) {
ret = cqspi_jh7110_clk_init(pdev, cqspi);
if (ret)
- goto probe_reset_failed;
+ goto disable_clk;
}
if (ddata->quirks & CQSPI_DISABLE_STIG_MODE)
cqspi->disable_stig_mode = true;
@@ -1963,7 +1963,7 @@ static int cqspi_probe(struct platform_device *pdev)
if (ddata->quirks & CQSPI_DMA_SET_MASK) {
ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
if (ret)
- goto probe_reset_failed;
+ goto disable_clks;
}
}
@@ -1974,7 +1974,7 @@ static int cqspi_probe(struct platform_device *pdev)
pdev->name, cqspi);
if (ret) {
dev_err(dev, "Cannot request IRQ.\n");
- goto probe_reset_failed;
+ goto disable_clks;
}
cqspi_wait_idle(cqspi);
@@ -2001,31 +2001,36 @@ static int cqspi_probe(struct platform_device *pdev)
ret = cqspi_request_mmap_dma(cqspi);
if (ret == -EPROBE_DEFER) {
dev_err_probe(&pdev->dev, ret, "Failed to request mmap DMA\n");
- goto probe_setup_failed;
+ goto disable_controller;
}
}
ret = spi_register_controller(host);
if (ret) {
dev_err(&pdev->dev, "failed to register SPI ctlr %d\n", ret);
- goto probe_setup_failed;
+ goto release_dma_chan;
}
if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM)))
pm_runtime_put_autosuspend(dev);
return 0;
-probe_setup_failed:
- if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM)))
- pm_runtime_disable(dev);
+
+release_dma_chan:
+ if (cqspi->rx_chan)
+ dma_release_channel(cqspi->rx_chan);
+disable_controller:
cqspi_controller_enable(cqspi, 0);
-probe_reset_failed:
+disable_clks:
if (cqspi->is_jh7110)
cqspi_jh7110_disable_clk(pdev, cqspi);
-
+disable_clk:
if (pm_runtime_get_sync(&pdev->dev) >= 0)
clk_disable_unprepare(cqspi->clk);
-probe_clk_failed:
+disable_rpm:
+ if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM)))
+ pm_runtime_disable(dev);
+
return ret;
}
@@ -2043,18 +2048,19 @@ static void cqspi_remove(struct platform_device *pdev)
cqspi_wait_idle(cqspi);
spi_unregister_controller(cqspi->host);
- cqspi_controller_enable(cqspi, 0);
if (cqspi->rx_chan)
dma_release_channel(cqspi->rx_chan);
- if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM)))
- if (pm_runtime_get_sync(&pdev->dev) >= 0)
- clk_disable(cqspi->clk);
+ cqspi_controller_enable(cqspi, 0);
if (cqspi->is_jh7110)
cqspi_jh7110_disable_clk(pdev, cqspi);
+ if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM)))
+ if (pm_runtime_get_sync(&pdev->dev) >= 0)
+ clk_disable(cqspi->clk);
+
if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) {
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 11/17] spi: cadence-qspi: Try hard to disable the clocks
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
` (9 preceding siblings ...)
2026-01-21 17:05 ` [PATCH v3 10/17] spi: cadence-qspi: Fix probe error path and remove Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:05 ` Miquel Raynal (Schneider Electric)
2026-01-21 17:05 ` [PATCH v3 12/17] spi: cadence-qspi: Kill cqspi_jh7110_clk_init Miquel Raynal (Schneider Electric)
` (5 subsequent siblings)
16 siblings, 0 replies; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:05 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
In the remove path, we should try hard to perform all steps as we simply
cannot fail.
The "no runtime PM" quirk must only alter the state of the RPM core, but
the clocks should still be disabled if that is possible. Move the
disable call outside of the RPM quirk.
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
drivers/spi/spi-cadence-quadspi.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 4bfe65af458e..af0ad24d8d39 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -2039,6 +2039,7 @@ static void cqspi_remove(struct platform_device *pdev)
const struct cqspi_driver_platdata *ddata;
struct cqspi_st *cqspi = platform_get_drvdata(pdev);
struct device *dev = &pdev->dev;
+ int ret = 0;
ddata = of_device_get_match_data(dev);
@@ -2058,8 +2059,10 @@ static void cqspi_remove(struct platform_device *pdev)
cqspi_jh7110_disable_clk(pdev, cqspi);
if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM)))
- if (pm_runtime_get_sync(&pdev->dev) >= 0)
- clk_disable(cqspi->clk);
+ ret = pm_runtime_get_sync(&pdev->dev);
+
+ if (ret >= 0)
+ clk_disable(cqspi->clk);
if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) {
pm_runtime_put_sync(&pdev->dev);
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 12/17] spi: cadence-qspi: Kill cqspi_jh7110_clk_init
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
` (10 preceding siblings ...)
2026-01-21 17:05 ` [PATCH v3 11/17] spi: cadence-qspi: Try hard to disable the clocks Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:05 ` Miquel Raynal (Schneider Electric)
2026-01-21 17:05 ` [PATCH v3 13/17] spi: cadence-qspi: Add a flag for controllers without indirect access support Miquel Raynal (Schneider Electric)
` (4 subsequent siblings)
16 siblings, 0 replies; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:05 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
This controller can be fed by either a main "ref" clock, or three clocks
("ref" again, "ahb", "apb"). In practice, it is likely that all
controllers have the same inputs, but a single clock feeds the three
interfaces (ref is used for controlling the external interface, ahb/apb
the internal ones). Handling these clocks is in no way SoC specific,
only the number of expected clocks may change. Plus, we will soon be
adding another controller requiring an AHB and an APB clock as well, so
it is time to align the whole clock handling.
Furthermore, the use of the cqspi_jh7110_clk_init() helper, which
specifically grabs and enables the "ahb" and "apb" clocks, is a bit
convoluted:
- only the JH7110 compatible provides the ->jh7110_clk_init() callback,
- in the probe, if the above callback is set in the driver data, the
driver does not call the callback (!) but instead calls the helper
directly (?),
- in the helper, the is_jh7110 boolean is set.
This logic does not make sense. Instead:
- in the probe, set the is_jh7110 boolean based on the compatible,
- collect all available clocks with the "bulk" helper,
- enable the extra clocks if they are available,
- kill the SoC specific cqspi_jh7110_clk_init() helper.
This also allows to group the clock handling instead of depending on the
driver data pointer, which further simplifies the error path and the
remove callback.
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
drivers/spi/spi-cadence-quadspi.c | 112 ++++++++++----------------------------
1 file changed, 29 insertions(+), 83 deletions(-)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index af0ad24d8d39..35379546c3b4 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -55,7 +55,8 @@ static_assert(CQSPI_MAX_CHIPSELECT <= SPI_DEVICE_CS_CNT_MAX);
#define CQSPI_OP_WIDTH(part) ((part).nbytes ? ilog2((part).buswidth) : 0)
enum {
- CLK_QSPI_APB = 0,
+ CLK_QSPI_REF = 0,
+ CLK_QSPI_APB,
CLK_QSPI_AHB,
CLK_QSPI_NUM,
};
@@ -76,8 +77,7 @@ struct cqspi_flash_pdata {
struct cqspi_st {
struct platform_device *pdev;
struct spi_controller *host;
- struct clk *clk;
- struct clk *clks[CLK_QSPI_NUM];
+ struct clk_bulk_data clks[CLK_QSPI_NUM];
unsigned int sclk;
void __iomem *iobase;
@@ -121,8 +121,6 @@ struct cqspi_driver_platdata {
int (*indirect_read_dma)(struct cqspi_flash_pdata *f_pdata,
u_char *rxbuf, loff_t from_addr, size_t n_rx);
u32 (*get_dma_status)(struct cqspi_st *cqspi);
- int (*jh7110_clk_init)(struct platform_device *pdev,
- struct cqspi_st *cqspi);
};
/* Operation timeout value */
@@ -1763,51 +1761,6 @@ static int cqspi_setup_flash(struct cqspi_st *cqspi)
return 0;
}
-static int cqspi_jh7110_clk_init(struct platform_device *pdev, struct cqspi_st *cqspi)
-{
- static struct clk_bulk_data qspiclk[] = {
- { .id = "apb" },
- { .id = "ahb" },
- };
-
- int ret = 0;
-
- ret = devm_clk_bulk_get(&pdev->dev, ARRAY_SIZE(qspiclk), qspiclk);
- if (ret) {
- dev_err(&pdev->dev, "%s: failed to get qspi clocks\n", __func__);
- return ret;
- }
-
- cqspi->clks[CLK_QSPI_APB] = qspiclk[0].clk;
- cqspi->clks[CLK_QSPI_AHB] = qspiclk[1].clk;
-
- ret = clk_prepare_enable(cqspi->clks[CLK_QSPI_APB]);
- if (ret) {
- dev_err(&pdev->dev, "%s: failed to enable CLK_QSPI_APB\n", __func__);
- return ret;
- }
-
- ret = clk_prepare_enable(cqspi->clks[CLK_QSPI_AHB]);
- if (ret) {
- dev_err(&pdev->dev, "%s: failed to enable CLK_QSPI_AHB\n", __func__);
- goto disable_apb_clk;
- }
-
- cqspi->is_jh7110 = true;
-
- return 0;
-
-disable_apb_clk:
- clk_disable_unprepare(cqspi->clks[CLK_QSPI_APB]);
-
- return ret;
-}
-
-static void cqspi_jh7110_disable_clk(struct platform_device *pdev, struct cqspi_st *cqspi)
-{
- clk_disable_unprepare(cqspi->clks[CLK_QSPI_AHB]);
- clk_disable_unprepare(cqspi->clks[CLK_QSPI_APB]);
-}
static int cqspi_probe(struct platform_device *pdev)
{
const struct cqspi_driver_platdata *ddata;
@@ -1816,8 +1769,7 @@ static int cqspi_probe(struct platform_device *pdev)
struct spi_controller *host;
struct resource *res_ahb;
struct cqspi_st *cqspi;
- int ret;
- int irq;
+ int ret, irq;
host = devm_spi_alloc_host(&pdev->dev, sizeof(*cqspi));
if (!host)
@@ -1829,10 +1781,11 @@ static int cqspi_probe(struct platform_device *pdev)
host->dev.of_node = pdev->dev.of_node;
cqspi = spi_controller_get_devdata(host);
+ if (of_device_is_compatible(pdev->dev.of_node, "starfive,jh7110-qspi"))
+ cqspi->is_jh7110 = true;
cqspi->pdev = pdev;
cqspi->host = host;
- cqspi->is_jh7110 = false;
cqspi->ddata = ddata = of_device_get_match_data(dev);
platform_set_drvdata(pdev, cqspi);
@@ -1849,12 +1802,14 @@ static int cqspi_probe(struct platform_device *pdev)
return ret;
}
- /* Obtain QSPI clock. */
- cqspi->clk = devm_clk_get(dev, NULL);
- if (IS_ERR(cqspi->clk)) {
- dev_err(dev, "Cannot claim QSPI clock.\n");
- ret = PTR_ERR(cqspi->clk);
- return ret;
+ /* Obtain QSPI clocks. */
+ ret = devm_clk_bulk_get_optional(dev, CLK_QSPI_NUM, cqspi->clks);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to get clocks\n");
+
+ if (!cqspi->clks[CLK_QSPI_REF].clk) {
+ dev_err(dev, "Cannot claim mandatory QSPI ref clock.\n");
+ return -ENODEV;
}
/* Obtain and remap controller address. */
@@ -1886,10 +1841,9 @@ static int cqspi_probe(struct platform_device *pdev)
if (ret)
return ret;
-
- ret = clk_prepare_enable(cqspi->clk);
+ ret = clk_bulk_prepare_enable(CLK_QSPI_NUM, cqspi->clks);
if (ret) {
- dev_err(dev, "Cannot enable QSPI clock.\n");
+ dev_err(dev, "Cannot enable QSPI clocks.\n");
goto disable_rpm;
}
@@ -1898,22 +1852,22 @@ static int cqspi_probe(struct platform_device *pdev)
if (IS_ERR(rstc)) {
ret = PTR_ERR(rstc);
dev_err(dev, "Cannot get QSPI reset.\n");
- goto disable_clk;
+ goto disable_clks;
}
rstc_ocp = devm_reset_control_get_optional_exclusive(dev, "qspi-ocp");
if (IS_ERR(rstc_ocp)) {
ret = PTR_ERR(rstc_ocp);
dev_err(dev, "Cannot get QSPI OCP reset.\n");
- goto disable_clk;
+ goto disable_clks;
}
- if (of_device_is_compatible(pdev->dev.of_node, "starfive,jh7110-qspi")) {
+ if (cqspi->is_jh7110) {
rstc_ref = devm_reset_control_get_optional_exclusive(dev, "rstc_ref");
if (IS_ERR(rstc_ref)) {
ret = PTR_ERR(rstc_ref);
dev_err(dev, "Cannot get QSPI REF reset.\n");
- goto disable_clk;
+ goto disable_clks;
}
reset_control_assert(rstc_ref);
reset_control_deassert(rstc_ref);
@@ -1925,7 +1879,7 @@ static int cqspi_probe(struct platform_device *pdev)
reset_control_assert(rstc_ocp);
reset_control_deassert(rstc_ocp);
- cqspi->master_ref_clk_hz = clk_get_rate(cqspi->clk);
+ cqspi->master_ref_clk_hz = clk_get_rate(cqspi->clks[CLK_QSPI_REF].clk);
host->max_speed_hz = cqspi->master_ref_clk_hz;
/* write completion is supported by default */
@@ -1951,12 +1905,6 @@ static int cqspi_probe(struct platform_device *pdev)
cqspi->slow_sram = true;
if (ddata->quirks & CQSPI_NEEDS_APB_AHB_HAZARD_WAR)
cqspi->apb_ahb_hazard = true;
-
- if (ddata->jh7110_clk_init) {
- ret = cqspi_jh7110_clk_init(pdev, cqspi);
- if (ret)
- goto disable_clk;
- }
if (ddata->quirks & CQSPI_DISABLE_STIG_MODE)
cqspi->disable_stig_mode = true;
@@ -2022,11 +1970,8 @@ static int cqspi_probe(struct platform_device *pdev)
disable_controller:
cqspi_controller_enable(cqspi, 0);
disable_clks:
- if (cqspi->is_jh7110)
- cqspi_jh7110_disable_clk(pdev, cqspi);
-disable_clk:
if (pm_runtime_get_sync(&pdev->dev) >= 0)
- clk_disable_unprepare(cqspi->clk);
+ clk_bulk_disable_unprepare(CLK_QSPI_NUM, cqspi->clks);
disable_rpm:
if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM)))
pm_runtime_disable(dev);
@@ -2055,14 +2000,12 @@ static void cqspi_remove(struct platform_device *pdev)
cqspi_controller_enable(cqspi, 0);
- if (cqspi->is_jh7110)
- cqspi_jh7110_disable_clk(pdev, cqspi);
if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM)))
ret = pm_runtime_get_sync(&pdev->dev);
if (ret >= 0)
- clk_disable(cqspi->clk);
+ clk_bulk_disable_unprepare(CLK_QSPI_NUM, cqspi->clks);
if (!(ddata && (ddata->quirks & CQSPI_DISABLE_RUNTIME_PM))) {
pm_runtime_put_sync(&pdev->dev);
@@ -2075,15 +2018,19 @@ static int cqspi_runtime_suspend(struct device *dev)
struct cqspi_st *cqspi = dev_get_drvdata(dev);
cqspi_controller_enable(cqspi, 0);
- clk_disable_unprepare(cqspi->clk);
+ clk_bulk_disable_unprepare(CLK_QSPI_NUM, cqspi->clks);
return 0;
}
static int cqspi_runtime_resume(struct device *dev)
{
struct cqspi_st *cqspi = dev_get_drvdata(dev);
+ int ret;
+
+ ret = clk_bulk_prepare_enable(CLK_QSPI_NUM, cqspi->clks);
+ if (ret)
+ return ret;
- clk_prepare_enable(cqspi->clk);
cqspi_wait_idle(cqspi);
cqspi_controller_enable(cqspi, 0);
cqspi_controller_init(cqspi);
@@ -2166,7 +2113,6 @@ static const struct cqspi_driver_platdata versal2_ospi = {
static const struct cqspi_driver_platdata jh7110_qspi = {
.quirks = CQSPI_DISABLE_DAC_MODE,
- .jh7110_clk_init = cqspi_jh7110_clk_init,
};
static const struct cqspi_driver_platdata pensando_cdns_qspi = {
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 13/17] spi: cadence-qspi: Add a flag for controllers without indirect access support
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
` (11 preceding siblings ...)
2026-01-21 17:05 ` [PATCH v3 12/17] spi: cadence-qspi: Kill cqspi_jh7110_clk_init Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:05 ` Miquel Raynal (Schneider Electric)
2026-01-21 17:05 ` [PATCH v3 14/17] spi: cadence-qspi: Make sure write protection is disabled Miquel Raynal (Schneider Electric)
` (3 subsequent siblings)
16 siblings, 0 replies; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:05 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
Renesas RZ/N1 QSPI controllers embed the Cadence IP with some
limitations/simplifications. One of the is that only direct access is
supported, none of the registers related to indirect writes are
populated, so create a flag to avoid these accesses and make sure only
direct accessors are called.
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
drivers/spi/spi-cadence-quadspi.c | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 35379546c3b4..e1ec20684b0a 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -47,6 +47,7 @@ static_assert(CQSPI_MAX_CHIPSELECT <= SPI_DEVICE_CS_CNT_MAX);
#define CQSPI_SUPPORT_DEVICE_RESET BIT(8)
#define CQSPI_DISABLE_STIG_MODE BIT(9)
#define CQSPI_DISABLE_RUNTIME_PM BIT(10)
+#define CQSPI_NO_INDIRECT_MODE BIT(11)
/* Capabilities */
#define CQSPI_SUPPORTS_OCTAL BIT(0)
@@ -1423,7 +1424,8 @@ static ssize_t cqspi_read(struct cqspi_flash_pdata *f_pdata,
if (ret)
return ret;
- if (cqspi->use_direct_mode && ((from + len) <= cqspi->ahb_size))
+ if ((cqspi->use_direct_mode && ((from + len) <= cqspi->ahb_size)) ||
+ (cqspi->ddata && cqspi->ddata->quirks & CQSPI_NO_INDIRECT_MODE))
return cqspi_direct_read_execute(f_pdata, buf, from, len);
if (cqspi->use_dma_read && ddata && ddata->indirect_read_dma &&
@@ -1624,19 +1626,20 @@ static void cqspi_controller_init(struct cqspi_st *cqspi)
/* Disable all interrupts. */
writel(0, cqspi->iobase + CQSPI_REG_IRQMASK);
- /* Configure the SRAM split to 1:1 . */
- writel(cqspi->fifo_depth / 2, cqspi->iobase + CQSPI_REG_SRAMPARTITION);
+ if (!(cqspi->ddata && cqspi->ddata->quirks & CQSPI_NO_INDIRECT_MODE)) {
+ /* Configure the SRAM split to 1:1 . */
+ writel(cqspi->fifo_depth / 2, cqspi->iobase + CQSPI_REG_SRAMPARTITION);
+ /* Load indirect trigger address. */
+ writel(cqspi->trigger_address,
+ cqspi->iobase + CQSPI_REG_INDIRECTTRIGGER);
- /* Load indirect trigger address. */
- writel(cqspi->trigger_address,
- cqspi->iobase + CQSPI_REG_INDIRECTTRIGGER);
-
- /* Program read watermark -- 1/2 of the FIFO. */
- writel(cqspi->fifo_depth * cqspi->fifo_width / 2,
- cqspi->iobase + CQSPI_REG_INDIRECTRDWATERMARK);
- /* Program write watermark -- 1/8 of the FIFO. */
- writel(cqspi->fifo_depth * cqspi->fifo_width / 8,
- cqspi->iobase + CQSPI_REG_INDIRECTWRWATERMARK);
+ /* Program read watermark -- 1/2 of the FIFO. */
+ writel(cqspi->fifo_depth * cqspi->fifo_width / 2,
+ cqspi->iobase + CQSPI_REG_INDIRECTRDWATERMARK);
+ /* Program write watermark -- 1/8 of the FIFO. */
+ writel(cqspi->fifo_depth * cqspi->fifo_width / 8,
+ cqspi->iobase + CQSPI_REG_INDIRECTWRWATERMARK);
+ }
/* Disable direct access controller */
if (!cqspi->use_direct_mode) {
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 14/17] spi: cadence-qspi: Make sure write protection is disabled
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
` (12 preceding siblings ...)
2026-01-21 17:05 ` [PATCH v3 13/17] spi: cadence-qspi: Add a flag for controllers without indirect access support Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:05 ` Miquel Raynal (Schneider Electric)
2026-01-21 17:05 ` [PATCH v3 15/17] spi: cadence-qspi: Use a default value for cdns,fifo-width Miquel Raynal (Schneider Electric)
` (2 subsequent siblings)
16 siblings, 0 replies; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:05 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
Renesas RZ/N1 QSPI controllers embed the Cadence IP with some
modifications. For instance, they feature a write protection of the
direct mapping at the controller level, with this feature all data
writes to the AHB region are aborted.
Despite the fact that the flag setting write protection is disabled by
default, Bootloaders may (and actually do) set it, so mark this feature
as being available with a specific flag to, if applicable, make sure it
is disabled.
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
drivers/spi/spi-cadence-quadspi.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index e1ec20684b0a..e0e4423baed9 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -48,6 +48,7 @@ static_assert(CQSPI_MAX_CHIPSELECT <= SPI_DEVICE_CS_CNT_MAX);
#define CQSPI_DISABLE_STIG_MODE BIT(9)
#define CQSPI_DISABLE_RUNTIME_PM BIT(10)
#define CQSPI_NO_INDIRECT_MODE BIT(11)
+#define CQSPI_HAS_WR_PROTECT BIT(12)
/* Capabilities */
#define CQSPI_SUPPORTS_OCTAL BIT(0)
@@ -218,6 +219,8 @@ struct cqspi_driver_platdata {
#define CQSPI_REG_IRQSTATUS 0x40
#define CQSPI_REG_IRQMASK 0x44
+#define CQSPI_REG_WR_PROT_CTRL 0x58
+
#define CQSPI_REG_INDIRECTRD 0x60
#define CQSPI_REG_INDIRECTRD_START_MASK BIT(0)
#define CQSPI_REG_INDIRECTRD_CANCEL_MASK BIT(1)
@@ -1641,6 +1644,10 @@ static void cqspi_controller_init(struct cqspi_st *cqspi)
cqspi->iobase + CQSPI_REG_INDIRECTWRWATERMARK);
}
+ /* Disable write protection at controller level */
+ if (cqspi->ddata && cqspi->ddata->quirks & CQSPI_HAS_WR_PROTECT)
+ writel(0, cqspi->iobase + CQSPI_REG_WR_PROT_CTRL);
+
/* Disable direct access controller */
if (!cqspi->use_direct_mode) {
reg = readl(cqspi->iobase + CQSPI_REG_CONFIG);
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 15/17] spi: cadence-qspi: Use a default value for cdns,fifo-width
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
` (13 preceding siblings ...)
2026-01-21 17:05 ` [PATCH v3 14/17] spi: cadence-qspi: Make sure write protection is disabled Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:05 ` Miquel Raynal (Schneider Electric)
2026-01-21 17:05 ` [PATCH v3 16/17] spi: cadence-qspi: Add support for the Renesas RZ/N1 controller Miquel Raynal (Schneider Electric)
2026-01-21 17:05 ` [PATCH v3 17/17] ARM: dts: r9a06g032: Describe the QSPI controller Miquel Raynal (Schneider Electric)
16 siblings, 0 replies; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:05 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
Bindings expect 4 to be the default value for cdns,fifo-width. Said
otherwise, if the property (which is not mandatory) is not provided, the
OS, in order to comply with the bindings, should not error out and take
4 as default value.
Comply with the bindings. This would have slighlty simplyfied my testing
if it had been implemented correctly in the first place, but in practice
it should have no impact on the existing boards using this controller, as
they all set cdns,fifo-width to 4 explicitly in their upstream DTS.
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
drivers/spi/spi-cadence-quadspi.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index e0e4423baed9..5f3a914e45f7 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -1596,10 +1596,8 @@ static int cqspi_of_get_pdata(struct cqspi_st *cqspi)
cqspi->fifo_depth = 0;
}
- if (of_property_read_u32(np, "cdns,fifo-width", &cqspi->fifo_width)) {
- dev_err(dev, "couldn't determine fifo-width\n");
- return -ENXIO;
- }
+ if (of_property_read_u32(np, "cdns,fifo-width", &cqspi->fifo_width))
+ cqspi->fifo_width = 4;
if (of_property_read_u32(np, "cdns,trigger-address",
&cqspi->trigger_address)) {
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 16/17] spi: cadence-qspi: Add support for the Renesas RZ/N1 controller
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
` (14 preceding siblings ...)
2026-01-21 17:05 ` [PATCH v3 15/17] spi: cadence-qspi: Use a default value for cdns,fifo-width Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:05 ` Miquel Raynal (Schneider Electric)
2026-01-21 17:05 ` [PATCH v3 17/17] ARM: dts: r9a06g032: Describe the QSPI controller Miquel Raynal (Schneider Electric)
16 siblings, 0 replies; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:05 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
Renesas RZ/N1 QSPI controllers embed a modified version of the Cadence
IP with the following settings:
- a limited bus clock range
- no DTR support
- no DMA
- no useful interrupt flag
- only direct accesses (no INDAC mode)
- write protection
The controller has been tested by running the SPI NOR check list with a
custom RZ/N1D400 based board mounted with a Spansion s25fl128s1 quad
SPI.
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
Output of the SPI NOR test procedure:
s25fl128s1
0120184d0180
spansion
xxd: /sys/bus/spi/devices/spi0.0/spi-nor/sfdp: No such file or directory
md5sum: can't open '/sys/bus/spi/devices/spi0.0/spi-nor/sfdp': No such file or directory
1+0 records in
1+0 records out
Copied 65536 bytes from qspi_test to address 0x00000000 in flash
Erased 65536 bytes from address 0x00000000 in flash
Copied 65536 bytes from address 0x00000000 in flash to qspi_read
0000000 ffff ffff ffff ffff ffff ffff ffff ffff
*
0010000
Copied 65536 bytes from qspi_test to address 0x00000000 in flash
Copied 65536 bytes from address 0x00000000 in flash to qspi_read
71f8b056a4bf5f51639a972dc9aac55eb8654fdc qspi_test
71f8b056a4bf5f51639a972dc9aac55eb8654fdc qspi_read
Read speed:
* page read speed is 6464 KiB/s
* 2 page read speed is 9014 KiB/s
* eraseblock read speed is 14222 KiB/s
Write speed:
* page write speed is 621 KiB/s
* 2 page write speed is 626 KiB/s
* eraseblock write speed is 633 KiB/s
Erase speed:
* erase speed is 617 KiB/s
---
drivers/spi/spi-cadence-quadspi.c | 56 +++++++++++++++++++++++++++++----------
1 file changed, 42 insertions(+), 14 deletions(-)
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
index 5f3a914e45f7..6dd14ac37434 100644
--- a/drivers/spi/spi-cadence-quadspi.c
+++ b/drivers/spi/spi-cadence-quadspi.c
@@ -110,6 +110,7 @@ struct cqspi_st {
bool apb_ahb_hazard;
bool is_jh7110; /* Flag for StarFive JH7110 SoC */
+ bool is_rzn1; /* Flag for Renesas RZN1 SoC */
bool disable_stig_mode;
refcount_t refcount;
refcount_t inflight_ops;
@@ -1337,8 +1338,9 @@ static ssize_t cqspi_write(struct cqspi_flash_pdata *f_pdata,
* mode. So, we can not use direct mode when in DTR mode for writing
* data.
*/
- if (!op->cmd.dtr && cqspi->use_direct_mode &&
- cqspi->use_direct_mode_wr && ((to + len) <= cqspi->ahb_size)) {
+ if ((!op->cmd.dtr && cqspi->use_direct_mode &&
+ cqspi->use_direct_mode_wr && ((to + len) <= cqspi->ahb_size)) ||
+ (cqspi->ddata && cqspi->ddata->quirks & CQSPI_NO_INDIRECT_MODE)) {
memcpy_toio(cqspi->ahb_base + to, buf, len);
return cqspi_wait_idle(cqspi);
}
@@ -1512,6 +1514,7 @@ static int cqspi_exec_mem_op(struct spi_mem *mem, const struct spi_mem_op *op)
static bool cqspi_supports_mem_op(struct spi_mem *mem,
const struct spi_mem_op *op)
{
+ struct cqspi_st *cqspi = spi_controller_get_devdata(mem->spi->controller);
bool all_true, all_false;
/*
@@ -1538,6 +1541,9 @@ static bool cqspi_supports_mem_op(struct spi_mem *mem,
/* A single opcode is supported, it will be repeated */
if ((op->cmd.opcode >> 8) != (op->cmd.opcode & 0xFF))
return false;
+
+ if (cqspi->is_rzn1)
+ return false;
} else if (!all_false) {
/* Mixed DTR modes are not supported. */
return false;
@@ -1591,18 +1597,20 @@ static int cqspi_of_get_pdata(struct cqspi_st *cqspi)
cqspi->is_decoded_cs = of_property_read_bool(np, "cdns,is-decoded-cs");
- if (of_property_read_u32(np, "cdns,fifo-depth", &cqspi->fifo_depth)) {
- /* Zero signals FIFO depth should be runtime detected. */
- cqspi->fifo_depth = 0;
- }
+ if (!(cqspi->ddata && cqspi->ddata->quirks & CQSPI_NO_INDIRECT_MODE)) {
+ if (of_property_read_u32(np, "cdns,fifo-depth", &cqspi->fifo_depth)) {
+ /* Zero signals FIFO depth should be runtime detected. */
+ cqspi->fifo_depth = 0;
+ }
- if (of_property_read_u32(np, "cdns,fifo-width", &cqspi->fifo_width))
- cqspi->fifo_width = 4;
+ if (of_property_read_u32(np, "cdns,fifo-width", &cqspi->fifo_width))
+ cqspi->fifo_width = 4;
- if (of_property_read_u32(np, "cdns,trigger-address",
- &cqspi->trigger_address)) {
- dev_err(dev, "couldn't determine trigger-address\n");
- return -ENXIO;
+ if (of_property_read_u32(np, "cdns,trigger-address",
+ &cqspi->trigger_address)) {
+ dev_err(dev, "couldn't determine trigger-address\n");
+ return -ENXIO;
+ }
}
if (of_property_read_u32(np, "num-cs", &cqspi->num_chipselect))
@@ -1666,6 +1674,9 @@ static void cqspi_controller_detect_fifo_depth(struct cqspi_st *cqspi)
struct device *dev = &cqspi->pdev->dev;
u32 reg, fifo_depth;
+ if (cqspi->ddata && cqspi->ddata->quirks & CQSPI_NO_INDIRECT_MODE)
+ return;
+
/*
* Bits N-1:0 are writable while bits 31:N are read as zero, with 2^N
* the FIFO depth.
@@ -1791,6 +1802,8 @@ static int cqspi_probe(struct platform_device *pdev)
cqspi = spi_controller_get_devdata(host);
if (of_device_is_compatible(pdev->dev.of_node, "starfive,jh7110-qspi"))
cqspi->is_jh7110 = true;
+ if (of_device_is_compatible(pdev->dev.of_node, "renesas,rzn1-qspi"))
+ cqspi->is_rzn1 = true;
cqspi->pdev = pdev;
cqspi->host = host;
@@ -1888,7 +1901,12 @@ static int cqspi_probe(struct platform_device *pdev)
reset_control_deassert(rstc_ocp);
cqspi->master_ref_clk_hz = clk_get_rate(cqspi->clks[CLK_QSPI_REF].clk);
- host->max_speed_hz = cqspi->master_ref_clk_hz;
+ if (!cqspi->is_rzn1) {
+ host->max_speed_hz = cqspi->master_ref_clk_hz;
+ } else {
+ host->max_speed_hz = cqspi->master_ref_clk_hz / 2;
+ host->min_speed_hz = cqspi->master_ref_clk_hz / 32;
+ }
/* write completion is supported by default */
cqspi->wr_completion = true;
@@ -1953,7 +1971,7 @@ static int cqspi_probe(struct platform_device *pdev)
if (ddata && (ddata->quirks & CQSPI_SUPPORT_DEVICE_RESET))
cqspi_device_reset(cqspi);
- if (cqspi->use_direct_mode) {
+ if (cqspi->use_direct_mode && !cqspi->is_rzn1) {
ret = cqspi_request_mmap_dma(cqspi);
if (ret == -EPROBE_DEFER) {
dev_err_probe(&pdev->dev, ret, "Failed to request mmap DMA\n");
@@ -2133,6 +2151,12 @@ static const struct cqspi_driver_platdata mobileye_eyeq5_ospi = {
CQSPI_RD_NO_IRQ,
};
+static const struct cqspi_driver_platdata renesas_rzn1_qspi = {
+ .hwcaps_mask = CQSPI_SUPPORTS_QUAD,
+ .quirks = CQSPI_NO_SUPPORT_WR_COMPLETION | CQSPI_RD_NO_IRQ |
+ CQSPI_HAS_WR_PROTECT | CQSPI_NO_INDIRECT_MODE,
+};
+
static const struct of_device_id cqspi_dt_ids[] = {
{
.compatible = "cdns,qspi-nor",
@@ -2174,6 +2198,10 @@ static const struct of_device_id cqspi_dt_ids[] = {
.compatible = "amd,versal2-ospi",
.data = &versal2_ospi,
},
+ {
+ .compatible = "renesas,rzn1-qspi",
+ .data = &renesas_rzn1_qspi,
+ },
{ /* end of table */ }
};
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* [PATCH v3 17/17] ARM: dts: r9a06g032: Describe the QSPI controller
2026-01-21 17:04 [PATCH v3 00/17] spi: cadence-qspi: Add Renesas RZ/N1 support Miquel Raynal (Schneider Electric)
` (15 preceding siblings ...)
2026-01-21 17:05 ` [PATCH v3 16/17] spi: cadence-qspi: Add support for the Renesas RZ/N1 controller Miquel Raynal (Schneider Electric)
@ 2026-01-21 17:05 ` Miquel Raynal (Schneider Electric)
2026-01-22 10:59 ` Geert Uytterhoeven
16 siblings, 1 reply; 27+ messages in thread
From: Miquel Raynal (Schneider Electric) @ 2026-01-21 17:05 UTC (permalink / raw)
To: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath
Cc: Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc, Miquel Raynal (Schneider Electric)
Add a node describing the QSPI controller.
There are 2 clocks feeding this controller:
- one for the reference clock
- one that feeds both the ahb and the apb interfaces
As the binding expect either the ref clock, or all three (ref, ahb and
apb) clocks, it makes sense to provide the same clock twice.
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
---
arch/arm/boot/dts/renesas/r9a06g032.dtsi | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm/boot/dts/renesas/r9a06g032.dtsi b/arch/arm/boot/dts/renesas/r9a06g032.dtsi
index 8debb77803bb..d20f397dcd96 100644
--- a/arch/arm/boot/dts/renesas/r9a06g032.dtsi
+++ b/arch/arm/boot/dts/renesas/r9a06g032.dtsi
@@ -66,6 +66,20 @@ soc {
#size-cells = <1>;
ranges;
+ qspi0: spi@40005000 {
+ compatible = "renesas,r9a06g032-qspi", "renesas,rzn1-qspi";
+ reg = <0x40005000 0x1000>, <0x10000000 0x10000000>;
+ interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&sysctrl R9A06G032_CLK_QSPI0>, <&sysctrl R9A06G032_HCLK_QSPI0>,
+ <&sysctrl R9A06G032_HCLK_QSPI0>;
+ clock-names = "ref", "ahb", "apb";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ cdns,fifo-width = <4>;
+ cdns,fifo-depth = <4>;
+ status = "disabled";
+ };
+
rtc0: rtc@40006000 {
compatible = "renesas,r9a06g032-rtc", "renesas,rzn1-rtc";
reg = <0x40006000 0x1000>;
--
2.51.1
^ permalink raw reply related [flat|nested] 27+ messages in thread* Re: [PATCH v3 17/17] ARM: dts: r9a06g032: Describe the QSPI controller
2026-01-21 17:05 ` [PATCH v3 17/17] ARM: dts: r9a06g032: Describe the QSPI controller Miquel Raynal (Schneider Electric)
@ 2026-01-22 10:59 ` Geert Uytterhoeven
2026-01-22 13:12 ` Miquel Raynal
0 siblings, 1 reply; 27+ messages in thread
From: Geert Uytterhoeven @ 2026-01-22 10:59 UTC (permalink / raw)
To: Miquel Raynal (Schneider Electric)
Cc: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath,
Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc
Hi Miquel,
On Wed, 21 Jan 2026 at 18:05, Miquel Raynal (Schneider Electric)
<miquel.raynal@bootlin.com> wrote:
> Add a node describing the QSPI controller.
> There are 2 clocks feeding this controller:
> - one for the reference clock
> - one that feeds both the ahb and the apb interfaces
> As the binding expect either the ref clock, or all three (ref, ahb and
> apb) clocks, it makes sense to provide the same clock twice.
>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Signed-off-by: Miquel Raynal (Schneider Electric) <miquel.raynal@bootlin.com>
Thanks for the update!
> --- a/arch/arm/boot/dts/renesas/r9a06g032.dtsi
> +++ b/arch/arm/boot/dts/renesas/r9a06g032.dtsi
> @@ -66,6 +66,20 @@ soc {
> #size-cells = <1>;
> ranges;
>
> + qspi0: spi@40005000 {
> + compatible = "renesas,r9a06g032-qspi", "renesas,rzn1-qspi";
> + reg = <0x40005000 0x1000>, <0x10000000 0x10000000>;
> + interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&sysctrl R9A06G032_CLK_QSPI0>, <&sysctrl R9A06G032_HCLK_QSPI0>,
> + <&sysctrl R9A06G032_HCLK_QSPI0>;
> + clock-names = "ref", "ahb", "apb";
> + #address-cells = <1>;
> + #size-cells = <0>;
> + cdns,fifo-width = <4>;
> + cdns,fifo-depth = <4>;
These two should be dropped, as per the updates to v3 of 04/17.
> + status = "disabled";
> + };
> +
> rtc0: rtc@40006000 {
> compatible = "renesas,r9a06g032-rtc", "renesas,rzn1-rtc";
> reg = <0x40006000 0x1000>;
>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 27+ messages in thread* Re: [PATCH v3 17/17] ARM: dts: r9a06g032: Describe the QSPI controller
2026-01-22 10:59 ` Geert Uytterhoeven
@ 2026-01-22 13:12 ` Miquel Raynal
0 siblings, 0 replies; 27+ messages in thread
From: Miquel Raynal @ 2026-01-22 13:12 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Geert Uytterhoeven, Magnus Damm, Vaishnav Achath,
Thomas Petazzoni, Hervé Codina, Wolfram Sang,
Vignesh Raghavendra, Santhosh Kumar K, Pratyush Yadav,
Pascal Eberhard, linux-spi, devicetree, linux-kernel,
linux-renesas-soc
Hi Geert,
>>
>> + qspi0: spi@40005000 {
>> + compatible = "renesas,r9a06g032-qspi", "renesas,rzn1-qspi";
>> + reg = <0x40005000 0x1000>, <0x10000000 0x10000000>;
>> + interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>;
>> + clocks = <&sysctrl R9A06G032_CLK_QSPI0>, <&sysctrl R9A06G032_HCLK_QSPI0>,
>> + <&sysctrl R9A06G032_HCLK_QSPI0>;
>> + clock-names = "ref", "ahb", "apb";
>> + #address-cells = <1>;
>> + #size-cells = <0>;
>> + cdns,fifo-width = <4>;
>> + cdns,fifo-depth = <4>;
>
> These two should be dropped, as per the updates to v3 of 04/17.
Gniiiiiii -_-
I did it in the yaml example and forgot to replicate it here.
Miquèl
^ permalink raw reply [flat|nested] 27+ messages in thread