diff mbox series

[v3,1/2] dt-bindings: PCI: mediatek-gen3: add SoC based clock config

Message ID 20221029175806.14899-2-frank-w@public-files.de (mailing list archive)
State New, archived
Headers show
Series rework mtk pcie-gen3 bindings and support mt7986 | expand

Commit Message

Frank Wunderlich Oct. 29, 2022, 5:58 p.m. UTC
The PCIe driver covers different SOC which needing different clock
configs. Define them based on compatible.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
v2:
- fix typo in mediatek,mt8192-pcie
v3:
- remove contains to match only if compatible is no fallback
  tested with series "Add driver nodes for MT8195 SoC" and mt7986
  pcie-nodes, dtbs_check is now clean
---
 .../bindings/pci/mediatek-pcie-gen3.yaml      | 47 ++++++++++++++-----
 1 file changed, 35 insertions(+), 12 deletions(-)

--
2.34.1

Comments

Rob Herring Oct. 31, 2022, 2:43 p.m. UTC | #1
On Sat, Oct 29, 2022 at 07:58:05PM +0200, Frank Wunderlich wrote:
> The PCIe driver covers different SOC which needing different clock
> configs. Define them based on compatible.
> 
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> ---
> v2:
> - fix typo in mediatek,mt8192-pcie
> v3:
> - remove contains to match only if compatible is no fallback
>   tested with series "Add driver nodes for MT8195 SoC" and mt7986
>   pcie-nodes, dtbs_check is now clean
> ---
>  .../bindings/pci/mediatek-pcie-gen3.yaml      | 47 ++++++++++++++-----
>  1 file changed, 35 insertions(+), 12 deletions(-)

Reviewed-by: Rob Herring <robh@kernel.org>
Jianjun Wang (王建军) Nov. 1, 2022, 12:12 p.m. UTC | #2
On Mon, 2022-10-31 at 09:43 -0500, Rob Herring wrote:
> On Sat, Oct 29, 2022 at 07:58:05PM +0200, Frank Wunderlich wrote:
> > The PCIe driver covers different SOC which needing different clock
> > configs. Define them based on compatible.
> > 
> > Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> > ---
> > v2:
> > - fix typo in mediatek,mt8192-pcie
> > v3:
> > - remove contains to match only if compatible is no fallback
> >   tested with series "Add driver nodes for MT8195 SoC" and mt7986
> >   pcie-nodes, dtbs_check is now clean
> > ---
> >  .../bindings/pci/mediatek-pcie-gen3.yaml      | 47 ++++++++++++++-
> > ----
> >  1 file changed, 35 insertions(+), 12 deletions(-)
> 
> Reviewed-by: Rob Herring <robh@kernel.org>

Acked-by: Jianjun Wang <jianjun.wang@mediatek.com>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml b/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml
index c00be39af64e..5d7369debff2 100644
--- a/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml
+++ b/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml
@@ -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,40 @@  required:
   - '#interrupt-cells'
   - interrupt-controller

+allOf:
+  - $ref: /schemas/pci/pci-bus.yaml#
+  - if:
+      properties:
+        compatible:
+          const: mediatek,mt8192-pcie
+    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: