linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] rework mtk pcie-gen3 bindings and support mt7986
@ 2022-10-23 17:02 Frank Wunderlich
  2022-10-23 17:02 ` [PATCH 1/3] dt-bindings: PCI: mediatek-gen3: add SoC based clock config Frank Wunderlich
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Frank Wunderlich @ 2022-10-23 17:02 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Frank Wunderlich, Ryder Lee, Sam Shih, Steven Liu, Jianjun Wang,
	Bjorn Helgaas, Rob Herring, Krzysztof Kozlowski,
	Matthias Brugger, linux-pci, devicetree, linux-kernel,
	linux-arm-kernel

From: Frank Wunderlich <frank-w@public-files.de>

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(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] dt-bindings: PCI: mediatek-gen3: add SoC based clock config
  2022-10-23 17:02 [PATCH 0/3] rework mtk pcie-gen3 bindings and support mt7986 Frank Wunderlich
@ 2022-10-23 17:02 ` Frank Wunderlich
  2022-10-24 19:21   ` Rob Herring
  2022-10-25  1:27   ` Jianjun Wang
  2022-10-23 17:02 ` [PATCH 2/3] dt-bindings: PCI: mediatek-gen3: add support for mt7986 Frank Wunderlich
  2022-10-23 17:02 ` [PATCH 3/3] dt-bindings: PCI: mediatek-gen3: add mt7986 clock config Frank Wunderlich
  2 siblings, 2 replies; 7+ messages in thread
From: Frank Wunderlich @ 2022-10-23 17:02 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Frank Wunderlich, Ryder Lee, Sam Shih, Steven Liu, Jianjun Wang,
	Bjorn Helgaas, Rob Herring, Krzysztof Kozlowski,
	Matthias Brugger, linux-pci, devicetree, linux-kernel,
	linux-arm-kernel

From: Frank Wunderlich <frank-w@public-files.de>

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>
---
 .../bindings/pci/mediatek-pcie-gen3.yaml      | 48 ++++++++++++++-----
 1 file changed, 36 insertions(+), 12 deletions(-)

diff --git a/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml b/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml
index c00be39af64e..af0d2201746d 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,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:
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] dt-bindings: PCI: mediatek-gen3: add support for mt7986
  2022-10-23 17:02 [PATCH 0/3] rework mtk pcie-gen3 bindings and support mt7986 Frank Wunderlich
  2022-10-23 17:02 ` [PATCH 1/3] dt-bindings: PCI: mediatek-gen3: add SoC based clock config Frank Wunderlich
@ 2022-10-23 17:02 ` Frank Wunderlich
  2022-10-23 17:02 ` [PATCH 3/3] dt-bindings: PCI: mediatek-gen3: add mt7986 clock config Frank Wunderlich
  2 siblings, 0 replies; 7+ messages in thread
From: Frank Wunderlich @ 2022-10-23 17:02 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Frank Wunderlich, Ryder Lee, Sam Shih, Steven Liu, Jianjun Wang,
	Bjorn Helgaas, Rob Herring, Krzysztof Kozlowski,
	Matthias Brugger, linux-pci, devicetree, linux-kernel,
	linux-arm-kernel

From: Frank Wunderlich <frank-w@public-files.de>

Add compatible string for mt7986.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml b/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml
index af0d2201746d..3662422b38ea 100644
--- a/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml
+++ b/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml
@@ -48,6 +48,7 @@ properties:
     oneOf:
       - items:
           - enum:
+              - mediatek,mt7986-pcie
               - mediatek,mt8188-pcie
               - mediatek,mt8195-pcie
           - const: mediatek,mt8192-pcie
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] dt-bindings: PCI: mediatek-gen3: add mt7986 clock config
  2022-10-23 17:02 [PATCH 0/3] rework mtk pcie-gen3 bindings and support mt7986 Frank Wunderlich
  2022-10-23 17:02 ` [PATCH 1/3] dt-bindings: PCI: mediatek-gen3: add SoC based clock config Frank Wunderlich
  2022-10-23 17:02 ` [PATCH 2/3] dt-bindings: PCI: mediatek-gen3: add support for mt7986 Frank Wunderlich
@ 2022-10-23 17:02 ` Frank Wunderlich
  2022-10-24 19:23   ` Rob Herring
  2 siblings, 1 reply; 7+ messages in thread
From: Frank Wunderlich @ 2022-10-23 17:02 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Frank Wunderlich, Ryder Lee, Sam Shih, Steven Liu, Jianjun Wang,
	Bjorn Helgaas, Rob Herring, Krzysztof Kozlowski,
	Matthias Brugger, linux-pci, devicetree, linux-kernel,
	linux-arm-kernel

From: Frank Wunderlich <frank-w@public-files.de>

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

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 .../bindings/pci/mediatek-pcie-gen3.yaml         | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml b/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml
index 3662422b38ea..e6020e684c00 100644
--- a/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml
+++ b/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml
@@ -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
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] dt-bindings: PCI: mediatek-gen3: add SoC based clock config
  2022-10-23 17:02 ` [PATCH 1/3] dt-bindings: PCI: mediatek-gen3: add SoC based clock config Frank Wunderlich
@ 2022-10-24 19:21   ` Rob Herring
  2022-10-25  1:27   ` Jianjun Wang
  1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring @ 2022-10-24 19:21 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: Jianjun Wang, linux-kernel, Steven Liu, Matthias Brugger,
	linux-arm-kernel, Sam Shih, linux-mediatek, Bjorn Helgaas,
	Frank Wunderlich, linux-pci, devicetree, Ryder Lee,
	Krzysztof Kozlowski, Rob Herring

On Sun, 23 Oct 2022 19:02:32 +0200, Frank Wunderlich wrote:
> From: Frank Wunderlich <frank-w@public-files.de>
> 
> 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>
> ---
>  .../bindings/pci/mediatek-pcie-gen3.yaml      | 48 ++++++++++++++-----
>  1 file changed, 36 insertions(+), 12 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 3/3] dt-bindings: PCI: mediatek-gen3: add mt7986 clock config
  2022-10-23 17:02 ` [PATCH 3/3] dt-bindings: PCI: mediatek-gen3: add mt7986 clock config Frank Wunderlich
@ 2022-10-24 19:23   ` Rob Herring
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2022-10-24 19:23 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: linux-mediatek, Frank Wunderlich, Ryder Lee, Sam Shih,
	Steven Liu, Jianjun Wang, Bjorn Helgaas, Krzysztof Kozlowski,
	Matthias Brugger, linux-pci, devicetree, linux-kernel,
	linux-arm-kernel

On Sun, Oct 23, 2022 at 07:02:34PM +0200, Frank Wunderlich wrote:
> From: Frank Wunderlich <frank-w@public-files.de>
> 
> 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.

> 
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> ---
>  .../bindings/pci/mediatek-pcie-gen3.yaml         | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml b/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml
> index 3662422b38ea..e6020e684c00 100644
> --- a/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml
> +++ b/Documentation/devicetree/bindings/pci/mediatek-pcie-gen3.yaml
> @@ -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
>  
> -- 
> 2.34.1
> 
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] dt-bindings: PCI: mediatek-gen3: add SoC based clock config
  2022-10-23 17:02 ` [PATCH 1/3] dt-bindings: PCI: mediatek-gen3: add SoC based clock config Frank Wunderlich
  2022-10-24 19:21   ` Rob Herring
@ 2022-10-25  1:27   ` Jianjun Wang
  1 sibling, 0 replies; 7+ messages in thread
From: Jianjun Wang @ 2022-10-25  1:27 UTC (permalink / raw)
  To: Frank Wunderlich, linux-mediatek
  Cc: Frank Wunderlich, Ryder Lee, Sam Shih, Steven Liu, Bjorn Helgaas,
	Rob Herring, Krzysztof Kozlowski, Matthias Brugger, linux-pci,
	devicetree, linux-kernel, linux-arm-kernel

On Sun, 2022-10-23 at 19:02 +0200, Frank Wunderlich wrote:
> From: Frank Wunderlich <frank-w@public-files.de>
> 
> 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>
> ---
>  .../bindings/pci/mediatek-pcie-gen3.yaml      | 48 ++++++++++++++---
> --
>  1 file changed, 36 insertions(+), 12 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/pci/mediatek-pcie-
> gen3.yaml b/Documentation/devicetree/bindings/pci/mediatek-pcie-
> gen3.yaml
> index c00be39af64e..af0d2201746d 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,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".

> +    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:


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-10-25  1:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-23 17:02 [PATCH 0/3] rework mtk pcie-gen3 bindings and support mt7986 Frank Wunderlich
2022-10-23 17:02 ` [PATCH 1/3] dt-bindings: PCI: mediatek-gen3: add SoC based clock config Frank Wunderlich
2022-10-24 19:21   ` Rob Herring
2022-10-25  1:27   ` Jianjun Wang
2022-10-23 17:02 ` [PATCH 2/3] dt-bindings: PCI: mediatek-gen3: add support for mt7986 Frank Wunderlich
2022-10-23 17:02 ` [PATCH 3/3] dt-bindings: PCI: mediatek-gen3: add mt7986 clock config Frank Wunderlich
2022-10-24 19:23   ` Rob Herring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).