All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Krait Documentation conversion
@ 2022-04-30  6:01 Ansuel Smith
  2022-04-30  6:01 ` [PATCH v2 1/3] dt-bindings: clock: Convert qcom,krait-cc to yaml Ansuel Smith
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Ansuel Smith @ 2022-04-30  6:01 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Andy Gross, Bjorn Andersson,
	Michael Turquette, Stephen Boyd, Ansuel Smith, devicetree,
	linux-kernel, linux-arm-msm, linux-clk

This series convert the krait-cc and the kpps-acc/gcc Documentation to
yaml.

This series comes form a split of a bigger series that got too big and
now hard to review.

While they are still more or less wrong and doesn't really reflect real
driver implementation, they are converted to prepare for a fixup later
when dts and driver are finally fixed. For now make a 1:1 conversion.
The only change is an additional binding for the kpss-gcc Documentation
that require the #clock-cells when clock-output-names is used.

v2:
- Fix bot error by adding missing #clock-cells

Changelog for previous series "Modernize rest of the krait drivers"
that was split to smaller series (only Documentation changes):
v7:
- Rework kpss-gcc Documentation (split patch for pure conversion and
  tweaks)
v6:
- Address comments from Rob
- Fix warning from make dtbs_check
v5:
- Address comments from Krzysztof
v4:
- Fix more dt-bindings bug errors
v3:
- Split Documentation files for kpss and krait-cc
v2:
- fix missing new line on patch 16 (krait-cc patch)

Ansuel Smith (3):
  dt-bindings: clock: Convert qcom,krait-cc to yaml
  dt-bindings: arm: msm: Convert kpss-acc driver Documentation to yaml
  dt-bindings: arm: msm: Convert kpss-gcc driver Documentation to yaml

 .../bindings/arm/msm/qcom,kpss-acc.txt        | 49 ----------
 .../bindings/arm/msm/qcom,kpss-acc.yaml       | 94 +++++++++++++++++++
 .../bindings/arm/msm/qcom,kpss-gcc.txt        | 44 ---------
 .../bindings/arm/msm/qcom,kpss-gcc.yaml       | 68 ++++++++++++++
 .../bindings/clock/qcom,krait-cc.txt          | 34 -------
 .../bindings/clock/qcom,krait-cc.yaml         | 59 ++++++++++++
 6 files changed, 221 insertions(+), 127 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.txt
 create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.yaml
 delete mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt
 create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.yaml
 delete mode 100644 Documentation/devicetree/bindings/clock/qcom,krait-cc.txt
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,krait-cc.yaml

-- 
2.34.1


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

* [PATCH v2 1/3] dt-bindings: clock: Convert qcom,krait-cc to yaml
  2022-04-30  6:01 [PATCH v2 0/3] Krait Documentation conversion Ansuel Smith
@ 2022-04-30  6:01 ` Ansuel Smith
  2022-04-30  6:01 ` [PATCH v2 2/3] dt-bindings: arm: msm: Convert kpss-acc driver Documentation " Ansuel Smith
  2022-04-30  6:01 ` [PATCH v2 3/3] dt-bindings: arm: msm: Convert kpss-gcc " Ansuel Smith
  2 siblings, 0 replies; 12+ messages in thread
From: Ansuel Smith @ 2022-04-30  6:01 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Andy Gross, Bjorn Andersson,
	Michael Turquette, Stephen Boyd, Ansuel Smith, devicetree,
	linux-kernel, linux-arm-msm, linux-clk
  Cc: Krzysztof Kozlowski, Rob Herring

Convert qcom,krait-cc to yaml Documentation.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Rob Herring <robh@kernel.org>
---
 .../bindings/clock/qcom,krait-cc.txt          | 34 -----------
 .../bindings/clock/qcom,krait-cc.yaml         | 59 +++++++++++++++++++
 2 files changed, 59 insertions(+), 34 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/clock/qcom,krait-cc.txt
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,krait-cc.yaml

diff --git a/Documentation/devicetree/bindings/clock/qcom,krait-cc.txt b/Documentation/devicetree/bindings/clock/qcom,krait-cc.txt
deleted file mode 100644
index 030ba60dab08..000000000000
--- a/Documentation/devicetree/bindings/clock/qcom,krait-cc.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-Krait Clock Controller
-
-PROPERTIES
-
-- compatible:
-	Usage: required
-	Value type: <string>
-	Definition: must be one of:
-			"qcom,krait-cc-v1"
-			"qcom,krait-cc-v2"
-
-- #clock-cells:
-	Usage: required
-	Value type: <u32>
-	Definition: must be 1
-
-- clocks:
-	Usage: required
-	Value type: <prop-encoded-array>
-	Definition: reference to the clock parents of hfpll, secondary muxes.
-
-- clock-names:
-	Usage: required
-	Value type: <stringlist>
-	Definition: must be "hfpll0", "hfpll1", "acpu0_aux", "acpu1_aux", "qsb".
-
-Example:
-
-	kraitcc: clock-controller {
-		compatible = "qcom,krait-cc-v1";
-		clocks = <&hfpll0>, <&hfpll1>, <&acpu0_aux>, <&acpu1_aux>, <qsb>;
-		clock-names = "hfpll0", "hfpll1", "acpu0_aux", "acpu1_aux", "qsb";
-		#clock-cells = <1>;
-	};
diff --git a/Documentation/devicetree/bindings/clock/qcom,krait-cc.yaml b/Documentation/devicetree/bindings/clock/qcom,krait-cc.yaml
new file mode 100644
index 000000000000..e879bfbe67ac
--- /dev/null
+++ b/Documentation/devicetree/bindings/clock/qcom,krait-cc.yaml
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/qcom,krait-cc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Krait Clock Controller
+
+maintainers:
+  - Ansuel Smith <ansuelsmth@gmail.com>
+
+description: |
+  Qualcomm Krait Clock Controller used to correctly scale the CPU and the L2
+  rates.
+
+properties:
+  compatible:
+    enum:
+      - qcom,krait-cc-v1
+      - qcom,krait-cc-v2
+
+  clocks:
+    items:
+      - description: phandle to hfpll for CPU0 mux
+      - description: phandle to hfpll for CPU1 mux
+      - description: phandle to CPU0 aux clock
+      - description: phandle to CPU1 aux clock
+      - description: phandle to QSB fixed clk
+
+  clock-names:
+    items:
+      - const: hfpll0
+      - const: hfpll1
+      - const: acpu0_aux
+      - const: acpu1_aux
+      - const: qsb
+
+  '#clock-cells':
+    const: 1
+
+required:
+  - compatible
+  - clocks
+  - clock-names
+  - '#clock-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    clock-controller {
+      compatible = "qcom,krait-cc-v1";
+      clocks = <&hfpll0>, <&hfpll1>,
+               <&acpu0_aux>, <&acpu1_aux>, <&qsb>;
+      clock-names = "hfpll0", "hfpll1",
+                    "acpu0_aux", "acpu1_aux", "qsb";
+      #clock-cells = <1>;
+    };
+...
-- 
2.34.1


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

* [PATCH v2 2/3] dt-bindings: arm: msm: Convert kpss-acc driver Documentation to yaml
  2022-04-30  6:01 [PATCH v2 0/3] Krait Documentation conversion Ansuel Smith
  2022-04-30  6:01 ` [PATCH v2 1/3] dt-bindings: clock: Convert qcom,krait-cc to yaml Ansuel Smith
@ 2022-04-30  6:01 ` Ansuel Smith
  2022-04-30  6:01 ` [PATCH v2 3/3] dt-bindings: arm: msm: Convert kpss-gcc " Ansuel Smith
  2 siblings, 0 replies; 12+ messages in thread
From: Ansuel Smith @ 2022-04-30  6:01 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Andy Gross, Bjorn Andersson,
	Michael Turquette, Stephen Boyd, Ansuel Smith, devicetree,
	linux-kernel, linux-arm-msm, linux-clk
  Cc: Krzysztof Kozlowski

Convert kpss-acc driver Documentation to yaml.
The original Documentation was wrong all along. Fix it while we are
converting it.
The example was wrong as kpss-acc-v2 should only expose the regs but we
don't have any driver that expose additional clocks. The kpss-acc driver
is only specific to v1. For this exact reason, limit all the additional
bindings (clocks, clock-names, clock-output-names and #clock-cells) to
v1 and also flag that these bindings should NOT be used for v2.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 .../bindings/arm/msm/qcom,kpss-acc.txt        | 49 ----------
 .../bindings/arm/msm/qcom,kpss-acc.yaml       | 94 +++++++++++++++++++
 2 files changed, 94 insertions(+), 49 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.txt
 create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.yaml

diff --git a/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.txt b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.txt
deleted file mode 100644
index 7f696362a4a1..000000000000
--- a/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-Krait Processor Sub-system (KPSS) Application Clock Controller (ACC)
-
-The KPSS ACC provides clock, power domain, and reset control to a Krait CPU.
-There is one ACC register region per CPU within the KPSS remapped region as
-well as an alias register region that remaps accesses to the ACC associated
-with the CPU accessing the region.
-
-PROPERTIES
-
-- compatible:
-	Usage: required
-	Value type: <string>
-	Definition: should be one of:
-			"qcom,kpss-acc-v1"
-			"qcom,kpss-acc-v2"
-
-- reg:
-	Usage: required
-	Value type: <prop-encoded-array>
-	Definition: the first element specifies the base address and size of
-		    the register region. An optional second element specifies
-		    the base address and size of the alias register region.
-
-- clocks:
-        Usage: required
-        Value type: <prop-encoded-array>
-        Definition: reference to the pll parents.
-
-- clock-names:
-        Usage: required
-        Value type: <stringlist>
-        Definition: must be "pll8_vote", "pxo".
-
-- clock-output-names:
-	Usage: optional
-	Value type: <string>
-	Definition: Name of the output clock. Typically acpuX_aux where X is a
-		    CPU number starting at 0.
-
-Example:
-
-	clock-controller@2088000 {
-		compatible = "qcom,kpss-acc-v2";
-		reg = <0x02088000 0x1000>,
-		      <0x02008000 0x1000>;
-		clocks = <&gcc PLL8_VOTE>, <&gcc PXO_SRC>;
-		clock-names = "pll8_vote", "pxo";
-		clock-output-names = "acpu0_aux";
-	};
diff --git a/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.yaml b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.yaml
new file mode 100644
index 000000000000..707a81a6c30e
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.yaml
@@ -0,0 +1,94 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/msm/qcom,kpss-acc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Krait Processor Sub-system (KPSS) Application Clock Controller (ACC)
+
+maintainers:
+  - Ansuel Smith <ansuelsmth@gmail.com>
+
+description: |
+  The KPSS ACC provides clock, power domain, and reset control to a Krait CPU.
+  There is one ACC register region per CPU within the KPSS remapped region as
+  well as an alias register region that remaps accesses to the ACC associated
+  with the CPU accessing the region.
+
+properties:
+  compatible:
+    enum:
+      - qcom,kpss-acc-v1
+      - qcom,kpss-acc-v2
+
+  reg:
+    items:
+      - description: Base address and size of the register region
+      - description: Optional base address and size of the alias register region
+
+  clocks:
+    items:
+      - description: phandle to pll8_vote
+      - description: phandle to pxo_board
+
+  clock-names:
+    items:
+      - const: pll8_vote
+      - const: pxo
+
+  clock-output-names:
+    description: Name of the aux clock. Krait can have at most 4 cpu.
+    enum:
+      - acpu0_aux
+      - acpu1_aux
+      - acpu2_aux
+      - acpu3_aux
+
+  '#clock-cells':
+    const: 0
+
+required:
+  - compatible
+  - reg
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: qcom,kpss-acc-v1
+      then:
+        required:
+          - clocks
+          - clock-names
+          - clock-output-names
+          - '#clock-cells'
+    else:
+      properties:
+        clocks: false
+        clock-names: false
+        clock-output-names: false
+        '#clock-cells': false
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,gcc-ipq806x.h>
+
+    clock-controller@2088000 {
+      compatible = "qcom,kpss-acc-v1";
+      reg = <0x02088000 0x1000>, <0x02008000 0x1000>;
+      clocks = <&gcc PLL8_VOTE>, <&pxo_board>;
+      clock-names = "pll8_vote", "pxo";
+      clock-output-names = "acpu0_aux";
+      #clock-cells = <0>;
+    };
+
+  - |
+    clock-controller@f9088000 {
+      compatible = "qcom,kpss-acc-v2";
+      reg = <0xf9088000 0x1000>,
+            <0xf9008000 0x1000>;
+    };
+...
-- 
2.34.1


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

* [PATCH v2 3/3] dt-bindings: arm: msm: Convert kpss-gcc driver Documentation to yaml
  2022-04-30  6:01 [PATCH v2 0/3] Krait Documentation conversion Ansuel Smith
  2022-04-30  6:01 ` [PATCH v2 1/3] dt-bindings: clock: Convert qcom,krait-cc to yaml Ansuel Smith
  2022-04-30  6:01 ` [PATCH v2 2/3] dt-bindings: arm: msm: Convert kpss-acc driver Documentation " Ansuel Smith
@ 2022-04-30  6:01 ` Ansuel Smith
  2022-04-30 14:40   ` Krzysztof Kozlowski
  2022-05-02 15:33   ` Rob Herring
  2 siblings, 2 replies; 12+ messages in thread
From: Ansuel Smith @ 2022-04-30  6:01 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Andy Gross, Bjorn Andersson,
	Michael Turquette, Stephen Boyd, Ansuel Smith, devicetree,
	linux-kernel, linux-arm-msm, linux-clk

Convert kpss-gcc driver Documentation to yaml.
Add #clock-cells additional binding to required bindings and example
as it's a required binding for clock-output-names.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
 .../bindings/arm/msm/qcom,kpss-gcc.txt        | 44 ------------
 .../bindings/arm/msm/qcom,kpss-gcc.yaml       | 68 +++++++++++++++++++
 2 files changed, 68 insertions(+), 44 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt
 create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.yaml

diff --git a/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt
deleted file mode 100644
index e628758950e1..000000000000
--- a/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-Krait Processor Sub-system (KPSS) Global Clock Controller (GCC)
-
-PROPERTIES
-
-- compatible:
-	Usage: required
-	Value type: <string>
-	Definition: should be one of the following. The generic compatible
-			"qcom,kpss-gcc" should also be included.
-			"qcom,kpss-gcc-ipq8064", "qcom,kpss-gcc"
-			"qcom,kpss-gcc-apq8064", "qcom,kpss-gcc"
-			"qcom,kpss-gcc-msm8974", "qcom,kpss-gcc"
-			"qcom,kpss-gcc-msm8960", "qcom,kpss-gcc"
-
-- reg:
-	Usage: required
-	Value type: <prop-encoded-array>
-	Definition: base address and size of the register region
-
-- clocks:
-	Usage: required
-	Value type: <prop-encoded-array>
-	Definition: reference to the pll parents.
-
-- clock-names:
-	Usage: required
-	Value type: <stringlist>
-	Definition: must be "pll8_vote", "pxo".
-
-- clock-output-names:
-	Usage: required
-	Value type: <string>
-	Definition: Name of the output clock. Typically acpu_l2_aux indicating
-		    an L2 cache auxiliary clock.
-
-Example:
-
-	l2cc: clock-controller@2011000 {
-		compatible = "qcom,kpss-gcc-ipq8064", "qcom,kpss-gcc";
-		reg = <0x2011000 0x1000>;
-		clocks = <&gcc PLL8_VOTE>, <&gcc PXO_SRC>;
-		clock-names = "pll8_vote", "pxo";
-		clock-output-names = "acpu_l2_aux";
-	};
diff --git a/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.yaml b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.yaml
new file mode 100644
index 000000000000..20ee182eb16f
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.yaml
@@ -0,0 +1,68 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/msm/qcom,kpss-gcc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Krait Processor Sub-system (KPSS) Global Clock Controller (GCC)
+
+maintainers:
+  - Ansuel Smith <ansuelsmth@gmail.com>
+
+description: |
+  Krait Processor Sub-system (KPSS) Global Clock Controller (GCC). Used
+  to control L2 mux (in the current implementation).
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - qcom,kpss-gcc-ipq8064
+          - qcom,kpss-gcc-apq8064
+          - qcom,kpss-gcc-msm8974
+          - qcom,kpss-gcc-msm8960
+      - const: qcom,kpss-gcc
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: phandle to pll8_vote
+      - description: phandle to pxo_board
+
+  clock-names:
+    items:
+      - const: pll8_vote
+      - const: pxo
+
+  clock-output-names:
+    const: acpu_l2_aux
+
+  '#clock-cells':
+    const: 0
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - clock-output-names
+  - '#clock-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/qcom,gcc-ipq806x.h>
+
+    clock-controller@2011000 {
+      compatible = "qcom,kpss-gcc-ipq8064", "qcom,kpss-gcc";
+      reg = <0x2011000 0x1000>;
+      clocks = <&gcc PLL8_VOTE>, <&pxo_board>;
+      clock-names = "pll8_vote", "pxo";
+      clock-output-names = "acpu_l2_aux";
+      #clock-cells = <0>;
+    };
+...
+
-- 
2.34.1


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

* Re: [PATCH v2 3/3] dt-bindings: arm: msm: Convert kpss-gcc driver Documentation to yaml
  2022-04-30 14:40   ` Krzysztof Kozlowski
@ 2022-04-30  7:42     ` Ansuel Smith
  2022-05-01  8:26       ` Krzysztof Kozlowski
  2022-06-27 20:54       ` Bjorn Andersson
  0 siblings, 2 replies; 12+ messages in thread
From: Ansuel Smith @ 2022-04-30  7:42 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rob Herring, Krzysztof Kozlowski, Andy Gross, Bjorn Andersson,
	Michael Turquette, Stephen Boyd, devicetree, linux-kernel,
	linux-arm-msm, linux-clk

On Sat, Apr 30, 2022 at 04:40:54PM +0200, Krzysztof Kozlowski wrote:
> On 30/04/2022 08:01, Ansuel Smith wrote:
> > Convert kpss-gcc driver Documentation to yaml.
> > Add #clock-cells additional binding to required bindings and example
> > as it's a required binding for clock-output-names.
> > 
> > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> 
> 
> (...)
> 
> > +properties:
> > +  compatible:
> > +    items:
> > +      - enum:
> > +          - qcom,kpss-gcc-ipq8064
> > +          - qcom,kpss-gcc-apq8064
> > +          - qcom,kpss-gcc-msm8974
> > +          - qcom,kpss-gcc-msm8960
> > +      - const: qcom,kpss-gcc
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    items:
> > +      - description: phandle to pll8_vote
> > +      - description: phandle to pxo_board
> > +
> > +  clock-names:
> > +    items:
> > +      - const: pll8_vote
> > +      - const: pxo
> > +
> > +  clock-output-names:
> > +    const: acpu_l2_aux
> 
> It does not make sense having a constant output name. What is the
> meaning this property in such case? The original binding did not enforce it.
> 
> 
> 
> Best regards,
> Krzysztof

Mh. Should I just drop the const and put a description referring to an
advised name? The driver with the kpss-gcc hardcode the name to
acpu_l2_aux that's why I thought it was a correct conversion using a
const but I assume this is another problem of not making a correct 1:1
conversion and adding fixes on pure conversion.
Think I should drop it and put a description to it. (and then later fix
it when I will push the other series with all the tweaks)

What do you think?

-- 
	Ansuel

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

* Re: [PATCH v2 3/3] dt-bindings: arm: msm: Convert kpss-gcc driver Documentation to yaml
  2022-04-30  6:01 ` [PATCH v2 3/3] dt-bindings: arm: msm: Convert kpss-gcc " Ansuel Smith
@ 2022-04-30 14:40   ` Krzysztof Kozlowski
  2022-04-30  7:42     ` Ansuel Smith
  2022-05-02 15:33   ` Rob Herring
  1 sibling, 1 reply; 12+ messages in thread
From: Krzysztof Kozlowski @ 2022-04-30 14:40 UTC (permalink / raw)
  To: Ansuel Smith, Rob Herring, Krzysztof Kozlowski, Andy Gross,
	Bjorn Andersson, Michael Turquette, Stephen Boyd, devicetree,
	linux-kernel, linux-arm-msm, linux-clk

On 30/04/2022 08:01, Ansuel Smith wrote:
> Convert kpss-gcc driver Documentation to yaml.
> Add #clock-cells additional binding to required bindings and example
> as it's a required binding for clock-output-names.
> 
> Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>


(...)

> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - qcom,kpss-gcc-ipq8064
> +          - qcom,kpss-gcc-apq8064
> +          - qcom,kpss-gcc-msm8974
> +          - qcom,kpss-gcc-msm8960
> +      - const: qcom,kpss-gcc
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    items:
> +      - description: phandle to pll8_vote
> +      - description: phandle to pxo_board
> +
> +  clock-names:
> +    items:
> +      - const: pll8_vote
> +      - const: pxo
> +
> +  clock-output-names:
> +    const: acpu_l2_aux

It does not make sense having a constant output name. What is the
meaning this property in such case? The original binding did not enforce it.



Best regards,
Krzysztof

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

* Re: [PATCH v2 3/3] dt-bindings: arm: msm: Convert kpss-gcc driver Documentation to yaml
  2022-04-30  7:42     ` Ansuel Smith
@ 2022-05-01  8:26       ` Krzysztof Kozlowski
  2022-05-02 10:40         ` Ansuel Smith
  2022-06-27 20:54       ` Bjorn Andersson
  1 sibling, 1 reply; 12+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-01  8:26 UTC (permalink / raw)
  To: Ansuel Smith
  Cc: Rob Herring, Krzysztof Kozlowski, Andy Gross, Bjorn Andersson,
	Michael Turquette, Stephen Boyd, devicetree, linux-kernel,
	linux-arm-msm, linux-clk

On 30/04/2022 09:42, Ansuel Smith wrote:
> On Sat, Apr 30, 2022 at 04:40:54PM +0200, Krzysztof Kozlowski wrote:
>> On 30/04/2022 08:01, Ansuel Smith wrote:
>>> Convert kpss-gcc driver Documentation to yaml.
>>> Add #clock-cells additional binding to required bindings and example
>>> as it's a required binding for clock-output-names.
>>>
>>> Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
>>
>>
>> (...)
>>
>>> +properties:
>>> +  compatible:
>>> +    items:
>>> +      - enum:
>>> +          - qcom,kpss-gcc-ipq8064
>>> +          - qcom,kpss-gcc-apq8064
>>> +          - qcom,kpss-gcc-msm8974
>>> +          - qcom,kpss-gcc-msm8960
>>> +      - const: qcom,kpss-gcc
>>> +
>>> +  reg:
>>> +    maxItems: 1
>>> +
>>> +  clocks:
>>> +    items:
>>> +      - description: phandle to pll8_vote
>>> +      - description: phandle to pxo_board
>>> +
>>> +  clock-names:
>>> +    items:
>>> +      - const: pll8_vote
>>> +      - const: pxo
>>> +
>>> +  clock-output-names:
>>> +    const: acpu_l2_aux
>>
>> It does not make sense having a constant output name. What is the
>> meaning this property in such case? The original binding did not enforce it.
>>
>>
>>
>> Best regards,
>> Krzysztof
> 
> Mh. Should I just drop the const and put a description referring to an
> advised name? The driver with the kpss-gcc hardcode the name to
> acpu_l2_aux that's why I thought it was a correct conversion using a
> const but I assume this is another problem of not making a correct 1:1
> conversion and adding fixes on pure conversion.

Hard-coding a name by implementation is not a reason to put that name in
DTS. DTS is not a place for values stored in the driver.

> Think I should drop it and put a description to it. (and then later fix
> it when I will push the other series with all the tweaks)

The driver kpss-gcc does not use this property at all, so I am not sure
if there is a point to even keep it. Any other user of bindings makes
use of the property?


Best regards,
Krzysztof

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

* Re: [PATCH v2 3/3] dt-bindings: arm: msm: Convert kpss-gcc driver Documentation to yaml
  2022-05-01  8:26       ` Krzysztof Kozlowski
@ 2022-05-02 10:40         ` Ansuel Smith
  2022-05-02 20:18           ` Krzysztof Kozlowski
  0 siblings, 1 reply; 12+ messages in thread
From: Ansuel Smith @ 2022-05-02 10:40 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rob Herring, Krzysztof Kozlowski, Andy Gross, Bjorn Andersson,
	Michael Turquette, Stephen Boyd, devicetree, linux-kernel,
	linux-arm-msm, linux-clk

On Sun, May 01, 2022 at 10:26:47AM +0200, Krzysztof Kozlowski wrote:
> On 30/04/2022 09:42, Ansuel Smith wrote:
> > On Sat, Apr 30, 2022 at 04:40:54PM +0200, Krzysztof Kozlowski wrote:
> >> On 30/04/2022 08:01, Ansuel Smith wrote:
> >>> Convert kpss-gcc driver Documentation to yaml.
> >>> Add #clock-cells additional binding to required bindings and example
> >>> as it's a required binding for clock-output-names.
> >>>
> >>> Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> >>
> >>
> >> (...)
> >>
> >>> +properties:
> >>> +  compatible:
> >>> +    items:
> >>> +      - enum:
> >>> +          - qcom,kpss-gcc-ipq8064
> >>> +          - qcom,kpss-gcc-apq8064
> >>> +          - qcom,kpss-gcc-msm8974
> >>> +          - qcom,kpss-gcc-msm8960
> >>> +      - const: qcom,kpss-gcc
> >>> +
> >>> +  reg:
> >>> +    maxItems: 1
> >>> +
> >>> +  clocks:
> >>> +    items:
> >>> +      - description: phandle to pll8_vote
> >>> +      - description: phandle to pxo_board
> >>> +
> >>> +  clock-names:
> >>> +    items:
> >>> +      - const: pll8_vote
> >>> +      - const: pxo
> >>> +
> >>> +  clock-output-names:
> >>> +    const: acpu_l2_aux
> >>
> >> It does not make sense having a constant output name. What is the
> >> meaning this property in such case? The original binding did not enforce it.
> >>
> >>
> >>
> >> Best regards,
> >> Krzysztof
> > 
> > Mh. Should I just drop the const and put a description referring to an
> > advised name? The driver with the kpss-gcc hardcode the name to
> > acpu_l2_aux that's why I thought it was a correct conversion using a
> > const but I assume this is another problem of not making a correct 1:1
> > conversion and adding fixes on pure conversion.
> 
> Hard-coding a name by implementation is not a reason to put that name in
> DTS. DTS is not a place for values stored in the driver.
> 
> > Think I should drop it and put a description to it. (and then later fix
> > it when I will push the other series with all the tweaks)
> 
> The driver kpss-gcc does not use this property at all, so I am not sure
> if there is a point to even keep it. Any other user of bindings makes
> use of the property?
> 
> 
> Best regards,
> Krzysztof

The idea is that you put the clk name in 'clock-output-names' and the
driver needs to have support for it (and set the clk name based on the
name defined in the dts)

This driver doesn't have support for it and is actually hardcoded.
So you are right and I should just drop it.

But now another question... Since #clock-cells was added as a
requirement for clock-output-names, should I drop also that?

In theory #clock-cells should always be declared for clock providers, is
it right to add it in the conversion commit or I should put this change
in another commit? (since it's now an addition and now something required
to fix a bot warning)

-- 
	Ansuel

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

* Re: [PATCH v2 3/3] dt-bindings: arm: msm: Convert kpss-gcc driver Documentation to yaml
  2022-04-30  6:01 ` [PATCH v2 3/3] dt-bindings: arm: msm: Convert kpss-gcc " Ansuel Smith
  2022-04-30 14:40   ` Krzysztof Kozlowski
@ 2022-05-02 15:33   ` Rob Herring
  1 sibling, 0 replies; 12+ messages in thread
From: Rob Herring @ 2022-05-02 15:33 UTC (permalink / raw)
  To: Ansuel Smith
  Cc: linux-kernel, Rob Herring, Krzysztof Kozlowski,
	Michael Turquette, linux-arm-msm, linux-clk, Stephen Boyd,
	devicetree, Andy Gross, Bjorn Andersson

On Sat, 30 Apr 2022 08:01:25 +0200, Ansuel Smith wrote:
> Convert kpss-gcc driver Documentation to yaml.
> Add #clock-cells additional binding to required bindings and example
> as it's a required binding for clock-output-names.
> 
> Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> ---
>  .../bindings/arm/msm/qcom,kpss-gcc.txt        | 44 ------------
>  .../bindings/arm/msm/qcom,kpss-gcc.yaml       | 68 +++++++++++++++++++
>  2 files changed, 68 insertions(+), 44 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.txt
>  create mode 100644 Documentation/devicetree/bindings/arm/msm/qcom,kpss-gcc.yaml
> 

Running 'make dtbs_check' with the schema in this patch gives the
following warnings. Consider if they are expected or the schema is
incorrect. These may not be new warnings.

Note that it is not yet a requirement to have 0 warnings for dtbs_check.
This will change in the future.

Full log is available here: https://patchwork.ozlabs.org/patch/


clock-controller@2011000: '#clock-cells' is a required property
	arch/arm/boot/dts/qcom-apq8064-asus-nexus7-flo.dtb
	arch/arm/boot/dts/qcom-apq8064-cm-qs600.dtb
	arch/arm/boot/dts/qcom-apq8064-ifc6410.dtb
	arch/arm/boot/dts/qcom-apq8064-sony-xperia-yuga.dtb
	arch/arm/boot/dts/qcom-ipq8064-ap148.dtb
	arch/arm/boot/dts/qcom-ipq8064-rb3011.dtb
	arch/arm/boot/dts/qcom-mdm9615-wp8548-mangoh-green.dtb
	arch/arm/boot/dts/qcom-msm8960-cdp.dtb

clock-controller@2011000: 'clock-names' is a required property
	arch/arm/boot/dts/qcom-apq8064-asus-nexus7-flo.dtb
	arch/arm/boot/dts/qcom-apq8064-cm-qs600.dtb
	arch/arm/boot/dts/qcom-apq8064-ifc6410.dtb
	arch/arm/boot/dts/qcom-apq8064-sony-xperia-yuga.dtb
	arch/arm/boot/dts/qcom-mdm9615-wp8548-mangoh-green.dtb
	arch/arm/boot/dts/qcom-msm8960-cdp.dtb

clock-controller@2011000: 'clock-output-names' is a required property
	arch/arm/boot/dts/qcom-apq8064-asus-nexus7-flo.dtb
	arch/arm/boot/dts/qcom-apq8064-cm-qs600.dtb
	arch/arm/boot/dts/qcom-apq8064-ifc6410.dtb
	arch/arm/boot/dts/qcom-apq8064-sony-xperia-yuga.dtb
	arch/arm/boot/dts/qcom-mdm9615-wp8548-mangoh-green.dtb
	arch/arm/boot/dts/qcom-msm8960-cdp.dtb

clock-controller@2011000: 'clocks' is a required property
	arch/arm/boot/dts/qcom-apq8064-asus-nexus7-flo.dtb
	arch/arm/boot/dts/qcom-apq8064-cm-qs600.dtb
	arch/arm/boot/dts/qcom-apq8064-ifc6410.dtb
	arch/arm/boot/dts/qcom-apq8064-sony-xperia-yuga.dtb
	arch/arm/boot/dts/qcom-mdm9615-wp8548-mangoh-green.dtb
	arch/arm/boot/dts/qcom-msm8960-cdp.dtb

clock-controller@2011000: compatible:0: 'qcom,kpss-gcc' is not one of ['qcom,kpss-gcc-ipq8064', 'qcom,kpss-gcc-apq8064', 'qcom,kpss-gcc-msm8974', 'qcom,kpss-gcc-msm8960']
	arch/arm/boot/dts/qcom-apq8064-asus-nexus7-flo.dtb
	arch/arm/boot/dts/qcom-apq8064-cm-qs600.dtb
	arch/arm/boot/dts/qcom-apq8064-ifc6410.dtb
	arch/arm/boot/dts/qcom-apq8064-sony-xperia-yuga.dtb
	arch/arm/boot/dts/qcom-ipq8064-ap148.dtb
	arch/arm/boot/dts/qcom-ipq8064-rb3011.dtb
	arch/arm/boot/dts/qcom-mdm9615-wp8548-mangoh-green.dtb
	arch/arm/boot/dts/qcom-msm8960-cdp.dtb

clock-controller@2011000: compatible:1: 'qcom,kpss-gcc' was expected
	arch/arm/boot/dts/qcom-apq8064-asus-nexus7-flo.dtb
	arch/arm/boot/dts/qcom-apq8064-cm-qs600.dtb
	arch/arm/boot/dts/qcom-apq8064-ifc6410.dtb
	arch/arm/boot/dts/qcom-apq8064-sony-xperia-yuga.dtb
	arch/arm/boot/dts/qcom-ipq8064-ap148.dtb
	arch/arm/boot/dts/qcom-ipq8064-rb3011.dtb
	arch/arm/boot/dts/qcom-mdm9615-wp8548-mangoh-green.dtb
	arch/arm/boot/dts/qcom-msm8960-cdp.dtb

clock-controller@2082000: '#clock-cells' is a required property
	arch/arm/boot/dts/qcom-apq8060-dragonboard.dtb
	arch/arm/boot/dts/qcom-msm8660-surf.dtb

clock-controller@2082000: 'clock-names' is a required property
	arch/arm/boot/dts/qcom-apq8060-dragonboard.dtb
	arch/arm/boot/dts/qcom-msm8660-surf.dtb

clock-controller@2082000: 'clock-output-names' is a required property
	arch/arm/boot/dts/qcom-apq8060-dragonboard.dtb
	arch/arm/boot/dts/qcom-msm8660-surf.dtb

clock-controller@2082000: 'clocks' is a required property
	arch/arm/boot/dts/qcom-apq8060-dragonboard.dtb
	arch/arm/boot/dts/qcom-msm8660-surf.dtb

clock-controller@2082000: compatible:0: 'qcom,kpss-gcc' is not one of ['qcom,kpss-gcc-ipq8064', 'qcom,kpss-gcc-apq8064', 'qcom,kpss-gcc-msm8974', 'qcom,kpss-gcc-msm8960']
	arch/arm/boot/dts/qcom-apq8060-dragonboard.dtb
	arch/arm/boot/dts/qcom-msm8660-surf.dtb

clock-controller@2082000: compatible:1: 'qcom,kpss-gcc' was expected
	arch/arm/boot/dts/qcom-apq8060-dragonboard.dtb
	arch/arm/boot/dts/qcom-msm8660-surf.dtb


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

* Re: [PATCH v2 3/3] dt-bindings: arm: msm: Convert kpss-gcc driver Documentation to yaml
  2022-05-02 20:18           ` Krzysztof Kozlowski
@ 2022-05-02 19:49             ` Ansuel Smith
  0 siblings, 0 replies; 12+ messages in thread
From: Ansuel Smith @ 2022-05-02 19:49 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rob Herring, Krzysztof Kozlowski, Andy Gross, Bjorn Andersson,
	Michael Turquette, Stephen Boyd, devicetree, linux-kernel,
	linux-arm-msm, linux-clk

On Mon, May 02, 2022 at 10:18:31PM +0200, Krzysztof Kozlowski wrote:
> On 02/05/2022 12:40, Ansuel Smith wrote:
> > 
> > The idea is that you put the clk name in 'clock-output-names' and the
> > driver needs to have support for it (and set the clk name based on the
> > name defined in the dts)
> > 
> > This driver doesn't have support for it and is actually hardcoded.
> > So you are right and I should just drop it.
> > 
> > But now another question... Since #clock-cells was added as a
> > requirement for clock-output-names, should I drop also that?
> > 
> > In theory #clock-cells should always be declared for clock providers, is
> > it right to add it in the conversion commit or I should put this change
> > in another commit? (since it's now an addition and now something required
> > to fix a bot warning)
> 
> These are not the best bindings to convert, if you are not into the qcom
> DTS and drivers. :)
>

As I said some times ago main problem of these thing is that they are
ancient and they were not in a good state from the start. So it's hard
to fix this in a sane way. (i'm trying tho so sorry for any mess i'm
making in the process)

> It looks like the bindings were added to match current Linux
> implementation and in this implementation the device is not used in DTS
> as a clock provider (even though it registers a clock) but as a syscon.
> I am not even sure if it is used as a clock provider outside of DTS
> (through using a fixed clock name in some clock consumer).
> 
> Probably this should be made either a proper clock controller or
> something stripped down to the point matching current usage (accepting
> the fact that bindings are incomplete). Anyway your choice should be
> made according to how this device and its driver fit to entire system.
> IOW, it's not a simple binding conversion and you should not just
> convert it to make dtbs_check happy.

I wonder if I should just drop this patch from the series and push it
later in another series as a rework directly (with also the other
relevant changes to fix the current problem we have with all the dts).

The intention of this series was to try to push small changes that could
be merged in a short time.

> 
> Best regards,
> Krzysztof

-- 
	Ansuel

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

* Re: [PATCH v2 3/3] dt-bindings: arm: msm: Convert kpss-gcc driver Documentation to yaml
  2022-05-02 10:40         ` Ansuel Smith
@ 2022-05-02 20:18           ` Krzysztof Kozlowski
  2022-05-02 19:49             ` Ansuel Smith
  0 siblings, 1 reply; 12+ messages in thread
From: Krzysztof Kozlowski @ 2022-05-02 20:18 UTC (permalink / raw)
  To: Ansuel Smith
  Cc: Rob Herring, Krzysztof Kozlowski, Andy Gross, Bjorn Andersson,
	Michael Turquette, Stephen Boyd, devicetree, linux-kernel,
	linux-arm-msm, linux-clk

On 02/05/2022 12:40, Ansuel Smith wrote:
> 
> The idea is that you put the clk name in 'clock-output-names' and the
> driver needs to have support for it (and set the clk name based on the
> name defined in the dts)
> 
> This driver doesn't have support for it and is actually hardcoded.
> So you are right and I should just drop it.
> 
> But now another question... Since #clock-cells was added as a
> requirement for clock-output-names, should I drop also that?
> 
> In theory #clock-cells should always be declared for clock providers, is
> it right to add it in the conversion commit or I should put this change
> in another commit? (since it's now an addition and now something required
> to fix a bot warning)

These are not the best bindings to convert, if you are not into the qcom
DTS and drivers. :)

It looks like the bindings were added to match current Linux
implementation and in this implementation the device is not used in DTS
as a clock provider (even though it registers a clock) but as a syscon.
I am not even sure if it is used as a clock provider outside of DTS
(through using a fixed clock name in some clock consumer).

Probably this should be made either a proper clock controller or
something stripped down to the point matching current usage (accepting
the fact that bindings are incomplete). Anyway your choice should be
made according to how this device and its driver fit to entire system.
IOW, it's not a simple binding conversion and you should not just
convert it to make dtbs_check happy.

Best regards,
Krzysztof

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

* Re: [PATCH v2 3/3] dt-bindings: arm: msm: Convert kpss-gcc driver Documentation to yaml
  2022-04-30  7:42     ` Ansuel Smith
  2022-05-01  8:26       ` Krzysztof Kozlowski
@ 2022-06-27 20:54       ` Bjorn Andersson
  1 sibling, 0 replies; 12+ messages in thread
From: Bjorn Andersson @ 2022-06-27 20:54 UTC (permalink / raw)
  To: Ansuel Smith
  Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	Andy Gross, Michael Turquette, Stephen Boyd, devicetree,
	linux-kernel, linux-arm-msm, linux-clk

On Sat 30 Apr 02:42 CDT 2022, Ansuel Smith wrote:

> On Sat, Apr 30, 2022 at 04:40:54PM +0200, Krzysztof Kozlowski wrote:
> > On 30/04/2022 08:01, Ansuel Smith wrote:
> > > Convert kpss-gcc driver Documentation to yaml.
> > > Add #clock-cells additional binding to required bindings and example
> > > as it's a required binding for clock-output-names.
> > > 
> > > Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
> > 
> > 
> > (...)
> > 
> > > +properties:
> > > +  compatible:
> > > +    items:
> > > +      - enum:
> > > +          - qcom,kpss-gcc-ipq8064
> > > +          - qcom,kpss-gcc-apq8064
> > > +          - qcom,kpss-gcc-msm8974
> > > +          - qcom,kpss-gcc-msm8960
> > > +      - const: qcom,kpss-gcc
> > > +
> > > +  reg:
> > > +    maxItems: 1
> > > +
> > > +  clocks:
> > > +    items:
> > > +      - description: phandle to pll8_vote
> > > +      - description: phandle to pxo_board
> > > +
> > > +  clock-names:
> > > +    items:
> > > +      - const: pll8_vote
> > > +      - const: pxo
> > > +
> > > +  clock-output-names:
> > > +    const: acpu_l2_aux
> > 
> > It does not make sense having a constant output name. What is the
> > meaning this property in such case? The original binding did not enforce it.
> > 
> > 
> > 
> > Best regards,
> > Krzysztof
> 
> Mh. Should I just drop the const and put a description referring to an
> advised name? The driver with the kpss-gcc hardcode the name to
> acpu_l2_aux that's why I thought it was a correct conversion using a
> const but I assume this is another problem of not making a correct 1:1
> conversion and adding fixes on pure conversion.
> Think I should drop it and put a description to it. (and then later fix
> it when I will push the other series with all the tweaks)
> 
> What do you think?
> 

The typical reason for using clock-output-names is that we have some
consumer that finds the clock based on global name lookup. Over time
we've been moving these to use .fw_name or .index based lookup, which
removes this problem.

But I don't see that being the case here. So my suggestion is that you
just drop clock-output-names from the binding, which will solve
Krzysztof's objection.


From there we can review what needs to be done in the Linux driver to
work with the improved binding.

Regards,
Bjorn

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

end of thread, other threads:[~2022-06-27 20:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-30  6:01 [PATCH v2 0/3] Krait Documentation conversion Ansuel Smith
2022-04-30  6:01 ` [PATCH v2 1/3] dt-bindings: clock: Convert qcom,krait-cc to yaml Ansuel Smith
2022-04-30  6:01 ` [PATCH v2 2/3] dt-bindings: arm: msm: Convert kpss-acc driver Documentation " Ansuel Smith
2022-04-30  6:01 ` [PATCH v2 3/3] dt-bindings: arm: msm: Convert kpss-gcc " Ansuel Smith
2022-04-30 14:40   ` Krzysztof Kozlowski
2022-04-30  7:42     ` Ansuel Smith
2022-05-01  8:26       ` Krzysztof Kozlowski
2022-05-02 10:40         ` Ansuel Smith
2022-05-02 20:18           ` Krzysztof Kozlowski
2022-05-02 19:49             ` Ansuel Smith
2022-06-27 20:54       ` Bjorn Andersson
2022-05-02 15:33   ` Rob Herring

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.