Skip to contentSkip to conversation

dt-bindings: PCI: mediatek-gen3: Add support for MT8188 and MT8195

PATCH Superseded Jianjun Wang 2 participants 4 messages Aug 1, 2022 – Aug 2, 2022

Subsystems (5)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 dt-bindings: PCI: mediatek-gen3: Add support for MT8188 and MT8195

MT8188 and MT8195 are ARM platform SoCs with the same PCIe IP as MT8192.

Also add new clock name "peri_mem" since the MT8188 and MT8195 use clock "peri_mem" instead of "top_133m".

---
Changes in v3:
Use enum property to add the new clock name.

Changes in v2:
Merge two patches into one.

---
 .../bindings/pci/mediatek-pcie-gen3.yaml           | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +12 -2
index 0499b94627ae..a0ca9c7f5dfa 100644
@@ -48,7 +48,14 @@ allOf:
 
 properties:
   compatible:
-    const: mediatek,mt8192-pcie
+    oneOf:
+      - items:
+          - enum:
+              - mediatek,mt8188-pcie
+              - mediatek,mt8195-pcie
+          - const: mediatek,mt8192-pcie
+      - items:
+          - const: mediatek,mt8192-pcie
 
   reg:
     maxItems: 1
@@ -84,7 +91,9 @@ properties:
       - const: tl_96m
       - const: tl_32k
       - const: peri_26m
-      - const: top_133m
+      - enum:
+          - top_133m        # for MT8192
+          - peri_mem        # for MT8188/MT8195
 
   assigned-clocks:
     maxItems: 1
@@ -126,6 +135,7 @@ required:
   - interrupts
   - ranges
   - clocks
+  - clock-names
   - '#interrupt-cells'
   - interrupt-controller
 
Signature · 1 line
2.18.0
#1 lore raw
Quoted 22 lines · Jianjun Wang

MT8188 and MT8195 are ARM platform SoCs with the same PCIe IP as MT8192.

Also add new clock name "peri_mem" since the MT8188 and MT8195 use clock "peri_mem" instead of "top_133m".

---
Changes in v3:
Use enum property to add the new clock name.

Changes in v2:
Merge two patches into one.

---
 .../bindings/pci/mediatek-pcie-gen3.yaml           | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +0 -0
index 0499b94627ae..a0ca9c7f5dfa 100644
@@ -48,7 +48,14 @@ allOf:
 

Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml allOf: · line 57

Quoted 10 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +7 -1
 properties:
   compatible:
-    const: mediatek,mt8192-pcie
+    oneOf:
+      - items:
+          - enum:
+              - mediatek,mt8188-pcie
+              - mediatek,mt8195-pcie
+          - const: mediatek,mt8192-pcie
+      - items:

You have one item, so this is just const. Or enum if you expect it to grow soon.

Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml properties: · line 96

Quoted 12 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +4 -1
+          - const: mediatek,mt8192-pcie
 
   reg:
     maxItems: 1
@@ -84,7 +91,9 @@ properties:
       - const: tl_96m
       - const: tl_32k
       - const: peri_26m
-      - const: top_133m
+      - enum:
+          - top_133m        # for MT8192
+          - peri_mem        # for MT8188/MT8195

This requires allOf:if:then restricting it further per variant.

Best regards,
Krzysztof

#2 lore raw
Quoted 13 lines · Krzysztof Kozlowski

Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml properties: · line 96

Quoted 11 lines

reg:
maxItems: 1

Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +3 -1
@@ -84,7 +91,9 @@ properties:
       - const: tl_96m
       - const: tl_32k
       - const: peri_26m
-      - const: top_133m
+      - enum:
+          - top_133m        # for MT8192
+          - peri_mem        # for MT8188/MT8195

This requires allOf:if:then restricting it further per variant.

I see Rob proposed that way, so skip this comment.

Best regards,
Krzysztof

#3 lore raw
In reply to Krzysztof Kozlowski

Hi Krzysztof,

Thanks for your comment.

Quoted 28 lines · Krzysztof Kozlowski
Quoted 27 lines · Jianjun Wang

MT8188 and MT8195 are ARM platform SoCs with the same PCIe IP as MT8192.

Also add new clock name "peri_mem" since the MT8188 and MT8195 use clock
"peri_mem" instead of "top_133m".

---
Changes in v3:
Use enum property to add the new clock name.

Changes in v2:
Merge two patches into one.

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

gen3.yaml b/Documentation/devicetree/bindings/pci/mediatek-pcie- gen3.yaml
index 0499b94627ae..a0ca9c7f5dfa 100644

Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +0 -0
@@ -48,7 +48,14 @@ allOf:
 
Quoted 14 lines

Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml allOf: · line 57

Quoted 10 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +7 -1
 properties:
   compatible:
-    const: mediatek,mt8192-pcie
+    oneOf:
+      - items:
+          - enum:
+              - mediatek,mt8188-pcie
+              - mediatek,mt8195-pcie
+          - const: mediatek,mt8192-pcie
+      - items:

You have one item, so this is just const. Or enum if you expect it to
grow soon.

It makes sense, I'll remove this "items" and just keep the const item in the next version.

Thanks.

Quoted 20 lines

Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml properties: · line 96

Quoted 13 lines
Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml +4 -1
+          - const: mediatek,mt8192-pcie
 
   reg:
     maxItems: 1
@@ -84,7 +91,9 @@ properties:
       - const: tl_96m
       - const: tl_32k
       - const: peri_26m
-      - const: top_133m
+      - enum:
+          - top_133m        # for MT8192
+          - peri_mem        # for MT8188/MT8195

This requires allOf:if:then restricting it further per variant.

Best regards,
Krzysztof