Skip to contentSkip to conversation

Use ti,j784s4-pcie-ctrl for PCIe CTRL spaces

PATCH In review Andrew Davis 3 participants 8 messages Oct 16, 2024 – Apr 2, 2025

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 1/5 dt-bindings: soc: ti: ti,j721e-system-controller: Add PCIe ctrl property

In reply to Andrew Davis

Add a pattern property for pcie-ctrl which can be part of this controller.

---
 .../bindings/soc/ti/ti,j721e-system-controller.yaml          | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml +5 -0
index 378e9cc5fac2a..2a64fc61d1262 100644
@@ -68,6 +68,11 @@ patternProperties:
     description:
       The node corresponding to SoC chip identification.
 
+  "^pcie-ctrl@[0-9a-f]+$":
+    type: object
+    description:
+      This is the PCIe control region.
+
 required:
   - compatible
   - reg
Signature · 1 line
2.39.2
#5 lore raw

PATCH 3/5 arm64: dts: ti: k3-j7200: Add PCIe ctrl node to scm_conf region

In reply to Andrew Davis

This region is used for controlling the function of the PCIe IP. It is compatible with "ti,j784s4-pcie-ctrl", add this here and use it with the PCIe node.

---
 arch/arm64/boot/dts/ti/k3-j7200-main.dtsi | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-j7200-main.dtsi +6 -1
index 9386bf3ef9f68..45091aa0fb1b0 100644
@@ -32,6 +32,11 @@ scm_conf: scm-conf@100000 {
 		#size-cells = <1>;
 		ranges = <0x00 0x00 0x00100000 0x1c000>;
 
+		pcie1_ctrl: pcie-ctrl@4074 {
+			compatible = "ti,j784s4-pcie-ctrl", "syscon";
+			reg = <0x4074 0x4>;
+		};
+
 		serdes_ln_ctrl: mux-controller@4080 {
 			compatible = "reg-mux";
 			reg = <0x4080 0x20>;
@@ -745,7 +750,7 @@ pcie1_rc: pcie@2910000 {
 		interrupt-names = "link_state";
 		interrupts = <GIC_SPI 330 IRQ_TYPE_EDGE_RISING>;
 		device_type = "pci";
-		ti,syscon-pcie-ctrl = <&scm_conf 0x4074>;
+		ti,syscon-pcie-ctrl = <&pcie1_ctrl 0x0>;
 		max-link-speed = <3>;
 		num-lanes = <4>;
 		power-domains = <&k3_pds 240 TI_SCI_PD_EXCLUSIVE>;
Signature · 1 line
2.39.2
#4 lore raw

PATCH 2/5 arm64: dts: ti: k3-j721e: Add PCIe ctrl node to scm_conf region

In reply to Andrew Davis

This region is used for controlling the function of the PCIe IP. It is compatible with "ti,j784s4-pcie-ctrl", add this here and use it with the PCIe nodes.

---
 .../boot/dts/ti/k3-j721e-evm-pcie0-ep.dtso    |  2 +-
 arch/arm64/boot/dts/ti/k3-j721e-main.dtsi     | 28 ++++++++++++++++---
 2 files changed, 25 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/ti/k3-j721e-evm-pcie0-ep.dtso +1 -1
index 4062709d65792..a8a502a6207f6 100644
@@ -38,7 +38,7 @@ pcie0_ep: pcie-ep@2900000 {
 		reg-names = "intd_cfg", "user_cfg", "reg", "mem";
 		interrupt-names = "link_state";
 		interrupts = <GIC_SPI 318 IRQ_TYPE_EDGE_RISING>;
-		ti,syscon-pcie-ctrl = <&scm_conf 0x4070>;
+		ti,syscon-pcie-ctrl = <&pcie0_ctrl 0x0>;
 		max-link-speed = <3>;
 		num-lanes = <1>;
 		power-domains = <&k3_pds 239 TI_SCI_PD_EXCLUSIVE>;
arch/arm64/boot/dts/ti/k3-j721e-main.dtsi +24 -4
index 0da785be80ff4..3b08e71081df3 100644
@@ -44,6 +44,26 @@ scm_conf: scm-conf@100000 {
 		#size-cells = <1>;
 		ranges = <0x0 0x0 0x00100000 0x1c000>;
 
+		pcie0_ctrl: pcie-ctrl@4070 {
+			compatible = "ti,j784s4-pcie-ctrl", "syscon";
+			reg = <0x4070 0x4>;
+		};
+
+		pcie1_ctrl: pcie-ctrl@4074 {
+			compatible = "ti,j784s4-pcie-ctrl", "syscon";
+			reg = <0x4074 0x4>;
+		};
+
+		pcie2_ctrl: pcie-ctrl@4078 {
+			compatible = "ti,j784s4-pcie-ctrl", "syscon";
+			reg = <0x4078 0x4>;
+		};
+
+		pcie3_ctrl: pcie-ctrl@407c {
+			compatible = "ti,j784s4-pcie-ctrl", "syscon";
+			reg = <0x407c 0x4>;
+		};
+
 		serdes_ln_ctrl: mux-controller@4080 {
 			compatible = "reg-mux";
 			reg = <0x4080 0x50>;
@@ -945,7 +965,7 @@ pcie0_rc: pcie@2900000 {
 		interrupt-names = "link_state";
 		interrupts = <GIC_SPI 318 IRQ_TYPE_EDGE_RISING>;
 		device_type = "pci";
-		ti,syscon-pcie-ctrl = <&scm_conf 0x4070>;
+		ti,syscon-pcie-ctrl = <&pcie0_ctrl 0x0>;
 		max-link-speed = <3>;
 		num-lanes = <2>;
 		power-domains = <&k3_pds 239 TI_SCI_PD_EXCLUSIVE>;
@@ -974,7 +994,7 @@ pcie1_rc: pcie@2910000 {
 		interrupt-names = "link_state";
 		interrupts = <GIC_SPI 330 IRQ_TYPE_EDGE_RISING>;
 		device_type = "pci";
-		ti,syscon-pcie-ctrl = <&scm_conf 0x4074>;
+		ti,syscon-pcie-ctrl = <&pcie1_ctrl 0x0>;
 		max-link-speed = <3>;
 		num-lanes = <2>;
 		power-domains = <&k3_pds 240 TI_SCI_PD_EXCLUSIVE>;
@@ -1003,7 +1023,7 @@ pcie2_rc: pcie@2920000 {
 		interrupt-names = "link_state";
 		interrupts = <GIC_SPI 342 IRQ_TYPE_EDGE_RISING>;
 		device_type = "pci";
-		ti,syscon-pcie-ctrl = <&scm_conf 0x4078>;
+		ti,syscon-pcie-ctrl = <&pcie2_ctrl 0x0>;
 		max-link-speed = <3>;
 		num-lanes = <2>;
 		power-domains = <&k3_pds 241 TI_SCI_PD_EXCLUSIVE>;
@@ -1032,7 +1052,7 @@ pcie3_rc: pcie@2930000 {
 		interrupt-names = "link_state";
 		interrupts = <GIC_SPI 354 IRQ_TYPE_EDGE_RISING>;
 		device_type = "pci";
-		ti,syscon-pcie-ctrl = <&scm_conf 0x407c>;
+		ti,syscon-pcie-ctrl = <&pcie3_ctrl 0x0>;
 		max-link-speed = <3>;
 		num-lanes = <2>;
 		power-domains = <&k3_pds 242 TI_SCI_PD_EXCLUSIVE>;
Signature · 1 line
2.39.2
#0 lore raw

cover Use ti,j784s4-pcie-ctrl for PCIe CTRL spaces

Hello all,

Now that we have ti,j784s4-pcie-ctrl[0] let's use it. This makes these K3 SoCs all match what is already done for J784s4.

No functional change, DT changes are fully backwards and forwards compatible.

Thanks,
Andrew

[0] commit cc1965b02d6c ("dt-bindings: mfd: syscon: Add ti,j784s4-pcie-ctrl compatible")

Andrew Davis (5):
dt-bindings: soc: ti: ti,j721e-system-controller: Add PCIe ctrl
property
arm64: dts: ti: k3-j721e: Add PCIe ctrl node to scm_conf region
arm64: dts: ti: k3-j7200: Add PCIe ctrl node to scm_conf region
arm64: dts: ti: k3-j721s2: Add PCIe ctrl node to scm_conf region
arm64: dts: ti: k3-am64: Add PCIe ctrl node to main_conf region

 .../soc/ti/ti,j721e-system-controller.yaml    |  5 ++++
 arch/arm64/boot/dts/ti/k3-am64-main.dtsi      |  7 ++++-
 arch/arm64/boot/dts/ti/k3-j7200-main.dtsi     |  7 ++++-
 .../boot/dts/ti/k3-j721e-evm-pcie0-ep.dtso    |  2 +-
 arch/arm64/boot/dts/ti/k3-j721e-main.dtsi     | 28 ++++++++++++++++---
 .../boot/dts/ti/k3-j721s2-evm-pcie1-ep.dtso   |  2 +-
 arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi    |  7 ++++-
 7 files changed, 49 insertions(+), 9 deletions(-)
Signature · 1 line
2.39.2
#6 lore raw

PATCH 4/5 arm64: dts: ti: k3-j721s2: Add PCIe ctrl node to scm_conf region

This region is used for controlling the function of the PCIe IP. It is compatible with "ti,j784s4-pcie-ctrl", add this here and use it with the PCIe node.

---
 arch/arm64/boot/dts/ti/k3-j721s2-evm-pcie1-ep.dtso | 2 +-
 arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi         | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-j721s2-evm-pcie1-ep.dtso +1 -1
index 5ff390915b75b..8c2cd99cf2b42 100644
@@ -38,7 +38,7 @@ pcie1_ep: pcie-ep@2910000 {
 		reg-names = "intd_cfg", "user_cfg", "reg", "mem";
 		interrupt-names = "link_state";
 		interrupts = <GIC_SPI 330 IRQ_TYPE_EDGE_RISING>;
-		ti,syscon-pcie-ctrl = <&scm_conf 0x074>;
+		ti,syscon-pcie-ctrl = <&pcie1_ctrl 0x0>;
 		max-link-speed = <3>;
 		num-lanes = <1>;
 		power-domains = <&k3_pds 276 TI_SCI_PD_EXCLUSIVE>;
arch/arm64/boot/dts/ti/k3-j721s2-main.dtsi +6 -1
index 9ed6949b40e9d..b32b0ce8be462 100644
@@ -57,6 +57,11 @@ phy_gmii_sel_cpsw: phy@34 {
 			#phy-cells = <1>;
 		};
 
+		pcie1_ctrl: pcie-ctrl@74 {
+			compatible = "ti,j784s4-pcie-ctrl", "syscon";
+			reg = <0x74 0x4>;
+		};
+
 		serdes_ln_ctrl: mux-controller@80 {
 			compatible = "reg-mux";
 			reg = <0x80 0x10>;
@@ -1398,7 +1403,7 @@ pcie1_rc: pcie@2910000 {
 		interrupt-names = "link_state";
 		interrupts = <GIC_SPI 330 IRQ_TYPE_EDGE_RISING>;
 		device_type = "pci";
-		ti,syscon-pcie-ctrl = <&scm_conf 0x074>;
+		ti,syscon-pcie-ctrl = <&pcie1_ctrl 0x0>;
 		max-link-speed = <3>;
 		num-lanes = <4>;
 		power-domains = <&k3_pds 276 TI_SCI_PD_EXCLUSIVE>;
Signature · 1 line
2.39.2
#7 lore raw

PATCH 5/5 arm64: dts: ti: k3-am64: Add PCIe ctrl node to main_conf region

In reply to Andrew Davis

This region is used for controlling the function of the PCIe IP. It is compatible with "ti,j784s4-pcie-ctrl", add this here and use it with the PCIe node.

---
 arch/arm64/boot/dts/ti/k3-am64-main.dtsi | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am64-main.dtsi +6 -1
index 7eae18399caa6..66587f20aa0fe 100644
@@ -51,6 +51,11 @@ chipid@14 {
 			reg = <0x00000014 0x4>;
 		};
 
+		pcie0_ctrl: pcie-ctrl@4070 {
+			compatible = "ti,j784s4-pcie-ctrl", "syscon";
+			reg = <0x4070 0x4>;
+		};
+
 		serdes_ln_ctrl: mux-controller@4080 {
 			compatible = "reg-mux";
 			reg = <0x4080 0x4>;
@@ -1036,7 +1041,7 @@ pcie0_rc: pcie@f102000 {
 		interrupt-names = "link_state";
 		interrupts = <GIC_SPI 203 IRQ_TYPE_EDGE_RISING>;
 		device_type = "pci";
-		ti,syscon-pcie-ctrl = <&main_conf 0x4070>;
+		ti,syscon-pcie-ctrl = <&pcie0_ctrl 0x0>;
 		max-link-speed = <2>;
 		num-lanes = <1>;
 		power-domains = <&k3_pds 114 TI_SCI_PD_EXCLUSIVE>;
Signature · 1 line
2.39.2
maintainer
#2 lore raw

Re: [PATCH 1/5] dt-bindings: soc: ti: ti,j721e-system-controller: Add PCIe ctrl property

In reply to Andrew Davis
Quoted 12 lines · Andrew Davis

Add a pattern property for pcie-ctrl which can be part of this controller.

---
 .../bindings/soc/ti/ti,j721e-system-controller.yaml          | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml +0 -0
index 378e9cc5fac2a..2a64fc61d1262 100644

Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml patternProperties: · line 74

Quoted 7 lines
Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml +4 -0
@@ -68,6 +68,11 @@ patternProperties:
     description:
       The node corresponding to SoC chip identification.
 
+  "^pcie-ctrl@[0-9a-f]+$":
+    type: object
+    description:
+      This is the PCIe control region.

What goes in this node?

Quoted 7 lines
Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml +1 -0
+
 required:
   - compatible
   - reg
Signature · 1 line
2.39.2
#3 lore raw

Re: [PATCH 1/5] dt-bindings: soc: ti: ti,j721e-system-controller: Add PCIe ctrl property

Hello Rob,

Quoted 16 lines · Rob Herring
Quoted 15 lines · Andrew Davis

Add a pattern property for pcie-ctrl which can be part of this controller.

---
  .../bindings/soc/ti/ti,j721e-system-controller.yaml          | 5 +++++
  1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml +0 -0
index 378e9cc5fac2a..2a64fc61d1262 100644
@@ -68,6 +68,11 @@ patternProperties:
      description:
        The node corresponding to SoC chip identification.
 
Quoted 6 lines

Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml patternProperties: · line 74

Quoted 4 lines
Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml +4 -0
+  "^pcie-ctrl@[0-9a-f]+$":
+    type: object
+    description:
+      This is the PCIe control region.

What goes in this node?

This node corresponds to PCIe control register (used/updated by j721e_pcie_driver for setting the mode, RC or EP)

There are new overlays now that need to be updated as well, with each SoC.
Will re-roll v2 with updated description and examples in the bindings and taking into account the new overlays.

Warm Regards,
Jayesh

Quoted 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/soc/ti/ti,j721e-system-controller.yaml +1 -0
+
  required:
    - compatible
    - reg
Signature · 1 line
2.39.2