Skip to contentSkip to conversation

Add ECAM aperture for Tegra234

PATCH In review Vidya Sagar 3 participants 8 messages Oct 27, 2022 – Oct 31, 2022

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

cover Add ECAM aperture for Tegra234

This series adds ECAM aperture information in both device-tree and documentation files for Tegra234

Vidya Sagar (2):
dt-bindings: PCI: tegra234: Add ECAM support
arm64: tegra: Add ECAM aperture info for all the PCIe controllers

 .../bindings/pci/nvidia,tegra194-pcie.yaml    | 10 +++-
 .../devicetree/bindings/pci/snps,dw-pcie.yaml |  2 +-
 arch/arm64/boot/dts/nvidia/tegra234.dtsi      | 55 +++++++++++--------
 3 files changed, 42 insertions(+), 25 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/2 dt-bindings: PCI: tegra234: Add ECAM support

Add support for ECAM aperture for Tegra234.

---
 .../devicetree/bindings/pci/nvidia,tegra194-pcie.yaml  | 10 ++++++++--
 .../devicetree/bindings/pci/snps,dw-pcie.yaml          |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml +8 -2
index 75da3e8eecb9..15cc2d2055bb 100644
@@ -27,6 +27,7 @@ properties:
       - nvidia,tegra234-pcie
 
   reg:
+    minItems: 4
     items:
       - description: controller's application logic registers
       - description: configuration registers
@@ -35,13 +36,17 @@ properties:
           available for software access.
       - description: aperture where the Root Port's own configuration
           registers are available.
+      - description: aperture to access the configuration space through ECAM.
+          This is applicable only for Tegra234.
 
   reg-names:
+    minItems: 4
     items:
       - const: appl
       - const: config
       - const: atu_dma
       - const: dbi
+      - const: ecam
 
   interrupts:
     items:
@@ -305,8 +310,9 @@ examples:
             reg = <0x00 0x14160000 0x0 0x00020000>, /* appl registers (128K)      */
                   <0x00 0x36000000 0x0 0x00040000>, /* configuration space (256K) */
                   <0x00 0x36040000 0x0 0x00040000>, /* iATU_DMA reg space (256K)  */
-                  <0x00 0x36080000 0x0 0x00040000>; /* DBI reg space (256K)       */
-            reg-names = "appl", "config", "atu_dma", "dbi";
+                  <0x00 0x36080000 0x0 0x00040000>, /* DBI reg space (256K)       */
+                  <0x24 0x30000000 0x0 0x10000000>; /* ECAM (256MB)               */
+            reg-names = "appl", "config", "atu_dma", "dbi", "ecam";
 
             #address-cells = <3>;
             #size-cells = <2>;
Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml +1 -1
index 7287d395e1b6..7e0b015f1414 100644
@@ -35,7 +35,7 @@ properties:
     maxItems: 5
     items:
       enum: [ dbi, dbi2, config, atu, atu_dma, app, appl, elbi, mgmt, ctrl,
-              parf, cfg, link, ulreg, smu, mpu, apb, phy ]
+              parf, cfg, link, ulreg, smu, mpu, apb, phy, ecam ]
 
   num-lanes:
     description: |
Signature · 1 line
2.17.1
#2 lore raw

Re: [PATCH V1 1/2] dt-bindings: PCI: tegra234: Add ECAM support

Quoted 21 lines · Vidya Sagar

Add support for ECAM aperture for Tegra234.

---
 .../devicetree/bindings/pci/nvidia,tegra194-pcie.yaml  | 10 ++++++++--
 .../devicetree/bindings/pci/snps,dw-pcie.yaml          |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml +1 -0
index 75da3e8eecb9..15cc2d2055bb 100644
@@ -27,6 +27,7 @@ properties:
       - nvidia,tegra234-pcie
 
   reg:
+    minItems: 4
     items:
       - description: controller's application logic registers
       - description: configuration registers

Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml properties: · line 40

Quoted 5 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml +2 -0
@@ -35,13 +36,17 @@ properties:
           available for software access.
       - description: aperture where the Root Port's own configuration
           registers are available.
+      - description: aperture to access the configuration space through ECAM.
+          This is applicable only for Tegra234.

Then restrict it per compatible in allOf

Quoted 1 line

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH V1 1/2] dt-bindings: PCI: tegra234: Add ECAM support

Quoted 19 lines · Krzysztof Kozlowski

External email: Use caution opening links or attachments

Quoted 15 lines · Vidya Sagar

Add support for ECAM aperture for Tegra234.

---
  .../devicetree/bindings/pci/nvidia,tegra194-pcie.yaml  | 10 ++++++++--
  .../devicetree/bindings/pci/snps,dw-pcie.yaml          |  2 +-
  2 files changed, 9 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml +0 -0
index 75da3e8eecb9..15cc2d2055bb 100644
@@ -27,6 +27,7 @@ properties:
        - nvidia,tegra234-pcie
 
Quoted 14 lines

Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml properties: · line 40

Quoted 11 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml +3 -0
    reg:
+    minItems: 4
      items:
        - description: controller's application logic registers
        - description: configuration registers
@@ -35,13 +36,17 @@ properties:
            available for software access.
        - description: aperture where the Root Port's own configuration
            registers are available.
+      - description: aperture to access the configuration space through ECAM.
+          This is applicable only for Tegra234.

Then restrict it per compatible in allOf

Thanks Krzysztof for your review.
For a similar change here https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]/ Rob had said that may be it is not worth it. Let me know if you really want this change and I'll push a new patch.

Thanks,
Vidya Sagar

Quoted 5 lines
Quoted 1 line

Best regards,
Krzysztof

#4 lore raw

Re: [PATCH V1 1/2] dt-bindings: PCI: tegra234: Add ECAM support

Quoted 37 lines · Vidya Sagar
Quoted 19 lines · Krzysztof Kozlowski

External email: Use caution opening links or attachments

Quoted 15 lines · Vidya Sagar

Add support for ECAM aperture for Tegra234.

---
  .../devicetree/bindings/pci/nvidia,tegra194-pcie.yaml  | 10 ++++++++--
  .../devicetree/bindings/pci/snps,dw-pcie.yaml          |  2 +-
  2 files changed, 9 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml +0 -0
index 75da3e8eecb9..15cc2d2055bb 100644
@@ -27,6 +27,7 @@ properties:
        - nvidia,tegra234-pcie
 
Quoted 14 lines

Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml properties: · line 40

Quoted 11 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml +3 -0
    reg:
+    minItems: 4
      items:
        - description: controller's application logic registers
        - description: configuration registers
@@ -35,13 +36,17 @@ properties:
            available for software access.
        - description: aperture where the Root Port's own configuration
            registers are available.
+      - description: aperture to access the configuration space through ECAM.
+          This is applicable only for Tegra234.

Then restrict it per compatible in allOf

Quoted 6 lines

Thanks Krzysztof for your review.
For a similar change here
https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]/
Rob had said that may be it is not worth it.
Let me know if you really want this change and I'll push a new patch.

That's a bit different. Restricting it per variant works and should be trivial.

Best regards,
Krzysztof

maintainer
#5 lore raw

Re: [PATCH V1 1/2] dt-bindings: PCI: tegra234: Add ECAM support

In reply to Vidya Sagar
Quoted 21 lines · Vidya Sagar

Add support for ECAM aperture for Tegra234.

---
 .../devicetree/bindings/pci/nvidia,tegra194-pcie.yaml  | 10 ++++++++--
 .../devicetree/bindings/pci/snps,dw-pcie.yaml          |  2 +-
 2 files changed, 9 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml +1 -0
index 75da3e8eecb9..15cc2d2055bb 100644
@@ -27,6 +27,7 @@ properties:
       - nvidia,tegra234-pcie
 
   reg:
+    minItems: 4
     items:
       - description: controller's application logic registers
       - description: configuration registers

Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml properties: · line 40

Quoted 5 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml +2 -0
@@ -35,13 +36,17 @@ properties:
           available for software access.
       - description: aperture where the Root Port's own configuration
           registers are available.
+      - description: aperture to access the configuration space through ECAM.
+          This is applicable only for Tegra234.

Is it really only Tegra234 or that's all you've tested or care about? For the former, I agree with Krzysztof.

Rob

#6 lore raw

Re: [PATCH V1 1/2] dt-bindings: PCI: tegra234: Add ECAM support

Quoted 19 lines · Rob Herring

External email: Use caution opening links or attachments

Quoted 15 lines · Vidya Sagar

Add support for ECAM aperture for Tegra234.

---
  .../devicetree/bindings/pci/nvidia,tegra194-pcie.yaml  | 10 ++++++++--
  .../devicetree/bindings/pci/snps,dw-pcie.yaml          |  2 +-
  2 files changed, 9 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml +0 -0
index 75da3e8eecb9..15cc2d2055bb 100644
@@ -27,6 +27,7 @@ properties:
        - nvidia,tegra234-pcie
 
Quoted 14 lines

Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml properties: · line 40

Quoted 11 lines
Documentation/devicetree/bindings/pci/nvidia,tegra194-pcie.yaml +3 -0
    reg:
+    minItems: 4
      items:
        - description: controller's application logic registers
        - description: configuration registers
@@ -35,13 +36,17 @@ properties:
            available for software access.
        - description: aperture where the Root Port's own configuration
            registers are available.
+      - description: aperture to access the configuration space through ECAM.
+          This is applicable only for Tegra234.

Is it really only Tegra234 or that's all you've tested or care about? For the former, I agree with Krzysztof.

It is applicable only for Tegra234 and not applicable for Tegra194 (I meant the support for ECAM itself is not there in Tegra194). I'll address the review comments in the next version.

- Vidya Sagar

Quoted 3 lines

Rob

#7 lore raw

PATCH 2/2 arm64: tegra: Add ECAM aperture info for all the PCIe controllers

In reply to Vidya Sagar

Add the ECAM aperture information for all the PCIe controllers of Tegra234.

---
 arch/arm64/boot/dts/nvidia/tegra234.dtsi | 55 ++++++++++++++----------
 1 file changed, 33 insertions(+), 22 deletions(-)
arch/arm64/boot/dts/nvidia/tegra234.dtsi +33 -22
index 85b0dea33117..f5d20f7253b0 100644
@@ -2044,8 +2044,9 @@
 		reg = <0x00 0x140a0000 0x0 0x00020000>, /* appl registers (128K)      */
 		      <0x00 0x2a000000 0x0 0x00040000>, /* configuration space (256K) */
 		      <0x00 0x2a040000 0x0 0x00040000>, /* iATU_DMA reg space (256K)  */
-		      <0x00 0x2a080000 0x0 0x00040000>; /* DBI reg space (256K)       */
-		reg-names = "appl", "config", "atu_dma", "dbi";
+		      <0x00 0x2a080000 0x0 0x00040000>, /* DBI reg space (256K)       */
+		      <0x35 0x30000000 0x0 0x10000000>; /* ECAM (256MB)               */
+		reg-names = "appl", "config", "atu_dma", "dbi", "ecam";
 
 		#address-cells = <3>;
 		#size-cells = <2>;
@@ -2097,8 +2098,9 @@
 		reg = <0x00 0x140c0000 0x0 0x00020000>, /* appl registers (128K)      */
 		      <0x00 0x2c000000 0x0 0x00040000>, /* configuration space (256K) */
 		      <0x00 0x2c040000 0x0 0x00040000>, /* iATU_DMA reg space (256K)  */
-		      <0x00 0x2c080000 0x0 0x00040000>; /* DBI reg space (256K)       */
-		reg-names = "appl", "config", "atu_dma", "dbi";
+		      <0x00 0x2c080000 0x0 0x00040000>, /* DBI reg space (256K)       */
+		      <0x38 0x30000000 0x0 0x10000000>; /* ECAM (256MB)               */
+		reg-names = "appl", "config", "atu_dma", "dbi", "ecam";
 
 		#address-cells = <3>;
 		#size-cells = <2>;
@@ -2150,8 +2152,9 @@
 		reg = <0x00 0x140e0000 0x0 0x00020000>, /* appl registers (128K)      */
 		      <0x00 0x2e000000 0x0 0x00040000>, /* configuration space (256K) */
 		      <0x00 0x2e040000 0x0 0x00040000>, /* iATU_DMA reg space (256K)  */
-		      <0x00 0x2e080000 0x0 0x00040000>; /* DBI reg space (256K)       */
-		reg-names = "appl", "config", "atu_dma", "dbi";
+		      <0x00 0x2e080000 0x0 0x00040000>, /* DBI reg space (256K)       */
+		      <0x3b 0x30000000 0x0 0x10000000>; /* ECAM (256MB)               */
+		reg-names = "appl", "config", "atu_dma", "dbi", "ecam";
 
 		#address-cells = <3>;
 		#size-cells = <2>;
@@ -2203,8 +2206,9 @@
 		reg = <0x00 0x14100000 0x0 0x00020000>, /* appl registers (128K)      */
 		      <0x00 0x30000000 0x0 0x00040000>, /* configuration space (256K) */
 		      <0x00 0x30040000 0x0 0x00040000>, /* iATU_DMA reg space (256K)  */
-		      <0x00 0x30080000 0x0 0x00040000>; /* DBI reg space (256K)       */
-		reg-names = "appl", "config", "atu_dma", "dbi";
+		      <0x00 0x30080000 0x0 0x00040000>, /* DBI reg space (256K)       */
+		      <0x20 0xb0000000 0x0 0x10000000>; /* ECAM (256MB)               */
+		reg-names = "appl", "config", "atu_dma", "dbi", "ecam";
 
 		#address-cells = <3>;
 		#size-cells = <2>;
@@ -2256,8 +2260,9 @@
 		reg = <0x00 0x14120000 0x0 0x00020000>, /* appl registers (128K)      */
 		      <0x00 0x32000000 0x0 0x00040000>, /* configuration space (256K) */
 		      <0x00 0x32040000 0x0 0x00040000>, /* iATU_DMA reg space (256K)  */
-		      <0x00 0x32080000 0x0 0x00040000>; /* DBI reg space (256K)       */
-		reg-names = "appl", "config", "atu_dma", "dbi";
+		      <0x00 0x32080000 0x0 0x00040000>, /* DBI reg space (256K)       */
+		      <0x20 0xf0000000 0x0 0x10000000>; /* ECAM (256MB)               */
+		reg-names = "appl", "config", "atu_dma", "dbi", "ecam";
 
 		#address-cells = <3>;
 		#size-cells = <2>;
@@ -2309,8 +2314,9 @@
 		reg = <0x00 0x14140000 0x0 0x00020000>, /* appl registers (128K)      */
 		      <0x00 0x34000000 0x0 0x00040000>, /* configuration space (256K) */
 		      <0x00 0x34040000 0x0 0x00040000>, /* iATU_DMA reg space (256K)  */
-		      <0x00 0x34080000 0x0 0x00040000>; /* DBI reg space (256K)       */
-		reg-names = "appl", "config", "atu_dma", "dbi";
+		      <0x00 0x34080000 0x0 0x00040000>, /* DBI reg space (256K)       */
+		      <0x21 0x30000000 0x0 0x10000000>; /* ECAM (256MB)               */
+		reg-names = "appl", "config", "atu_dma", "dbi", "ecam";
 
 		#address-cells = <3>;
 		#size-cells = <2>;
@@ -2362,8 +2368,9 @@
 		reg = <0x00 0x14160000 0x0 0x00020000>, /* appl registers (128K)      */
 		      <0x00 0x36000000 0x0 0x00040000>, /* configuration space (256K) */
 		      <0x00 0x36040000 0x0 0x00040000>, /* iATU_DMA reg space (256K)  */
-		      <0x00 0x36080000 0x0 0x00040000>; /* DBI reg space (256K)       */
-		reg-names = "appl", "config", "atu_dma", "dbi";
+		      <0x00 0x36080000 0x0 0x00040000>, /* DBI reg space (256K)       */
+		      <0x24 0x30000000 0x0 0x10000000>; /* ECAM (256MB)               */
+		reg-names = "appl", "config", "atu_dma", "dbi", "ecam";
 
 		#address-cells = <3>;
 		#size-cells = <2>;
@@ -2415,8 +2422,9 @@
 		reg = <0x00 0x14180000 0x0 0x00020000>, /* appl registers (128K)      */
 		      <0x00 0x38000000 0x0 0x00040000>, /* configuration space (256K) */
 		      <0x00 0x38040000 0x0 0x00040000>, /* iATU_DMA reg space (256K)  */
-		      <0x00 0x38080000 0x0 0x00040000>; /* DBI reg space (256K)       */
-		reg-names = "appl", "config", "atu_dma", "dbi";
+		      <0x00 0x38080000 0x0 0x00040000>, /* DBI reg space (256K)       */
+		      <0x27 0x30000000 0x0 0x10000000>; /* ECAM (256MB)               */
+		reg-names = "appl", "config", "atu_dma", "dbi", "ecam";
 
 		#address-cells = <3>;
 		#size-cells = <2>;
@@ -2468,8 +2476,9 @@
 		reg = <0x00 0x141a0000 0x0 0x00020000>, /* appl registers (128K)      */
 		      <0x00 0x3a000000 0x0 0x00040000>, /* configuration space (256K) */
 		      <0x00 0x3a040000 0x0 0x00040000>, /* iATU_DMA reg space (256K)  */
-		      <0x00 0x3a080000 0x0 0x00040000>; /* DBI reg space (256K)       */
-		reg-names = "appl", "config", "atu_dma", "dbi";
+		      <0x00 0x3a080000 0x0 0x00040000>, /* DBI reg space (256K)       */
+		      <0x2b 0x30000000 0x0 0x10000000>; /* ECAM (256MB)               */
+		reg-names = "appl", "config", "atu_dma", "dbi", "ecam";
 
 		#address-cells = <3>;
 		#size-cells = <2>;
@@ -2521,8 +2530,9 @@
 		reg = <0x00 0x141c0000 0x0 0x00020000>, /* appl registers (128K)      */
 		      <0x00 0x3c000000 0x0 0x00040000>, /* configuration space (256K) */
 		      <0x00 0x3c040000 0x0 0x00040000>, /* iATU_DMA reg space (256K)  */
-		      <0x00 0x3c080000 0x0 0x00040000>; /* DBI reg space (256K)       */
-		reg-names = "appl", "config", "atu_dma", "dbi";
+		      <0x00 0x3c080000 0x0 0x00040000>, /* DBI reg space (256K)       */
+		      <0x2e 0x30000000 0x0 0x10000000>; /* ECAM (256MB)               */
+		reg-names = "appl", "config", "atu_dma", "dbi", "ecam";
 
 		#address-cells = <3>;
 		#size-cells = <2>;
@@ -2574,8 +2584,9 @@
 		reg = <0x00 0x141e0000 0x0 0x00020000>, /* appl registers (128K)      */
 		      <0x00 0x3e000000 0x0 0x00040000>, /* configuration space (256K) */
 		      <0x00 0x3e040000 0x0 0x00040000>, /* iATU_DMA reg space (256K)  */
-		      <0x00 0x3e080000 0x0 0x00040000>; /* DBI reg space (256K)       */
-		reg-names = "appl", "config", "atu_dma", "dbi";
+		      <0x00 0x3e080000 0x0 0x00040000>, /* DBI reg space (256K)       */
+		      <0x32 0x30000000 0x0 0x10000000>; /* ECAM (256MB)               */
+		reg-names = "appl", "config", "atu_dma", "dbi", "ecam";
 
 		#address-cells = <3>;
 		#size-cells = <2>;
Signature · 1 line
2.17.1