Skip to contentSkip to conversation

(no cover subject)

PATCH Superseded Zixian Zeng 3 participants 8 messages Mar 13, 2025 – Mar 14, 2025

Subsystems (4)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v3 cover (no cover subject)

This is tested on milkv-pioneer board. Using driver/spi/spidev.c for creating /dev/spidevX.Y and tools/spi/spidev_test for testing functionality.

---
Changes in v3:
- disable the spi status on sg2042-milkv-pioneer board
- create dt-binding of compatible property
- replace the general compatible property with SoC-specific in dts
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- rebase v1 to sophgo/master(github.com/sophgo/linux.git).
- order properties in device node.
- remove unevaluated properties clock-frequency.
- set default status to disable.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Zixian Zeng (2):
spi: dt-bindings: snps,dw-apb-ssi: Add compatible for SOPHGO SG2042 SoC
riscv: sophgo: dts: Add spi controller for SG2042

 .../devicetree/bindings/spi/snps,dw-apb-ssi.yaml   |  4 ++++
 arch/riscv/boot/dts/sophgo/sg2042.dtsi             | 26 ++++++++++++++++++++++
 2 files changed, 30 insertions(+)

---
base-commit: aa5ee7180ec41bb77c3e327e95d119f2294babea
change-id: 20250228-sfg-spi-e3f2aeca09ab

Best regards,

Signature · 1 line
Zixian Zeng <[email protected]>
#1 lore raw

PATCH v3 1/2 spi: dt-bindings: snps,dw-apb-ssi: Add compatible for SOPHGO SG2042 SoC

add compatible property to include "sophgo,sg2042-spi" for the SOPHGO SG2042 SoC SPI Controller.

---
 Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml +4 -0
index bccd00a1ddd0ad92b437eed5b525a6ea1963db57..33fb21267df2594e68419cfb980a40909868e337 100644
@@ -92,6 +92,10 @@ properties:
         items:
           - const: thead,th1520-spi
           - const: snps,dw-apb-ssi
+      - description: SOPHGO SG2042 SoC SPI Controller
+        items:
+          - const: sophgo,sg2042-spi
+          - const: snps,dw-apb-ssi
 
   reg:
     minItems: 1
Signature · 1 line
2.48.1
#2 lore raw

Re: [PATCH v3 1/2] spi: dt-bindings: snps,dw-apb-ssi: Add compatible for SOPHGO SG2042 SoC

Quoted 13 lines · Zixian Zeng

add compatible property to include "sophgo,sg2042-spi" for the SOPHGO SG2042 SoC SPI Controller.

---
 Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml +0 -0
index bccd00a1ddd0ad92b437eed5b525a6ea1963db57..33fb21267df2594e68419cfb980a40909868e337 100644

Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml properties: · line 95

Quoted 4 lines
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml +1 -0
@@ -92,6 +92,10 @@ properties:
         items:
           - const: thead,th1520-spi
           - const: snps,dw-apb-ssi
+      - description: SOPHGO SG2042 SoC SPI Controller

Please do not add things to the end - it increases conflicts and makes it difficult to find entries when reading the code. Place it after Renesas.

Best regards,
Krzysztof

#3 lore raw

PATCH v3 2/2 riscv: sophgo: dts: Add spi controller for SG2042

In reply to Zixian Zeng

Add spi controllers for SG2042.

SG2042 uses the upstreamed Synopsys DW SPI IP.

---
 arch/riscv/boot/dts/sophgo/sg2042.dtsi | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
arch/riscv/boot/dts/sophgo/sg2042.dtsi +26 -0
index e62ac51ac55abd922b5ef796ba8c2196383850c4..9e0ec64e91a2330698aea202c8f0a2ca1f7e0919 100644
@@ -545,5 +545,31 @@ sd: mmc@704002b000 {
 				      "timer";
 			status = "disabled";
 		};
+
+		spi0: spi@7040004000 {
+			compatible = "sophgo,sg2042-spi", "snps,dw-apb-ssi";
+			reg = <0x70 0x40004000 0x00 0x1000>;
+			clocks = <&clkgen GATE_CLK_APB_SPI>;
+			interrupt-parent = <&intc>;
+			interrupts = <110 IRQ_TYPE_LEVEL_HIGH>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			num-cs = <2>;
+			resets = <&rstgen RST_SPI0>;
+			status = "disabled";
+		};
+
+		spi1: spi@7040005000 {
+			compatible = "sophgo,sg2042-spi", "snps,dw-apb-ssi";
+			reg = <0x70 0x40005000 0x00 0x1000>;
+			clocks = <&clkgen GATE_CLK_APB_SPI>;
+			interrupt-parent = <&intc>;
+			interrupts = <111 IRQ_TYPE_LEVEL_HIGH>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			num-cs = <2>;
+			resets = <&rstgen RST_SPI1>;
+			status = "disabled";
+		};
 	};
 };
Signature · 1 line
2.48.1
#4 lore raw

Re: [PATCH v3 2/2] riscv: sophgo: dts: Add spi controller for SG2042

Quoted 14 lines · Zixian Zeng

Add spi controllers for SG2042.

SG2042 uses the upstreamed Synopsys DW SPI IP.

---
 arch/riscv/boot/dts/sophgo/sg2042.dtsi | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
arch/riscv/boot/dts/sophgo/sg2042.dtsi +0 -0
index e62ac51ac55abd922b5ef796ba8c2196383850c4..9e0ec64e91a2330698aea202c8f0a2ca1f7e0919 100644

arch/riscv/boot/dts/sophgo/sg2042.dtsi sd: mmc@704002b000 { · line 549

Quoted 5 lines
arch/riscv/boot/dts/sophgo/sg2042.dtsi +2 -0
@@ -545,5 +545,31 @@ sd: mmc@704002b000 {
 				      "timer";
 			status = "disabled";
 		};
+
+		spi0: spi@7040004000 {

Does not look like you keep order by unit address (see DTS coding style).

Best regards,
Krzysztof

#5 lore raw

Re: [PATCH v3 2/2] riscv: sophgo: dts: Add spi controller for SG2042

Quoted 10 lines · Krzysztof Kozlowski
Quoted 9 lines · Zixian Zeng

Add spi controllers for SG2042.

SG2042 uses the upstreamed Synopsys DW SPI IP.

---
 arch/riscv/boot/dts/sophgo/sg2042.dtsi | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
Quoted 13 lines

arch/riscv/boot/dts/sophgo/sg2042.dtsi sd: mmc@704002b000 { · line 549

Quoted 10 lines
arch/riscv/boot/dts/sophgo/sg2042.dtsi +2 -0
index e62ac51ac55abd922b5ef796ba8c2196383850c4..9e0ec64e91a2330698aea202c8f0a2ca1f7e0919 100644
@@ -545,5 +545,31 @@ sd: mmc@704002b000 {
 				      "timer";
 			status = "disabled";
 		};
+
+		spi0: spi@7040004000 {

Does not look like you keep order by unit address (see DTS coding style).

Thanks for reminding, I will read it more carefully.

Quoted 3 lines

Best regards,
Krzysztof

Best regards,
Zixian Zeng

#6 lore raw
In reply to Zixian Zeng

Hi, Zixian,

First, it looks like you forgot to write a subject line for your email.

Quoted 3 lines · Zixian Zeng

This is tested on milkv-pioneer board. Using driver/spi/spidev.c for creating /dev/spidevX.Y and tools/spi/spidev_test for testing functionality.

Second, why is there no description of what was changed in the patch set? Maybe it was missed.

Introduction to testing can be used as supplementary information, but it should not be the main body of this email.

Quoted 4 lines

---
Changes in v3:
- disable the spi status on sg2042-milkv-pioneer board

Not "disable", should be "Remove", and please capitalize the first letter of the sentences.

Quoted 2 lines

- create dt-binding of compatible property
- replace the general compatible property with SoC-specific in dts

Another relatively important change is about the clock, which you seem to have missed.

Quoted 14 lines

- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- rebase v1 to sophgo/master(github.com/sophgo/linux.git).
- order properties in device node.
- remove unevaluated properties clock-frequency.
- set default status to disable.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Zixian Zeng (2):
spi: dt-bindings: snps,dw-apb-ssi: Add compatible for SOPHGO SG2042 SoC
riscv: sophgo: dts: Add spi controller for SG2042

Quoted 8 lines
  .../devicetree/bindings/spi/snps,dw-apb-ssi.yaml   |  4 ++++
  arch/riscv/boot/dts/sophgo/sg2042.dtsi             | 26 ++++++++++++++++++++++
  2 files changed, 30 insertions(+)

---
base-commit: aa5ee7180ec41bb77c3e327e95d119f2294babea
change-id: 20250228-sfg-spi-e3f2aeca09ab

Best regards,

BTW, I suggest you wait until 6.15-rc1 comes out before submitting the next version, because I have already sent a PR to Arnd for Sophgo DTS.

Regards,

Chen

#7 lore raw
Quoted 11 lines · Chen Wang

Hi, Zixian,

First, it looks like you forgot to write a subject line for your email.

Quoted 3 lines · Zixian Zeng

This is tested on milkv-pioneer board. Using driver/spi/spidev.c for creating /dev/spidevX.Y and tools/spi/spidev_test for testing functionality.

Second, why is there no description of what was changed in the patch set? Maybe it was missed.

I was intended to avoid duplication with commit msg, but it seems unnecessary. I will try to write a better cover letter next time. Thanks for your review.

Quoted 7 lines

Introduction to testing can be used as supplementary information, but it should not be the main body of this email.

Quoted 4 lines

---
Changes in v3:
- disable the spi status on sg2042-milkv-pioneer board

Quoted 6 lines

Not "disable", should be "Remove", and please capitalize the first letter of the sentences.

Quoted 2 lines

- create dt-binding of compatible property
- replace the general compatible property with SoC-specific in dts

Another relatively important change is about the clock, which you seem to have missed.

My mistake, I will add it in the next version.

Quoted 21 lines
Quoted 21 lines

- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- rebase v1 to sophgo/master(github.com/sophgo/linux.git).
- order properties in device node.
- remove unevaluated properties clock-frequency.
- set default status to disable.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Zixian Zeng (2):
spi: dt-bindings: snps,dw-apb-ssi: Add compatible for SOPHGO SG2042 SoC
riscv: sophgo: dts: Add spi controller for SG2042

  .../devicetree/bindings/spi/snps,dw-apb-ssi.yaml   |  4 ++++
  arch/riscv/boot/dts/sophgo/sg2042.dtsi             | 26 ++++++++++++++++++++++
  2 files changed, 30 insertions(+)

---
base-commit: aa5ee7180ec41bb77c3e327e95d119f2294babea
change-id: 20250228-sfg-spi-e3f2aeca09ab

Quoted 5 lines
Quoted 1 line

Best regards,

BTW, I suggest you wait until 6.15-rc1 comes out before submitting the next version, because I have already sent a PR to Arnd for Sophgo DTS.

Sure, I will keep an eye on the release.

Quoted 4 lines

Regards,

Chen

Best regards,
Zixian Zeng