* [PATCH v2 0/9] spi: enable the SpacemiT K1 SoC QSPI
@ 2025-10-23 17:59 Alex Elder
2025-10-23 17:59 ` [PATCH v2 1/9] dt-bindings: spi: fsl-qspi: support SpacemiT K1 Alex Elder
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Alex Elder @ 2025-10-23 17:59 UTC (permalink / raw)
To: robh, krzk+dt, conor+dt, han.xu, broonie, dlan, pjw
Cc: Frank.li, p.zabel, guodong, palmer, aou, alex, apatel, joel,
geert+renesas, cyy, heylenay, conor.dooley, fustini, linux-spi,
devicetree, imx, spacemit, linux-riscv, linux-kernel
This series adds support for the SpacemiT K1 SoC QSPI. This IP
is generally compatible with the Freescale QSPI driver, requiring
three minor changes to enable it to be supported. The changes
are:
- Adding support for optional resets
- Having the clock *not* be disabled when changing its rate
- Allowing the size of storage blocks written to flash chips
to be set to something different from the AHB buffer size
-Alex
This series is available here:
https://github.com/riscstar/linux/tree/outgoing/qspi-v2
Version 2 addresses comments recieved during review of v1:
- The "reset" property now only applies to spacemit,k1-qspi compatible.
- Patch 1 (previously patch 2) now points out that this is the first
non-Freescale device using the binding.
- Added Frank Li's Reviewed-by on patch 3.
- A quirk flag has been renamed to be QUADSPI_QUIRK_SKIP_CLK_DISABLE.
- The predicate for that quirk now returns bool type.
- All other similar predicates now return bool type; this is done in a new
patch (patch 4).
- If non-zero, new field fsl_qspi_devtype_data->sfa_size defines the
size of the serial flash regions, rather than ahb_buf_size.
- A continued line in the Kconfig is now aligned.
- Patch descriptions are wrapped at 75 columns.
Alex Elder (9):
dt-bindings: spi: fsl-qspi: support SpacemiT K1
dt-bindings: spi: fsl-qspi: add optional resets
spi: fsl-qspi: add optional reset support
spi: fsl-qspi: switch predicates to bool
spi: fsl-qspi: add a clock disable quirk
spi: fsl-qspi: allot 1KB per chip
spi: fsl-qspi: support the SpacemiT K1 SoC
riscv: dts: spacemit: enable K1 SoC QSPI on BPI-F3
riscv: defconfig: enable SPI_FSL_QUADSPI as a module
.../bindings/spi/fsl,spi-fsl-qspi.yaml | 16 ++++
.../boot/dts/spacemit/k1-bananapi-f3.dts | 6 ++
arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 21 +++++
arch/riscv/boot/dts/spacemit/k1.dtsi | 16 ++++
arch/riscv/configs/defconfig | 1 +
drivers/spi/Kconfig | 3 +-
drivers/spi/spi-fsl-qspi.c | 87 +++++++++++++------
7 files changed, 124 insertions(+), 26 deletions(-)
base-commit: efb26a23ed5f5dc3554886ab398f559dcb1de96b
--
2.43.0
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v2 1/9] dt-bindings: spi: fsl-qspi: support SpacemiT K1
2025-10-23 17:59 [PATCH v2 0/9] spi: enable the SpacemiT K1 SoC QSPI Alex Elder
@ 2025-10-23 17:59 ` Alex Elder
2025-10-23 18:51 ` Conor Dooley
2025-10-23 23:29 ` Frank Li
2025-10-23 17:59 ` [PATCH v2 2/9] dt-bindings: spi: fsl-qspi: add optional resets Alex Elder
2025-10-23 17:59 ` [PATCH v2 8/9] riscv: dts: spacemit: enable K1 SoC QSPI on BPI-F3 Alex Elder
2 siblings, 2 replies; 9+ messages in thread
From: Alex Elder @ 2025-10-23 17:59 UTC (permalink / raw)
To: robh, krzk+dt, conor+dt, han.xu, broonie
Cc: dlan, Frank.li, guodong, devicetree, linux-spi, imx, spacemit,
linux-riscv, linux-kernel
Add the SpacemiT K1 SoC QSPI IP to the list of supported hardware. This
is the first non-Freescale device represented here. It has a nearly
identidal register set, and this binding correctly describes the hardware.
Signed-off-by: Alex Elder <elder@riscstar.com>
---
v2: - Point out that this is the first non-Freescale device used here
Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
index f2dd20370dbb3..5e6aff1bc2ed3 100644
--- a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
+++ b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
@@ -22,6 +22,7 @@ properties:
- fsl,imx6ul-qspi
- fsl,ls1021a-qspi
- fsl,ls2080a-qspi
+ - spacemit,k1-qspi
- items:
- enum:
- fsl,ls1043a-qspi
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 2/9] dt-bindings: spi: fsl-qspi: add optional resets
2025-10-23 17:59 [PATCH v2 0/9] spi: enable the SpacemiT K1 SoC QSPI Alex Elder
2025-10-23 17:59 ` [PATCH v2 1/9] dt-bindings: spi: fsl-qspi: support SpacemiT K1 Alex Elder
@ 2025-10-23 17:59 ` Alex Elder
2025-10-23 18:52 ` Conor Dooley
2025-10-23 23:32 ` Frank Li
2025-10-23 17:59 ` [PATCH v2 8/9] riscv: dts: spacemit: enable K1 SoC QSPI on BPI-F3 Alex Elder
2 siblings, 2 replies; 9+ messages in thread
From: Alex Elder @ 2025-10-23 17:59 UTC (permalink / raw)
To: robh, krzk+dt, conor+dt, han.xu, broonie
Cc: dlan, Frank.li, guodong, linux-spi, imx, devicetree, spacemit,
linux-riscv, linux-kernel
Allow two resets to be defined to support the SpacemiT K1 SoC QSPI IP.
Signed-off-by: Alex Elder <elder@riscstar.com>
---
v2: - The "reset" property now only applies to spacemit,k1-qspi compatible
.../devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
index 5e6aff1bc2ed3..edd3158a6f2e8 100644
--- a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
+++ b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
@@ -55,6 +55,21 @@ properties:
- const: qspi_en
- const: qspi
+ resets:
+ items:
+ - description: SoC QSPI reset
+ - description: SoC QSPI bus reset
+
+if:
+ properties:
+ compatible:
+ not:
+ contains:
+ const: spacemit,k1-qspi
+then:
+ properties:
+ resets: false
+
required:
- compatible
- reg
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v2 8/9] riscv: dts: spacemit: enable K1 SoC QSPI on BPI-F3
2025-10-23 17:59 [PATCH v2 0/9] spi: enable the SpacemiT K1 SoC QSPI Alex Elder
2025-10-23 17:59 ` [PATCH v2 1/9] dt-bindings: spi: fsl-qspi: support SpacemiT K1 Alex Elder
2025-10-23 17:59 ` [PATCH v2 2/9] dt-bindings: spi: fsl-qspi: add optional resets Alex Elder
@ 2025-10-23 17:59 ` Alex Elder
2 siblings, 0 replies; 9+ messages in thread
From: Alex Elder @ 2025-10-23 17:59 UTC (permalink / raw)
To: dlan, robh, krzk+dt, conor+dt
Cc: Frank.li, guodong, pjw, palmer, aou, alex, devicetree, spacemit,
linux-riscv, linux-kernel
Define DTS nodes to enable support for QSPI on the K1 SoC, including the
pin control configuration used. Enable QSPI on the Banana Pi BPI-F3 board.
Signed-off-by: Alex Elder <elder@riscstar.com>
---
.../boot/dts/spacemit/k1-bananapi-f3.dts | 6 ++++++
arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 21 +++++++++++++++++++
arch/riscv/boot/dts/spacemit/k1.dtsi | 16 ++++++++++++++
3 files changed, 43 insertions(+)
diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
index 33ca816bfd4b3..2f3750f7fd6f3 100644
--- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
+++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
@@ -258,6 +258,12 @@ dldo7 {
};
};
+&qspi {
+ pinctrl-names = "default";
+ pinctrl-0 = <&qspi_cfg>;
+ status = "okay";
+};
+
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_2_cfg>;
diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
index 4eef81d583f3d..e922e05ff856d 100644
--- a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
@@ -73,6 +73,27 @@ i2c8-0-pins {
};
};
+ qspi_cfg: qspi-cfg {
+ qspi-pins {
+ pinmux = <K1_PADCONF(98, 0)>, /* QSPI_DATA3 */
+ <K1_PADCONF(99, 0)>, /* QSPI_DATA2 */
+ <K1_PADCONF(100, 0)>, /* QSPI_DATA1 */
+ <K1_PADCONF(101, 0)>, /* QSPI_DATA0 */
+ <K1_PADCONF(102, 0)>; /* QSPI_CLK */
+
+ bias-disable;
+ drive-strength = <19>;
+ power-source = <3300>;
+ };
+
+ qspi-cs1-pins {
+ pinmux = <K1_PADCONF(103, 0)>; /* QSPI_CS1 */
+ bias-pull-up = <0>;
+ drive-strength = <19>;
+ power-source = <3300>;
+ };
+ };
+
/omit-if-no-ref/
uart0_0_cfg: uart0-0-cfg {
uart0-0-pins {
diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
index af35f9cd64351..47f97105bff0b 100644
--- a/arch/riscv/boot/dts/spacemit/k1.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
@@ -823,6 +823,22 @@ uart9: serial@d4017800 {
status = "disabled";
};
+ qspi: spi@d420c000 {
+ compatible = "spacemit,k1-qspi";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0x0 0xd420c000 0x0 0x1000>,
+ <0x0 0xb8000000 0x0 0xc00000>;
+ reg-names = "QuadSPI", "QuadSPI-memory";
+ clocks = <&syscon_apmu CLK_QSPI_BUS>,
+ <&syscon_apmu CLK_QSPI>;
+ clock-names = "qspi_en", "qspi";
+ resets = <&syscon_apmu RESET_QSPI>,
+ <&syscon_apmu RESET_QSPI_BUS>;
+ interrupts = <117>;
+ status = "disabled";
+ };
+
/* sec_uart1: 0xf0612000, not available from Linux */
};
--
2.43.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v2 1/9] dt-bindings: spi: fsl-qspi: support SpacemiT K1
2025-10-23 17:59 ` [PATCH v2 1/9] dt-bindings: spi: fsl-qspi: support SpacemiT K1 Alex Elder
@ 2025-10-23 18:51 ` Conor Dooley
2025-10-23 23:29 ` Frank Li
1 sibling, 0 replies; 9+ messages in thread
From: Conor Dooley @ 2025-10-23 18:51 UTC (permalink / raw)
To: Alex Elder
Cc: robh, krzk+dt, conor+dt, han.xu, broonie, dlan, Frank.li, guodong,
devicetree, linux-spi, imx, spacemit, linux-riscv, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 500 bytes --]
On Thu, Oct 23, 2025 at 12:59:13PM -0500, Alex Elder wrote:
> Add the SpacemiT K1 SoC QSPI IP to the list of supported hardware. This
> is the first non-Freescale device represented here. It has a nearly
> identidal register set, and this binding correctly describes the hardware.
>
> Signed-off-by: Alex Elder <elder@riscstar.com>
> ---
> v2: - Point out that this is the first non-Freescale device used here
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
* Re: [PATCH v2 2/9] dt-bindings: spi: fsl-qspi: add optional resets
2025-10-23 17:59 ` [PATCH v2 2/9] dt-bindings: spi: fsl-qspi: add optional resets Alex Elder
@ 2025-10-23 18:52 ` Conor Dooley
2025-10-23 23:32 ` Frank Li
1 sibling, 0 replies; 9+ messages in thread
From: Conor Dooley @ 2025-10-23 18:52 UTC (permalink / raw)
To: Alex Elder
Cc: robh, krzk+dt, conor+dt, han.xu, broonie, dlan, Frank.li, guodong,
linux-spi, imx, devicetree, spacemit, linux-riscv, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 353 bytes --]
On Thu, Oct 23, 2025 at 12:59:14PM -0500, Alex Elder wrote:
> Allow two resets to be defined to support the SpacemiT K1 SoC QSPI IP.
>
> Signed-off-by: Alex Elder <elder@riscstar.com>
> ---
> v2: - The "reset" property now only applies to spacemit,k1-qspi compatible
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
* Re: [PATCH v2 1/9] dt-bindings: spi: fsl-qspi: support SpacemiT K1
2025-10-23 17:59 ` [PATCH v2 1/9] dt-bindings: spi: fsl-qspi: support SpacemiT K1 Alex Elder
2025-10-23 18:51 ` Conor Dooley
@ 2025-10-23 23:29 ` Frank Li
1 sibling, 0 replies; 9+ messages in thread
From: Frank Li @ 2025-10-23 23:29 UTC (permalink / raw)
To: Alex Elder
Cc: robh, krzk+dt, conor+dt, han.xu, broonie, dlan, guodong,
devicetree, linux-spi, imx, spacemit, linux-riscv, linux-kernel
On Thu, Oct 23, 2025 at 12:59:13PM -0500, Alex Elder wrote:
> Add the SpacemiT K1 SoC QSPI IP to the list of supported hardware. This
> is the first non-Freescale device represented here. It has a nearly
> identidal register set, and this binding correctly describes the hardware.
>
> Signed-off-by: Alex Elder <elder@riscstar.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> v2: - Point out that this is the first non-Freescale device used here
>
> Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
> index f2dd20370dbb3..5e6aff1bc2ed3 100644
> --- a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
> +++ b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
> @@ -22,6 +22,7 @@ properties:
> - fsl,imx6ul-qspi
> - fsl,ls1021a-qspi
> - fsl,ls2080a-qspi
> + - spacemit,k1-qspi
> - items:
> - enum:
> - fsl,ls1043a-qspi
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 2/9] dt-bindings: spi: fsl-qspi: add optional resets
2025-10-23 17:59 ` [PATCH v2 2/9] dt-bindings: spi: fsl-qspi: add optional resets Alex Elder
2025-10-23 18:52 ` Conor Dooley
@ 2025-10-23 23:32 ` Frank Li
2025-10-24 0:04 ` Alex Elder
1 sibling, 1 reply; 9+ messages in thread
From: Frank Li @ 2025-10-23 23:32 UTC (permalink / raw)
To: Alex Elder
Cc: robh, krzk+dt, conor+dt, han.xu, broonie, dlan, guodong,
linux-spi, imx, devicetree, spacemit, linux-riscv, linux-kernel
On Thu, Oct 23, 2025 at 12:59:14PM -0500, Alex Elder wrote:
> Allow two resets to be defined to support the SpacemiT K1 SoC QSPI IP.
>
> Signed-off-by: Alex Elder <elder@riscstar.com>
> ---
> v2: - The "reset" property now only applies to spacemit,k1-qspi compatible
>
> .../devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
> index 5e6aff1bc2ed3..edd3158a6f2e8 100644
> --- a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
> +++ b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
> @@ -55,6 +55,21 @@ properties:
> - const: qspi_en
> - const: qspi
>
> + resets:
> + items:
> + - description: SoC QSPI reset
> + - description: SoC QSPI bus reset
> +
> +if:
> + properties:
> + compatible:
> + not:
> + contains:
> + const: spacemit,k1-qspi
> +then:
> + properties:
> + resets: false
> +
strange, if-then should be under allOf, I have not seen you add allOf. And
original file have not allOf.
Frank
> required:
> - compatible
> - reg
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 2/9] dt-bindings: spi: fsl-qspi: add optional resets
2025-10-23 23:32 ` Frank Li
@ 2025-10-24 0:04 ` Alex Elder
0 siblings, 0 replies; 9+ messages in thread
From: Alex Elder @ 2025-10-24 0:04 UTC (permalink / raw)
To: Frank Li
Cc: robh, krzk+dt, conor+dt, han.xu, broonie, dlan, guodong,
linux-spi, imx, devicetree, spacemit, linux-riscv, linux-kernel
On 10/23/25 6:32 PM, Frank Li wrote:
> On Thu, Oct 23, 2025 at 12:59:14PM -0500, Alex Elder wrote:
>> Allow two resets to be defined to support the SpacemiT K1 SoC QSPI IP.
>>
>> Signed-off-by: Alex Elder <elder@riscstar.com>
>> ---
>> v2: - The "reset" property now only applies to spacemit,k1-qspi compatible
>>
>> .../devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml | 15 +++++++++++++++
>> 1 file changed, 15 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
>> index 5e6aff1bc2ed3..edd3158a6f2e8 100644
>> --- a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
>> +++ b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
>> @@ -55,6 +55,21 @@ properties:
>> - const: qspi_en
>> - const: qspi
>>
>> + resets:
>> + items:
>> + - description: SoC QSPI reset
>> + - description: SoC QSPI bus reset
>> +
>> +if:
>> + properties:
>> + compatible:
>> + not:
>> + contains:
>> + const: spacemit,k1-qspi
>> +then:
>> + properties:
>> + resets: false
>> +
>
> strange, if-then should be under allOf, I have not seen you add allOf. And
> original file have not allOf.
The file currently has allOf at the top, to reference
spi-controller.yaml. I'll include this next time within
that allOf.
-Alex
>
> Frank
>
>> required:
>> - compatible
>> - reg
>> --
>> 2.43.0
>>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2025-10-24 0:04 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-23 17:59 [PATCH v2 0/9] spi: enable the SpacemiT K1 SoC QSPI Alex Elder
2025-10-23 17:59 ` [PATCH v2 1/9] dt-bindings: spi: fsl-qspi: support SpacemiT K1 Alex Elder
2025-10-23 18:51 ` Conor Dooley
2025-10-23 23:29 ` Frank Li
2025-10-23 17:59 ` [PATCH v2 2/9] dt-bindings: spi: fsl-qspi: add optional resets Alex Elder
2025-10-23 18:52 ` Conor Dooley
2025-10-23 23:32 ` Frank Li
2025-10-24 0:04 ` Alex Elder
2025-10-23 17:59 ` [PATCH v2 8/9] riscv: dts: spacemit: enable K1 SoC QSPI on BPI-F3 Alex Elder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox