diff mbox series

[v3,2/4] dt-bindings: arm: msm: Convert kpss-acc driver Documentation to yaml

Message ID 20220628184137.21678-3-ansuelsmth@gmail.com (mailing list archive)
State Superseded
Headers show
Series Krait Documentation conversion | expand

Commit Message

Christian Marangi June 28, 2022, 6:41 p.m. UTC
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: Christian Marangi <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

Comments

Rob Herring June 29, 2022, 2:09 a.m. UTC | #1
On Tue, 28 Jun 2022 20:41:35 +0200, Christian Marangi wrote:
> 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: Christian Marangi <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
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.yaml: allOf:0: 'then' is a dependency of 'if'
	hint: Keywords must be a subset of known json-schema keywords
	from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.yaml: allOf:0: 'then' is a dependency of 'else'
	hint: Keywords must be a subset of known json-schema keywords
	from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.yaml: allOf:0:if: 'if' is a dependency of 'then'
	hint: Keywords must be a subset of known json-schema keywords
	from schema $id: http://devicetree.org/meta-schemas/keywords.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml: patternProperties:^thermistor@:properties:adi,excitation-current-nanoamp: '$ref' should not be valid under {'const': '$ref'}
	hint: Standard unit suffix properties don't need a type $ref
	from schema $id: http://devicetree.org/meta-schemas/core.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.yaml: ignoring, error in schema: allOf: 0
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml: ignoring, error in schema: patternProperties: ^thermistor@: properties: adi,excitation-current-nanoamp
Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.example.dtb:0:0: /example-0/spi/ltc2983@0: failed to match any schema with compatible: ['adi,ltc2983']
Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.example.dtb:0:0: /example-0/clock-controller@2088000: failed to match any schema with compatible: ['qcom,kpss-acc-v1']
Documentation/devicetree/bindings/arm/msm/qcom,kpss-acc.example.dtb:0:0: /example-1/clock-controller@f9088000: failed to match any schema with compatible: ['qcom,kpss-acc-v2']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Krzysztof Kozlowski June 29, 2022, 6:14 a.m. UTC | #2
On 28/06/2022 20:41, Christian Marangi wrote:
> 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: Christian Marangi <ansuelsmth@gmail.com>
> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

This is still not fixed and not tested. Since 4 versions of this
patchset (previously was part of other set).

I retract my review. Please test the bindings.

Best regards,
Krzysztof
Christian Marangi June 29, 2022, 10:40 a.m. UTC | #3
On Wed, Jun 29, 2022 at 08:14:12AM +0200, Krzysztof Kozlowski wrote:
> On 28/06/2022 20:41, Christian Marangi wrote:
> > 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: Christian Marangi <ansuelsmth@gmail.com>
> > Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
> 
> This is still not fixed and not tested. Since 4 versions of this
> patchset (previously was part of other set).
> 
> I retract my review. Please test the bindings.
> 
> Best regards,
> Krzysztof

Thing is that I tested them and on my side I don't have such errors.

I'm using the linux-next branch. Should I use something else that have
newer schema files?

Also on other patch there are some error reported that are unrelated to
my change and that looks strange.
Krzysztof Kozlowski June 29, 2022, 11:12 a.m. UTC | #4
On 29/06/2022 12:40, Christian Marangi wrote:
> On Wed, Jun 29, 2022 at 08:14:12AM +0200, Krzysztof Kozlowski wrote:
>> On 28/06/2022 20:41, Christian Marangi wrote:
>>> 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: Christian Marangi <ansuelsmth@gmail.com>
>>> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
>>
>> This is still not fixed and not tested. Since 4 versions of this
>> patchset (previously was part of other set).
>>
>> I retract my review. Please test the bindings.
>>
>> Best regards,
>> Krzysztof
> 
> Thing is that I tested them and on my side I don't have such errors.

Then maybe update your dtschema because I can easily see them.

> 
> I'm using the linux-next branch. Should I use something else that have
> newer schema files?
> 
> Also on other patch there are some error reported that are unrelated to
> my change and that looks strange.

The other might be not be relevant, but this one is real and reproducible.

Best regards,
Krzysztof
Christian Marangi June 29, 2022, noon UTC | #5
On Wed, Jun 29, 2022 at 01:12:37PM +0200, Krzysztof Kozlowski wrote:
> On 29/06/2022 12:40, Christian Marangi wrote:
> > On Wed, Jun 29, 2022 at 08:14:12AM +0200, Krzysztof Kozlowski wrote:
> >> On 28/06/2022 20:41, Christian Marangi wrote:
> >>> 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: Christian Marangi <ansuelsmth@gmail.com>
> >>> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
> >>
> >> This is still not fixed and not tested. Since 4 versions of this
> >> patchset (previously was part of other set).
> >>
> >> I retract my review. Please test the bindings.
> >>
> >> Best regards,
> >> Krzysztof
> > 
> > Thing is that I tested them and on my side I don't have such errors.
> 
> Then maybe update your dtschema because I can easily see them.
>

You are totally right. I didn't had the problem as I was updating the
dtschema with sudo pip3... and it wasn't updating the dtschema local to
the linux repo. Didn't know that and I could't understand why I didn't
had the error.

> > 
> > I'm using the linux-next branch. Should I use something else that have
> > newer schema files?
> > 
> > Also on other patch there are some error reported that are unrelated to
> > my change and that looks strange.
> 
> The other might be not be relevant, but this one is real and reproducible.
> 
> Best regards,
> Krzysztof
diff mbox series

Patch

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..3e7de44e7c74
--- /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:
+  - Christian Marangi <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>;
+    };
+...