Skip to contentSkip to conversation

clk: qcom: Drop use of pxo/cxo_board for rpm devices

PATCH Superseded Christian Marangi 4 participants 24 messages Jul 5, 2022 – Jul 6, 2022

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover clk: qcom: Drop use of pxo/cxo_board for rpm devices

Trying to convert every driver used by ipq806x to parent_data api, I notice RPM was still using pxo_board clk.

pxo and pxo_board are the same clock and are defined just to handle old clock definition. It was discovered that rpm is the last driver using pxo_board instead of pxo.

While updating the rpm driver I notice the documentation was also wrong, so this series also fix that.

Christian Marangi (5):
dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc
ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks
clk: qcom: clk-rpm: convert to parent_data API
ARM: dts: qcom: add pxo/cxo clock-output-names for ipq8064
clk: qcom: gcc-ipq806x: remove cc_register_board for pxo and cxo

 .../devicetree/bindings/clock/qcom,rpmcc.yaml | 77 ++++++++++++++++++-
 arch/arm/boot/dts/qcom-apq8064.dtsi           |  2 +
 arch/arm/boot/dts/qcom-ipq8064.dtsi           |  4 +
 arch/arm/boot/dts/qcom-msm8660.dtsi           |  4 +-
 drivers/clk/qcom/clk-rpm.c                    | 24 ++++--
 drivers/clk/qcom/gcc-ipq806x.c                |  8 --
 6 files changed, 98 insertions(+), 21 deletions(-)
Signature · 1 line
2.36.1
#1 lore raw

PATCH 1/5 dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc

qcom,rpmcc describe 2 different kind of device. Currently we have definition for rpm-smd based device but we lack Documentation for simple rpm based device.

Add the missing clk for ipq806x, apq8060, msm8660 and apq8064 and provide and additional example.

---
 .../devicetree/bindings/clock/qcom,rpmcc.yaml | 77 ++++++++++++++++++-
 1 file changed, 73 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +73 -4
index 9d296b89a8d0..028eb0277495 100644
@@ -48,16 +48,65 @@ properties:
   '#clock-cells':
     const: 1
 
-  clocks:
-    maxItems: 1
+  clocks: true
 
-  clock-names:
-    const: xo
+  clock-names: true
 
 required:
   - compatible
   - '#clock-cells'
 
+if:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - qcom,rpmcc-apq8060
+          - qcom,rpmcc-ipq806x
+          - qcom,rpmcc-msm8660
+
+then:
+  properties:
+    clocks:
+      description: pxo clock
+
+    clock-names:
+      const: pxo
+
+  required:
+    - clocks
+    - clock-names
+
+else:
+  if:
+    properties:
+      compatible:
+        contains:
+          const: qcom,rpmcc-apq8064
+  then:
+    properties:
+      clocks:
+        items:
+          - description: pxo clock
+          - description: cxo clock
+
+      clock-names:
+        items:
+          - const: pxo
+          - const: cxo
+
+    required:
+      - clocks
+      - clock-names
+
+  else:
+    properties:
+      clocks:
+        description: xo clock
+
+      clock-names:
+        const: xo
+
 additionalProperties: false
 
 examples:
@@ -73,3 +122,23 @@ examples:
             };
         };
     };
+
+  - |
+    rpm {
+        clock-controller {
+            compatible = "qcom,rpmcc-ipq806x", "qcom,rpmcc";
+            #clock-cells = <1>;
+            clocks = <&pxo_board>;
+            clock-names = "pxo";
+        };
+    };
+
+  - |
+    rpm {
+        clock-controller {
+            compatible = "qcom,rpmcc-apq8064", "qcom,rpmcc";
+            #clock-cells = <1>;
+            clocks = <&pxo_board>, <&cxo_board>;
+            clock-names = "pxo", "cxo";
+        };
+    };
Signature · 1 line
2.36.1
#2 lore raw

Re: [PATCH 1/5] dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc

Quoted 17 lines · Christian Marangi

qcom,rpmcc describe 2 different kind of device. Currently we have definition for rpm-smd based device but we lack Documentation for simple rpm based device.

Add the missing clk for ipq806x, apq8060, msm8660 and apq8064 and provide and additional example.

---
 .../devicetree/bindings/clock/qcom,rpmcc.yaml | 77 ++++++++++++++++++-
 1 file changed, 73 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +0 -0
index 9d296b89a8d0..028eb0277495 100644

Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml properties: · line 53

Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +2 -4
@@ -48,16 +48,65 @@ properties:
   '#clock-cells':
     const: 1
 
-  clocks:
-    maxItems: 1
+  clocks: true
 
-  clock-names:
-    const: xo
+  clock-names: true

That's not correct way to describe these. Check other files, we've already talked about this. You need min and maxItems here.

Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml properties: · line 59

Quoted 6 lines
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +1 -0
 required:
   - compatible
   - '#clock-cells'
 
+if:

allOf

Quoted 12 lines
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +12 -0
+  properties:
+    compatible:
+      contains:
+        enum:
+          - qcom,rpmcc-apq8060
+          - qcom,rpmcc-ipq806x
+          - qcom,rpmcc-msm8660
+
+then:
+  properties:
+    clocks:
+      description: pxo clock

Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml properties: · line 81

Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +10 -0
+
+    clock-names:
+      const: pxo
+
+  required:
+    - clocks
+    - clock-names
+
+else:
+  if:

No nested ifs.

Quoted 44 lines
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +37 -0
+    properties:
+      compatible:
+        contains:
+          const: qcom,rpmcc-apq8064
+  then:
+    properties:
+      clocks:
+        items:
+          - description: pxo clock
+          - description: cxo clock
+
+      clock-names:
+        items:
+          - const: pxo
+          - const: cxo
+
+    required:
+      - clocks
+      - clock-names
+
+  else:
+    properties:
+      clocks:
+        description: xo clock
+
+      clock-names:
+        const: xo
+
 additionalProperties: false
 
 examples:
@@ -73,3 +122,23 @@ examples:
             };
         };
     };
+
+  - |
+    rpm {
+        clock-controller {
+            compatible = "qcom,rpmcc-ipq806x", "qcom,rpmcc";
+            #clock-cells = <1>;
+            clocks = <&pxo_board>;
+            clock-names = "pxo";
+        };

Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml examples: · line 143

Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +10 -0
+    };
+
+  - |
+    rpm {
+        clock-controller {
+            compatible = "qcom,rpmcc-apq8064", "qcom,rpmcc";
+            #clock-cells = <1>;
+            clocks = <&pxo_board>, <&cxo_board>;
+            clock-names = "pxo", "cxo";
+        };

These are the same. Provide examples only for blocks which are significantly different.

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH 1/5] dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc

In reply to Christian Marangi

Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml

Quoted 17 lines · Christian Marangi

qcom,rpmcc describe 2 different kind of device. Currently we have definition for rpm-smd based device but we lack Documentation for simple rpm based device.

Add the missing clk for ipq806x, apq8060, msm8660 and apq8064 and provide and additional example.

---
 .../devicetree/bindings/clock/qcom,rpmcc.yaml | 77 ++++++++++++++++++-
 1 file changed, 73 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +0 -0
index 9d296b89a8d0..028eb0277495 100644

[,,,,]

Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml properties: · line 78

Quoted 12 lines
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +12 -0
+
+then:
+  properties:
+    clocks:
+      description: pxo clock
+
+    clock-names:
+      const: pxo
+
+  required:
+    - clocks
+    - clock-names

I don't think you can not mark these properties as required, older schemas do not have them.

Quoted 13 lines
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +13 -0
+
+else:
+  if:
+    properties:
+      compatible:
+        contains:
+          const: qcom,rpmcc-apq8064
+  then:
+    properties:
+      clocks:
+        items:
+          - description: pxo clock
+          - description: cxo clock

[...]

Signature · 2 lines
With best wishes
Dmitry
#4 lore raw

Re: [PATCH 1/5] dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc

Quoted 20 lines · Dmitry Baryshkov

Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml

Quoted 17 lines · Christian Marangi

qcom,rpmcc describe 2 different kind of device. Currently we have definition for rpm-smd based device but we lack Documentation for simple rpm based device.

Add the missing clk for ipq806x, apq8060, msm8660 and apq8064 and provide and additional example.

---
 .../devicetree/bindings/clock/qcom,rpmcc.yaml | 77 ++++++++++++++++++-
 1 file changed, 73 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +0 -0
index 9d296b89a8d0..028eb0277495 100644

[,,,,]

Quoted 16 lines

Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml properties: · line 78

Quoted 12 lines
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +12 -0
+
+then:
+  properties:
+    clocks:
+      description: pxo clock
+
+    clock-names:
+      const: pxo
+
+  required:
+    - clocks
+    - clock-names

I don't think you can not mark these properties as required, older schemas do not have them.

Well considering we changed rpmcc to parent_data and rpm clock require pxo clock as parents it seems to be they should be required.

Actually no idea why this wasn't required before. Probably because this schema described only rpm-smd and not old rpm?

Quoted 18 lines
Quoted 13 lines
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +13 -0
+
+else:
+  if:
+    properties:
+      compatible:
+        contains:
+          const: qcom,rpmcc-apq8064
+  then:
+    properties:
+      clocks:
+        items:
+          - description: pxo clock
+          - description: cxo clock

[...]

Signature · 2 lines
With best wishes
Dmitry
Signature · 1 line
	Ansuel
#5 lore raw

Re: [PATCH 1/5] dt-bindings: clock: fix wrong clock documentation for qcom,rpmcc

Quoted 39 lines · Christian Marangi
Quoted 20 lines · Dmitry Baryshkov

Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml

Quoted 17 lines · Christian Marangi

qcom,rpmcc describe 2 different kind of device. Currently we have definition for rpm-smd based device but we lack Documentation for simple rpm based device.

Add the missing clk for ipq806x, apq8060, msm8660 and apq8064 and provide and additional example.

---
 .../devicetree/bindings/clock/qcom,rpmcc.yaml | 77 ++++++++++++++++++-
 1 file changed, 73 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +0 -0
index 9d296b89a8d0..028eb0277495 100644

[,,,,]

Quoted 16 lines

Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml properties: · line 78

Quoted 12 lines
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +12 -0
+
+then:
+  properties:
+    clocks:
+      description: pxo clock
+
+    clock-names:
+      const: pxo
+
+  required:
+    - clocks
+    - clock-names

I don't think you can not mark these properties as required, older schemas do not have them.

Quoted 2 lines

Well considering we changed rpmcc to parent_data and rpm clock require pxo clock as parents it seems to be they should be required.

parent_data specifies both the normal flow (.fw_name) and the fallback (.name), so they are not required.
I actually miss 'recommended: true' in YAML for such cases.

Quoted 17 lines

Actually no idea why this wasn't required before. Probably because this schema described only rpm-smd and not old rpm?

Quoted 14 lines
Quoted 13 lines
Documentation/devicetree/bindings/clock/qcom,rpmcc.yaml +13 -0
+
+else:
+  if:
+    properties:
+      compatible:
+        contains:
+          const: qcom,rpmcc-apq8064
+  then:
+    properties:
+      clocks:
+        items:
+          - description: pxo clock
+          - description: cxo clock

[...]

Signature · 2 lines
With best wishes
Dmitry
#6 lore raw

PATCH 2/5 ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks

In reply to Christian Marangi

Fix dtbs_check warning for new rpmcc Documentation changes and add the required clocks.

---
 arch/arm/boot/dts/qcom-apq8064.dtsi | 2 ++
 arch/arm/boot/dts/qcom-ipq8064.dtsi | 2 ++
 arch/arm/boot/dts/qcom-msm8660.dtsi | 4 +++-
 3 files changed, 7 insertions(+), 1 deletion(-)
arch/arm/boot/dts/qcom-apq8064.dtsi +2 -0
index 91adcbd54b17..6a88e616ea01 100644
@@ -853,6 +853,8 @@ rpm@108000 {
 			rpmcc: clock-controller {
 				compatible = "qcom,rpmcc-apq8064", "qcom,rpmcc";
 				#clock-cells = <1>;
+				clocks = <&pxo_board>, <&cxo_board>;
+				clock-names = "pxo", "cxo";
 			};
 
 			regulators {
arch/arm/boot/dts/qcom-ipq8064.dtsi +2 -0
index 4b475d98343c..1425a4e4283f 100644
@@ -773,6 +773,8 @@ rpm: rpm@108000 {
 			rpmcc: clock-controller {
 				compatible = "qcom,rpmcc-ipq806x", "qcom,rpmcc";
 				#clock-cells = <1>;
+				clocks = <&pxo_board>;
+				clock-names = "pxo";
 			};
 		};
 
arch/arm/boot/dts/qcom-msm8660.dtsi +3 -1
index b9cded35b1cc..63a501c63cf8 100644
@@ -56,7 +56,7 @@ cxo_board {
 			clock-frequency = <19200000>;
 		};
 
-		pxo_board {
+		pxo_board: pxo_board {
 			compatible = "fixed-clock";
 			#clock-cells = <0>;
 			clock-frequency = <27000000>;
@@ -411,6 +411,8 @@ rpm: rpm@104000 {
 			rpmcc: clock-controller {
 				compatible = "qcom,rpmcc-msm8660", "qcom,rpmcc";
 				#clock-cells = <1>;
+				clocks = <&pxo_board>;
+				clock-names = "pxo";
 			};
 
 			pm8901-regulators {
Signature · 1 line
2.36.1
Reviewed-by on v1 2/5
#7 lore raw

Re: [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks

Quoted 5 lines · Christian Marangi

Fix dtbs_check warning for new rpmcc Documentation changes and add the required clocks.

Quoted 57 lines
---
 arch/arm/boot/dts/qcom-apq8064.dtsi | 2 ++
 arch/arm/boot/dts/qcom-ipq8064.dtsi | 2 ++
 arch/arm/boot/dts/qcom-msm8660.dtsi | 4 +++-
 3 files changed, 7 insertions(+), 1 deletion(-)
arch/arm/boot/dts/qcom-apq8064.dtsi +2 -0
index 91adcbd54b17..6a88e616ea01 100644
@@ -853,6 +853,8 @@ rpm@108000 {
                        rpmcc: clock-controller {
                                compatible = "qcom,rpmcc-apq8064", "qcom,rpmcc";
                                #clock-cells = <1>;
+                               clocks = <&pxo_board>, <&cxo_board>;
+                               clock-names = "pxo", "cxo";
                        };
 
                        regulators {
arch/arm/boot/dts/qcom-ipq8064.dtsi +2 -0
index 4b475d98343c..1425a4e4283f 100644
@@ -773,6 +773,8 @@ rpm: rpm@108000 {
                        rpmcc: clock-controller {
                                compatible = "qcom,rpmcc-ipq806x", "qcom,rpmcc";
                                #clock-cells = <1>;
+                               clocks = <&pxo_board>;
+                               clock-names = "pxo";
                        };
                };
 
arch/arm/boot/dts/qcom-msm8660.dtsi +3 -2
index b9cded35b1cc..63a501c63cf8 100644
@@ -56,7 +56,7 @@ cxo_board {
                        clock-frequency = <19200000>;
                };
 
-               pxo_board {
+               pxo_board: pxo_board {
                        compatible = "fixed-clock";
                        #clock-cells = <0>;
                        clock-frequency = <27000000>;
@@ -411,6 +411,8 @@ rpm: rpm@104000 {
                        rpmcc: clock-controller {
                                compatible = "qcom,rpmcc-msm8660", "qcom,rpmcc";
                                #clock-cells = <1>;
+                               clocks = <&pxo_board>;
+                               clock-names = "pxo";
                        };
 
                        pm8901-regulators {
--

2.36.1

Signature · 2 lines
With best wishes
Dmitry
#8 lore raw

Re: [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks

In reply to Christian Marangi
Quoted 2 lines · Christian Marangi

Fix dtbs_check warning for new rpmcc Documentation changes and add the required clocks.

There is no warning in the kernel, right? So the commit is not correct.

Only the second part of your sentence applies, but you should extend it.

Best regards,
Krzysztof

#9 lore raw

Re: [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks

Quoted 6 lines · Krzysztof Kozlowski
Quoted 2 lines · Christian Marangi

Fix dtbs_check warning for new rpmcc Documentation changes and add the required clocks.

There is no warning in the kernel, right? So the commit is not correct.

Oh ok, the warning is generated by the new Documentation.

Quoted 2 lines

Only the second part of your sentence applies, but you should extend it.

Ok will reword this.

Quoted 4 lines

Best regards,
Krzysztof

Signature · 1 line
	Ansuel
#10 lore raw

Re: [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks

Quoted 9 lines · Christian Marangi
Quoted 6 lines · Krzysztof Kozlowski
Quoted 2 lines · Christian Marangi

Fix dtbs_check warning for new rpmcc Documentation changes and add the required clocks.

There is no warning in the kernel, right? So the commit is not correct.

Oh ok, the warning is generated by the new Documentation.

Patches, especially DTS, might go via different trees, so the moment DTS is applied there might be no such warning.

Best regards,
Krzysztof

#11 lore raw

Re: [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks

Quoted 6 lines · Krzysztof Kozlowski
Quoted 5 lines · Christian Marangi
Quoted 4 lines · Krzysztof Kozlowski
Quoted 2 lines · Christian Marangi

Fix dtbs_check warning for new rpmcc Documentation changes and add the required clocks.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

There is no warning in the kernel, right? So the commit is not correct.

Oh ok, the warning is generated by the new Documentation.

Patches, especially DTS, might go via different trees, so the moment DTS is applied there might be no such warning.

I'm still confused about this topic...
With this kind of change, I notice I sent Documentation change and then rob bot complain about dtbs_check having warning...

So the correct way is to send Documentation change and fix dtbs_check warning in the same commit OR keep what I'm doing with sending Documentation changes and fix DTS in a separate commit?

I assume separate patch was the way to go but now I'm not sure anymore...

Quoted 2 lines

Best regards,
Krzysztof

Signature · 1 line
	Ansuel
#12 lore raw

Re: [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks

Quoted 16 lines · Christian Marangi
Quoted 6 lines · Krzysztof Kozlowski
Quoted 5 lines · Christian Marangi
Quoted 4 lines · Krzysztof Kozlowski
Quoted 2 lines · Christian Marangi

Fix dtbs_check warning for new rpmcc Documentation changes and add the required clocks.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

There is no warning in the kernel, right? So the commit is not correct.

Oh ok, the warning is generated by the new Documentation.

Patches, especially DTS, might go via different trees, so the moment DTS is applied there might be no such warning.

Quoted 7 lines

I'm still confused about this topic...
With this kind of change, I notice I sent Documentation change and then rob bot complain about dtbs_check having warning...

So the correct way is to send Documentation change and fix dtbs_check warning in the same commit OR keep what I'm doing with sending Documentation changes and fix DTS in a separate commit?

Binding is almost always separate from DTS and always separate from driver. The order depends on what you're doing. If you bring ABI break change to bindings, then the order does not matter, because each order will be non-bisectable. Because you broke ABI. That's the case in this patchset.

For other cases, usually bindings patches should be the first in patchset.

How it goes via maintainer trees is not your problem here. Patches might go together or might go separate.

Anyway it was not the topic of my comment. Comment was about not specific commit msg which does not fit the Linux kernel process and does not fit git history once applied by maintainer. It fits even less when backported to stable kernels, which you commit msg encourages to do.

Best regards,
Krzysztof

#13 lore raw

Re: [PATCH 2/5] ARM: DTS: qcom: fix dtbs_check warning with new rpmcc clocks

Quoted 33 lines · Krzysztof Kozlowski
Quoted 16 lines · Christian Marangi
Quoted 6 lines · Krzysztof Kozlowski
Quoted 5 lines · Christian Marangi
Quoted 4 lines · Krzysztof Kozlowski
Quoted 2 lines · Christian Marangi

Fix dtbs_check warning for new rpmcc Documentation changes and add the required clocks.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

There is no warning in the kernel, right? So the commit is not correct.

Oh ok, the warning is generated by the new Documentation.

Patches, especially DTS, might go via different trees, so the moment DTS is applied there might be no such warning.

Quoted 7 lines

I'm still confused about this topic...
With this kind of change, I notice I sent Documentation change and then rob bot complain about dtbs_check having warning...

So the correct way is to send Documentation change and fix dtbs_check warning in the same commit OR keep what I'm doing with sending Documentation changes and fix DTS in a separate commit?

Binding is almost always separate from DTS and always separate from driver. The order depends on what you're doing. If you bring ABI break change to bindings, then the order does not matter, because each order will be non-bisectable. Because you broke ABI. That's the case in this patchset.

For other cases, usually bindings patches should be the first in patchset.

Quoted 8 lines

How it goes via maintainer trees is not your problem here. Patches might go together or might go separate.

Anyway it was not the topic of my comment. Comment was about not specific commit msg which does not fit the Linux kernel process and does not fit git history once applied by maintainer. It fits even less when backported to stable kernels, which you commit msg encourages to do.

It was a more generic question so sorry for the OT.

Will reword the commit description, thanks again for the clarification about this generic topic.

Signature · 1 line
	Ansuel
#14 lore raw

PATCH 3/5 clk: qcom: clk-rpm: convert to parent_data API

In reply to Christian Marangi

Convert clk-rpm driver to parent_data API and change parent names to cxo and pxo instead of the board variant as pxo_board is an ancient name and pxo should be used instead.

---
 drivers/clk/qcom/clk-rpm.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)
drivers/clk/qcom/clk-rpm.c +16 -8
index a18811c38018..d45a8b0fc97c 100644
@@ -23,6 +23,14 @@
 #define QCOM_RPM_SCALING_ENABLE_ID			0x2
 #define QCOM_RPM_XO_MODE_ON				0x2
 
+static const struct clk_parent_data gcc_pxo[] = {
+	{ .fw_name = "pxo", .name = "pxo" },
+};
+
+static const struct clk_parent_data gcc_cxo[] = {
+	{ .fw_name = "cxo", .name = "cxo" },
+};
+
 #define DEFINE_CLK_RPM(_platform, _name, _active, r_id)			      \
 	static struct clk_rpm _platform##_##_active;			      \
 	static struct clk_rpm _platform##_##_name = {			      \
@@ -32,8 +40,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_ops,				      \
 			.name = #_name,					      \
-			.parent_names = (const char *[]){ "pxo_board" },      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_pxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
 		},							      \
 	};								      \
 	static struct clk_rpm _platform##_##_active = {			      \
@@ -44,8 +52,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_ops,				      \
 			.name = #_active,				      \
-			.parent_names = (const char *[]){ "pxo_board" },      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_pxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
 		},							      \
 	}
 
@@ -56,8 +64,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_xo_ops,			      \
 			.name = #_name,					      \
-			.parent_names = (const char *[]){ "cxo_board" },      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_cxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_cxo),		      \
 		},							      \
 	}
 
@@ -68,8 +76,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_fixed_ops,			      \
 			.name = #_name,					      \
-			.parent_names = (const char *[]){ "pxo" },	      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_pxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
 		},							      \
 	}
 
Signature · 1 line
2.36.1
#15 lore raw

Re: [PATCH 3/5] clk: qcom: clk-rpm: convert to parent_data API

Quoted 15 lines · Christian Marangi

Convert clk-rpm driver to parent_data API and change parent names to cxo and pxo instead of the board variant as pxo_board is an ancient name and pxo should be used instead.

---
 drivers/clk/qcom/clk-rpm.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)
drivers/clk/qcom/clk-rpm.c +0 -0
index a18811c38018..d45a8b0fc97c 100644

drivers/clk/qcom/clk-rpm.c line 27

Quoted 5 lines
drivers/clk/qcom/clk-rpm.c +2 -0
@@ -23,6 +23,14 @@
 #define QCOM_RPM_SCALING_ENABLE_ID                     0x2
 #define QCOM_RPM_XO_MODE_ON                            0x2
 
+static const struct clk_parent_data gcc_pxo[] = {
+       { .fw_name = "pxo", .name = "pxo" },

This means that the core clock would look for the DT clock named 'pxo' with the fallback to the global clock named 'pxo'. Fallback is required to keep compatibility with older DT files, not having the clocks/clock-names properties.
For all other platforms we were using as a fallback the 'pxo_board' clock (defined in the DT) rather than the 'pxo' (hackily injected by the gcc driver).
I'd suggest following this pattern and using .fw_name = "pxo', .name = "pxo_board".

Same applies to the CXO clock.

Quoted 2 lines
drivers/clk/qcom/clk-rpm.c +2 -0
+};
+
Signature · 2 lines
With best wishes
Dmitry
#16 lore raw

Re: [PATCH 3/5] clk: qcom: clk-rpm: convert to parent_data API

Quoted 19 lines · Dmitry Baryshkov
Quoted 18 lines · Christian Marangi

Convert clk-rpm driver to parent_data API and change parent names to cxo and pxo instead of the board variant as pxo_board is an ancient name and pxo should be used instead.

---
 drivers/clk/qcom/clk-rpm.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)
drivers/clk/qcom/clk-rpm.c +0 -0
index a18811c38018..d45a8b0fc97c 100644
@@ -23,6 +23,14 @@
 #define QCOM_RPM_SCALING_ENABLE_ID                     0x2
 #define QCOM_RPM_XO_MODE_ON                            0x2
 
Quoted 12 lines

drivers/clk/qcom/clk-rpm.c line 27

Quoted 2 lines
drivers/clk/qcom/clk-rpm.c +2 -0
+static const struct clk_parent_data gcc_pxo[] = {
+       { .fw_name = "pxo", .name = "pxo" },

This means that the core clock would look for the DT clock named 'pxo' with the fallback to the global clock named 'pxo'. Fallback is required to keep compatibility with older DT files, not having the clocks/clock-names properties.
For all other platforms we were using as a fallback the 'pxo_board' clock (defined in the DT) rather than the 'pxo' (hackily injected by the gcc driver).
I'd suggest following this pattern and using .fw_name = "pxo', .name = "pxo_board".

We were discussing this to the lcc driver. Problematic topic, yes will follow the pattern just to not change things.

Quoted 10 lines

Same applies to the CXO clock.

Quoted 2 lines
drivers/clk/qcom/clk-rpm.c +2 -0
+};
+
Signature · 2 lines
With best wishes
Dmitry
Signature · 1 line
	Ansuel
#17 lore raw

Re: [PATCH 3/5] clk: qcom: clk-rpm: convert to parent_data API

In reply to Christian Marangi
Quoted 14 lines · Christian Marangi

Convert clk-rpm driver to parent_data API and change parent names to cxo and pxo instead of the board variant as pxo_board is an ancient name and pxo should be used instead.

---
 drivers/clk/qcom/clk-rpm.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)
drivers/clk/qcom/clk-rpm.c +0 -0
index a18811c38018..d45a8b0fc97c 100644

drivers/clk/qcom/clk-rpm.c line 27

Quoted 5 lines
drivers/clk/qcom/clk-rpm.c +2 -0
@@ -23,6 +23,14 @@
 #define QCOM_RPM_SCALING_ENABLE_ID			0x2
 #define QCOM_RPM_XO_MODE_ON				0x2
 
+static const struct clk_parent_data gcc_pxo[] = {
+	{ .fw_name = "pxo", .name = "pxo" },

The .name lookup should include _board, as the old DTs expect that. If I understand correctly though, you need to preserve both pxo and pxo_board, as they were separate, not sure though..

Konrad

Quoted 53 lines
drivers/clk/qcom/clk-rpm.c +14 -8
+};
+
+static const struct clk_parent_data gcc_cxo[] = {
+	{ .fw_name = "cxo", .name = "cxo" },
+};
+
 #define DEFINE_CLK_RPM(_platform, _name, _active, r_id)			      \
 	static struct clk_rpm _platform##_##_active;			      \
 	static struct clk_rpm _platform##_##_name = {			      \
@@ -32,8 +40,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_ops,				      \
 			.name = #_name,					      \
-			.parent_names = (const char *[]){ "pxo_board" },      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_pxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
 		},							      \
 	};								      \
 	static struct clk_rpm _platform##_##_active = {			      \
@@ -44,8 +52,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_ops,				      \
 			.name = #_active,				      \
-			.parent_names = (const char *[]){ "pxo_board" },      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_pxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
 		},							      \
 	}
 
@@ -56,8 +64,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_xo_ops,			      \
 			.name = #_name,					      \
-			.parent_names = (const char *[]){ "cxo_board" },      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_cxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_cxo),		      \
 		},							      \
 	}
 
@@ -68,8 +76,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_fixed_ops,			      \
 			.name = #_name,					      \
-			.parent_names = (const char *[]){ "pxo" },	      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_pxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
 		},							      \
 	}
 
#18 lore raw

Re: [PATCH 3/5] clk: qcom: clk-rpm: convert to parent_data API

Quoted 20 lines · Konrad Dybcio
Quoted 17 lines · Christian Marangi

Convert clk-rpm driver to parent_data API and change parent names to cxo and pxo instead of the board variant as pxo_board is an ancient name and pxo should be used instead.

---
 drivers/clk/qcom/clk-rpm.c | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)
drivers/clk/qcom/clk-rpm.c +0 -0
index a18811c38018..d45a8b0fc97c 100644
@@ -23,6 +23,14 @@
 #define QCOM_RPM_SCALING_ENABLE_ID			0x2
 #define QCOM_RPM_XO_MODE_ON				0x2
 
Quoted 6 lines

drivers/clk/qcom/clk-rpm.c line 27

Quoted 2 lines
drivers/clk/qcom/clk-rpm.c +2 -0
+static const struct clk_parent_data gcc_pxo[] = {
+	{ .fw_name = "pxo", .name = "pxo" },

The .name lookup should include _board, as the old DTs expect that. If I understand correctly though, you need to preserve both pxo and pxo_board, as they were separate, not sure though..

pxo_board is what comes first... then qcom gcc driver hacks it and create a factor clk with 1/1 div and provide pxo.
In practice they are the same clk. But yhea I should not change the name, will resent with .name = pxo_board and be done with it.

Quoted 54 lines

Konrad

Quoted 53 lines
drivers/clk/qcom/clk-rpm.c +14 -8
+};
+
+static const struct clk_parent_data gcc_cxo[] = {
+	{ .fw_name = "cxo", .name = "cxo" },
+};
+
 #define DEFINE_CLK_RPM(_platform, _name, _active, r_id)			      \
 	static struct clk_rpm _platform##_##_active;			      \
 	static struct clk_rpm _platform##_##_name = {			      \
@@ -32,8 +40,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_ops,				      \
 			.name = #_name,					      \
-			.parent_names = (const char *[]){ "pxo_board" },      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_pxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
 		},							      \
 	};								      \
 	static struct clk_rpm _platform##_##_active = {			      \
@@ -44,8 +52,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_ops,				      \
 			.name = #_active,				      \
-			.parent_names = (const char *[]){ "pxo_board" },      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_pxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
 		},							      \
 	}
 
@@ -56,8 +64,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_xo_ops,			      \
 			.name = #_name,					      \
-			.parent_names = (const char *[]){ "cxo_board" },      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_cxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_cxo),		      \
 		},							      \
 	}
 
@@ -68,8 +76,8 @@
 		.hw.init = &(struct clk_init_data){			      \
 			.ops = &clk_rpm_fixed_ops,			      \
 			.name = #_name,					      \
-			.parent_names = (const char *[]){ "pxo" },	      \
-			.num_parents = 1,				      \
+			.parent_data = gcc_pxo,				      \
+			.num_parents = ARRAY_SIZE(gcc_pxo),		      \
 		},							      \
 	}
 
Signature · 1 line
	Ansuel
#19 lore raw

PATCH 4/5 ARM: dts: qcom: add pxo/cxo clock-output-names for ipq8064

In reply to Christian Marangi

Drivers expect to call pxo/cxo_board clock as pxo/cxo.
Use clock-output-names to set the correct naming for these fixed clock to save drivers that are migrating to parent_data and still use parent_names.

---
 arch/arm/boot/dts/qcom-ipq8064.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/qcom-ipq8064.dtsi +2 -0
index 1425a4e4283f..720e27e29627 100644
@@ -302,12 +302,14 @@ cxo_board: cxo_board {
 			compatible = "fixed-clock";
 			#clock-cells = <0>;
 			clock-frequency = <25000000>;
+			clock-output-names = "cxo";
 		};
 
 		pxo_board: pxo_board {
 			compatible = "fixed-clock";
 			#clock-cells = <0>;
 			clock-frequency = <25000000>;
+			clock-output-names = "pxo";
 		};
 
 		sleep_clk: sleep_clk {
Signature · 1 line
2.36.1
#20 lore raw

Re: [PATCH 4/5] ARM: dts: qcom: add pxo/cxo clock-output-names for ipq8064

Quoted 5 lines · Christian Marangi

Drivers expect to call pxo/cxo_board clock as pxo/cxo.
Use clock-output-names to set the correct naming for these fixed clock to save drivers that are migrating to parent_data and still use parent_names.

Please no. There is no reason to add these names. Let's follow the example of other platforms.

Quoted 28 lines
---
 arch/arm/boot/dts/qcom-ipq8064.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/qcom-ipq8064.dtsi +2 -1
index 1425a4e4283f..720e27e29627 100644
@@ -302,12 +302,14 @@ cxo_board: cxo_board {
                        compatible = "fixed-clock";
                        #clock-cells = <0>;
                        clock-frequency = <25000000>;
+                       clock-output-names = "cxo";
                };
 
                pxo_board: pxo_board {
                        compatible = "fixed-clock";
                        #clock-cells = <0>;
                        clock-frequency = <25000000>;
+                       clock-output-names = "pxo";
                };
 
                sleep_clk: sleep_clk {
--

2.36.1

Signature · 2 lines
With best wishes
Dmitry
#21 lore raw

Re: [PATCH 4/5] ARM: dts: qcom: add pxo/cxo clock-output-names for ipq8064

Quoted 10 lines · Dmitry Baryshkov
Quoted 5 lines · Christian Marangi

Drivers expect to call pxo/cxo_board clock as pxo/cxo.
Use clock-output-names to set the correct naming for these fixed clock to save drivers that are migrating to parent_data and still use parent_names.

Please no. There is no reason to add these names. Let's follow the example of other platforms.

Okok... just don't like the '_board' suffix but will drop...

Quoted 33 lines
Quoted 28 lines
---
 arch/arm/boot/dts/qcom-ipq8064.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/qcom-ipq8064.dtsi +2 -1
index 1425a4e4283f..720e27e29627 100644
@@ -302,12 +302,14 @@ cxo_board: cxo_board {
                        compatible = "fixed-clock";
                        #clock-cells = <0>;
                        clock-frequency = <25000000>;
+                       clock-output-names = "cxo";
                };
 
                pxo_board: pxo_board {
                        compatible = "fixed-clock";
                        #clock-cells = <0>;
                        clock-frequency = <25000000>;
+                       clock-output-names = "pxo";
                };
 
                sleep_clk: sleep_clk {
--

2.36.1

Signature · 2 lines
With best wishes
Dmitry
Signature · 1 line
	Ansuel
#22 lore raw

Re: [PATCH 4/5] ARM: dts: qcom: add pxo/cxo clock-output-names for ipq8064

In reply to Christian Marangi
Quoted 5 lines · Christian Marangi

Drivers expect to call pxo/cxo_board clock as pxo/cxo.
Use clock-output-names to set the correct naming for these fixed clock to save drivers that are migrating to parent_data and still use parent_names.

For this you'd want to call them "cxo_board" and "pxo_board", as that's what they were named because of their node names.

Konrad

Quoted 24 lines
---
 arch/arm/boot/dts/qcom-ipq8064.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/qcom-ipq8064.dtsi +2 -0
index 1425a4e4283f..720e27e29627 100644
@@ -302,12 +302,14 @@ cxo_board: cxo_board {
 			compatible = "fixed-clock";
 			#clock-cells = <0>;
 			clock-frequency = <25000000>;
+			clock-output-names = "cxo";
 		};
 
 		pxo_board: pxo_board {
 			compatible = "fixed-clock";
 			#clock-cells = <0>;
 			clock-frequency = <25000000>;
+			clock-output-names = "pxo";
 		};
 
 		sleep_clk: sleep_clk {
#23 lore raw

PATCH 5/5 clk: qcom: gcc-ipq806x: remove cc_register_board for pxo and cxo

In reply to Christian Marangi

Now that these clock are defined as fixed clk in dts, we can drop the register_board_clk for cxo_board and pxo_board in gcc_ipq806x_probe.

---
 drivers/clk/qcom/gcc-ipq806x.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/clk/qcom/gcc-ipq806x.c +0 -8
index 718de17a1e60..883629de2751 100644
@@ -3384,14 +3384,6 @@ static int gcc_ipq806x_probe(struct platform_device *pdev)
 	struct regmap *regmap;
 	int ret;
 
-	ret = qcom_cc_register_board_clk(dev, "cxo_board", "cxo", 25000000);
-	if (ret)
-		return ret;
-
-	ret = qcom_cc_register_board_clk(dev, "pxo_board", "pxo", 25000000);
-	if (ret)
-		return ret;
-
 	if (of_machine_is_compatible("qcom,ipq8065")) {
 		ubi32_core1_src_clk.freq_tbl = clk_tbl_nss_ipq8065;
 		ubi32_core2_src_clk.freq_tbl = clk_tbl_nss_ipq8065;
Signature · 1 line
2.36.1