public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Add PCIe Gen2x1 controller support for RK3528
@ 2025-09-18 15:30 Yao Zi
  2025-09-18 15:30 ` [PATCH v2 1/3] dt-bindings: PCI: dwc: rockchip: Add RK3528 variant Yao Zi
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Yao Zi @ 2025-09-18 15:30 UTC (permalink / raw)
  To: Bjorn Helgaas, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Manivannan Sadhasivam, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Heiko Stuebner, Shawn Lin, Simon Xue
  Cc: linux-pci, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel, Jonas Karlman, Chukun Pan, Yao Zi

Rockchip RK3528 ships one PCIe Gen2x1 controller that operates in RC
mode only. The SoC doesn't provide a separate MSI controller, thus the
one integrated in designware PCIe IP must be used. This series documents
the PCIe controller in dt-binding and describes it in the SoC devicetree.

Radxa E20C board is used for testing, whose LAN GbE port is provided
through an RTL8111H chip connected to PCIe controller. Its devicetree
is adjusted to enable the controller, and IPERF3 shows the interface
runs at full-speed. A typical result looks like

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.10 GBytes   942 Mbits/sec    0             sender
[  5]   0.00-10.01  sec  1.10 GBytes   941 Mbits/sec                  receiver

This series is based on next-20250917, thanks for your time and review.

Changed from v1
- Collect review tags
- SoC devicetree
  - Drop redundant PCLK_PCIE_PHY clock for PCIe node
  - Use 32-bit DBI address, adjust SoC ranges property and reorder nodes
  - Align cells of reg and ranges properties
- board devicetree
  - drop redundant pinconf pcie_reset_g
  - Add missing vpcie3v3-supply
- Link to v1: https://lore.kernel.org/all/20250906135246.19398-1-ziyao@disroot.org/

Yao Zi (3):
  dt-bindings: PCI: dwc: rockchip: Add RK3528 variant
  arm64: dts: rockchip: Add PCIe Gen2x1 controller for RK3528
  arm64: dts: rockchip: Enable PCIe controller on Radxa E20C

 .../bindings/pci/rockchip-dw-pcie.yaml        |  3 +
 .../boot/dts/rockchip/rk3528-radxa-e20c.dts   | 12 ++++
 arch/arm64/boot/dts/rockchip/rk3528.dtsi      | 56 ++++++++++++++++++-
 3 files changed, 70 insertions(+), 1 deletion(-)

-- 
2.50.1


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

* [PATCH v2 1/3] dt-bindings: PCI: dwc: rockchip: Add RK3528 variant
  2025-09-18 15:30 [PATCH v2 0/3] Add PCIe Gen2x1 controller support for RK3528 Yao Zi
@ 2025-09-18 15:30 ` Yao Zi
  2025-09-18 16:06   ` Heiko Stübner
  2025-09-18 15:30 ` [PATCH v2 2/3] arm64: dts: rockchip: Add PCIe Gen2x1 controller for RK3528 Yao Zi
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Yao Zi @ 2025-09-18 15:30 UTC (permalink / raw)
  To: Bjorn Helgaas, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Manivannan Sadhasivam, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Heiko Stuebner, Shawn Lin, Simon Xue
  Cc: linux-pci, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel, Jonas Karlman, Chukun Pan, Yao Zi

RK3528 ships a PCIe Gen2x1 controller that operates in RC mode only.
Since the SoC has no separate MSI controller, the one integrated in the
DWC PCIe IP must be used, and thus its interrupt scheme is similar to
variants found in RK3562 and RK3576.

Older BSP code claimed its integrated MSI controller supports only 8
MSIs[1], but this has been changed in newer BSP[2] and testing proves
the controller works correctly with more than 8 MSIs allocated,
suggesting the controller should be compatible with the RK3568 variant.
Let's document its compatible string.

Link: https://github.com/rockchip-linux/kernel/blob/792a7d4273a5/drivers/pci/controller/dwc/pcie-dw-rockchip.c#L1610-L1613 # [1]
Link: https://github.com/rockchip-linux/kernel/blob/1ba51b059f25/drivers/pci/controller/dwc/pcie-dw-rockchip.c#L904-L906 # [2]
Signed-off-by: Yao Zi <ziyao@disroot.org>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
---
 Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml b/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml
index 6c6d828ce964..67f1a5502048 100644
--- a/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml
+++ b/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml
@@ -22,6 +22,7 @@ properties:
       - const: rockchip,rk3568-pcie
       - items:
           - enum:
+              - rockchip,rk3528-pcie
               - rockchip,rk3562-pcie
               - rockchip,rk3576-pcie
               - rockchip,rk3588-pcie
@@ -78,6 +79,7 @@ allOf:
           compatible:
             contains:
               enum:
+                - rockchip,rk3528-pcie
                 - rockchip,rk3562-pcie
                 - rockchip,rk3576-pcie
     then:
@@ -89,6 +91,7 @@ allOf:
         compatible:
           contains:
             enum:
+              - rockchip,rk3528-pcie
               - rockchip,rk3562-pcie
               - rockchip,rk3576-pcie
     then:
-- 
2.50.1


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

* [PATCH v2 2/3] arm64: dts: rockchip: Add PCIe Gen2x1 controller for RK3528
  2025-09-18 15:30 [PATCH v2 0/3] Add PCIe Gen2x1 controller support for RK3528 Yao Zi
  2025-09-18 15:30 ` [PATCH v2 1/3] dt-bindings: PCI: dwc: rockchip: Add RK3528 variant Yao Zi
@ 2025-09-18 15:30 ` Yao Zi
  2025-09-18 15:30 ` [PATCH v2 3/3] arm64: dts: rockchip: Enable PCIe controller on Radxa E20C Yao Zi
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Yao Zi @ 2025-09-18 15:30 UTC (permalink / raw)
  To: Bjorn Helgaas, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Manivannan Sadhasivam, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Heiko Stuebner, Shawn Lin, Simon Xue
  Cc: linux-pci, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel, Jonas Karlman, Chukun Pan, Yao Zi

Describes the PCIe Gen2x1 controller integrated in RK3528 SoC. The SoC
doesn't provide a separate MSI controller, thus the one integrated in
designware PCIe IP must be used.

Signed-off-by: Yao Zi <ziyao@disroot.org>
Reviewed-by: Jonas Karlman <jonas@kwiboo.se>
---
 arch/arm64/boot/dts/rockchip/rk3528.dtsi | 56 +++++++++++++++++++++++-
 1 file changed, 55 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3528.dtsi b/arch/arm64/boot/dts/rockchip/rk3528.dtsi
index d5f8f7b9bf01..d402f2828814 100644
--- a/arch/arm64/boot/dts/rockchip/rk3528.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3528.dtsi
@@ -7,6 +7,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/phy/phy.h>
 #include <dt-bindings/pinctrl/rockchip.h>
 #include <dt-bindings/clock/rockchip,rk3528-cru.h>
 #include <dt-bindings/power/rockchip,rk3528-power.h>
@@ -278,10 +279,63 @@ gmac0_clk: clock-gmac50m {
 
 	soc {
 		compatible = "simple-bus";
-		ranges = <0x0 0xfe000000 0x0 0xfe000000 0x0 0x2000000>;
+		ranges = <0x0 0xfc000000 0x0 0xfc000000 0x0 0x44000000>;
 		#address-cells = <2>;
 		#size-cells = <2>;
 
+		pcie: pcie@fe000000 {
+			compatible = "rockchip,rk3528-pcie",
+				     "rockchip,rk3568-pcie";
+			reg = <0x0 0xfe000000 0x0 0x400000>,
+			      <0x0 0xfe4f0000 0x0 0x010000>,
+			      <0x0 0xfc000000 0x0 0x100000>;
+			reg-names = "dbi", "apb", "config";
+			bus-range = <0x0 0xff>;
+			clocks = <&cru ACLK_PCIE>, <&cru HCLK_PCIE_SLV>,
+				 <&cru HCLK_PCIE_DBI>, <&cru PCLK_PCIE>,
+				 <&cru CLK_PCIE_AUX>;
+			clock-names = "aclk_mst", "aclk_slv",
+				      "aclk_dbi", "pclk",
+				      "aux";
+			device_type = "pci";
+			interrupts = <GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 153 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "sys", "pmc", "msg", "legacy", "err",
+					  "msi";
+			#interrupt-cells = <1>;
+			interrupt-map-mask = <0 0 0 7>;
+			interrupt-map = <0 0 0 1 &pcie_intc 0>,
+					<0 0 0 2 &pcie_intc 1>,
+					<0 0 0 3 &pcie_intc 2>,
+					<0 0 0 4 &pcie_intc 3>;
+			linux,pci-domain = <0>;
+			max-link-speed = <2>;
+			num-lanes = <1>;
+			phys = <&combphy PHY_TYPE_PCIE>;
+			phy-names = "pcie-phy";
+			power-domains = <&power RK3528_PD_VPU>;
+			ranges = <0x01000000 0x0 0xfc100000 0x0 0xfc100000 0x0 0x00100000>,
+				 <0x02000000 0x0 0xfc200000 0x0 0xfc200000 0x0 0x01e00000>,
+				 <0x03000000 0x1 0x00000000 0x1 0x00000000 0x0 0x40000000>;
+			resets = <&cru SRST_PCIE_POWER_UP>, <&cru SRST_P_PCIE>;
+			reset-names = "pwr", "pipe";
+			#address-cells = <3>;
+			#size-cells = <2>;
+			status = "disabled";
+
+			pcie_intc: legacy-interrupt-controller {
+				interrupt-controller;
+				interrupt-parent = <&gic>;
+				interrupts = <GIC_SPI 155 IRQ_TYPE_EDGE_RISING>;
+				#address-cells = <0>;
+				#interrupt-cells = <1>;
+			};
+		};
+
 		gic: interrupt-controller@fed01000 {
 			compatible = "arm,gic-400";
 			reg = <0x0 0xfed01000 0 0x1000>,
-- 
2.50.1


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

* [PATCH v2 3/3] arm64: dts: rockchip: Enable PCIe controller on Radxa E20C
  2025-09-18 15:30 [PATCH v2 0/3] Add PCIe Gen2x1 controller support for RK3528 Yao Zi
  2025-09-18 15:30 ` [PATCH v2 1/3] dt-bindings: PCI: dwc: rockchip: Add RK3528 variant Yao Zi
  2025-09-18 15:30 ` [PATCH v2 2/3] arm64: dts: rockchip: Add PCIe Gen2x1 controller for RK3528 Yao Zi
@ 2025-09-18 15:30 ` Yao Zi
  2025-10-19  6:46 ` (subset) [PATCH v2 0/3] Add PCIe Gen2x1 controller support for RK3528 Manivannan Sadhasivam
  2025-10-20 13:14 ` Heiko Stuebner
  4 siblings, 0 replies; 7+ messages in thread
From: Yao Zi @ 2025-09-18 15:30 UTC (permalink / raw)
  To: Bjorn Helgaas, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Manivannan Sadhasivam, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Heiko Stuebner, Shawn Lin, Simon Xue
  Cc: linux-pci, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel, Jonas Karlman, Chukun Pan, Yao Zi

Radxa E20C provides one of its GbE ports through RTL8111H connected to
SoC's PCIe controller. Let's enable the controller and the PHY used by
it to allow usage of the port.

Signed-off-by: Yao Zi <ziyao@disroot.org>
---
 arch/arm64/boot/dts/rockchip/rk3528-radxa-e20c.dts | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3528-radxa-e20c.dts b/arch/arm64/boot/dts/rockchip/rk3528-radxa-e20c.dts
index 12eec2c1db22..b32452756155 100644
--- a/arch/arm64/boot/dts/rockchip/rk3528-radxa-e20c.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3528-radxa-e20c.dts
@@ -171,6 +171,10 @@ vdd_logic: regulator-vdd-logic {
 	};
 };
 
+&combphy {
+	status = "okay";
+};
+
 &cpu0 {
 	cpu-supply = <&vdd_arm>;
 };
@@ -229,6 +233,14 @@ rgmii_phy: ethernet-phy@1 {
 	};
 };
 
+&pcie {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pciem1_pins>;
+	reset-gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
+	vpcie3v3-supply = <&vcc_3v3>;
+	status = "okay";
+};
+
 &pinctrl {
 	ethernet {
 		gmac1_rstn_l: gmac1-rstn-l {
-- 
2.50.1


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

* Re: [PATCH v2 1/3] dt-bindings: PCI: dwc: rockchip: Add RK3528 variant
  2025-09-18 15:30 ` [PATCH v2 1/3] dt-bindings: PCI: dwc: rockchip: Add RK3528 variant Yao Zi
@ 2025-09-18 16:06   ` Heiko Stübner
  0 siblings, 0 replies; 7+ messages in thread
From: Heiko Stübner @ 2025-09-18 16:06 UTC (permalink / raw)
  To: Bjorn Helgaas, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Manivannan Sadhasivam, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Shawn Lin, Simon Xue, Yao Zi
  Cc: linux-pci, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel, Jonas Karlman, Chukun Pan, Yao Zi

Am Donnerstag, 18. September 2025, 17:30:55 Mitteleuropäische Sommerzeit schrieb Yao Zi:
> RK3528 ships a PCIe Gen2x1 controller that operates in RC mode only.
> Since the SoC has no separate MSI controller, the one integrated in the
> DWC PCIe IP must be used, and thus its interrupt scheme is similar to
> variants found in RK3562 and RK3576.
> 
> Older BSP code claimed its integrated MSI controller supports only 8
> MSIs[1], but this has been changed in newer BSP[2] and testing proves
> the controller works correctly with more than 8 MSIs allocated,
> suggesting the controller should be compatible with the RK3568 variant.
> Let's document its compatible string.
> 
> Link: https://github.com/rockchip-linux/kernel/blob/792a7d4273a5/drivers/pci/controller/dwc/pcie-dw-rockchip.c#L1610-L1613 # [1]
> Link: https://github.com/rockchip-linux/kernel/blob/1ba51b059f25/drivers/pci/controller/dwc/pcie-dw-rockchip.c#L904-L906 # [2]
> Signed-off-by: Yao Zi <ziyao@disroot.org>
> Acked-by: Rob Herring (Arm) <robh@kernel.org>

Acked-by: Heiko Stuebner <heiko@sntech.de>

This likely should to go through the PCI tree.
(or needs an Ack from PCI maintainers, for me to pick it up)

Heiko




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

* Re: (subset) [PATCH v2 0/3] Add PCIe Gen2x1 controller support for RK3528
  2025-09-18 15:30 [PATCH v2 0/3] Add PCIe Gen2x1 controller support for RK3528 Yao Zi
                   ` (2 preceding siblings ...)
  2025-09-18 15:30 ` [PATCH v2 3/3] arm64: dts: rockchip: Enable PCIe controller on Radxa E20C Yao Zi
@ 2025-10-19  6:46 ` Manivannan Sadhasivam
  2025-10-20 13:14 ` Heiko Stuebner
  4 siblings, 0 replies; 7+ messages in thread
From: Manivannan Sadhasivam @ 2025-10-19  6:46 UTC (permalink / raw)
  To: Bjorn Helgaas, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Heiko Stuebner,
	Shawn Lin, Simon Xue, Yao Zi
  Cc: linux-pci, devicetree, linux-arm-kernel, linux-rockchip,
	linux-kernel, Jonas Karlman, Chukun Pan


On Thu, 18 Sep 2025 15:30:54 +0000, Yao Zi wrote:
> Rockchip RK3528 ships one PCIe Gen2x1 controller that operates in RC
> mode only. The SoC doesn't provide a separate MSI controller, thus the
> one integrated in designware PCIe IP must be used. This series documents
> the PCIe controller in dt-binding and describes it in the SoC devicetree.
> 
> Radxa E20C board is used for testing, whose LAN GbE port is provided
> through an RTL8111H chip connected to PCIe controller. Its devicetree
> is adjusted to enable the controller, and IPERF3 shows the interface
> runs at full-speed. A typical result looks like
> 
> [...]

Applied, thanks!

[1/3] dt-bindings: PCI: dwc: rockchip: Add RK3528 variant
      commit: dfbf19c47a01eda5df4d476d64a273e1188ea5a1

Best regards,
-- 
Manivannan Sadhasivam <mani@kernel.org>


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

* Re: (subset) [PATCH v2 0/3] Add PCIe Gen2x1 controller support for RK3528
  2025-09-18 15:30 [PATCH v2 0/3] Add PCIe Gen2x1 controller support for RK3528 Yao Zi
                   ` (3 preceding siblings ...)
  2025-10-19  6:46 ` (subset) [PATCH v2 0/3] Add PCIe Gen2x1 controller support for RK3528 Manivannan Sadhasivam
@ 2025-10-20 13:14 ` Heiko Stuebner
  4 siblings, 0 replies; 7+ messages in thread
From: Heiko Stuebner @ 2025-10-20 13:14 UTC (permalink / raw)
  To: Bjorn Helgaas, Lorenzo Pieralisi, Krzysztof Wilczyński,
	Manivannan Sadhasivam, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Shawn Lin, Simon Xue, Yao Zi
  Cc: Heiko Stuebner, linux-pci, devicetree, linux-arm-kernel,
	linux-rockchip, linux-kernel, Jonas Karlman, Chukun Pan


On Thu, 18 Sep 2025 15:30:54 +0000, Yao Zi wrote:
> Rockchip RK3528 ships one PCIe Gen2x1 controller that operates in RC
> mode only. The SoC doesn't provide a separate MSI controller, thus the
> one integrated in designware PCIe IP must be used. This series documents
> the PCIe controller in dt-binding and describes it in the SoC devicetree.
> 
> Radxa E20C board is used for testing, whose LAN GbE port is provided
> through an RTL8111H chip connected to PCIe controller. Its devicetree
> is adjusted to enable the controller, and IPERF3 shows the interface
> runs at full-speed. A typical result looks like
> 
> [...]

Applied, thanks!

[2/3] arm64: dts: rockchip: Add PCIe Gen2x1 controller for RK3528
      commit: 263fac6b09b42a1b077c21354370d38758237ab0
[3/3] arm64: dts: rockchip: Enable PCIe controller on Radxa E20C
      commit: 047bac0be317e68b89d0deed4f659f8e080df6e8

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

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

end of thread, other threads:[~2025-10-20 13:14 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-18 15:30 [PATCH v2 0/3] Add PCIe Gen2x1 controller support for RK3528 Yao Zi
2025-09-18 15:30 ` [PATCH v2 1/3] dt-bindings: PCI: dwc: rockchip: Add RK3528 variant Yao Zi
2025-09-18 16:06   ` Heiko Stübner
2025-09-18 15:30 ` [PATCH v2 2/3] arm64: dts: rockchip: Add PCIe Gen2x1 controller for RK3528 Yao Zi
2025-09-18 15:30 ` [PATCH v2 3/3] arm64: dts: rockchip: Enable PCIe controller on Radxa E20C Yao Zi
2025-10-19  6:46 ` (subset) [PATCH v2 0/3] Add PCIe Gen2x1 controller support for RK3528 Manivannan Sadhasivam
2025-10-20 13:14 ` Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox