364 lines
12 KiB
Diff
364 lines
12 KiB
Diff
From ce732448e140a388f74734edf2e2ec02a0478c55 Mon Sep 17 00:00:00 2001
|
|
From: Sebastian Reichel <sebastian.reichel@collabora.com>
|
|
Date: Wed, 19 Apr 2023 14:57:14 +0200
|
|
Subject: [PATCH 1/3] dt-bindings: PCI: dwc: rockchip: Fix interrupt-names
|
|
issue
|
|
|
|
The RK356x (and RK3588) have 5 ganged interrupts. For example the
|
|
"legacy" interrupt combines "inta/intb/intc/intd" with a register
|
|
providing the details.
|
|
|
|
Currently the binding is not specifying these interrupts resulting
|
|
in a bunch of errors for all rk356x boards using PCIe.
|
|
|
|
Fix this by specifying the interrupts and add them to the example
|
|
to prevent regressions.
|
|
|
|
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
|
---
|
|
.../bindings/pci/rockchip-dw-pcie.yaml | 18 ++++++++++++++++++
|
|
.../devicetree/bindings/pci/snps,dw-pcie.yaml | 15 ++++++++++++++-
|
|
2 files changed, 32 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml b/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml
|
|
index a4f61ced5e88..aad53c7d8485 100644
|
|
--- a/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml
|
|
+++ b/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml
|
|
@@ -60,6 +60,17 @@ properties:
|
|
- const: aux
|
|
- const: pipe
|
|
|
|
+ interrupts:
|
|
+ maxItems: 5
|
|
+
|
|
+ interrupt-names:
|
|
+ items:
|
|
+ - const: sys
|
|
+ - const: pmc
|
|
+ - const: msg
|
|
+ - const: legacy
|
|
+ - const: err
|
|
+
|
|
msi-map: true
|
|
|
|
num-lanes: true
|
|
@@ -108,6 +119,7 @@ unevaluatedProperties: false
|
|
|
|
examples:
|
|
- |
|
|
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
|
|
|
|
bus {
|
|
#address-cells = <2>;
|
|
@@ -127,6 +139,12 @@ examples:
|
|
"aclk_dbi", "pclk",
|
|
"aux";
|
|
device_type = "pci";
|
|
+ interrupts = <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 159 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>,
|
|
+ <GIC_SPI 156 IRQ_TYPE_LEVEL_HIGH>;
|
|
+ interrupt-names = "sys", "pmc", "msg", "legacy", "err";
|
|
linux,pci-domain = <2>;
|
|
max-link-speed = <2>;
|
|
msi-map = <0x2000 &its 0x2000 0x1000>;
|
|
diff --git a/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml b/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml
|
|
index 1a83f0f65f19..9f605eb297f5 100644
|
|
--- a/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml
|
|
+++ b/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml
|
|
@@ -193,9 +193,22 @@ properties:
|
|
oneOf:
|
|
- description: See native "app" IRQ for details
|
|
enum: [ intr ]
|
|
+ - description: Combined Legacy A/B/C/D interrupt signal.
|
|
+ const: legacy
|
|
+ - description: Combined System interrupt signal.
|
|
+ const: sys
|
|
+ - description: Combined Power Management interrupt signal.
|
|
+ const: pmc
|
|
+ - description: Combined Message Received interrupt signal.
|
|
+ const: msg
|
|
+ - description: Combined Error interrupt signal.
|
|
+ const: err
|
|
+
|
|
allOf:
|
|
- contains:
|
|
- const: msi
|
|
+ enum:
|
|
+ - msi
|
|
+ - msg
|
|
|
|
additionalProperties: true
|
|
|
|
--
|
|
2.41.0
|
|
|
|
|
|
From 24502533a9950837c50469c1cbb37324a6c83b0e Mon Sep 17 00:00:00 2001
|
|
From: Sebastian Reichel <sebastian.reichel@collabora.com>
|
|
Date: Wed, 19 Apr 2023 18:27:12 +0200
|
|
Subject: [PATCH 2/3] dt-bindings: PCI: dwc: rockchip: Add missing
|
|
legacy-interrupt-controller
|
|
|
|
Rockchip RK356x and RK3588 handle legacy interrupts via a ganged
|
|
interrupts. The RK356x DT implements this via a sub-node named
|
|
"legacy-interrupt-controller", just like a couple of other PCIe
|
|
implementations. This adds proper documentation for this and updates
|
|
the example to avoid regressions.
|
|
|
|
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
|
---
|
|
.../bindings/pci/rockchip-dw-pcie.yaml | 24 +++++++++++++++++++
|
|
1 file changed, 24 insertions(+)
|
|
|
|
diff --git a/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml b/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml
|
|
index aad53c7d8485..7897af0ec297 100644
|
|
--- a/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml
|
|
+++ b/Documentation/devicetree/bindings/pci/rockchip-dw-pcie.yaml
|
|
@@ -71,6 +71,22 @@ properties:
|
|
- const: legacy
|
|
- const: err
|
|
|
|
+ legacy-interrupt-controller:
|
|
+ description: Interrupt controller node for handling legacy PCI interrupts.
|
|
+ type: object
|
|
+ properties:
|
|
+ "#address-cells":
|
|
+ const: 0
|
|
+
|
|
+ "#interrupt-cells":
|
|
+ const: 1
|
|
+
|
|
+ "interrupt-controller": true
|
|
+
|
|
+ interrupts:
|
|
+ items:
|
|
+ - description: combined legacy interrupt
|
|
+
|
|
msi-map: true
|
|
|
|
num-lanes: true
|
|
@@ -158,6 +174,14 @@ examples:
|
|
reset-names = "pipe";
|
|
#address-cells = <3>;
|
|
#size-cells = <2>;
|
|
+
|
|
+ legacy-interrupt-controller {
|
|
+ interrupt-controller;
|
|
+ #address-cells = <0>;
|
|
+ #interrupt-cells = <1>;
|
|
+ interrupt-parent = <&gic>;
|
|
+ interrupts = <GIC_SPI 72 IRQ_TYPE_EDGE_RISING>;
|
|
+ };
|
|
};
|
|
};
|
|
...
|
|
--
|
|
2.41.0
|
|
|
|
|
|
From 9afd072bbcb97efccf1be82515cbe4ba682cce38 Mon Sep 17 00:00:00 2001
|
|
From: Sebastian Reichel <sebastian.reichel@collabora.com>
|
|
Date: Mon, 17 Apr 2023 20:03:08 +0200
|
|
Subject: [PATCH 3/3] arm64: dts: rockchip: rk3588: add PCIe2 support
|
|
|
|
Add all three PCIe2 IP blocks to the RK3588 DT. Note, that RK3588
|
|
also has two PCIe3 IP blocks, that will be handled separately.
|
|
|
|
Co-developed-by: Kever Yang <kever.yang@rock-chips.com>
|
|
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
|
|
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
|
---
|
|
arch/arm64/boot/dts/rockchip/rk3588.dtsi | 54 +++++++++++
|
|
arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 108 ++++++++++++++++++++++
|
|
2 files changed, 162 insertions(+)
|
|
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3588.dtsi b/arch/arm64/boot/dts/rockchip/rk3588.dtsi
|
|
index b9508cea34f1..5c61cce52a21 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3588.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3588.dtsi
|
|
@@ -80,6 +80,60 @@ i2s10_8ch: i2s@fde00000 {
|
|
status = "disabled";
|
|
};
|
|
|
|
+ pcie2x1l0: pcie@fe170000 {
|
|
+ compatible = "rockchip,rk3588-pcie", "rockchip,rk3568-pcie";
|
|
+ #address-cells = <3>;
|
|
+ #size-cells = <2>;
|
|
+ bus-range = <0x20 0x2f>;
|
|
+ clocks = <&cru ACLK_PCIE_1L0_MSTR>, <&cru ACLK_PCIE_1L0_SLV>,
|
|
+ <&cru ACLK_PCIE_1L0_DBI>, <&cru PCLK_PCIE_1L0>,
|
|
+ <&cru CLK_PCIE_AUX2>, <&cru CLK_PCIE1L0_PIPE>;
|
|
+ clock-names = "aclk_mst", "aclk_slv",
|
|
+ "aclk_dbi", "pclk",
|
|
+ "aux", "pipe";
|
|
+ device_type = "pci";
|
|
+ interrupts = <GIC_SPI 243 IRQ_TYPE_LEVEL_HIGH 0>,
|
|
+ <GIC_SPI 242 IRQ_TYPE_LEVEL_HIGH 0>,
|
|
+ <GIC_SPI 241 IRQ_TYPE_LEVEL_HIGH 0>,
|
|
+ <GIC_SPI 240 IRQ_TYPE_LEVEL_HIGH 0>,
|
|
+ <GIC_SPI 239 IRQ_TYPE_LEVEL_HIGH 0>;
|
|
+ interrupt-names = "sys", "pmc", "msg", "legacy", "err";
|
|
+ #interrupt-cells = <1>;
|
|
+ interrupt-map-mask = <0 0 0 7>;
|
|
+ interrupt-map = <0 0 0 1 &pcie2x1l0_intc 0>,
|
|
+ <0 0 0 2 &pcie2x1l0_intc 1>,
|
|
+ <0 0 0 3 &pcie2x1l0_intc 2>,
|
|
+ <0 0 0 4 &pcie2x1l0_intc 3>;
|
|
+ linux,pci-domain = <2>;
|
|
+ num-ib-windows = <8>;
|
|
+ num-ob-windows = <8>;
|
|
+ num-viewport = <4>;
|
|
+ max-link-speed = <2>;
|
|
+ msi-map = <0x2000 &its0 0x2000 0x1000>;
|
|
+ num-lanes = <1>;
|
|
+ phys = <&combphy1_ps PHY_TYPE_PCIE>;
|
|
+ phy-names = "pcie-phy";
|
|
+ power-domains = <&power RK3588_PD_PCIE>;
|
|
+ ranges = <0x01000000 0x0 0xf2100000 0x0 0xf2100000 0x0 0x00100000>,
|
|
+ <0x02000000 0x0 0xf2200000 0x0 0xf2200000 0x0 0x00e00000>,
|
|
+ <0x03000000 0x0 0x40000000 0x9 0x80000000 0x0 0x40000000>;
|
|
+ reg = <0xa 0x40800000 0x0 0x00400000>,
|
|
+ <0x0 0xfe170000 0x0 0x00010000>,
|
|
+ <0x0 0xf2000000 0x0 0x00100000>;
|
|
+ reg-names = "dbi", "apb", "config";
|
|
+ resets = <&cru SRST_PCIE2_POWER_UP>, <&cru SRST_P_PCIE2>;
|
|
+ reset-names = "pwr", "pipe";
|
|
+ status = "disabled";
|
|
+
|
|
+ pcie2x1l0_intc: legacy-interrupt-controller {
|
|
+ interrupt-controller;
|
|
+ #address-cells = <0>;
|
|
+ #interrupt-cells = <1>;
|
|
+ interrupt-parent = <&gic>;
|
|
+ interrupts = <GIC_SPI 240 IRQ_TYPE_EDGE_RISING 0>;
|
|
+ };
|
|
+ };
|
|
+
|
|
gmac0: ethernet@fe1b0000 {
|
|
compatible = "rockchip,rk3588-gmac", "snps,dwmac-4.20a";
|
|
reg = <0x0 0xfe1b0000 0x0 0x10000>;
|
|
diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
|
|
index 7e6c08817284..a009c4414256 100644
|
|
--- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
|
|
+++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
|
|
@@ -1679,6 +1679,114 @@ qos_vop_m1: qos@fdf82200 {
|
|
reg = <0x0 0xfdf82200 0x0 0x20>;
|
|
};
|
|
|
|
+ pcie2x1l1: pcie@fe180000 {
|
|
+ compatible = "rockchip,rk3588-pcie", "rockchip,rk3568-pcie";
|
|
+ #address-cells = <3>;
|
|
+ #size-cells = <2>;
|
|
+ bus-range = <0x30 0x3f>;
|
|
+ clocks = <&cru ACLK_PCIE_1L1_MSTR>, <&cru ACLK_PCIE_1L1_SLV>,
|
|
+ <&cru ACLK_PCIE_1L1_DBI>, <&cru PCLK_PCIE_1L1>,
|
|
+ <&cru CLK_PCIE_AUX3>, <&cru CLK_PCIE1L1_PIPE>;
|
|
+ clock-names = "aclk_mst", "aclk_slv",
|
|
+ "aclk_dbi", "pclk",
|
|
+ "aux", "pipe";
|
|
+ device_type = "pci";
|
|
+ interrupts = <GIC_SPI 248 IRQ_TYPE_LEVEL_HIGH 0>,
|
|
+ <GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH 0>,
|
|
+ <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH 0>,
|
|
+ <GIC_SPI 245 IRQ_TYPE_LEVEL_HIGH 0>,
|
|
+ <GIC_SPI 244 IRQ_TYPE_LEVEL_HIGH 0>;
|
|
+ interrupt-names = "sys", "pmc", "msg", "legacy", "err";
|
|
+ #interrupt-cells = <1>;
|
|
+ interrupt-map-mask = <0 0 0 7>;
|
|
+ interrupt-map = <0 0 0 1 &pcie2x1l1_intc 0>,
|
|
+ <0 0 0 2 &pcie2x1l1_intc 1>,
|
|
+ <0 0 0 3 &pcie2x1l1_intc 2>,
|
|
+ <0 0 0 4 &pcie2x1l1_intc 3>;
|
|
+ linux,pci-domain = <3>;
|
|
+ num-ib-windows = <8>;
|
|
+ num-ob-windows = <8>;
|
|
+ num-viewport = <4>;
|
|
+ max-link-speed = <2>;
|
|
+ msi-map = <0x3000 &its0 0x3000 0x1000>;
|
|
+ num-lanes = <1>;
|
|
+ phys = <&combphy2_psu PHY_TYPE_PCIE>;
|
|
+ phy-names = "pcie-phy";
|
|
+ power-domains = <&power RK3588_PD_PCIE>;
|
|
+ ranges = <0x01000000 0x0 0xf3100000 0x0 0xf3100000 0x0 0x00100000>,
|
|
+ <0x02000000 0x0 0xf3200000 0x0 0xf3200000 0x0 0x00e00000>,
|
|
+ <0x03000000 0x0 0x40000000 0x9 0xc0000000 0x0 0x40000000>;
|
|
+ reg = <0xa 0x40c00000 0x0 0x00400000>,
|
|
+ <0x0 0xfe180000 0x0 0x00010000>,
|
|
+ <0x0 0xf3000000 0x0 0x00100000>;
|
|
+ reg-names = "dbi", "apb", "config";
|
|
+ resets = <&cru SRST_PCIE3_POWER_UP>, <&cru SRST_P_PCIE3>;
|
|
+ reset-names = "pwr", "pipe";
|
|
+ status = "disabled";
|
|
+
|
|
+ pcie2x1l1_intc: legacy-interrupt-controller {
|
|
+ interrupt-controller;
|
|
+ #address-cells = <0>;
|
|
+ #interrupt-cells = <1>;
|
|
+ interrupt-parent = <&gic>;
|
|
+ interrupts = <GIC_SPI 245 IRQ_TYPE_EDGE_RISING 0>;
|
|
+ };
|
|
+ };
|
|
+
|
|
+ pcie2x1l2: pcie@fe190000 {
|
|
+ compatible = "rockchip,rk3588-pcie", "rockchip,rk3568-pcie";
|
|
+ #address-cells = <3>;
|
|
+ #size-cells = <2>;
|
|
+ bus-range = <0x40 0x4f>;
|
|
+ clocks = <&cru ACLK_PCIE_1L2_MSTR>, <&cru ACLK_PCIE_1L2_SLV>,
|
|
+ <&cru ACLK_PCIE_1L2_DBI>, <&cru PCLK_PCIE_1L2>,
|
|
+ <&cru CLK_PCIE_AUX4>, <&cru CLK_PCIE1L2_PIPE>;
|
|
+ clock-names = "aclk_mst", "aclk_slv",
|
|
+ "aclk_dbi", "pclk",
|
|
+ "aux", "pipe";
|
|
+ device_type = "pci";
|
|
+ interrupts = <GIC_SPI 253 IRQ_TYPE_LEVEL_HIGH 0>,
|
|
+ <GIC_SPI 252 IRQ_TYPE_LEVEL_HIGH 0>,
|
|
+ <GIC_SPI 251 IRQ_TYPE_LEVEL_HIGH 0>,
|
|
+ <GIC_SPI 250 IRQ_TYPE_LEVEL_HIGH 0>,
|
|
+ <GIC_SPI 249 IRQ_TYPE_LEVEL_HIGH 0>;
|
|
+ interrupt-names = "sys", "pmc", "msg", "legacy", "err";
|
|
+ #interrupt-cells = <1>;
|
|
+ interrupt-map-mask = <0 0 0 7>;
|
|
+ interrupt-map = <0 0 0 1 &pcie2x1l2_intc 0>,
|
|
+ <0 0 0 2 &pcie2x1l2_intc 1>,
|
|
+ <0 0 0 3 &pcie2x1l2_intc 2>,
|
|
+ <0 0 0 4 &pcie2x1l2_intc 3>;
|
|
+ linux,pci-domain = <4>;
|
|
+ num-ib-windows = <8>;
|
|
+ num-ob-windows = <8>;
|
|
+ num-viewport = <4>;
|
|
+ max-link-speed = <2>;
|
|
+ msi-map = <0x4000 &its0 0x4000 0x1000>;
|
|
+ num-lanes = <1>;
|
|
+ phys = <&combphy0_ps PHY_TYPE_PCIE>;
|
|
+ phy-names = "pcie-phy";
|
|
+ power-domains = <&power RK3588_PD_PCIE>;
|
|
+ ranges = <0x01000000 0x0 0xf4100000 0x0 0xf4100000 0x0 0x00100000>,
|
|
+ <0x02000000 0x0 0xf4200000 0x0 0xf4200000 0x0 0x00e00000>,
|
|
+ <0x03000000 0x0 0x40000000 0xa 0x00000000 0x0 0x40000000>;
|
|
+ reg = <0xa 0x41000000 0x0 0x00400000>,
|
|
+ <0x0 0xfe190000 0x0 0x00010000>,
|
|
+ <0x0 0xf4000000 0x0 0x00100000>;
|
|
+ reg-names = "dbi", "apb", "config";
|
|
+ resets = <&cru SRST_PCIE4_POWER_UP>, <&cru SRST_P_PCIE4>;
|
|
+ reset-names = "pwr", "pipe";
|
|
+ status = "disabled";
|
|
+
|
|
+ pcie2x1l2_intc: legacy-interrupt-controller {
|
|
+ interrupt-controller;
|
|
+ #address-cells = <0>;
|
|
+ #interrupt-cells = <1>;
|
|
+ interrupt-parent = <&gic>;
|
|
+ interrupts = <GIC_SPI 250 IRQ_TYPE_EDGE_RISING 0>;
|
|
+ };
|
|
+ };
|
|
+
|
|
gmac1: ethernet@fe1c0000 {
|
|
compatible = "rockchip,rk3588-gmac", "snps,dwmac-4.20a";
|
|
reg = <0x0 0xfe1c0000 0x0 0x10000>;
|
|
--
|
|
2.41.0
|
|
|