* [PATCH 0/8] spi: enable the SpacemiT K1 SoC QSPI
@ 2025-10-20 16:51 Alex Elder
2025-10-20 16:51 ` [PATCH 1/8] dt-bindings: spi: fsl-qspi: add optional resets Alex Elder
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Alex Elder @ 2025-10-20 16:51 UTC (permalink / raw)
To: han.xu, broonie, dlan, robh, krzk+dt, conor+dt, pjw, palmer, aou
Cc: alex, p.zabel, emil.renner.berthing, geert+renesas, fustini,
ben717, apatel, joel, guodong, linux-spi, imx, devicetree,
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
- Using a fixed 1K size for flash chips rather than having it
be related to the AHB buffer size.
-Alex
This series is available here:
https://github.com/riscstar/linux/tree/outgoing/qspi-v1
Alex Elder (8):
dt-bindings: spi: fsl-qspi: add optional resets
dt-bindings: spi: fsl-qspi: support SpacemiT K1
spi: fsl-qspi: add optional reset support
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 | 6 ++
.../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 | 60 ++++++++++++++-----
7 files changed, 98 insertions(+), 15 deletions(-)
base-commit: 606da5bb165594c052ee11de79bf05bc38bc1aa6
--
2.48.1
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH 1/8] dt-bindings: spi: fsl-qspi: add optional resets
2025-10-20 16:51 [PATCH 0/8] spi: enable the SpacemiT K1 SoC QSPI Alex Elder
@ 2025-10-20 16:51 ` Alex Elder
2025-10-20 17:44 ` Conor Dooley
2025-10-20 16:51 ` [PATCH 2/8] dt-bindings: spi: fsl-qspi: support SpacemiT K1 Alex Elder
2025-10-20 16:51 ` [PATCH 7/8] riscv: dts: spacemit: enable K1 SoC QSPI on BPI-F3 Alex Elder
2 siblings, 1 reply; 15+ messages in thread
From: Alex Elder @ 2025-10-20 16:51 UTC (permalink / raw)
To: robh, krzk+dt, conor+dt, han.xu, broonie
Cc: dlan, guodong, devicetree, linux-spi, imx, spacemit, linux-riscv,
linux-kernel
Allow two resets to be optionally included for the Freescale QSPI driver.
Signed-off-by: Alex Elder <elder@riscstar.com>
---
Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
index f2dd20370dbb3..0315a13fe319a 100644
--- a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
+++ b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
@@ -54,6 +54,11 @@ properties:
- const: qspi_en
- const: qspi
+ resets:
+ items:
+ - description: SoC QSPI reset
+ - description: SoC QSPI bus reset
+
required:
- compatible
- reg
--
2.48.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 2/8] dt-bindings: spi: fsl-qspi: support SpacemiT K1
2025-10-20 16:51 [PATCH 0/8] spi: enable the SpacemiT K1 SoC QSPI Alex Elder
2025-10-20 16:51 ` [PATCH 1/8] dt-bindings: spi: fsl-qspi: add optional resets Alex Elder
@ 2025-10-20 16:51 ` Alex Elder
2025-10-20 17:39 ` Conor Dooley
2025-10-20 17:41 ` Conor Dooley
2025-10-20 16:51 ` [PATCH 7/8] riscv: dts: spacemit: enable K1 SoC QSPI on BPI-F3 Alex Elder
2 siblings, 2 replies; 15+ messages in thread
From: Alex Elder @ 2025-10-20 16:51 UTC (permalink / raw)
To: han.xu, broonie, robh, krzk+dt, conor+dt
Cc: dlan, guodong, devicetree, linux-spi, imx, spacemit, linux-riscv,
linux-kernel
Add the SpacemiT K1 SoC QSPI IP to the list of supported hardware.
Signed-off-by: Alex Elder <elder@riscstar.com>
---
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 0315a13fe319a..5bbda4bc33350 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.48.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 7/8] riscv: dts: spacemit: enable K1 SoC QSPI on BPI-F3
2025-10-20 16:51 [PATCH 0/8] spi: enable the SpacemiT K1 SoC QSPI Alex Elder
2025-10-20 16:51 ` [PATCH 1/8] dt-bindings: spi: fsl-qspi: add optional resets Alex Elder
2025-10-20 16:51 ` [PATCH 2/8] dt-bindings: spi: fsl-qspi: support SpacemiT K1 Alex Elder
@ 2025-10-20 16:51 ` Alex Elder
2 siblings, 0 replies; 15+ messages in thread
From: Alex Elder @ 2025-10-20 16:51 UTC (permalink / raw)
To: robh, krzk+dt, conor+dt, dlan
Cc: pjw, palmer, aou, alex, guodong, 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.48.1
^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH 2/8] dt-bindings: spi: fsl-qspi: support SpacemiT K1
2025-10-20 16:51 ` [PATCH 2/8] dt-bindings: spi: fsl-qspi: support SpacemiT K1 Alex Elder
@ 2025-10-20 17:39 ` Conor Dooley
2025-10-20 18:06 ` Alex Elder
2025-10-20 17:41 ` Conor Dooley
1 sibling, 1 reply; 15+ messages in thread
From: Conor Dooley @ 2025-10-20 17:39 UTC (permalink / raw)
To: Alex Elder
Cc: han.xu, broonie, robh, krzk+dt, conor+dt, dlan, guodong,
devicetree, linux-spi, imx, spacemit, linux-riscv, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 954 bytes --]
On Mon, Oct 20, 2025 at 11:51:45AM -0500, Alex Elder wrote:
> Add the SpacemiT K1 SoC QSPI IP to the list of supported hardware.
>
> Signed-off-by: Alex Elder <elder@riscstar.com>
> ---
> 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 0315a13fe319a..5bbda4bc33350 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
Are the newly added resets mandatory for the spacemit platform?
> - items:
> - enum:
> - fsl,ls1043a-qspi
> --
> 2.48.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/8] dt-bindings: spi: fsl-qspi: support SpacemiT K1
2025-10-20 16:51 ` [PATCH 2/8] dt-bindings: spi: fsl-qspi: support SpacemiT K1 Alex Elder
2025-10-20 17:39 ` Conor Dooley
@ 2025-10-20 17:41 ` Conor Dooley
2025-10-20 18:06 ` Alex Elder
1 sibling, 1 reply; 15+ messages in thread
From: Conor Dooley @ 2025-10-20 17:41 UTC (permalink / raw)
To: Alex Elder
Cc: han.xu, broonie, robh, krzk+dt, conor+dt, dlan, guodong,
devicetree, linux-spi, imx, spacemit, linux-riscv, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1069 bytes --]
On Mon, Oct 20, 2025 at 11:51:45AM -0500, Alex Elder wrote:
> Add the SpacemiT K1 SoC QSPI IP to the list of supported hardware.
Also, you should really explain why this spacemit device is the first
one to be in what's been an fsl-specific binding for now in the commit
message.
pw-bot: changes-requested
>
> Signed-off-by: Alex Elder <elder@riscstar.com>
> ---
> 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 0315a13fe319a..5bbda4bc33350 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.48.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/8] dt-bindings: spi: fsl-qspi: add optional resets
2025-10-20 16:51 ` [PATCH 1/8] dt-bindings: spi: fsl-qspi: add optional resets Alex Elder
@ 2025-10-20 17:44 ` Conor Dooley
2025-10-20 18:06 ` Alex Elder
0 siblings, 1 reply; 15+ messages in thread
From: Conor Dooley @ 2025-10-20 17:44 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
[-- Attachment #1: Type: text/plain, Size: 1118 bytes --]
On Mon, Oct 20, 2025 at 11:51:44AM -0500, Alex Elder wrote:
> Allow two resets to be optionally included for the Freescale QSPI driver.
This is a binding, please don't mention the driver here.
> Signed-off-by: Alex Elder <elder@riscstar.com>
> ---
> Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
> index f2dd20370dbb3..0315a13fe319a 100644
> --- a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
> +++ b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
> @@ -54,6 +54,11 @@ properties:
> - const: qspi_en
> - const: qspi
>
> + resets:
> + items:
> + - description: SoC QSPI reset
> + - description: SoC QSPI bus reset
If none of the fsl devices have resets, this should be added alongside
the new spacemit compatible and not permitted for the other compatibles.
> +
> required:
> - compatible
> - reg
> --
> 2.48.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/8] dt-bindings: spi: fsl-qspi: support SpacemiT K1
2025-10-20 17:39 ` Conor Dooley
@ 2025-10-20 18:06 ` Alex Elder
2025-10-20 18:26 ` Mark Brown
0 siblings, 1 reply; 15+ messages in thread
From: Alex Elder @ 2025-10-20 18:06 UTC (permalink / raw)
To: Conor Dooley
Cc: han.xu, broonie, robh, krzk+dt, conor+dt, dlan, guodong,
devicetree, linux-spi, imx, spacemit, linux-riscv, linux-kernel
On 10/20/25 12:39 PM, Conor Dooley wrote:
> On Mon, Oct 20, 2025 at 11:51:45AM -0500, Alex Elder wrote:
>> Add the SpacemiT K1 SoC QSPI IP to the list of supported hardware.
>>
>> Signed-off-by: Alex Elder <elder@riscstar.com>
>> ---
>> 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 0315a13fe319a..5bbda4bc33350 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
>
> Are the newly added resets mandatory for the spacemit platform?
This is interesting. I never even tried it without specifying them.
I just tried it, and at least on my system QSPI functioned without
defining these resets. I will ask SpacemiT about this. If they are
not needed I will omit the first patch (which added optional resets),
and won't use them.
Thanks for pointing this out.
-Alex
>
>> - items:
>> - enum:
>> - fsl,ls1043a-qspi
>> --
>> 2.48.1
>>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 1/8] dt-bindings: spi: fsl-qspi: add optional resets
2025-10-20 17:44 ` Conor Dooley
@ 2025-10-20 18:06 ` Alex Elder
0 siblings, 0 replies; 15+ messages in thread
From: Alex Elder @ 2025-10-20 18:06 UTC (permalink / raw)
To: Conor Dooley
Cc: robh, krzk+dt, conor+dt, han.xu, broonie, dlan, guodong,
devicetree, linux-spi, imx, spacemit, linux-riscv, linux-kernel
On 10/20/25 12:44 PM, Conor Dooley wrote:
> On Mon, Oct 20, 2025 at 11:51:44AM -0500, Alex Elder wrote:
>> Allow two resets to be optionally included for the Freescale QSPI driver.
>
> This is a binding, please don't mention the driver here.
OK, I will reword it in v2.
>> Signed-off-by: Alex Elder <elder@riscstar.com>
>> ---
>> Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
>> index f2dd20370dbb3..0315a13fe319a 100644
>> --- a/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
>> +++ b/Documentation/devicetree/bindings/spi/fsl,spi-fsl-qspi.yaml
>> @@ -54,6 +54,11 @@ properties:
>> - const: qspi_en
>> - const: qspi
>>
>> + resets:
>> + items:
>> + - description: SoC QSPI reset
>> + - description: SoC QSPI bus reset
>
> If none of the fsl devices have resets, this should be added alongside
> the new spacemit compatible and not permitted for the other compatibles.
I thought that, being optional, this kind of constraint wasn't
strictly necessary.
Anyway, I'll find out first whether the resets are even required,
and if they are I'll rework this the way you suggest.
Thank you for your very quick review.
-Alex
>> +
>> required:
>> - compatible
>> - reg
>> --
>> 2.48.1
>>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/8] dt-bindings: spi: fsl-qspi: support SpacemiT K1
2025-10-20 17:41 ` Conor Dooley
@ 2025-10-20 18:06 ` Alex Elder
2025-10-20 18:41 ` Conor Dooley
0 siblings, 1 reply; 15+ messages in thread
From: Alex Elder @ 2025-10-20 18:06 UTC (permalink / raw)
To: Conor Dooley
Cc: han.xu, broonie, robh, krzk+dt, conor+dt, dlan, guodong,
devicetree, linux-spi, imx, spacemit, linux-riscv, linux-kernel
On 10/20/25 12:41 PM, Conor Dooley wrote:
> On Mon, Oct 20, 2025 at 11:51:45AM -0500, Alex Elder wrote:
>> Add the SpacemiT K1 SoC QSPI IP to the list of supported hardware.
>
> Also, you should really explain why this spacemit device is the first
> one to be in what's been an fsl-specific binding for now in the commit
> message.
I'm not sure how much of an explanation you're looking for, but
yes, I agree with you, it stands out that it's the first one, so
I at least should have acknowledged that. I'll add something
here in the next version.
-Alex
> pw-bot: changes-requested
>
>>
>> Signed-off-by: Alex Elder <elder@riscstar.com>
>> ---
>> 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 0315a13fe319a..5bbda4bc33350 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.48.1
>>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/8] dt-bindings: spi: fsl-qspi: support SpacemiT K1
2025-10-20 18:06 ` Alex Elder
@ 2025-10-20 18:26 ` Mark Brown
2025-10-20 18:37 ` Alex Elder
2025-10-20 18:39 ` Conor Dooley
0 siblings, 2 replies; 15+ messages in thread
From: Mark Brown @ 2025-10-20 18:26 UTC (permalink / raw)
To: Alex Elder
Cc: Conor Dooley, han.xu, robh, krzk+dt, conor+dt, dlan, guodong,
devicetree, linux-spi, imx, spacemit, linux-riscv, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 659 bytes --]
On Mon, Oct 20, 2025 at 01:06:46PM -0500, Alex Elder wrote:
> On 10/20/25 12:39 PM, Conor Dooley wrote:
> > > + - spacemit,k1-qspi
> > Are the newly added resets mandatory for the spacemit platform?
> This is interesting. I never even tried it without specifying them.
> I just tried it, and at least on my system QSPI functioned without
> defining these resets. I will ask SpacemiT about this. If they are
> not needed I will omit the first patch (which added optional resets),
> and won't use them.
It might be safer to describe them, otherwise things are vulnerable to
issues like the bootloader not leaving things in a predictable state.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/8] dt-bindings: spi: fsl-qspi: support SpacemiT K1
2025-10-20 18:26 ` Mark Brown
@ 2025-10-20 18:37 ` Alex Elder
2025-10-20 18:39 ` Conor Dooley
1 sibling, 0 replies; 15+ messages in thread
From: Alex Elder @ 2025-10-20 18:37 UTC (permalink / raw)
To: Mark Brown
Cc: Conor Dooley, han.xu, robh, krzk+dt, conor+dt, dlan, guodong,
devicetree, linux-spi, imx, spacemit, linux-riscv, linux-kernel
On 10/20/25 1:26 PM, Mark Brown wrote:
> On Mon, Oct 20, 2025 at 01:06:46PM -0500, Alex Elder wrote:
>> On 10/20/25 12:39 PM, Conor Dooley wrote:
>
>>>> + - spacemit,k1-qspi
>
>>> Are the newly added resets mandatory for the spacemit platform?
>
>> This is interesting. I never even tried it without specifying them.
>
>> I just tried it, and at least on my system QSPI functioned without
>> defining these resets. I will ask SpacemiT about this. If they are
>> not needed I will omit the first patch (which added optional resets),
>> and won't use them.
>
> It might be safer to describe them, otherwise things are vulnerable to
> issues like the bootloader not leaving things in a predictable state.
I mentioned exactly this in my message to SpacemiT just now.
And yes, regardless of their answer, you're probably right.
It is *possible* that these resets must be de-asserted, so
it's safest to describe them.
Conor please if you disagree with this, please say so.
Otherwise I think I'll keep them in the next version
Thanks.
-Alex
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/8] dt-bindings: spi: fsl-qspi: support SpacemiT K1
2025-10-20 18:26 ` Mark Brown
2025-10-20 18:37 ` Alex Elder
@ 2025-10-20 18:39 ` Conor Dooley
2025-10-22 4:34 ` Alex Elder
1 sibling, 1 reply; 15+ messages in thread
From: Conor Dooley @ 2025-10-20 18:39 UTC (permalink / raw)
To: Mark Brown
Cc: Alex Elder, han.xu, robh, krzk+dt, conor+dt, dlan, guodong,
devicetree, linux-spi, imx, spacemit, linux-riscv, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1172 bytes --]
On Mon, Oct 20, 2025 at 07:26:17PM +0100, Mark Brown wrote:
> On Mon, Oct 20, 2025 at 01:06:46PM -0500, Alex Elder wrote:
> > On 10/20/25 12:39 PM, Conor Dooley wrote:
>
> > > > + - spacemit,k1-qspi
>
> > > Are the newly added resets mandatory for the spacemit platform?
>
> > This is interesting. I never even tried it without specifying them.
>
> > I just tried it, and at least on my system QSPI functioned without
> > defining these resets. I will ask SpacemiT about this. If they are
> > not needed I will omit the first patch (which added optional resets),
> > and won't use them.
>
> It might be safer to describe them, otherwise things are vulnerable to
> issues like the bootloader not leaving things in a predictable state.
Yeah, if a linux driver requires that a bootloader set up a clock or
de-assert a reset etc, then the binding should mark them required since,
as you say, a bootloader change might do away with that de-assertion.
Additionally, the stage doing that de-assertion etc could be U-Boot
or barebox, which import devicetrees from Linux, so making sure that
the resets are present has that benefit too.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/8] dt-bindings: spi: fsl-qspi: support SpacemiT K1
2025-10-20 18:06 ` Alex Elder
@ 2025-10-20 18:41 ` Conor Dooley
0 siblings, 0 replies; 15+ messages in thread
From: Conor Dooley @ 2025-10-20 18:41 UTC (permalink / raw)
To: Alex Elder
Cc: han.xu, broonie, robh, krzk+dt, conor+dt, dlan, guodong,
devicetree, linux-spi, imx, spacemit, linux-riscv, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1819 bytes --]
On Mon, Oct 20, 2025 at 01:06:50PM -0500, Alex Elder wrote:
> On 10/20/25 12:41 PM, Conor Dooley wrote:
> > On Mon, Oct 20, 2025 at 11:51:45AM -0500, Alex Elder wrote:
> > > Add the SpacemiT K1 SoC QSPI IP to the list of supported hardware.
> >
> > Also, you should really explain why this spacemit device is the first
> > one to be in what's been an fsl-specific binding for now in the commit
> > message.
>
> I'm not sure how much of an explanation you're looking for, but
> yes, I agree with you, it stands out that it's the first one, so
> I at least should have acknowledged that. I'll add something
> here in the next version.
Even just mentioning that the register interface etc is nigh identical.
Otherwise this just looks like picking a random file to put the
compatible in. Remember, this is independent from the driver change and
must be justified in its own commit message.
>
> -Alex
>
> > pw-bot: changes-requested
> >
> > >
> > > Signed-off-by: Alex Elder <elder@riscstar.com>
> > > ---
> > > 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 0315a13fe319a..5bbda4bc33350 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.48.1
> > >
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 2/8] dt-bindings: spi: fsl-qspi: support SpacemiT K1
2025-10-20 18:39 ` Conor Dooley
@ 2025-10-22 4:34 ` Alex Elder
0 siblings, 0 replies; 15+ messages in thread
From: Alex Elder @ 2025-10-22 4:34 UTC (permalink / raw)
To: Conor Dooley, Mark Brown
Cc: han.xu, robh, krzk+dt, conor+dt, dlan, guodong, devicetree,
linux-spi, imx, spacemit, linux-riscv, linux-kernel
On 10/20/25 1:39 PM, Conor Dooley wrote:
> On Mon, Oct 20, 2025 at 07:26:17PM +0100, Mark Brown wrote:
>> On Mon, Oct 20, 2025 at 01:06:46PM -0500, Alex Elder wrote:
>>> On 10/20/25 12:39 PM, Conor Dooley wrote:
>>
>>>>> + - spacemit,k1-qspi
>>
>>>> Are the newly added resets mandatory for the spacemit platform?
>>
>>> This is interesting. I never even tried it without specifying them.
>>
>>> I just tried it, and at least on my system QSPI functioned without
>>> defining these resets. I will ask SpacemiT about this. If they are
>>> not needed I will omit the first patch (which added optional resets),
>>> and won't use them.
>>
>> It might be safer to describe them, otherwise things are vulnerable to
>> issues like the bootloader not leaving things in a predictable state.
>
> Yeah, if a linux driver requires that a bootloader set up a clock or
> de-assert a reset etc, then the binding should mark them required since,
> as you say, a bootloader change might do away with that de-assertion.
> Additionally, the stage doing that de-assertion etc could be U-Boot
> or barebox, which import devicetrees from Linux, so making sure that
> the resets are present has that benefit too.
OK, so the resets property (added in patch 1) will stay. It will
be defined such that it is an optional property, and only when the
compatible string includes "spacemit,k1-qspi".
-Alex
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2025-10-22 4:34 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-20 16:51 [PATCH 0/8] spi: enable the SpacemiT K1 SoC QSPI Alex Elder
2025-10-20 16:51 ` [PATCH 1/8] dt-bindings: spi: fsl-qspi: add optional resets Alex Elder
2025-10-20 17:44 ` Conor Dooley
2025-10-20 18:06 ` Alex Elder
2025-10-20 16:51 ` [PATCH 2/8] dt-bindings: spi: fsl-qspi: support SpacemiT K1 Alex Elder
2025-10-20 17:39 ` Conor Dooley
2025-10-20 18:06 ` Alex Elder
2025-10-20 18:26 ` Mark Brown
2025-10-20 18:37 ` Alex Elder
2025-10-20 18:39 ` Conor Dooley
2025-10-22 4:34 ` Alex Elder
2025-10-20 17:41 ` Conor Dooley
2025-10-20 18:06 ` Alex Elder
2025-10-20 18:41 ` Conor Dooley
2025-10-20 16:51 ` [PATCH 7/8] 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