Skip to contentSkip to conversation

rework mtk pcie-gen3 bindings and support mt7986

PATCH Superseded Frank Wunderlich 3 participants 7 messages Oct 23, 2022 – Oct 25, 2022

Subsystems (5)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover rework mtk pcie-gen3 bindings and support mt7986

From: Frank Wunderlich <[email protected]>

This Series prepares support for mt7986 PCIe which is basicly gen3 PCIe but with slightly differnt clock configuration.

To make differences better to read i split the exiting bindings which has already different settings with a compatible switch and then add a new one for mt7986.

Frank Wunderlich (3):
dt-bindings: PCI: mediatek-gen3: add SoC based clock config
dt-bindings: PCI: mediatek-gen3: add support for mt7986
dt-bindings: PCI: mediatek-gen3: add mt7986 clock config

 .../bindings/pci/mediatek-pcie-gen3.yaml      | 65 +++++++++++++++----
 1 file changed, 53 insertions(+), 12 deletions(-)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/3 dt-bindings: PCI: mediatek-gen3: add SoC based clock config

From: Frank Wunderlich <[email protected]>

The PCIe driver covers different SOC which needing different clock configs. Define them based on compatible.

---
 .../bindings/pci/mediatek-pcie-gen3.yaml      | 48 ++++++++++++++-----
 1 file changed, 36 insertions(+), 12 deletions(-)
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +36 -12
index c00be39af64e..af0d2201746d 100644
@@ -43,9 +43,6 @@ description: |+
   each set has its own address for MSI message, and supports 32 MSI vectors
   to generate interrupt.
 
-allOf:
-  - $ref: /schemas/pci/pci-bus.yaml#
-
 properties:
   compatible:
     oneOf:
@@ -84,15 +81,7 @@ properties:
     maxItems: 6
 
   clock-names:
-    items:
-      - const: pl_250m
-      - const: tl_26m
-      - const: tl_96m
-      - const: tl_32k
-      - const: peri_26m
-      - enum:
-          - top_133m        # for MT8192
-          - peri_mem        # for MT8188/MT8195
+    maxItems: 6
 
   assigned-clocks:
     maxItems: 1
@@ -138,6 +127,41 @@ required:
   - '#interrupt-cells'
   - interrupt-controller
 
+allOf:
+  - $ref: /schemas/pci/pci-bus.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: mediatek,mt8192-mmc
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: pl_250m
+            - const: tl_26m
+            - const: tl_96m
+            - const: tl_32k
+            - const: peri_26m
+            - const: top_133m
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt8188-pcie
+              - mediatek,mt8195-pcie
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: pl_250m
+            - const: tl_26m
+            - const: tl_96m
+            - const: tl_32k
+            - const: peri_26m
+            - const: peri_mem
+
 unevaluatedProperties: false
 
 examples:
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] dt-bindings: PCI: mediatek-gen3: add SoC based clock config

Quoted 10 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

The PCIe driver covers different SOC which needing different clock configs. Define them based on compatible.

---
 .../bindings/pci/mediatek-pcie-gen3.yaml      | 48 ++++++++++++++-----
 1 file changed, 36 insertions(+), 12 deletions(-)
#3 lore raw

Re: [PATCH 1/3] dt-bindings: PCI: mediatek-gen3: add SoC based clock config

In reply to Frank Wunderlich
Quoted 46 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

The PCIe driver covers different SOC which needing different clock configs. Define them based on compatible.

---
 .../bindings/pci/mediatek-pcie-gen3.yaml      | 48 ++++++++++++++---
--
 1 file changed, 36 insertions(+), 12 deletions(-)
(quoted diff) +0 -0

gen3.yaml b/Documentation/devicetree/bindings/pci/mediatek-pcie- gen3.yaml
index c00be39af64e..af0d2201746d 100644

Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +0 -0
@@ -43,9 +43,6 @@ description: |+
   each set has its own address for MSI message, and supports 32 MSI

vectors
to generate interrupt.

Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +1 -12
-allOf:
-  - $ref: /schemas/pci/pci-bus.yaml#
-
 properties:
   compatible:
     oneOf:
@@ -84,15 +81,7 @@ properties:
     maxItems: 6
 
   clock-names:
-    items:
-      - const: pl_250m
-      - const: tl_26m
-      - const: tl_96m
-      - const: tl_32k
-      - const: peri_26m
-      - enum:
-          - top_133m        # for MT8192
-          - peri_mem        # for MT8188/MT8195
+    maxItems: 6
 
   assigned-clocks:
     maxItems: 1

Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml required: · line 136

Quoted 10 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +7 -0
@@ -138,6 +127,41 @@ required:
   - '#interrupt-cells'
   - interrupt-controller
 
+allOf:
+  - $ref: /schemas/pci/pci-bus.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: mediatek,mt8192-mmc

This should be "mediatek,mt8192-pcie".

Quoted 31 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +28 -0
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: pl_250m
+            - const: tl_26m
+            - const: tl_96m
+            - const: tl_32k
+            - const: peri_26m
+            - const: top_133m
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt8188-pcie
+              - mediatek,mt8195-pcie
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: pl_250m
+            - const: tl_26m
+            - const: tl_96m
+            - const: tl_32k
+            - const: peri_26m
+            - const: peri_mem
+
 unevaluatedProperties: false
 
 examples:
#4 lore raw

PATCH 2/3 dt-bindings: PCI: mediatek-gen3: add support for mt7986

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add compatible string for mt7986.

---
 Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +1 -0
index af0d2201746d..3662422b38ea 100644
@@ -48,6 +48,7 @@ properties:
     oneOf:
       - items:
           - enum:
+              - mediatek,mt7986-pcie
               - mediatek,mt8188-pcie
               - mediatek,mt8195-pcie
           - const: mediatek,mt8192-pcie
Signature · 1 line
2.34.1
#5 lore raw

PATCH 3/3 dt-bindings: PCI: mediatek-gen3: add mt7986 clock config

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

MT7986 needs 4 clocks for PCIe, define them in binding.

---
 .../bindings/pci/mediatek-pcie-gen3.yaml         | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +16 -0
index 3662422b38ea..e6020e684c00 100644
@@ -79,9 +79,11 @@ properties:
       - const: mac
 
   clocks:
+    minItems: 4
     maxItems: 6
 
   clock-names:
+    minItems: 4
     maxItems: 6
 
   assigned-clocks:
@@ -162,6 +164,20 @@ allOf:
             - const: tl_32k
             - const: peri_26m
             - const: peri_mem
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt7986-pcie
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: pl_250m
+            - const: tl_26m
+            - const: peri_26m
+            - const: top_133m
 
 unevaluatedProperties: false
 
Signature · 1 line
2.34.1
maintainer
#6 lore raw

Re: [PATCH 3/3] dt-bindings: PCI: mediatek-gen3: add mt7986 clock config

Quoted 3 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

MT7986 needs 4 clocks for PCIe, define them in binding.

Patch 2 is incomplete without this one. Therefore, patch 2 and 3 should be 1 patch.

Quoted 47 lines
---
 .../bindings/pci/mediatek-pcie-gen3.yaml         | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +16 -0
index 3662422b38ea..e6020e684c00 100644
@@ -79,9 +79,11 @@ properties:
       - const: mac
 
   clocks:
+    minItems: 4
     maxItems: 6
 
   clock-names:
+    minItems: 4
     maxItems: 6
 
   assigned-clocks:
@@ -162,6 +164,20 @@ allOf:
             - const: tl_32k
             - const: peri_26m
             - const: peri_mem
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - mediatek,mt7986-pcie
+    then:
+      properties:
+        clock-names:
+          items:
+            - const: pl_250m
+            - const: tl_26m
+            - const: peri_26m
+            - const: top_133m
 
 unevaluatedProperties: false
 
Signature · 1 line
2.34.1