All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v7 1/4] dt-bindings: mailbox: qcom: set correct #clock-cells
@ 2022-07-11 10:59 Robert Marko
  2022-07-11 10:59 ` [PATCH v7 2/4] dt-bindings: mailbox: qcom: correct clocks for IPQ6018 and IPQ8074 Robert Marko
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Robert Marko @ 2022-07-11 10:59 UTC (permalink / raw)
  To: agross, bjorn.andersson, konrad.dybcio, jassisinghbrar, robh+dt,
	krzysztof.kozlowski+dt, linux-arm-msm, linux-kernel, devicetree
  Cc: Robert Marko, Krzysztof Kozlowski

IPQ6018 and IPQ8074 require #clock-cells to be set to 1 as their APSS
clock driver provides multiple clock outputs.

So allow setting 1 as #clock-cells and check that its set to 1 for IPQ6018
and IPQ8074, check others for 0 as its currently.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
Changes in v3:
* Drop not needed blank line

Changes in v2:
* Correct subject name
---
 .../bindings/mailbox/qcom,apcs-kpss-global.yaml | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
index 3b5ba7ecc19d..95ecb84e3278 100644
--- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
+++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
@@ -50,7 +50,7 @@ properties:
     const: 1
 
   '#clock-cells':
-    const: 0
+    enum: [0, 1]
 
   clock-names:
     minItems: 2
@@ -96,6 +96,21 @@ allOf:
       properties:
         clocks:
           maxItems: 3
+  - if:
+      properties:
+        compatible:
+          enum:
+            - qcom,ipq6018-apcs-apps-global
+            - qcom,ipq8074-apcs-apps-global
+    then:
+      properties:
+        '#clock-cells':
+          const: 1
+    else:
+      properties:
+        '#clock-cells':
+          const: 0
+
 examples:
 
   # Example apcs with msm8996
-- 
2.36.1


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

* [PATCH v7 2/4] dt-bindings: mailbox: qcom: correct clocks for IPQ6018 and IPQ8074
  2022-07-11 10:59 [PATCH v7 1/4] dt-bindings: mailbox: qcom: set correct #clock-cells Robert Marko
@ 2022-07-11 10:59 ` Robert Marko
  2022-07-12  8:56   ` Krzysztof Kozlowski
  2022-07-11 10:59 ` [PATCH v7 3/4] mailbox: qcom-apcs-ipc: add IPQ8074 APSS clock support Robert Marko
  2022-07-11 10:59 ` [PATCH v7 4/4] arm64: dts: ipq8074: add APCS support Robert Marko
  2 siblings, 1 reply; 6+ messages in thread
From: Robert Marko @ 2022-07-11 10:59 UTC (permalink / raw)
  To: agross, bjorn.andersson, konrad.dybcio, jassisinghbrar, robh+dt,
	krzysztof.kozlowski+dt, linux-arm-msm, linux-kernel, devicetree
  Cc: Robert Marko

IPQ6018 APSS driver is registered by APCS as they share the same register
space, and it uses "pll" and "xo" as inputs.

Correct the allowed clocks for IPQ6018 and IPQ8074 as they share the same
driver to allow "pll" and "xo" as clock-names.

Signed-off-by: Robert Marko <robimarko@gmail.com>
---
 .../mailbox/qcom,apcs-kpss-global.yaml        | 44 ++++++++++++++-----
 1 file changed, 32 insertions(+), 12 deletions(-)

diff --git a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
index 95ecb84e3278..939ce63fa824 100644
--- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
+++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
@@ -41,10 +41,6 @@ properties:
   clocks:
     description: phandles to the parent clocks of the clock driver
     minItems: 2
-    items:
-      - description: primary pll parent of the clock driver
-      - description: auxiliary parent
-      - description: reference clock
 
   '#mbox-cells':
     const: 1
@@ -54,10 +50,6 @@ properties:
 
   clock-names:
     minItems: 2
-    items:
-      - const: pll
-      - const: aux
-      - const: ref
 
 required:
   - compatible
@@ -71,8 +63,6 @@ allOf:
       properties:
         compatible:
           enum:
-            - qcom,ipq6018-apcs-apps-global
-            - qcom,ipq8074-apcs-apps-global
             - qcom,msm8916-apcs-kpss-global
             - qcom,msm8994-apcs-kpss-global
             - qcom,msm8996-apcs-hmss-global
@@ -86,7 +76,13 @@ allOf:
     then:
       properties:
         clocks:
-          maxItems: 2
+          items:
+            - description: primary pll parent of the clock driver
+            - description: auxiliary parent
+        clock-names:
+          items:
+            - const: pll
+            - const: aux
   - if:
       properties:
         compatible:
@@ -95,7 +91,31 @@ allOf:
     then:
       properties:
         clocks:
-          maxItems: 3
+          items:
+            - description: primary pll parent of the clock driver
+            - description: auxiliary parent
+            - description: reference clock
+        clock-names:
+          items:
+            - const: pll
+            - const: aux
+            - const: ref
+  - if:
+      properties:
+        compatible:
+          enum:
+            - qcom,ipq6018-apcs-apps-global
+            - qcom,ipq8074-apcs-apps-global
+    then:
+      properties:
+        clocks:
+          items:
+            - description: primary pll parent of the clock driver
+            - description: XO clock
+        clock-names:
+          items:
+            - const: pll
+            - const: xo
   - if:
       properties:
         compatible:
-- 
2.36.1


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

* [PATCH v7 3/4] mailbox: qcom-apcs-ipc: add IPQ8074 APSS clock support
  2022-07-11 10:59 [PATCH v7 1/4] dt-bindings: mailbox: qcom: set correct #clock-cells Robert Marko
  2022-07-11 10:59 ` [PATCH v7 2/4] dt-bindings: mailbox: qcom: correct clocks for IPQ6018 and IPQ8074 Robert Marko
@ 2022-07-11 10:59 ` Robert Marko
  2022-07-11 12:49   ` Dmitry Baryshkov
  2022-07-11 10:59 ` [PATCH v7 4/4] arm64: dts: ipq8074: add APCS support Robert Marko
  2 siblings, 1 reply; 6+ messages in thread
From: Robert Marko @ 2022-07-11 10:59 UTC (permalink / raw)
  To: agross, bjorn.andersson, konrad.dybcio, jassisinghbrar, robh+dt,
	krzysztof.kozlowski+dt, linux-arm-msm, linux-kernel, devicetree
  Cc: Robert Marko

IPQ8074 has the APSS clock controller utilizing the same register space as
the APCS, so provide access to the APSS utilizing a child device like
IPQ6018.

IPQ6018 and IPQ8074 use the same controller and driver, so just utilize
IPQ6018 match data for IPQ8074.

Signed-off-by: Robert Marko <robimarko@gmail.com>
---
Changes in v7:
* Dont max_register modifications
* Drop custom IPQ8074 match data and use IPQ6018 one as they share the
controller and driver

Changes in v5:
* Use lower case hex for max_register
* Update the APSS clock name to match the new one without commas
---
 drivers/mailbox/qcom-apcs-ipc-mailbox.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
index 80a54d81412e..f1f0e87a79e6 100644
--- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c
+++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
@@ -142,7 +142,7 @@ static int qcom_apcs_ipc_remove(struct platform_device *pdev)
 /* .data is the offset of the ipc register within the global block */
 static const struct of_device_id qcom_apcs_ipc_of_match[] = {
 	{ .compatible = "qcom,ipq6018-apcs-apps-global", .data = &ipq6018_apcs_data },
-	{ .compatible = "qcom,ipq8074-apcs-apps-global", .data = &msm8994_apcs_data },
+	{ .compatible = "qcom,ipq8074-apcs-apps-global", .data = &ipq6018_apcs_data },
 	{ .compatible = "qcom,msm8916-apcs-kpss-global", .data = &msm8916_apcs_data },
 	{ .compatible = "qcom,msm8939-apcs-kpss-global", .data = &msm8916_apcs_data },
 	{ .compatible = "qcom,msm8953-apcs-kpss-global", .data = &msm8994_apcs_data },
-- 
2.36.1


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

* [PATCH v7 4/4] arm64: dts: ipq8074: add APCS support
  2022-07-11 10:59 [PATCH v7 1/4] dt-bindings: mailbox: qcom: set correct #clock-cells Robert Marko
  2022-07-11 10:59 ` [PATCH v7 2/4] dt-bindings: mailbox: qcom: correct clocks for IPQ6018 and IPQ8074 Robert Marko
  2022-07-11 10:59 ` [PATCH v7 3/4] mailbox: qcom-apcs-ipc: add IPQ8074 APSS clock support Robert Marko
@ 2022-07-11 10:59 ` Robert Marko
  2 siblings, 0 replies; 6+ messages in thread
From: Robert Marko @ 2022-07-11 10:59 UTC (permalink / raw)
  To: agross, bjorn.andersson, konrad.dybcio, jassisinghbrar, robh+dt,
	krzysztof.kozlowski+dt, linux-arm-msm, linux-kernel, devicetree
  Cc: Robert Marko

APCS now has support for providing the APSS clocks as the child device
for IPQ8074.

So, add the required DT node for APCS and A53PLL which feeds it the PLL
clock for APSS, since APSS will be used for CPU frequency scaling.

Signed-off-by: Robert Marko <robimarko@gmail.com>
---
Changes in v7:
* Drop review tag due to significant changes
* Add A53PLL node
* Add clocks to APCS node

Changes in v3:
* Node does not currently exist in the upstream kernel, so add it instead
of modifying.
---
 arch/arm64/boot/dts/qcom/ipq8074.dtsi | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/ipq8074.dtsi b/arch/arm64/boot/dts/qcom/ipq8074.dtsi
index 080796555809..6a13bd3ead55 100644
--- a/arch/arm64/boot/dts/qcom/ipq8074.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq8074.dtsi
@@ -879,6 +879,23 @@ IRQ_TYPE_LEVEL_HIGH>, /* int_c */
 				      "axi_m_sticky";
 			status = "disabled";
 		};
+
+		apcs_glb: mailbox@b111000 {
+			compatible = "qcom,ipq8074-apcs-apps-global";
+			reg = <0x0b111000 0x1000>;
+			#clock-cells = <1>;
+			clocks = <&a53pll>, <&xo>;
+			clock-names = "pll", "xo";
+			#mbox-cells = <1>;
+		};
+
+		a53pll: clock@b116000 {
+			compatible = "qcom,ipq8074-a53pll";
+			reg = <0x0b116000 0x40>;
+			#clock-cells = <0>;
+			clocks = <&xo>;
+			clock-names = "xo";
+		};
 	};
 
 	timer {
-- 
2.36.1


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

* Re: [PATCH v7 3/4] mailbox: qcom-apcs-ipc: add IPQ8074 APSS clock support
  2022-07-11 10:59 ` [PATCH v7 3/4] mailbox: qcom-apcs-ipc: add IPQ8074 APSS clock support Robert Marko
@ 2022-07-11 12:49   ` Dmitry Baryshkov
  0 siblings, 0 replies; 6+ messages in thread
From: Dmitry Baryshkov @ 2022-07-11 12:49 UTC (permalink / raw)
  To: Robert Marko
  Cc: agross, bjorn.andersson, konrad.dybcio, jassisinghbrar, robh+dt,
	krzysztof.kozlowski+dt, linux-arm-msm, linux-kernel, devicetree

On Mon, 11 Jul 2022 at 14:26, Robert Marko <robimarko@gmail.com> wrote:
>
> IPQ8074 has the APSS clock controller utilizing the same register space as
> the APCS, so provide access to the APSS utilizing a child device like
> IPQ6018.
>
> IPQ6018 and IPQ8074 use the same controller and driver, so just utilize
> IPQ6018 match data for IPQ8074.
>
> Signed-off-by: Robert Marko <robimarko@gmail.com>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

> ---
> Changes in v7:
> * Dont max_register modifications
> * Drop custom IPQ8074 match data and use IPQ6018 one as they share the
> controller and driver
>
> Changes in v5:
> * Use lower case hex for max_register
> * Update the APSS clock name to match the new one without commas
> ---
>  drivers/mailbox/qcom-apcs-ipc-mailbox.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mailbox/qcom-apcs-ipc-mailbox.c b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
> index 80a54d81412e..f1f0e87a79e6 100644
> --- a/drivers/mailbox/qcom-apcs-ipc-mailbox.c
> +++ b/drivers/mailbox/qcom-apcs-ipc-mailbox.c
> @@ -142,7 +142,7 @@ static int qcom_apcs_ipc_remove(struct platform_device *pdev)
>  /* .data is the offset of the ipc register within the global block */
>  static const struct of_device_id qcom_apcs_ipc_of_match[] = {
>         { .compatible = "qcom,ipq6018-apcs-apps-global", .data = &ipq6018_apcs_data },
> -       { .compatible = "qcom,ipq8074-apcs-apps-global", .data = &msm8994_apcs_data },
> +       { .compatible = "qcom,ipq8074-apcs-apps-global", .data = &ipq6018_apcs_data },
>         { .compatible = "qcom,msm8916-apcs-kpss-global", .data = &msm8916_apcs_data },
>         { .compatible = "qcom,msm8939-apcs-kpss-global", .data = &msm8916_apcs_data },
>         { .compatible = "qcom,msm8953-apcs-kpss-global", .data = &msm8994_apcs_data },
> --
> 2.36.1
>


-- 
With best wishes
Dmitry

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

* Re: [PATCH v7 2/4] dt-bindings: mailbox: qcom: correct clocks for IPQ6018 and IPQ8074
  2022-07-11 10:59 ` [PATCH v7 2/4] dt-bindings: mailbox: qcom: correct clocks for IPQ6018 and IPQ8074 Robert Marko
@ 2022-07-12  8:56   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Kozlowski @ 2022-07-12  8:56 UTC (permalink / raw)
  To: Robert Marko, agross, bjorn.andersson, konrad.dybcio,
	jassisinghbrar, robh+dt, krzysztof.kozlowski+dt, linux-arm-msm,
	linux-kernel, devicetree

On 11/07/2022 12:59, Robert Marko wrote:
> IPQ6018 APSS driver is registered by APCS as they share the same register
> space, and it uses "pll" and "xo" as inputs.
> 
> Correct the allowed clocks for IPQ6018 and IPQ8074 as they share the same
> driver to allow "pll" and "xo" as clock-names.
> 
> Signed-off-by: Robert Marko <robimarko@gmail.com>
> ---
>  .../mailbox/qcom,apcs-kpss-global.yaml        | 44 ++++++++++++++-----
>  1 file changed, 32 insertions(+), 12 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
> index 95ecb84e3278..939ce63fa824 100644
> --- a/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
> +++ b/Documentation/devicetree/bindings/mailbox/qcom,apcs-kpss-global.yaml
> @@ -41,10 +41,6 @@ properties:
>    clocks:
>      description: phandles to the parent clocks of the clock driver
>      minItems: 2

You need maxItems (widest) as well.

> -    items:
> -      - description: primary pll parent of the clock driver
> -      - description: auxiliary parent
> -      - description: reference clock
>  
>    '#mbox-cells':
>      const: 1
> @@ -54,10 +50,6 @@ properties:
>  
>    clock-names:
>      minItems: 2

You need maxItems as well.

> -    items:
> -      - const: pll
> -      - const: aux
> -      - const: ref

Best regards,
Krzysztof

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

end of thread, other threads:[~2022-07-12  8:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-11 10:59 [PATCH v7 1/4] dt-bindings: mailbox: qcom: set correct #clock-cells Robert Marko
2022-07-11 10:59 ` [PATCH v7 2/4] dt-bindings: mailbox: qcom: correct clocks for IPQ6018 and IPQ8074 Robert Marko
2022-07-12  8:56   ` Krzysztof Kozlowski
2022-07-11 10:59 ` [PATCH v7 3/4] mailbox: qcom-apcs-ipc: add IPQ8074 APSS clock support Robert Marko
2022-07-11 12:49   ` Dmitry Baryshkov
2022-07-11 10:59 ` [PATCH v7 4/4] arm64: dts: ipq8074: add APCS support Robert Marko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.