All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] riscv: dts: spacemit: k3: Add USB/PCIe devices
@ 2026-07-09  4:04 ` Inochi Amaoto
  0 siblings, 0 replies; 14+ messages in thread
From: Inochi Amaoto @ 2026-07-09  4:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan
  Cc: Inochi Amaoto, devicetree, linux-riscv, spacemit, linux-kernel,
	Yixun Lan, Longbin Li

DTS for series:
https://lore.kernel.org/linux-pci/20260709040027.958400-1-inochiama@gmail.com
https://lore.kernel.org/linux-phy/20260703021024.495433-1-inochiama@gmail.com

Inochi Amaoto (2):
  riscv: dts: spacemit: k3: add USB controller and USB phy support
  riscv: dts: spacemit: k3: Add PCIe device node

 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts |  51 ++++
 arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi |  33 +++
 arch/riscv/boot/dts/spacemit/k3.dtsi         | 237 +++++++++++++++++++
 3 files changed, 321 insertions(+)

--
2.55.0


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

* [PATCH 0/2] riscv: dts: spacemit: k3: Add USB/PCIe devices
@ 2026-07-09  4:04 ` Inochi Amaoto
  0 siblings, 0 replies; 14+ messages in thread
From: Inochi Amaoto @ 2026-07-09  4:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan
  Cc: Inochi Amaoto, devicetree, linux-riscv, spacemit, linux-kernel,
	Yixun Lan, Longbin Li

DTS for series:
https://lore.kernel.org/linux-pci/20260709040027.958400-1-inochiama@gmail.com
https://lore.kernel.org/linux-phy/20260703021024.495433-1-inochiama@gmail.com

Inochi Amaoto (2):
  riscv: dts: spacemit: k3: add USB controller and USB phy support
  riscv: dts: spacemit: k3: Add PCIe device node

 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts |  51 ++++
 arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi |  33 +++
 arch/riscv/boot/dts/spacemit/k3.dtsi         | 237 +++++++++++++++++++
 3 files changed, 321 insertions(+)

--
2.55.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* [PATCH 1/2] riscv: dts: spacemit: k3: add USB controller and USB phy support
  2026-07-09  4:04 ` Inochi Amaoto
@ 2026-07-09  4:04   ` Inochi Amaoto
  -1 siblings, 0 replies; 14+ messages in thread
From: Inochi Amaoto @ 2026-07-09  4:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan
  Cc: Inochi Amaoto, devicetree, linux-riscv, spacemit, linux-kernel,
	Yixun Lan, Longbin Li

Add all USB device node to the Spacemit K3.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 13 ++++++
 arch/riscv/boot/dts/spacemit/k3.dtsi         | 42 ++++++++++++++++++++
 2 files changed, 55 insertions(+)

diff --git a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
index b89c1521e664..2a6d35a64d5c 100644
--- a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
+++ b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
@@ -182,6 +182,11 @@ dldo7: dldo7 {
 	};
 };
 
+&combophy {
+	spacemit,apmu = <&syscon_apmu 0x11>;
+	status = "okay";
+};
+
 &eth0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&gmac0_rgmii_0_cfg>, <&gmac0_phy_0_cfg>;
@@ -221,3 +226,11 @@ hub@1 {
 &usb2_phy {
 	status = "okay";
 };
+
+&usb3d_u2phy {
+	status = "okay";
+};
+
+&usb3d {
+	status = "okay";
+};
diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
index 19fc9b49668e..82c9e2da82e9 100644
--- a/arch/riscv/boot/dts/spacemit/k3.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
@@ -7,6 +7,7 @@
 #include <dt-bindings/clock/spacemit,k3-clocks.h>
 #include <dt-bindings/reset/spacemit,k3-resets.h>
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/phy/phy.h>
 
 /dts-v1/;
 
@@ -438,6 +439,47 @@ soc: soc {
 		dma-noncoherent;
 		ranges;
 
+		usb3d: usb@81a00000 {
+			compatible = "spacemit,k3-dwc3";
+			reg = <0x0 0x81a00000 0x0 0x10000>;
+			interrupts = <149 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-parent = <&saplic>;
+			clocks = <&syscon_apmu CLK_APMU_USB3_PORTD_BUS>;
+			clock-names = "usbdrd30";
+			resets = <&syscon_apmu RESET_APMU_USB3_D_AHB>,
+				 <&syscon_apmu RESET_APMU_USB3_D_VCC>,
+				 <&syscon_apmu RESET_APMU_USB3_D_PHY>;
+			reset-names = "ahb", "vcc", "phy";
+			phys = <&usb3d_u2phy>,
+			       <&combophy 4 PHY_TYPE_USB3>;
+			phy-names = "usb2-phy", "usb3-phy";
+			phy_type = "utmi";
+			snps,dis_enblslpm_quirk;
+			snps,dis_u2_susphy_quirk;
+			snps,dis_u3_susphy_quirk;
+			snps,dis-del-phy-power-chg-quirk;
+			snps,dis-tx-ipgap-linecheck-quirk;
+			snps,parkmode-disable-ss-quirk;
+			dr_mode = "host";
+			status = "disabled";
+		};
+
+		usb3d_u2phy: phy@81b00000 {
+			compatible = "spacemit,k3-usb2-phy";
+			reg = <0x0 0x81b00000 0x0 0x200>;
+			clocks = <&syscon_apmu CLK_APMU_USB2_BUS>;
+			#phy-cells = <0>;
+			status = "disabled";
+		};
+
+		combophy: phy@81d00000 {
+			compatible = "spacemit,k3-combo-phy";
+			reg = <0x0 0x81d00000 0x0 0x600000>;
+			#phy-cells = <2>;
+			spacemit,apb-spare = <&pll>;
+			status = "disabled";
+		};
+
 		usb2_host: usb@c0a00000 {
 			compatible = "spacemit,k3-dwc3";
 			reg = <0x0 0xc0a00000 0x0 0x10000>;
-- 
2.55.0


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

* [PATCH 1/2] riscv: dts: spacemit: k3: add USB controller and USB phy support
@ 2026-07-09  4:04   ` Inochi Amaoto
  0 siblings, 0 replies; 14+ messages in thread
From: Inochi Amaoto @ 2026-07-09  4:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan
  Cc: Inochi Amaoto, devicetree, linux-riscv, spacemit, linux-kernel,
	Yixun Lan, Longbin Li

Add all USB device node to the Spacemit K3.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts | 13 ++++++
 arch/riscv/boot/dts/spacemit/k3.dtsi         | 42 ++++++++++++++++++++
 2 files changed, 55 insertions(+)

diff --git a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
index b89c1521e664..2a6d35a64d5c 100644
--- a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
+++ b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
@@ -182,6 +182,11 @@ dldo7: dldo7 {
 	};
 };
 
+&combophy {
+	spacemit,apmu = <&syscon_apmu 0x11>;
+	status = "okay";
+};
+
 &eth0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&gmac0_rgmii_0_cfg>, <&gmac0_phy_0_cfg>;
@@ -221,3 +226,11 @@ hub@1 {
 &usb2_phy {
 	status = "okay";
 };
+
+&usb3d_u2phy {
+	status = "okay";
+};
+
+&usb3d {
+	status = "okay";
+};
diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
index 19fc9b49668e..82c9e2da82e9 100644
--- a/arch/riscv/boot/dts/spacemit/k3.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
@@ -7,6 +7,7 @@
 #include <dt-bindings/clock/spacemit,k3-clocks.h>
 #include <dt-bindings/reset/spacemit,k3-resets.h>
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/phy/phy.h>
 
 /dts-v1/;
 
@@ -438,6 +439,47 @@ soc: soc {
 		dma-noncoherent;
 		ranges;
 
+		usb3d: usb@81a00000 {
+			compatible = "spacemit,k3-dwc3";
+			reg = <0x0 0x81a00000 0x0 0x10000>;
+			interrupts = <149 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-parent = <&saplic>;
+			clocks = <&syscon_apmu CLK_APMU_USB3_PORTD_BUS>;
+			clock-names = "usbdrd30";
+			resets = <&syscon_apmu RESET_APMU_USB3_D_AHB>,
+				 <&syscon_apmu RESET_APMU_USB3_D_VCC>,
+				 <&syscon_apmu RESET_APMU_USB3_D_PHY>;
+			reset-names = "ahb", "vcc", "phy";
+			phys = <&usb3d_u2phy>,
+			       <&combophy 4 PHY_TYPE_USB3>;
+			phy-names = "usb2-phy", "usb3-phy";
+			phy_type = "utmi";
+			snps,dis_enblslpm_quirk;
+			snps,dis_u2_susphy_quirk;
+			snps,dis_u3_susphy_quirk;
+			snps,dis-del-phy-power-chg-quirk;
+			snps,dis-tx-ipgap-linecheck-quirk;
+			snps,parkmode-disable-ss-quirk;
+			dr_mode = "host";
+			status = "disabled";
+		};
+
+		usb3d_u2phy: phy@81b00000 {
+			compatible = "spacemit,k3-usb2-phy";
+			reg = <0x0 0x81b00000 0x0 0x200>;
+			clocks = <&syscon_apmu CLK_APMU_USB2_BUS>;
+			#phy-cells = <0>;
+			status = "disabled";
+		};
+
+		combophy: phy@81d00000 {
+			compatible = "spacemit,k3-combo-phy";
+			reg = <0x0 0x81d00000 0x0 0x600000>;
+			#phy-cells = <2>;
+			spacemit,apb-spare = <&pll>;
+			status = "disabled";
+		};
+
 		usb2_host: usb@c0a00000 {
 			compatible = "spacemit,k3-dwc3";
 			reg = <0x0 0xc0a00000 0x0 0x10000>;
-- 
2.55.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* [PATCH 2/2] riscv: dts: spacemit: k3: Add PCIe device node
  2026-07-09  4:04 ` Inochi Amaoto
@ 2026-07-09  4:04   ` Inochi Amaoto
  -1 siblings, 0 replies; 14+ messages in thread
From: Inochi Amaoto @ 2026-07-09  4:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan
  Cc: Inochi Amaoto, devicetree, linux-riscv, spacemit, linux-kernel,
	Yixun Lan, Longbin Li

Add all PCIe device node for Spacemit K3.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts |  38 ++++
 arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi |  33 ++++
 arch/riscv/boot/dts/spacemit/k3.dtsi         | 195 +++++++++++++++++++
 3 files changed, 266 insertions(+)

diff --git a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
index 2a6d35a64d5c..1eb5abbc61f9 100644
--- a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
+++ b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
@@ -205,6 +205,44 @@ phy0: phy@1 {
 	};
 };
 
+&pcie0_rc {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie0_0_cfg>;
+	num-lanes = <4>;
+	status = "okay";
+
+	pcie@0 {
+		vpcie3v3-supply = <&reg_aux_vcc3v3>;
+		phys = <&combophy 0 PHY_TYPE_PCIE>,
+		       <&combophy 1 PHY_TYPE_PCIE>;
+	};
+};
+
+&pcie2_rc {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie2_0_cfg>;
+	num-lanes = <2>;
+	status = "okay";
+
+	pcie@0 {
+		vpcie3v3-supply = <&reg_aux_vcc3v3>;
+		phys = <&combophy 2 PHY_TYPE_PCIE>,
+		       <&combophy 3 PHY_TYPE_PCIE>;
+	};
+};
+
+&pcie4_rc {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie4_0_cfg>;
+	num-lanes = <1>;
+	status = "okay";
+
+	pcie@0 {
+		vpcie3v3-supply = <&reg_aux_vcc3v3>;
+		phys = <&combophy 5 PHY_TYPE_PCIE>;
+	};
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_0_cfg>;
diff --git a/arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi
index 3ee1471f3798..68aa21a5279f 100644
--- a/arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi
@@ -689,4 +689,37 @@ uart0-0-pins {
 			drive-strength = <25>;
 		};
 	};
+
+	pcie0_0_cfg: pcie0-0-cfg {
+		pcie0-0-pins {
+			pinmux = <K3_PADCONF(79, 5)>,   /* pcie0 perst */
+				 <K3_PADCONF(81, 5)>;	/* pcie0 clkreq */
+
+			bias-pull-up = <1>;
+			drive-strength = <33>;
+			power-source = <1800>;
+		};
+	};
+
+	pcie2_0_cfg: pcie2-0-cfg {
+		pcie2-0-pins {
+			pinmux = <K3_PADCONF(25, 4)>,	/* pcie2 perst */
+				 <K3_PADCONF(27, 4)>;	/* pcie2 clkreq */
+
+			drive-strength = <38>;
+			power-source = <3300>;
+		};
+	};
+
+	pcie4_0_cfg: pcie4-0-cfg {
+		pcie4-0-pins {
+			pinmux = <K3_PADCONF(76, 5)>,	/* pcie4 perst */
+				 <K3_PADCONF(77, 5)>,	/* pcie4 wake */
+				 <K3_PADCONF(78, 5)>;	/* pcie4 clkreq */
+
+			bias-pull-up = <1>;
+			drive-strength = <33>;
+			power-source = <1800>;
+		};
+	};
 };
diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
index 82c9e2da82e9..53cfb2ad48cf 100644
--- a/arch/riscv/boot/dts/spacemit/k3.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
@@ -439,6 +439,201 @@ soc: soc {
 		dma-noncoherent;
 		ranges;
 
+		pcie0_rc: pcie@80000000 {
+			compatible = "spacemit,k3-pcie";
+			reg = <0x0 0x80000000 0x0 0x00001000>,
+			      <0x0 0x80300000 0x0 0x00003f20>,
+			      <0x11 0x00000000 0x0 0x00010000>,
+			      <0x0 0x82900000 0x0 0x00001000>,
+			      <0x0 0x80100000 0x0 0x00001000>;
+			reg-names = "dbi", "atu", "config", "link", "dbi2";
+			device_type = "pci";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			clocks = <&syscon_apmu CLK_APMU_PCIE_PORTA_DBI>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTA_MSTE>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTA_SLV>;
+			clock-names = "dbi", "mstr", "slv";
+			msi-parent = <&simsic>;
+			ranges = <0x01000000 0x00 0x00010000 0x11 0x00010000 0x0 0x00100000>,
+				 <0x02000000 0x0 0x00110000 0x11 0x00110000 0x0 0x7fef0000>,
+				 <0x43000000 0x18 0x00000000 0x18 0x00000000 0x1 0x00000000>;
+			resets = <&syscon_apmu RESET_APMU_PCIE_A_DBI>,
+				 <&syscon_apmu RESET_APMU_PCIE_A_MASTER>,
+				 <&syscon_apmu RESET_APMU_PCIE_A_SLAVE>;
+			reset-names = "dbi", "mstr", "slv";
+			max-link-speed = <3>;
+			linux,pci-domain = <0>;
+			spacemit,apmu = <&syscon_apmu 0x1f0>;
+			status = "disabled";
+
+			pcie0_port: pcie@0 {
+				device_type = "pci";
+				compatible = "pciclass,0604";
+				reg = <0x0 0x0 0x0 0x0 0x0>;
+				bus-range = <0x01 0xff>;
+				#address-cells = <3>;
+				#size-cells = <2>;
+				ranges;
+			};
+		};
+
+		pcie1_rc: pcie@80400000 {
+			compatible = "spacemit,k3-pcie";
+			reg = <0x0 0x80400000 0x0 0x00001000>,
+			      <0x0 0x80700000 0x0 0x00003f20>,
+			      <0x11 0x80000000 0x0 0x00010000>,
+			      <0x0 0x82c00000 0x0 0x00001000>,
+			      <0x0 0x80500000 0x0 0x00001000>;
+			reg-names = "dbi", "atu", "config", "link", "dbi2";
+			device_type = "pci";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			clocks = <&syscon_apmu CLK_APMU_PCIE_PORTB_DBI>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTB_MSTE>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTB_SLV>;
+			clock-names = "dbi", "mstr", "slv";
+			msi-parent = <&simsic>;
+			ranges = <0x01000000 0x0 0x00010000 0x11 0x80010000 0x0 0x00100000>,
+				 <0x02000000 0x0 0x80110000 0x11 0x80110000 0x0 0x7fef0000>,
+				 <0x43000000 0x16 0x00000000 0x16 0x00000000 0x1 0x00000000>;
+			resets = <&syscon_apmu RESET_APMU_PCIE_B_DBI>,
+				 <&syscon_apmu RESET_APMU_PCIE_B_MASTER>,
+				 <&syscon_apmu RESET_APMU_PCIE_B_SLAVE>;
+			reset-names = "dbi", "mstr", "slv";
+			max-link-speed = <3>;
+			linux,pci-domain = <1>;
+			spacemit,apmu = <&syscon_apmu 0x1d0>;
+			status = "disabled";
+
+			pcie1_port: pcie@0 {
+				device_type = "pci";
+				compatible = "pciclass,0604";
+				reg = <0x0 0x0 0x0 0x0 0x0>;
+				bus-range = <0x01 0xff>;
+				#address-cells = <3>;
+				#size-cells = <2>;
+				ranges;
+			};
+		};
+
+		pcie2_rc: pcie@80800000 {
+			compatible = "spacemit,k3-pcie";
+			reg = <0x0 0x80800000 0x0 0x00001000>,
+			      <0x0 0x80b00000 0x0 0x00003f20>,
+			      <0x12 0x00000000 0x0 0x00010000>,
+			      <0x0 0x82d00000 0x0 0x00001000>,
+			      <0x0 0x80900000 0x0 0x00001000>;
+			reg-names = "dbi", "atu", "config", "link", "dbi2";
+			device_type = "pci";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			clocks = <&syscon_apmu CLK_APMU_PCIE_PORTC_DBI>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTC_MSTE>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTC_SLV>;
+			clock-names = "dbi", "mstr", "slv";
+			msi-parent = <&simsic>;
+			ranges = <0x01000000 0x00 0x00000000 0x12 0x00010000 0x0 0x00100000>,
+				 <0x02000000 0x0 0x00110000 0x12 0x00110000 0x0 0x7fef0000>,
+				 <0x43000000 0x15 0x00000000 0x15 0x00000000 0x1 0x00000000>;
+			resets = <&syscon_apmu RESET_APMU_PCIE_C_DBI>,
+				 <&syscon_apmu RESET_APMU_PCIE_C_MASTER>,
+				 <&syscon_apmu RESET_APMU_PCIE_C_SLAVE>;
+			reset-names = "dbi", "mstr", "slv";
+			linux,pci-domain = <2>;
+			max-link-speed = <3>;
+			spacemit,apmu = <&syscon_apmu 0x1c8>;
+			status = "disabled";
+
+			pcie2_port: pcie@0 {
+				device_type = "pci";
+				compatible = "pciclass,0604";
+				reg = <0x0 0x0 0x0 0x0 0x0>;
+				bus-range = <0x01 0xff>;
+				#address-cells = <3>;
+				#size-cells = <2>;
+				ranges;
+			};
+		};
+
+		pcie3_rc: pcie@80c00000 {
+			compatible = "spacemit,k3-pcie";
+			reg = <0x0 0x80c00000 0x0 0x00001000>,
+			      <0x0 0x80f00000 0x0 0x00003f20>,
+			      <0x12 0x80000000 0x0 0x00010000>,
+			      <0x0 0x82a00000 0x0 0x00001000>,
+			      <0x0 0x80d00000 0x0 0x00001000>;
+			reg-names = "dbi", "atu", "config", "link", "dbi2";
+			device_type = "pci";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			clocks = <&syscon_apmu CLK_APMU_PCIE_PORTD_DBI>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTD_MSTE>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTD_SLV>;
+			clock-names = "dbi", "mstr", "slv";
+			msi-parent = <&simsic>;
+			ranges = <0x01000000 0x0 0x00010000 0x12 0x80010000 0x0 0x100000>,
+				 <0x02000000 0x0 0x80110000 0x12 0x80110000 0x0 0x3fef0000>,
+				 <0x43000000 0x14 0x00000000 0x14 0x00000000 0x1 0x00000000>;
+			resets = <&syscon_apmu RESET_APMU_PCIE_D_DBI>,
+				 <&syscon_apmu RESET_APMU_PCIE_D_MASTER>,
+				 <&syscon_apmu RESET_APMU_PCIE_D_SLAVE>;
+			reset-names = "dbi", "mstr", "slv";
+			linux,pci-domain = <3>;
+			bus-range = <0x00 0xff>;
+			max-link-speed = <3>;
+			spacemit,apmu = <&syscon_apmu 0x1e0>;
+			status = "disabled";
+
+			pcie3_port: pcie@0 {
+				device_type = "pci";
+				compatible = "pciclass,0604";
+				reg = <0x0 0x0 0x0 0x0 0x0>;
+				#address-cells = <3>;
+				#size-cells = <2>;
+				ranges;
+			};
+		};
+
+		pcie4_rc: pcie@81000000 {
+			compatible = "spacemit,k3-pcie";
+			reg = <0x0 0x81000000 0x0 0x00001000>,
+			      <0x0 0x81300000 0x0 0x00003f20>,
+			      <0x12 0xc0000000 0x0 0x00010000>,
+			      <0x0 0x82b00000 0x0 0x00001000>,
+			      <0x0 0x81100000 0x0 0x00001000>;
+			reg-names = "dbi", "atu", "config", "link", "dbi2";
+			device_type = "pci";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			clocks = <&syscon_apmu CLK_APMU_PCIE_PORTE_DBI>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTE_MSTE>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTE_SLV>;
+			clock-names = "dbi", "mstr", "slv";
+			msi-parent = <&simsic>;
+			ranges = <0x01000000 0x0 0x00000000 0x12 0xc0010000 0x0 0x100000>,
+				 <0x02000000 0x0 0xc0110000 0x12 0xc0110000 0x0 0x3fef0000>,
+				 <0x43000000 0x13 0x00000000 0x13 0x00000000 0x1 0x00000000>;
+			resets = <&syscon_apmu RESET_APMU_PCIE_E_DBI>,
+				 <&syscon_apmu RESET_APMU_PCIE_E_MASTER>,
+				 <&syscon_apmu RESET_APMU_PCIE_E_SLAVE>;
+			reset-names = "dbi", "mstr", "slv";
+			linux,pci-domain = <4>;
+			max-link-speed = <3>;
+			spacemit,apmu = <&syscon_apmu 0x1e8>;
+			status = "disabled";
+
+			pcie4_port: pcie@0 {
+				device_type = "pci";
+				compatible = "pciclass,0604";
+				reg = <0x0 0x0 0x0 0x0 0x0>;
+				bus-range = <0x01 0xff>;
+				#address-cells = <3>;
+				#size-cells = <2>;
+				ranges;
+			};
+		};
+
 		usb3d: usb@81a00000 {
 			compatible = "spacemit,k3-dwc3";
 			reg = <0x0 0x81a00000 0x0 0x10000>;
-- 
2.55.0


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

* [PATCH 2/2] riscv: dts: spacemit: k3: Add PCIe device node
@ 2026-07-09  4:04   ` Inochi Amaoto
  0 siblings, 0 replies; 14+ messages in thread
From: Inochi Amaoto @ 2026-07-09  4:04 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan
  Cc: Inochi Amaoto, devicetree, linux-riscv, spacemit, linux-kernel,
	Yixun Lan, Longbin Li

Add all PCIe device node for Spacemit K3.

Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
---
 arch/riscv/boot/dts/spacemit/k3-pico-itx.dts |  38 ++++
 arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi |  33 ++++
 arch/riscv/boot/dts/spacemit/k3.dtsi         | 195 +++++++++++++++++++
 3 files changed, 266 insertions(+)

diff --git a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
index 2a6d35a64d5c..1eb5abbc61f9 100644
--- a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
+++ b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
@@ -205,6 +205,44 @@ phy0: phy@1 {
 	};
 };
 
+&pcie0_rc {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie0_0_cfg>;
+	num-lanes = <4>;
+	status = "okay";
+
+	pcie@0 {
+		vpcie3v3-supply = <&reg_aux_vcc3v3>;
+		phys = <&combophy 0 PHY_TYPE_PCIE>,
+		       <&combophy 1 PHY_TYPE_PCIE>;
+	};
+};
+
+&pcie2_rc {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie2_0_cfg>;
+	num-lanes = <2>;
+	status = "okay";
+
+	pcie@0 {
+		vpcie3v3-supply = <&reg_aux_vcc3v3>;
+		phys = <&combophy 2 PHY_TYPE_PCIE>,
+		       <&combophy 3 PHY_TYPE_PCIE>;
+	};
+};
+
+&pcie4_rc {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie4_0_cfg>;
+	num-lanes = <1>;
+	status = "okay";
+
+	pcie@0 {
+		vpcie3v3-supply = <&reg_aux_vcc3v3>;
+		phys = <&combophy 5 PHY_TYPE_PCIE>;
+	};
+};
+
 &uart0 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&uart0_0_cfg>;
diff --git a/arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi
index 3ee1471f3798..68aa21a5279f 100644
--- a/arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi
@@ -689,4 +689,37 @@ uart0-0-pins {
 			drive-strength = <25>;
 		};
 	};
+
+	pcie0_0_cfg: pcie0-0-cfg {
+		pcie0-0-pins {
+			pinmux = <K3_PADCONF(79, 5)>,   /* pcie0 perst */
+				 <K3_PADCONF(81, 5)>;	/* pcie0 clkreq */
+
+			bias-pull-up = <1>;
+			drive-strength = <33>;
+			power-source = <1800>;
+		};
+	};
+
+	pcie2_0_cfg: pcie2-0-cfg {
+		pcie2-0-pins {
+			pinmux = <K3_PADCONF(25, 4)>,	/* pcie2 perst */
+				 <K3_PADCONF(27, 4)>;	/* pcie2 clkreq */
+
+			drive-strength = <38>;
+			power-source = <3300>;
+		};
+	};
+
+	pcie4_0_cfg: pcie4-0-cfg {
+		pcie4-0-pins {
+			pinmux = <K3_PADCONF(76, 5)>,	/* pcie4 perst */
+				 <K3_PADCONF(77, 5)>,	/* pcie4 wake */
+				 <K3_PADCONF(78, 5)>;	/* pcie4 clkreq */
+
+			bias-pull-up = <1>;
+			drive-strength = <33>;
+			power-source = <1800>;
+		};
+	};
 };
diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
index 82c9e2da82e9..53cfb2ad48cf 100644
--- a/arch/riscv/boot/dts/spacemit/k3.dtsi
+++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
@@ -439,6 +439,201 @@ soc: soc {
 		dma-noncoherent;
 		ranges;
 
+		pcie0_rc: pcie@80000000 {
+			compatible = "spacemit,k3-pcie";
+			reg = <0x0 0x80000000 0x0 0x00001000>,
+			      <0x0 0x80300000 0x0 0x00003f20>,
+			      <0x11 0x00000000 0x0 0x00010000>,
+			      <0x0 0x82900000 0x0 0x00001000>,
+			      <0x0 0x80100000 0x0 0x00001000>;
+			reg-names = "dbi", "atu", "config", "link", "dbi2";
+			device_type = "pci";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			clocks = <&syscon_apmu CLK_APMU_PCIE_PORTA_DBI>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTA_MSTE>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTA_SLV>;
+			clock-names = "dbi", "mstr", "slv";
+			msi-parent = <&simsic>;
+			ranges = <0x01000000 0x00 0x00010000 0x11 0x00010000 0x0 0x00100000>,
+				 <0x02000000 0x0 0x00110000 0x11 0x00110000 0x0 0x7fef0000>,
+				 <0x43000000 0x18 0x00000000 0x18 0x00000000 0x1 0x00000000>;
+			resets = <&syscon_apmu RESET_APMU_PCIE_A_DBI>,
+				 <&syscon_apmu RESET_APMU_PCIE_A_MASTER>,
+				 <&syscon_apmu RESET_APMU_PCIE_A_SLAVE>;
+			reset-names = "dbi", "mstr", "slv";
+			max-link-speed = <3>;
+			linux,pci-domain = <0>;
+			spacemit,apmu = <&syscon_apmu 0x1f0>;
+			status = "disabled";
+
+			pcie0_port: pcie@0 {
+				device_type = "pci";
+				compatible = "pciclass,0604";
+				reg = <0x0 0x0 0x0 0x0 0x0>;
+				bus-range = <0x01 0xff>;
+				#address-cells = <3>;
+				#size-cells = <2>;
+				ranges;
+			};
+		};
+
+		pcie1_rc: pcie@80400000 {
+			compatible = "spacemit,k3-pcie";
+			reg = <0x0 0x80400000 0x0 0x00001000>,
+			      <0x0 0x80700000 0x0 0x00003f20>,
+			      <0x11 0x80000000 0x0 0x00010000>,
+			      <0x0 0x82c00000 0x0 0x00001000>,
+			      <0x0 0x80500000 0x0 0x00001000>;
+			reg-names = "dbi", "atu", "config", "link", "dbi2";
+			device_type = "pci";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			clocks = <&syscon_apmu CLK_APMU_PCIE_PORTB_DBI>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTB_MSTE>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTB_SLV>;
+			clock-names = "dbi", "mstr", "slv";
+			msi-parent = <&simsic>;
+			ranges = <0x01000000 0x0 0x00010000 0x11 0x80010000 0x0 0x00100000>,
+				 <0x02000000 0x0 0x80110000 0x11 0x80110000 0x0 0x7fef0000>,
+				 <0x43000000 0x16 0x00000000 0x16 0x00000000 0x1 0x00000000>;
+			resets = <&syscon_apmu RESET_APMU_PCIE_B_DBI>,
+				 <&syscon_apmu RESET_APMU_PCIE_B_MASTER>,
+				 <&syscon_apmu RESET_APMU_PCIE_B_SLAVE>;
+			reset-names = "dbi", "mstr", "slv";
+			max-link-speed = <3>;
+			linux,pci-domain = <1>;
+			spacemit,apmu = <&syscon_apmu 0x1d0>;
+			status = "disabled";
+
+			pcie1_port: pcie@0 {
+				device_type = "pci";
+				compatible = "pciclass,0604";
+				reg = <0x0 0x0 0x0 0x0 0x0>;
+				bus-range = <0x01 0xff>;
+				#address-cells = <3>;
+				#size-cells = <2>;
+				ranges;
+			};
+		};
+
+		pcie2_rc: pcie@80800000 {
+			compatible = "spacemit,k3-pcie";
+			reg = <0x0 0x80800000 0x0 0x00001000>,
+			      <0x0 0x80b00000 0x0 0x00003f20>,
+			      <0x12 0x00000000 0x0 0x00010000>,
+			      <0x0 0x82d00000 0x0 0x00001000>,
+			      <0x0 0x80900000 0x0 0x00001000>;
+			reg-names = "dbi", "atu", "config", "link", "dbi2";
+			device_type = "pci";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			clocks = <&syscon_apmu CLK_APMU_PCIE_PORTC_DBI>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTC_MSTE>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTC_SLV>;
+			clock-names = "dbi", "mstr", "slv";
+			msi-parent = <&simsic>;
+			ranges = <0x01000000 0x00 0x00000000 0x12 0x00010000 0x0 0x00100000>,
+				 <0x02000000 0x0 0x00110000 0x12 0x00110000 0x0 0x7fef0000>,
+				 <0x43000000 0x15 0x00000000 0x15 0x00000000 0x1 0x00000000>;
+			resets = <&syscon_apmu RESET_APMU_PCIE_C_DBI>,
+				 <&syscon_apmu RESET_APMU_PCIE_C_MASTER>,
+				 <&syscon_apmu RESET_APMU_PCIE_C_SLAVE>;
+			reset-names = "dbi", "mstr", "slv";
+			linux,pci-domain = <2>;
+			max-link-speed = <3>;
+			spacemit,apmu = <&syscon_apmu 0x1c8>;
+			status = "disabled";
+
+			pcie2_port: pcie@0 {
+				device_type = "pci";
+				compatible = "pciclass,0604";
+				reg = <0x0 0x0 0x0 0x0 0x0>;
+				bus-range = <0x01 0xff>;
+				#address-cells = <3>;
+				#size-cells = <2>;
+				ranges;
+			};
+		};
+
+		pcie3_rc: pcie@80c00000 {
+			compatible = "spacemit,k3-pcie";
+			reg = <0x0 0x80c00000 0x0 0x00001000>,
+			      <0x0 0x80f00000 0x0 0x00003f20>,
+			      <0x12 0x80000000 0x0 0x00010000>,
+			      <0x0 0x82a00000 0x0 0x00001000>,
+			      <0x0 0x80d00000 0x0 0x00001000>;
+			reg-names = "dbi", "atu", "config", "link", "dbi2";
+			device_type = "pci";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			clocks = <&syscon_apmu CLK_APMU_PCIE_PORTD_DBI>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTD_MSTE>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTD_SLV>;
+			clock-names = "dbi", "mstr", "slv";
+			msi-parent = <&simsic>;
+			ranges = <0x01000000 0x0 0x00010000 0x12 0x80010000 0x0 0x100000>,
+				 <0x02000000 0x0 0x80110000 0x12 0x80110000 0x0 0x3fef0000>,
+				 <0x43000000 0x14 0x00000000 0x14 0x00000000 0x1 0x00000000>;
+			resets = <&syscon_apmu RESET_APMU_PCIE_D_DBI>,
+				 <&syscon_apmu RESET_APMU_PCIE_D_MASTER>,
+				 <&syscon_apmu RESET_APMU_PCIE_D_SLAVE>;
+			reset-names = "dbi", "mstr", "slv";
+			linux,pci-domain = <3>;
+			bus-range = <0x00 0xff>;
+			max-link-speed = <3>;
+			spacemit,apmu = <&syscon_apmu 0x1e0>;
+			status = "disabled";
+
+			pcie3_port: pcie@0 {
+				device_type = "pci";
+				compatible = "pciclass,0604";
+				reg = <0x0 0x0 0x0 0x0 0x0>;
+				#address-cells = <3>;
+				#size-cells = <2>;
+				ranges;
+			};
+		};
+
+		pcie4_rc: pcie@81000000 {
+			compatible = "spacemit,k3-pcie";
+			reg = <0x0 0x81000000 0x0 0x00001000>,
+			      <0x0 0x81300000 0x0 0x00003f20>,
+			      <0x12 0xc0000000 0x0 0x00010000>,
+			      <0x0 0x82b00000 0x0 0x00001000>,
+			      <0x0 0x81100000 0x0 0x00001000>;
+			reg-names = "dbi", "atu", "config", "link", "dbi2";
+			device_type = "pci";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			clocks = <&syscon_apmu CLK_APMU_PCIE_PORTE_DBI>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTE_MSTE>,
+				 <&syscon_apmu CLK_APMU_PCIE_PORTE_SLV>;
+			clock-names = "dbi", "mstr", "slv";
+			msi-parent = <&simsic>;
+			ranges = <0x01000000 0x0 0x00000000 0x12 0xc0010000 0x0 0x100000>,
+				 <0x02000000 0x0 0xc0110000 0x12 0xc0110000 0x0 0x3fef0000>,
+				 <0x43000000 0x13 0x00000000 0x13 0x00000000 0x1 0x00000000>;
+			resets = <&syscon_apmu RESET_APMU_PCIE_E_DBI>,
+				 <&syscon_apmu RESET_APMU_PCIE_E_MASTER>,
+				 <&syscon_apmu RESET_APMU_PCIE_E_SLAVE>;
+			reset-names = "dbi", "mstr", "slv";
+			linux,pci-domain = <4>;
+			max-link-speed = <3>;
+			spacemit,apmu = <&syscon_apmu 0x1e8>;
+			status = "disabled";
+
+			pcie4_port: pcie@0 {
+				device_type = "pci";
+				compatible = "pciclass,0604";
+				reg = <0x0 0x0 0x0 0x0 0x0>;
+				bus-range = <0x01 0xff>;
+				#address-cells = <3>;
+				#size-cells = <2>;
+				ranges;
+			};
+		};
+
 		usb3d: usb@81a00000 {
 			compatible = "spacemit,k3-dwc3";
 			reg = <0x0 0x81a00000 0x0 0x10000>;
-- 
2.55.0


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH 2/2] riscv: dts: spacemit: k3: Add PCIe device node
  2026-07-09  4:04   ` Inochi Amaoto
  (?)
@ 2026-07-09  4:17   ` sashiko-bot
  -1 siblings, 0 replies; 14+ messages in thread
From: sashiko-bot @ 2026-07-09  4:17 UTC (permalink / raw)
  To: Inochi Amaoto; +Cc: robh, conor+dt, devicetree

Thank you for your contribution! Sashiko AI review found 6 potential issue(s) to consider:
- [High] Incorrect and inconsistent PCI I/O space mapping in the ranges property.
- [High] PCIe root complex nodes are missing mandatory interrupt properties.
- [High] pcie0_rc requests 4 lanes but only provides 2 PHYs.
- [High] The phys and vpcie3v3-supply properties are incorrectly nested inside the child nodes.
- [Medium] Undocumented compatible string 'spacemit,k3-pcie' prevents schema validation.
- [Medium] The bus-range property is incorrectly placed on the child PCI-PCI bridge node.
--

--- Patch [2]: [PATCH 2/2] riscv: dts: spacemit: k3: Add PCIe device node ---
commit d6aabd33ce9c5592fb5dc09875e34a446d2e973d
Author: Inochi Amaoto <inochiama@gmail.com>

riscv: dts: spacemit: k3: Add PCIe device node
    
Add all PCIe device node for Spacemit K3.

> diff --git a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
> index 2a6d35a64d5ce..1eb5abbc61f97 100644
> --- a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
> +++ b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
> @@ -205,6 +205,44 @@ phy0: phy@1 {
>  	};
>  };
>  
> +&pcie0_rc {
> +	pinctrl-names = "default";
> +	pinctrl-0 = <&pcie0_0_cfg>;
> +	num-lanes = <4>;
> +	status = "okay";
> +
> +	pcie@0 {
> +		vpcie3v3-supply = <&reg_aux_vcc3v3>;
> +		phys = <&combophy 0 PHY_TYPE_PCIE>,
> +		       <&combophy 1 PHY_TYPE_PCIE>;
> +	};

[Severity: High]
Are there PHY definitions missing here? The pcie0_rc node requests 4 lanes 
(num-lanes = <4>) but only provides 2 PHYs in the phys array. This mismatch 
typically causes controller initialization failures or degraded links.

[Severity: High]
Should the vpcie3v3-supply and phys properties be placed in the parent 
pcie0_rc node instead of the pcie@0 child node? Standard host controller 
drivers typically query regulators and phys on the host controller's own 
device node. If they are nested under the bridge node, the regulator query 
will fail and the slot may not receive power.

[ ... ]

> diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
> index 82c9e2da82e9f..53cfb2ad48cf7 100644
> --- a/arch/riscv/boot/dts/spacemit/k3.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k3.dtsi
> @@ -439,6 +439,201 @@ soc: soc {
>  		dma-noncoherent;
>  		ranges;
>  
> +		pcie0_rc: pcie@80000000 {
> +			compatible = "spacemit,k3-pcie";

[Severity: Medium]
Is there a companion patch that adds the DT binding documentation for 
spacemit,k3-pcie? Without the schema documentation, dt_binding_check 
cannot validate constraints and required properties.

[Severity: High]
Does this PCIe root complex node need interrupts, #interrupt-cells, and 
interrupt-map properties? Without these mandatory interrupt properties, 
legacy INTx routing, AER, and power management host events will typically 
fail to function.

> +			reg = <0x0 0x80000000 0x0 0x00001000>,
> +			      <0x0 0x80300000 0x0 0x00003f20>,
> +			      <0x11 0x00000000 0x0 0x00010000>,
> +			      <0x0 0x82900000 0x0 0x00001000>,
> +			      <0x0 0x80100000 0x0 0x00001000>;
> +			reg-names = "dbi", "atu", "config", "link", "dbi2";
> +			device_type = "pci";
> +			#address-cells = <3>;
> +			#size-cells = <2>;
> +			clocks = <&syscon_apmu CLK_APMU_PCIE_PORTA_DBI>,
> +				 <&syscon_apmu CLK_APMU_PCIE_PORTA_MSTE>,
> +				 <&syscon_apmu CLK_APMU_PCIE_PORTA_SLV>;
> +			clock-names = "dbi", "mstr", "slv";
> +			msi-parent = <&simsic>;
> +			ranges = <0x01000000 0x00 0x00010000 0x11 0x00010000 0x0 0x00100000>,

[Severity: High]
Is the PCI I/O space child address intentionally mapped to 0x00010000 
instead of 0x00000000? Legacy PCI endpoints expecting standard I/O BAR 
behavior might fail since the base address is shifted beyond the typical 
16-bit legacy I/O boundary.

> +				 <0x02000000 0x0 0x00110000 0x11 0x00110000 0x0 0x7fef0000>,
> +				 <0x43000000 0x18 0x00000000 0x18 0x00000000 0x1 0x00000000>;
> +			resets = <&syscon_apmu RESET_APMU_PCIE_A_DBI>,
> +				 <&syscon_apmu RESET_APMU_PCIE_A_MASTER>,
> +				 <&syscon_apmu RESET_APMU_PCIE_A_SLAVE>;
> +			reset-names = "dbi", "mstr", "slv";
> +			max-link-speed = <3>;
> +			linux,pci-domain = <0>;
> +			spacemit,apmu = <&syscon_apmu 0x1f0>;
> +			status = "disabled";
> +
> +			pcie0_port: pcie@0 {
> +				device_type = "pci";
> +				compatible = "pciclass,0604";
> +				reg = <0x0 0x0 0x0 0x0 0x0>;
> +				bus-range = <0x01 0xff>;

[Severity: Medium]
Should the bus-range property be located in the parent pcie0_rc node 
rather than here in the child PCI-PCI bridge node? The PCI core subsystem 
relies on bus-range at the host controller level to properly define the 
decoded buses.

> +				#address-cells = <3>;
> +				#size-cells = <2>;
> +				ranges;
> +			};
> +		};
> +
> +		pcie1_rc: pcie@80400000 {
> +			compatible = "spacemit,k3-pcie";

[ ... ]

> +			ranges = <0x01000000 0x0 0x00010000 0x11 0x80010000 0x0 0x00100000>,

[Severity: High]
Does this mapping also have the same offset issue for the child PCI address, 
starting at 0x00010000 instead of 0x00000000?

[ ... ]

> +		pcie3_rc: pcie@80c00000 {
> +			compatible = "spacemit,k3-pcie";

[ ... ]

> +			ranges = <0x01000000 0x0 0x00010000 0x12 0x80010000 0x0 0x100000>,

[Severity: High]
Similarly, is this child PCI address mapping offset intentionally starting 
at 0x00010000 here as well?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260709040415.977784-1-inochiama@gmail.com?part=2

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

* Re: [PATCH 1/2] riscv: dts: spacemit: k3: add USB controller and USB phy support
  2026-07-09  4:04   ` Inochi Amaoto
  (?)
@ 2026-07-09  4:23   ` sashiko-bot
  -1 siblings, 0 replies; 14+ messages in thread
From: sashiko-bot @ 2026-07-09  4:23 UTC (permalink / raw)
  To: Inochi Amaoto; +Cc: devicetree, robh, conor+dt

Thank you for your contribution! Sashiko AI review found 4 potential issue(s) to consider:
- [High] The `spacemit,apmu` property for `combophy` uses an unaligned register offset (`0x11`) and is misplaced in the board file.
- [High] Missing driver for `spacemit,k3-combo-phy` causes the USB3 controller probe to defer indefinitely.
- [Medium] The `combophy` node specifies an abnormally large 6MB register space (`0x600000`), which is highly likely a typo.
- [Medium] The `combophy` node introduces undocumented custom properties and an invalid syscon reference, while lacking standard required properties.
--

--- Patch [1]: [PATCH 1/2] riscv: dts: spacemit: k3: add USB controller and USB phy support ---
commit d2902167c4edb4e87ae123e61df4d877f88a5943
Author: Inochi Amaoto <inochiama@gmail.com>

riscv: dts: spacemit: k3: add USB controller and USB phy support

This commit adds USB device nodes and combo PHY support to the Spacemit K3
device tree and the K3 Pico-ITX board.

> diff --git a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
> index b89c1521e6649..2a6d35a64d5ce 100644
> --- a/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts
> +++ b/arch/riscv/boot/dts/spacemit/k3-pico-itx.dts

[ ... ]

> @@ -182,6 +182,11 @@ dldo7: dldo7 {
>  	};
>  };
>  
> +&combophy {
> +	spacemit,apmu = <&syscon_apmu 0x11>;

[Severity: High]
Does this offset cause unaligned access faults? The offset 0x11 (17 decimal)
is not 4-byte aligned, which can result in -EINVAL stride violations when the
underlying driver attempts regmap_read or regmap_update_bits.

Additionally, should SoC-level APMU offsets be placed in the main k3.dtsi
instead of the board-specific k3-pico-itx.dts?

> +	status = "okay";
> +};
> +

[ ... ]

> diff --git a/arch/riscv/boot/dts/spacemit/k3.dtsi b/arch/riscv/boot/dts/spacemit/k3.dtsi
> index 19fc9b49668ed..82c9e2da82e9f 100644
> --- a/arch/riscv/boot/dts/spacemit/k3.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k3.dtsi

[ ... ]

> @@ -438,6 +439,47 @@ soc: soc {
>  		dma-noncoherent;
>  		ranges;
>  
> +		usb3d: usb@81a00000 {
> +			compatible = "spacemit,k3-dwc3";

[ ... ]

> +			reset-names = "ahb", "vcc", "phy";
> +			phys = <&usb3d_u2phy>,
> +			       <&combophy 4 PHY_TYPE_USB3>;

[Severity: High]
Is there a corresponding driver for the spacemit,k3-combo-phy compatible
string currently available in the tree?

Because the usb3d node depends on this PHY, the DWC3 core may continuously
fail to acquire the usb3-phy dependency and return -EPROBE_DEFER, leaving
the USB3 port uninitialized.

> +			phy-names = "usb2-phy", "usb3-phy";

[ ... ]

> +		combophy: phy@81d00000 {
> +			compatible = "spacemit,k3-combo-phy";
> +			reg = <0x0 0x81d00000 0x0 0x600000>;

[Severity: Medium]
Is this register map size intentional? Mapping 6MB of physical address space
for a PHY controller seems abnormally large and might be a typo.

> +			#phy-cells = <2>;
> +			spacemit,apb-spare = <&pll>;

[Severity: Medium]
Will this syscon reference work properly? The pll node being referenced is a
clock controller that lacks the syscon compatible string, meaning standard
syscon_regmap_lookup_by_phandle operations could fail.

Are the standard clocks and resets properties missing from this node as well?

> +			status = "disabled";
> +		};
> +

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260709040415.977784-1-inochiama@gmail.com?part=1

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

* Re: [PATCH 2/2] riscv: dts: spacemit: k3: Add PCIe device node
  2026-07-09  4:04   ` Inochi Amaoto
@ 2026-07-13  4:13     ` Anirudh Srinivasan
  -1 siblings, 0 replies; 14+ messages in thread
From: Anirudh Srinivasan @ 2026-07-13  4:13 UTC (permalink / raw)
  To: Inochi Amaoto
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, devicetree,
	linux-riscv, spacemit, linux-kernel, Yixun Lan, Longbin Li

Hi Inochi,

On Thu, Jul 09, 2026 at 12:04:14PM +0800, Inochi Amaoto wrote:
> Add all PCIe device node for Spacemit K3.
> 
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> ---
>  arch/riscv/boot/dts/spacemit/k3-pico-itx.dts |  38 ++++
>  arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi |  33 ++++
>  arch/riscv/boot/dts/spacemit/k3.dtsi         | 195 +++++++++++++++++++
>  3 files changed, 266 insertions(+)
> 

I see some warnings printed during probe

[   10.842955] r8169 0002:01:00.0: of_irq_parse_pci: failed with rc=-22

[   10.937754] rtw89_8852be 0004:01:00.0: of_irq_parse_pci: failed with rc=-22

I see that all the 3 rc nodes are missing an interrupts node and an
interrupt parent (saplic). The vendor DT seems to have this. Not sure if
this is related.

The 10G ethernet probes fine, but the wifi card fails to probe. Seems
like the card is trying to request 32 bit DMA addresses and we're
failing cause we have 64 bit memory only.
The vendor kernel seems to have a patch to enable 36 bit DMA in
the rtw89 driver. That'll probably fix this.

[   10.937754] rtw89_8852be 0004:01:00.0: of_irq_parse_pci: failed with rc=-22
[   10.987983] rtw89_8852be 0004:01:00.0: loaded firmware rtw89/rtw8852b_fw-2.bin
[   10.988151] rtw89_8852be 0004:01:00.0: enabling device (0000 -> 0003)
[   10.988215] (udev-worker): page allocation failure: order:2, mode:0xcc4(GFP_KERNEL|GFP_DMA32), nodemask=(null),cpuset=/,mems_allowed=0
[   10.988243] CPU: 5 UID: 0 PID: 503 Comm: (udev-worker) Not tainted 7.2.0-rc1-00034-gc57907b4459d #1 PREEMPT(lazy)
[   10.988249] Hardware name: SpacemiT K3 Pico-ITX (DT)
[   10.988252] Call Trace:
[   10.988255] [<ffffffff8001f2b8>] dump_backtrace+0x28/0x48
[   10.988265] [<ffffffff80002612>] show_stack+0x3a/0x58
[   10.988269] [<ffffffff80016432>] dump_stack_lvl+0x5a/0x88
[   10.988274] [<ffffffff80016478>] dump_stack+0x18/0x22
[   10.988277] [<ffffffff803984da>] warn_alloc+0x102/0x120
[   10.988283] [<ffffffff80398b7a>] __alloc_frozen_pages_noprof+0x682/0x1470 
[   10.988288] [<ffffffff80399980>] __alloc_pages_noprof+0x18/0x38
[   10.988292] [<ffffffff80113494>] __dma_direct_alloc_pages.isra.0+0x26c/0x428
[   10.988298] [<ffffffff801137a8>] dma_direct_alloc+0x78/0x3d0
[   10.988301] [<ffffffff8011282c>] dma_alloc_attrs+0x74/0x240
[   10.988309] [<ffffffff031a6bb6>] rtw89_pci_probe+0x20e/0xc90 [rtw89_pci]
[   10.988375] [<ffffffff8087cd1c>] local_pci_probe+0x3c/0x90
[   10.988381] [<ffffffff8087def6>] pci_device_probe+0xde/0x298
[   10.988385] [<ffffffff80a80f3e>] really_probe+0x9e/0x3e0
[   10.988390] [<ffffffff80a81308>] __driver_probe_device+0x88/0x190
[   10.988393] [<ffffffff80a814f8>] driver_probe_device+0x38/0xc0
[   10.988396] [<ffffffff80a81796>] __driver_attach+0xbe/0x208
[   10.988399] [<ffffffff80a7e22c>] bus_for_each_dev+0x6c/0xd0
[   10.988404] [<ffffffff80a806ce>] driver_attach+0x26/0x40
[   10.988407] [<ffffffff80a7fcac>] bus_add_driver+0x15c/0x298
[   10.988410] [<ffffffff80a82a82>] driver_register+0x52/0x118
[   10.988413] [<ffffffff8087c44c>] __pci_register_driver+0x4c/0x70
[   10.988417] [<ffffffff02fbc038>] rtw89_8852be_driver_init+0x30/0xff8 [rtw89_8852be]
[   10.988422] [<ffffffff80017b2a>] do_one_initcall+0x5a/0x2d0
[   10.988427] [<ffffffff8011d7b6>] do_init_module+0x96/0x2c0
[   10.988430] [<ffffffff8011f6c6>] load_module+0x19a6/0x2078
[   10.988434] [<ffffffff80120046>] init_module_from_file+0xce/0x138
[   10.988437] [<ffffffff801202d0>] __riscv_sys_finit_module+0x220/0x398
[   10.988441] [<ffffffff81010c40>] do_trap_ecall_u+0x108/0x588
[   10.988446] [<ffffffff81022a14>] handle_exception+0x16c/0x178
[   10.988455] Mem-Info:
[   10.988483] active_anon:5773 inactive_anon:0 isolated_anon:0
                active_file:0 inactive_file:30149 isolated_file:0
                unevictable:0 dirty:222 writeback:0
                slab_reclaimable:3461 slab_unreclaimable:8595
                mapped:5588 shmem:115 pagetables:949
                sec_pagetables:0 bounce:0
                kernel_misc_reclaimable:0
                free:4028911 free_pcp:0 free_cma:0
[   10.988493] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
[   10.988497] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=64kB
[   10.988501] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB 
[   10.988505] 30300 total pagecache pages
[   10.988508] 0 pages in swap cache
[   10.988511] Free swap  = 0kB
[   10.988514] Total swap = 0kB
[   10.988516] 4186368 pages RAM
[   10.988519] 0 pages HighMem/MovableOnly
[   10.988522] 86381 pages reserved
[   10.988525] 0 pages cma reserved
[   10.988528] Memory cgroup min protection 0kB -- low protection 0kB
[   10.988532] rtw89_8852be 0004:01:00.0: failed to alloc dma tx rings
[   10.994421] rtw89_8852be 0004:01:00.0: failed to alloc pci trx rings
[   11.000734] rtw89_8852be 0004:01:00.0: failed to setup pci resource
[   11.007088] rtw89_8852be 0004:01:00.0: probe with driver rtw89_8852be failed with error -12

Regards
Anirudh Srinivasan

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

* Re: [PATCH 2/2] riscv: dts: spacemit: k3: Add PCIe device node
@ 2026-07-13  4:13     ` Anirudh Srinivasan
  0 siblings, 0 replies; 14+ messages in thread
From: Anirudh Srinivasan @ 2026-07-13  4:13 UTC (permalink / raw)
  To: Inochi Amaoto
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, devicetree,
	linux-riscv, spacemit, linux-kernel, Yixun Lan, Longbin Li

Hi Inochi,

On Thu, Jul 09, 2026 at 12:04:14PM +0800, Inochi Amaoto wrote:
> Add all PCIe device node for Spacemit K3.
> 
> Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> ---
>  arch/riscv/boot/dts/spacemit/k3-pico-itx.dts |  38 ++++
>  arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi |  33 ++++
>  arch/riscv/boot/dts/spacemit/k3.dtsi         | 195 +++++++++++++++++++
>  3 files changed, 266 insertions(+)
> 

I see some warnings printed during probe

[   10.842955] r8169 0002:01:00.0: of_irq_parse_pci: failed with rc=-22

[   10.937754] rtw89_8852be 0004:01:00.0: of_irq_parse_pci: failed with rc=-22

I see that all the 3 rc nodes are missing an interrupts node and an
interrupt parent (saplic). The vendor DT seems to have this. Not sure if
this is related.

The 10G ethernet probes fine, but the wifi card fails to probe. Seems
like the card is trying to request 32 bit DMA addresses and we're
failing cause we have 64 bit memory only.
The vendor kernel seems to have a patch to enable 36 bit DMA in
the rtw89 driver. That'll probably fix this.

[   10.937754] rtw89_8852be 0004:01:00.0: of_irq_parse_pci: failed with rc=-22
[   10.987983] rtw89_8852be 0004:01:00.0: loaded firmware rtw89/rtw8852b_fw-2.bin
[   10.988151] rtw89_8852be 0004:01:00.0: enabling device (0000 -> 0003)
[   10.988215] (udev-worker): page allocation failure: order:2, mode:0xcc4(GFP_KERNEL|GFP_DMA32), nodemask=(null),cpuset=/,mems_allowed=0
[   10.988243] CPU: 5 UID: 0 PID: 503 Comm: (udev-worker) Not tainted 7.2.0-rc1-00034-gc57907b4459d #1 PREEMPT(lazy)
[   10.988249] Hardware name: SpacemiT K3 Pico-ITX (DT)
[   10.988252] Call Trace:
[   10.988255] [<ffffffff8001f2b8>] dump_backtrace+0x28/0x48
[   10.988265] [<ffffffff80002612>] show_stack+0x3a/0x58
[   10.988269] [<ffffffff80016432>] dump_stack_lvl+0x5a/0x88
[   10.988274] [<ffffffff80016478>] dump_stack+0x18/0x22
[   10.988277] [<ffffffff803984da>] warn_alloc+0x102/0x120
[   10.988283] [<ffffffff80398b7a>] __alloc_frozen_pages_noprof+0x682/0x1470 
[   10.988288] [<ffffffff80399980>] __alloc_pages_noprof+0x18/0x38
[   10.988292] [<ffffffff80113494>] __dma_direct_alloc_pages.isra.0+0x26c/0x428
[   10.988298] [<ffffffff801137a8>] dma_direct_alloc+0x78/0x3d0
[   10.988301] [<ffffffff8011282c>] dma_alloc_attrs+0x74/0x240
[   10.988309] [<ffffffff031a6bb6>] rtw89_pci_probe+0x20e/0xc90 [rtw89_pci]
[   10.988375] [<ffffffff8087cd1c>] local_pci_probe+0x3c/0x90
[   10.988381] [<ffffffff8087def6>] pci_device_probe+0xde/0x298
[   10.988385] [<ffffffff80a80f3e>] really_probe+0x9e/0x3e0
[   10.988390] [<ffffffff80a81308>] __driver_probe_device+0x88/0x190
[   10.988393] [<ffffffff80a814f8>] driver_probe_device+0x38/0xc0
[   10.988396] [<ffffffff80a81796>] __driver_attach+0xbe/0x208
[   10.988399] [<ffffffff80a7e22c>] bus_for_each_dev+0x6c/0xd0
[   10.988404] [<ffffffff80a806ce>] driver_attach+0x26/0x40
[   10.988407] [<ffffffff80a7fcac>] bus_add_driver+0x15c/0x298
[   10.988410] [<ffffffff80a82a82>] driver_register+0x52/0x118
[   10.988413] [<ffffffff8087c44c>] __pci_register_driver+0x4c/0x70
[   10.988417] [<ffffffff02fbc038>] rtw89_8852be_driver_init+0x30/0xff8 [rtw89_8852be]
[   10.988422] [<ffffffff80017b2a>] do_one_initcall+0x5a/0x2d0
[   10.988427] [<ffffffff8011d7b6>] do_init_module+0x96/0x2c0
[   10.988430] [<ffffffff8011f6c6>] load_module+0x19a6/0x2078
[   10.988434] [<ffffffff80120046>] init_module_from_file+0xce/0x138
[   10.988437] [<ffffffff801202d0>] __riscv_sys_finit_module+0x220/0x398
[   10.988441] [<ffffffff81010c40>] do_trap_ecall_u+0x108/0x588
[   10.988446] [<ffffffff81022a14>] handle_exception+0x16c/0x178
[   10.988455] Mem-Info:
[   10.988483] active_anon:5773 inactive_anon:0 isolated_anon:0
                active_file:0 inactive_file:30149 isolated_file:0
                unevictable:0 dirty:222 writeback:0
                slab_reclaimable:3461 slab_unreclaimable:8595
                mapped:5588 shmem:115 pagetables:949
                sec_pagetables:0 bounce:0
                kernel_misc_reclaimable:0
                free:4028911 free_pcp:0 free_cma:0
[   10.988493] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
[   10.988497] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=64kB
[   10.988501] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB 
[   10.988505] 30300 total pagecache pages
[   10.988508] 0 pages in swap cache
[   10.988511] Free swap  = 0kB
[   10.988514] Total swap = 0kB
[   10.988516] 4186368 pages RAM
[   10.988519] 0 pages HighMem/MovableOnly
[   10.988522] 86381 pages reserved
[   10.988525] 0 pages cma reserved
[   10.988528] Memory cgroup min protection 0kB -- low protection 0kB
[   10.988532] rtw89_8852be 0004:01:00.0: failed to alloc dma tx rings
[   10.994421] rtw89_8852be 0004:01:00.0: failed to alloc pci trx rings
[   11.000734] rtw89_8852be 0004:01:00.0: failed to setup pci resource
[   11.007088] rtw89_8852be 0004:01:00.0: probe with driver rtw89_8852be failed with error -12

Regards
Anirudh Srinivasan

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH 2/2] riscv: dts: spacemit: k3: Add PCIe device node
  2026-07-13  4:13     ` Anirudh Srinivasan
@ 2026-07-13  4:18       ` Inochi Amaoto
  -1 siblings, 0 replies; 14+ messages in thread
From: Inochi Amaoto @ 2026-07-13  4:18 UTC (permalink / raw)
  To: Anirudh Srinivasan, Inochi Amaoto
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, devicetree,
	linux-riscv, spacemit, linux-kernel, Yixun Lan, Longbin Li

On Sun, Jul 12, 2026 at 11:13:07PM -0500, Anirudh Srinivasan wrote:
> Hi Inochi,
> 
> On Thu, Jul 09, 2026 at 12:04:14PM +0800, Inochi Amaoto wrote:
> > Add all PCIe device node for Spacemit K3.
> > 
> > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > ---
> >  arch/riscv/boot/dts/spacemit/k3-pico-itx.dts |  38 ++++
> >  arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi |  33 ++++
> >  arch/riscv/boot/dts/spacemit/k3.dtsi         | 195 +++++++++++++++++++
> >  3 files changed, 266 insertions(+)
> > 
> 
> I see some warnings printed during probe
> 
> [   10.842955] r8169 0002:01:00.0: of_irq_parse_pci: failed with rc=-22
> 
> [   10.937754] rtw89_8852be 0004:01:00.0: of_irq_parse_pci: failed with rc=-22
> 

This is an expected error because the driver does not support INTx
but the hardware claims it supports. Since the vendor does not want
to support it, so there is no way for the upstreamer to add this.

> I see that all the 3 rc nodes are missing an interrupts node and an
> interrupt parent (saplic). The vendor DT seems to have this. Not sure if
> this is related.
> 
> The 10G ethernet probes fine, but the wifi card fails to probe. Seems
> like the card is trying to request 32 bit DMA addresses and we're
> failing cause we have 64 bit memory only.
> The vendor kernel seems to have a patch to enable 36 bit DMA in
> the rtw89 driver. That'll probably fix this.
> 

This warning is also found on my test, it is not related to
the PCIe driver, but a lack of the RTL phy driver. :(

You may also noticed a bad performance on this 10G ethernet,
it is caused by the single queue used by the RTL driver.
IIRC, even 9800 X3D can not achieve the max speed.

Regards,
Inochi

> [   10.937754] rtw89_8852be 0004:01:00.0: of_irq_parse_pci: failed with rc=-22
> [   10.987983] rtw89_8852be 0004:01:00.0: loaded firmware rtw89/rtw8852b_fw-2.bin
> [   10.988151] rtw89_8852be 0004:01:00.0: enabling device (0000 -> 0003)
> [   10.988215] (udev-worker): page allocation failure: order:2, mode:0xcc4(GFP_KERNEL|GFP_DMA32), nodemask=(null),cpuset=/,mems_allowed=0
> [   10.988243] CPU: 5 UID: 0 PID: 503 Comm: (udev-worker) Not tainted 7.2.0-rc1-00034-gc57907b4459d #1 PREEMPT(lazy)
> [   10.988249] Hardware name: SpacemiT K3 Pico-ITX (DT)
> [   10.988252] Call Trace:
> [   10.988255] [<ffffffff8001f2b8>] dump_backtrace+0x28/0x48
> [   10.988265] [<ffffffff80002612>] show_stack+0x3a/0x58
> [   10.988269] [<ffffffff80016432>] dump_stack_lvl+0x5a/0x88
> [   10.988274] [<ffffffff80016478>] dump_stack+0x18/0x22
> [   10.988277] [<ffffffff803984da>] warn_alloc+0x102/0x120
> [   10.988283] [<ffffffff80398b7a>] __alloc_frozen_pages_noprof+0x682/0x1470 
> [   10.988288] [<ffffffff80399980>] __alloc_pages_noprof+0x18/0x38
> [   10.988292] [<ffffffff80113494>] __dma_direct_alloc_pages.isra.0+0x26c/0x428
> [   10.988298] [<ffffffff801137a8>] dma_direct_alloc+0x78/0x3d0
> [   10.988301] [<ffffffff8011282c>] dma_alloc_attrs+0x74/0x240
> [   10.988309] [<ffffffff031a6bb6>] rtw89_pci_probe+0x20e/0xc90 [rtw89_pci]
> [   10.988375] [<ffffffff8087cd1c>] local_pci_probe+0x3c/0x90
> [   10.988381] [<ffffffff8087def6>] pci_device_probe+0xde/0x298
> [   10.988385] [<ffffffff80a80f3e>] really_probe+0x9e/0x3e0
> [   10.988390] [<ffffffff80a81308>] __driver_probe_device+0x88/0x190
> [   10.988393] [<ffffffff80a814f8>] driver_probe_device+0x38/0xc0
> [   10.988396] [<ffffffff80a81796>] __driver_attach+0xbe/0x208
> [   10.988399] [<ffffffff80a7e22c>] bus_for_each_dev+0x6c/0xd0
> [   10.988404] [<ffffffff80a806ce>] driver_attach+0x26/0x40
> [   10.988407] [<ffffffff80a7fcac>] bus_add_driver+0x15c/0x298
> [   10.988410] [<ffffffff80a82a82>] driver_register+0x52/0x118
> [   10.988413] [<ffffffff8087c44c>] __pci_register_driver+0x4c/0x70
> [   10.988417] [<ffffffff02fbc038>] rtw89_8852be_driver_init+0x30/0xff8 [rtw89_8852be]
> [   10.988422] [<ffffffff80017b2a>] do_one_initcall+0x5a/0x2d0
> [   10.988427] [<ffffffff8011d7b6>] do_init_module+0x96/0x2c0
> [   10.988430] [<ffffffff8011f6c6>] load_module+0x19a6/0x2078
> [   10.988434] [<ffffffff80120046>] init_module_from_file+0xce/0x138
> [   10.988437] [<ffffffff801202d0>] __riscv_sys_finit_module+0x220/0x398
> [   10.988441] [<ffffffff81010c40>] do_trap_ecall_u+0x108/0x588
> [   10.988446] [<ffffffff81022a14>] handle_exception+0x16c/0x178
> [   10.988455] Mem-Info:
> [   10.988483] active_anon:5773 inactive_anon:0 isolated_anon:0
>                 active_file:0 inactive_file:30149 isolated_file:0
>                 unevictable:0 dirty:222 writeback:0
>                 slab_reclaimable:3461 slab_unreclaimable:8595
>                 mapped:5588 shmem:115 pagetables:949
>                 sec_pagetables:0 bounce:0
>                 kernel_misc_reclaimable:0
>                 free:4028911 free_pcp:0 free_cma:0
> [   10.988493] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
> [   10.988497] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=64kB
> [   10.988501] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB 
> [   10.988505] 30300 total pagecache pages
> [   10.988508] 0 pages in swap cache
> [   10.988511] Free swap  = 0kB
> [   10.988514] Total swap = 0kB
> [   10.988516] 4186368 pages RAM
> [   10.988519] 0 pages HighMem/MovableOnly
> [   10.988522] 86381 pages reserved
> [   10.988525] 0 pages cma reserved
> [   10.988528] Memory cgroup min protection 0kB -- low protection 0kB
> [   10.988532] rtw89_8852be 0004:01:00.0: failed to alloc dma tx rings
> [   10.994421] rtw89_8852be 0004:01:00.0: failed to alloc pci trx rings
> [   11.000734] rtw89_8852be 0004:01:00.0: failed to setup pci resource
> [   11.007088] rtw89_8852be 0004:01:00.0: probe with driver rtw89_8852be failed with error -12
> 
> Regards
> Anirudh Srinivasan

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

* Re: [PATCH 2/2] riscv: dts: spacemit: k3: Add PCIe device node
@ 2026-07-13  4:18       ` Inochi Amaoto
  0 siblings, 0 replies; 14+ messages in thread
From: Inochi Amaoto @ 2026-07-13  4:18 UTC (permalink / raw)
  To: Anirudh Srinivasan, Inochi Amaoto
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, devicetree,
	linux-riscv, spacemit, linux-kernel, Yixun Lan, Longbin Li

On Sun, Jul 12, 2026 at 11:13:07PM -0500, Anirudh Srinivasan wrote:
> Hi Inochi,
> 
> On Thu, Jul 09, 2026 at 12:04:14PM +0800, Inochi Amaoto wrote:
> > Add all PCIe device node for Spacemit K3.
> > 
> > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > ---
> >  arch/riscv/boot/dts/spacemit/k3-pico-itx.dts |  38 ++++
> >  arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi |  33 ++++
> >  arch/riscv/boot/dts/spacemit/k3.dtsi         | 195 +++++++++++++++++++
> >  3 files changed, 266 insertions(+)
> > 
> 
> I see some warnings printed during probe
> 
> [   10.842955] r8169 0002:01:00.0: of_irq_parse_pci: failed with rc=-22
> 
> [   10.937754] rtw89_8852be 0004:01:00.0: of_irq_parse_pci: failed with rc=-22
> 

This is an expected error because the driver does not support INTx
but the hardware claims it supports. Since the vendor does not want
to support it, so there is no way for the upstreamer to add this.

> I see that all the 3 rc nodes are missing an interrupts node and an
> interrupt parent (saplic). The vendor DT seems to have this. Not sure if
> this is related.
> 
> The 10G ethernet probes fine, but the wifi card fails to probe. Seems
> like the card is trying to request 32 bit DMA addresses and we're
> failing cause we have 64 bit memory only.
> The vendor kernel seems to have a patch to enable 36 bit DMA in
> the rtw89 driver. That'll probably fix this.
> 

This warning is also found on my test, it is not related to
the PCIe driver, but a lack of the RTL phy driver. :(

You may also noticed a bad performance on this 10G ethernet,
it is caused by the single queue used by the RTL driver.
IIRC, even 9800 X3D can not achieve the max speed.

Regards,
Inochi

> [   10.937754] rtw89_8852be 0004:01:00.0: of_irq_parse_pci: failed with rc=-22
> [   10.987983] rtw89_8852be 0004:01:00.0: loaded firmware rtw89/rtw8852b_fw-2.bin
> [   10.988151] rtw89_8852be 0004:01:00.0: enabling device (0000 -> 0003)
> [   10.988215] (udev-worker): page allocation failure: order:2, mode:0xcc4(GFP_KERNEL|GFP_DMA32), nodemask=(null),cpuset=/,mems_allowed=0
> [   10.988243] CPU: 5 UID: 0 PID: 503 Comm: (udev-worker) Not tainted 7.2.0-rc1-00034-gc57907b4459d #1 PREEMPT(lazy)
> [   10.988249] Hardware name: SpacemiT K3 Pico-ITX (DT)
> [   10.988252] Call Trace:
> [   10.988255] [<ffffffff8001f2b8>] dump_backtrace+0x28/0x48
> [   10.988265] [<ffffffff80002612>] show_stack+0x3a/0x58
> [   10.988269] [<ffffffff80016432>] dump_stack_lvl+0x5a/0x88
> [   10.988274] [<ffffffff80016478>] dump_stack+0x18/0x22
> [   10.988277] [<ffffffff803984da>] warn_alloc+0x102/0x120
> [   10.988283] [<ffffffff80398b7a>] __alloc_frozen_pages_noprof+0x682/0x1470 
> [   10.988288] [<ffffffff80399980>] __alloc_pages_noprof+0x18/0x38
> [   10.988292] [<ffffffff80113494>] __dma_direct_alloc_pages.isra.0+0x26c/0x428
> [   10.988298] [<ffffffff801137a8>] dma_direct_alloc+0x78/0x3d0
> [   10.988301] [<ffffffff8011282c>] dma_alloc_attrs+0x74/0x240
> [   10.988309] [<ffffffff031a6bb6>] rtw89_pci_probe+0x20e/0xc90 [rtw89_pci]
> [   10.988375] [<ffffffff8087cd1c>] local_pci_probe+0x3c/0x90
> [   10.988381] [<ffffffff8087def6>] pci_device_probe+0xde/0x298
> [   10.988385] [<ffffffff80a80f3e>] really_probe+0x9e/0x3e0
> [   10.988390] [<ffffffff80a81308>] __driver_probe_device+0x88/0x190
> [   10.988393] [<ffffffff80a814f8>] driver_probe_device+0x38/0xc0
> [   10.988396] [<ffffffff80a81796>] __driver_attach+0xbe/0x208
> [   10.988399] [<ffffffff80a7e22c>] bus_for_each_dev+0x6c/0xd0
> [   10.988404] [<ffffffff80a806ce>] driver_attach+0x26/0x40
> [   10.988407] [<ffffffff80a7fcac>] bus_add_driver+0x15c/0x298
> [   10.988410] [<ffffffff80a82a82>] driver_register+0x52/0x118
> [   10.988413] [<ffffffff8087c44c>] __pci_register_driver+0x4c/0x70
> [   10.988417] [<ffffffff02fbc038>] rtw89_8852be_driver_init+0x30/0xff8 [rtw89_8852be]
> [   10.988422] [<ffffffff80017b2a>] do_one_initcall+0x5a/0x2d0
> [   10.988427] [<ffffffff8011d7b6>] do_init_module+0x96/0x2c0
> [   10.988430] [<ffffffff8011f6c6>] load_module+0x19a6/0x2078
> [   10.988434] [<ffffffff80120046>] init_module_from_file+0xce/0x138
> [   10.988437] [<ffffffff801202d0>] __riscv_sys_finit_module+0x220/0x398
> [   10.988441] [<ffffffff81010c40>] do_trap_ecall_u+0x108/0x588
> [   10.988446] [<ffffffff81022a14>] handle_exception+0x16c/0x178
> [   10.988455] Mem-Info:
> [   10.988483] active_anon:5773 inactive_anon:0 isolated_anon:0
>                 active_file:0 inactive_file:30149 isolated_file:0
>                 unevictable:0 dirty:222 writeback:0
>                 slab_reclaimable:3461 slab_unreclaimable:8595
>                 mapped:5588 shmem:115 pagetables:949
>                 sec_pagetables:0 bounce:0
>                 kernel_misc_reclaimable:0
>                 free:4028911 free_pcp:0 free_cma:0
> [   10.988493] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
> [   10.988497] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=64kB
> [   10.988501] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB 
> [   10.988505] 30300 total pagecache pages
> [   10.988508] 0 pages in swap cache
> [   10.988511] Free swap  = 0kB
> [   10.988514] Total swap = 0kB
> [   10.988516] 4186368 pages RAM
> [   10.988519] 0 pages HighMem/MovableOnly
> [   10.988522] 86381 pages reserved
> [   10.988525] 0 pages cma reserved
> [   10.988528] Memory cgroup min protection 0kB -- low protection 0kB
> [   10.988532] rtw89_8852be 0004:01:00.0: failed to alloc dma tx rings
> [   10.994421] rtw89_8852be 0004:01:00.0: failed to alloc pci trx rings
> [   11.000734] rtw89_8852be 0004:01:00.0: failed to setup pci resource
> [   11.007088] rtw89_8852be 0004:01:00.0: probe with driver rtw89_8852be failed with error -12
> 
> Regards
> Anirudh Srinivasan

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

* Re: [PATCH 2/2] riscv: dts: spacemit: k3: Add PCIe device node
  2026-07-13  4:18       ` Inochi Amaoto
@ 2026-07-13 15:04         ` Anirudh Srinivasan
  -1 siblings, 0 replies; 14+ messages in thread
From: Anirudh Srinivasan @ 2026-07-13 15:04 UTC (permalink / raw)
  To: Inochi Amaoto
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, devicetree,
	linux-riscv, spacemit, linux-kernel, Yixun Lan, Longbin Li

Hi Inochi,

On Sun, Jul 12, 2026 at 11:19 PM Inochi Amaoto <inochiama@gmail.com> wrote:
>
> On Sun, Jul 12, 2026 at 11:13:07PM -0500, Anirudh Srinivasan wrote:
> > Hi Inochi,
> >
> > On Thu, Jul 09, 2026 at 12:04:14PM +0800, Inochi Amaoto wrote:
> > > Add all PCIe device node for Spacemit K3.
> > >
> > > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > > ---
> > >  arch/riscv/boot/dts/spacemit/k3-pico-itx.dts |  38 ++++
> > >  arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi |  33 ++++
> > >  arch/riscv/boot/dts/spacemit/k3.dtsi         | 195 +++++++++++++++++++
> > >  3 files changed, 266 insertions(+)
> > >
> >
> > I see some warnings printed during probe
> >
> > [   10.842955] r8169 0002:01:00.0: of_irq_parse_pci: failed with rc=-22
> >
> > [   10.937754] rtw89_8852be 0004:01:00.0: of_irq_parse_pci: failed with rc=-22
> >
>
> This is an expected error because the driver does not support INTx
> but the hardware claims it supports. Since the vendor does not want
> to support it, so there is no way for the upstreamer to add this.

Are you saying that the hardware advertises support for INTx, but
spacemit hasn't provided a driver that uses it?

Is there a way to let the driver know to not try setting up legacy
interrupts then? It seems like it's trying to do that now, and failing
to find interrupts node in the DT.

>
> > I see that all the 3 rc nodes are missing an interrupts node and an
> > interrupt parent (saplic). The vendor DT seems to have this. Not sure if
> > this is related.
> >
> > The 10G ethernet probes fine, but the wifi card fails to probe. Seems
> > like the card is trying to request 32 bit DMA addresses and we're
> > failing cause we have 64 bit memory only.
> > The vendor kernel seems to have a patch to enable 36 bit DMA in
> > the rtw89 driver. That'll probably fix this.
> >
>
> This warning is also found on my test, it is not related to
> the PCIe driver, but a lack of the RTL phy driver. :(
>
> You may also noticed a bad performance on this 10G ethernet,
> it is caused by the single queue used by the RTL driver.
> IIRC, even 9800 X3D can not achieve the max speed.

I don't have the ability to test the 10G NIC unfortunately :(

Regards
Anirudh Srinivasan

>
> Regards,
> Inochi
>

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

* Re: [PATCH 2/2] riscv: dts: spacemit: k3: Add PCIe device node
@ 2026-07-13 15:04         ` Anirudh Srinivasan
  0 siblings, 0 replies; 14+ messages in thread
From: Anirudh Srinivasan @ 2026-07-13 15:04 UTC (permalink / raw)
  To: Inochi Amaoto
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti, Yixun Lan, devicetree,
	linux-riscv, spacemit, linux-kernel, Yixun Lan, Longbin Li

Hi Inochi,

On Sun, Jul 12, 2026 at 11:19 PM Inochi Amaoto <inochiama@gmail.com> wrote:
>
> On Sun, Jul 12, 2026 at 11:13:07PM -0500, Anirudh Srinivasan wrote:
> > Hi Inochi,
> >
> > On Thu, Jul 09, 2026 at 12:04:14PM +0800, Inochi Amaoto wrote:
> > > Add all PCIe device node for Spacemit K3.
> > >
> > > Signed-off-by: Inochi Amaoto <inochiama@gmail.com>
> > > ---
> > >  arch/riscv/boot/dts/spacemit/k3-pico-itx.dts |  38 ++++
> > >  arch/riscv/boot/dts/spacemit/k3-pinctrl.dtsi |  33 ++++
> > >  arch/riscv/boot/dts/spacemit/k3.dtsi         | 195 +++++++++++++++++++
> > >  3 files changed, 266 insertions(+)
> > >
> >
> > I see some warnings printed during probe
> >
> > [   10.842955] r8169 0002:01:00.0: of_irq_parse_pci: failed with rc=-22
> >
> > [   10.937754] rtw89_8852be 0004:01:00.0: of_irq_parse_pci: failed with rc=-22
> >
>
> This is an expected error because the driver does not support INTx
> but the hardware claims it supports. Since the vendor does not want
> to support it, so there is no way for the upstreamer to add this.

Are you saying that the hardware advertises support for INTx, but
spacemit hasn't provided a driver that uses it?

Is there a way to let the driver know to not try setting up legacy
interrupts then? It seems like it's trying to do that now, and failing
to find interrupts node in the DT.

>
> > I see that all the 3 rc nodes are missing an interrupts node and an
> > interrupt parent (saplic). The vendor DT seems to have this. Not sure if
> > this is related.
> >
> > The 10G ethernet probes fine, but the wifi card fails to probe. Seems
> > like the card is trying to request 32 bit DMA addresses and we're
> > failing cause we have 64 bit memory only.
> > The vendor kernel seems to have a patch to enable 36 bit DMA in
> > the rtw89 driver. That'll probably fix this.
> >
>
> This warning is also found on my test, it is not related to
> the PCIe driver, but a lack of the RTL phy driver. :(
>
> You may also noticed a bad performance on this 10G ethernet,
> it is caused by the single queue used by the RTL driver.
> IIRC, even 9800 X3D can not achieve the max speed.

I don't have the ability to test the 10G NIC unfortunately :(

Regards
Anirudh Srinivasan

>
> Regards,
> Inochi
>

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

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

end of thread, other threads:[~2026-07-13 15:04 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-09  4:04 [PATCH 0/2] riscv: dts: spacemit: k3: Add USB/PCIe devices Inochi Amaoto
2026-07-09  4:04 ` Inochi Amaoto
2026-07-09  4:04 ` [PATCH 1/2] riscv: dts: spacemit: k3: add USB controller and USB phy support Inochi Amaoto
2026-07-09  4:04   ` Inochi Amaoto
2026-07-09  4:23   ` sashiko-bot
2026-07-09  4:04 ` [PATCH 2/2] riscv: dts: spacemit: k3: Add PCIe device node Inochi Amaoto
2026-07-09  4:04   ` Inochi Amaoto
2026-07-09  4:17   ` sashiko-bot
2026-07-13  4:13   ` Anirudh Srinivasan
2026-07-13  4:13     ` Anirudh Srinivasan
2026-07-13  4:18     ` Inochi Amaoto
2026-07-13  4:18       ` Inochi Amaoto
2026-07-13 15:04       ` Anirudh Srinivasan
2026-07-13 15:04         ` Anirudh Srinivasan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.