diff mbox series

dt-bindings: timer: convert MSM timer to yaml

Message ID 20211224234607.109049-1-david@ixit.cz
State New
Headers show
Series dt-bindings: timer: convert MSM timer to yaml | expand

Commit Message

David Heidelberg Dec. 24, 2021, 11:46 p.m. UTC
Convert Qualcomm MSM Timer to yaml format.

Signed-off-by: David Heidelberg <david@ixit.cz>

---
It has currently issue, that it fights with watchdog/qcom-wdt.yaml
Both bindings and drivers use similar sets of compatibles and qcom-wdt
isn't very strictly defined.

 .../bindings/timer/qcom,msm-timer.txt         | 47 -----------
 .../bindings/timer/qcom,msm-timer.yaml        | 78 +++++++++++++++++++
 2 files changed, 78 insertions(+), 47 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
 create mode 100644 Documentation/devicetree/bindings/timer/qcom,msm-timer.yaml

Comments

Rob Herring (Arm) Dec. 25, 2021, 2:48 p.m. UTC | #1
On Sat, 25 Dec 2021 00:46:06 +0100, David Heidelberg wrote:
> Convert Qualcomm MSM Timer to yaml format.
> 
> Signed-off-by: David Heidelberg <david@ixit.cz>
> 
> ---
> It has currently issue, that it fights with watchdog/qcom-wdt.yaml
> Both bindings and drivers use similar sets of compatibles and qcom-wdt
> isn't very strictly defined.
> 
>  .../bindings/timer/qcom,msm-timer.txt         | 47 -----------
>  .../bindings/timer/qcom,msm-timer.yaml        | 78 +++++++++++++++++++
>  2 files changed, 78 insertions(+), 47 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
>  create mode 100644 Documentation/devicetree/bindings/timer/qcom,msm-timer.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/watchdog/qcom-wdt.example.dt.yaml: watchdog@208a038: $nodename:0: 'watchdog@208a038' does not match '^timer@[a-f0-9]+$'
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/timer/qcom,msm-timer.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/watchdog/qcom-wdt.example.dt.yaml: watchdog@208a038: compatible: 'oneOf' conditional failed, one must be fixed:
	['qcom,kpss-wdt-ipq8064'] is too short
	'qcom,kpss-timer' was expected
	'qcom,kpss-wdt-ipq8064' is not one of ['qcom,kpss-timer', 'qcom,scss-timer']
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/timer/qcom,msm-timer.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/watchdog/qcom-wdt.example.dt.yaml: watchdog@208a038: 'clock-frequency' is a required property
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/timer/qcom,msm-timer.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/watchdog/qcom-wdt.example.dt.yaml: watchdog@208a038: 'timeout-sec' does not match any of the regexes: 'pinctrl-[0-9]+'
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/timer/qcom,msm-timer.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/watchdog/qcom-wdt.example.dt.yaml: watchdog@208a038: 'oneOf' conditional failed, one must be fixed:
	'interrupts' is a required property
	'interrupts-extended' is a required property
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/timer/qcom,msm-timer.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/timer/qcom,msm-timer.example.dt.yaml: timer@200a000: $nodename:0: 'timer@200a000' does not match '^watchdog(@.*|-[0-9a-f])?$'
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/timer/qcom,msm-timer.example.dt.yaml: timer@200a000: compatible: ['qcom,scss-timer', 'qcom,msm-timer'] is too long
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/timer/qcom,msm-timer.example.dt.yaml: timer@200a000: compatible: Additional items are not allowed ('qcom,msm-timer' was unexpected)
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/timer/qcom,msm-timer.example.dt.yaml: timer@200a000: Unevaluated properties are not allowed ('compatible', 'interrupts', 'clock-frequency', 'clock-names', 'cpu-offset' were unexpected)
	From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/watchdog/qcom-wdt.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/timer/qcom,msm-timer.example.dt.yaml: timer@200a000: clock-frequency: 'oneOf' conditional failed, one must be fixed:
	[[19200000], [32768]] is too long
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/timer/qcom,msm-timer.example.dt.yaml: timer@200a000: clock-frequency: 'oneOf' conditional failed, one must be fixed:
		[[19200000], [32768]] is too long
		missing size tag in [[19200000], [32768]]
		[19200000] is too short
		[32768] is too short
	From schema: /usr/local/lib/python3.8/dist-packages/dtschema/schemas/clock/clock.yaml

doc reference errors (make refcheckdocs):

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

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.
Rob Herring (Arm) Dec. 27, 2021, 4:23 p.m. UTC | #2
On Sat, Dec 25, 2021 at 12:46:06AM +0100, David Heidelberg wrote:
> Convert Qualcomm MSM Timer to yaml format.
> 
> Signed-off-by: David Heidelberg <david@ixit.cz>
> 
> ---
> It has currently issue, that it fights with watchdog/qcom-wdt.yaml
> Both bindings and drivers use similar sets of compatibles and qcom-wdt
> isn't very strictly defined.

What a mess... They should be merged most likely.

> 
>  .../bindings/timer/qcom,msm-timer.txt         | 47 -----------
>  .../bindings/timer/qcom,msm-timer.yaml        | 78 +++++++++++++++++++
>  2 files changed, 78 insertions(+), 47 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
>  create mode 100644 Documentation/devicetree/bindings/timer/qcom,msm-timer.yaml
> 
> diff --git a/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt b/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
> deleted file mode 100644
> index 5e10c345548f..000000000000
> --- a/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
> +++ /dev/null
> @@ -1,47 +0,0 @@
> -* MSM Timer
> -
> -Properties:
> -
> -- compatible : Should at least contain "qcom,msm-timer". More specific
> -               properties specify which subsystem the timers are paired with.
> -
> -               "qcom,kpss-timer" - krait subsystem
> -               "qcom,scss-timer" - scorpion subsystem
> -
> -- interrupts : Interrupts for the debug timer, the first general purpose
> -               timer, and optionally a second general purpose timer, and
> -               optionally as well, 2 watchdog interrupts, in that order.
> -
> -- reg : Specifies the base address of the timer registers.
> -
> -- clocks: Reference to the parent clocks, one per output clock. The parents
> -          must appear in the same order as the clock names.
> -
> -- clock-names: The name of the clocks as free-form strings. They should be in
> -               the same order as the clocks.
> -
> -- clock-frequency : The frequency of the debug timer and the general purpose
> -                    timer(s) in Hz in that order.
> -
> -Optional:
> -
> -- cpu-offset : per-cpu offset used when the timer is accessed without the
> -               CPU remapping facilities. The offset is
> -               cpu-offset + (0x10000 * cpu-nr).
> -
> -Example:
> -
> -       timer@200a000 {
> -               compatible = "qcom,scss-timer", "qcom,msm-timer";
> -               interrupts = <1 1 0x301>,
> -                            <1 2 0x301>,
> -                            <1 3 0x301>,
> -                            <1 4 0x301>,
> -                            <1 5 0x301>;
> -               reg = <0x0200a000 0x100>;
> -               clock-frequency = <19200000>,
> -                                 <32768>;
> -               clocks = <&sleep_clk>;
> -               clock-names = "sleep";
> -               cpu-offset = <0x40000>;
> -       };
> diff --git a/Documentation/devicetree/bindings/timer/qcom,msm-timer.yaml b/Documentation/devicetree/bindings/timer/qcom,msm-timer.yaml
> new file mode 100644
> index 000000000000..238eb985d0fb
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/timer/qcom,msm-timer.yaml
> @@ -0,0 +1,78 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/timer/qcom,msm-timer.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Qualcomm MSM Timer
> +
> +maintainers:
> +  - Rob Herring <robh@kernel.org>
> +
> +properties:
> +  $nodename:
> +    pattern: '^timer@[a-f0-9]+$'
> +
> +  compatible:
> +    oneOf:
> +      - items:
> +          - const: qcom,kpss-timer
> +          - enum:
> +              - qcom,kpss-wdt-apq8064
> +              - qcom,kpss-wdt-ipq8064
> +              - qcom,kpss-wdt-msm8960

Wrong order here. qcom,kpss-timer should be after these as it is less 
specific.
> +          - const: qcom,msm-timer

Drop this compatible string. It is unused and pointless.

> +      - items:
> +          - enum:
> +              - qcom,kpss-timer  # Krait subsystem
> +              - qcom,scss-timer  # Scorpion subsystem
> +          - const: qcom,msm-timer
> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    minItems: 1
> +    items:
> +      - description: 1st purpose timer
> +      - description: 2nd general purpose timer
> +      - description: 1st watchdog interrupt
> +      - description: 2nd watchdog interrupt
> +      - description: 3nd watchdog interrupt
> +
> +  clocks: true

You must define how many.

> +
> +  clock-names: true
> +
> +  clock-frequency: true
> +
> +  cpu-offset:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description: >
> +      Per-cpu offset used when the timer is accessed without the
> +      CPU remapping facilities. The offset is cpu-offset + (0x10000 * cpu-nr).
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clock-frequency
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    timer@200a000 {
> +        compatible = "qcom,scss-timer", "qcom,msm-timer";
> +        interrupts = <1 1 0x301>,
> +                     <1 2 0x301>,
> +                     <1 3 0x301>,
> +                     <1 4 0x301>,
> +                     <1 5 0x301>;
> +        reg = <0x0200a000 0x100>;
> +        clock-frequency = <19200000>,
> +                          <32768>;
> +        clocks = <&sleep_clk>;
> +        clock-names = "sleep";
> +        cpu-offset = <0x40000>;
> +    };
> -- 
> 2.34.1
> 
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt b/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
deleted file mode 100644
index 5e10c345548f..000000000000
--- a/Documentation/devicetree/bindings/timer/qcom,msm-timer.txt
+++ /dev/null
@@ -1,47 +0,0 @@ 
-* MSM Timer
-
-Properties:
-
-- compatible : Should at least contain "qcom,msm-timer". More specific
-               properties specify which subsystem the timers are paired with.
-
-               "qcom,kpss-timer" - krait subsystem
-               "qcom,scss-timer" - scorpion subsystem
-
-- interrupts : Interrupts for the debug timer, the first general purpose
-               timer, and optionally a second general purpose timer, and
-               optionally as well, 2 watchdog interrupts, in that order.
-
-- reg : Specifies the base address of the timer registers.
-
-- clocks: Reference to the parent clocks, one per output clock. The parents
-          must appear in the same order as the clock names.
-
-- clock-names: The name of the clocks as free-form strings. They should be in
-               the same order as the clocks.
-
-- clock-frequency : The frequency of the debug timer and the general purpose
-                    timer(s) in Hz in that order.
-
-Optional:
-
-- cpu-offset : per-cpu offset used when the timer is accessed without the
-               CPU remapping facilities. The offset is
-               cpu-offset + (0x10000 * cpu-nr).
-
-Example:
-
-       timer@200a000 {
-               compatible = "qcom,scss-timer", "qcom,msm-timer";
-               interrupts = <1 1 0x301>,
-                            <1 2 0x301>,
-                            <1 3 0x301>,
-                            <1 4 0x301>,
-                            <1 5 0x301>;
-               reg = <0x0200a000 0x100>;
-               clock-frequency = <19200000>,
-                                 <32768>;
-               clocks = <&sleep_clk>;
-               clock-names = "sleep";
-               cpu-offset = <0x40000>;
-       };
diff --git a/Documentation/devicetree/bindings/timer/qcom,msm-timer.yaml b/Documentation/devicetree/bindings/timer/qcom,msm-timer.yaml
new file mode 100644
index 000000000000..238eb985d0fb
--- /dev/null
+++ b/Documentation/devicetree/bindings/timer/qcom,msm-timer.yaml
@@ -0,0 +1,78 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/timer/qcom,msm-timer.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm MSM Timer
+
+maintainers:
+  - Rob Herring <robh@kernel.org>
+
+properties:
+  $nodename:
+    pattern: '^timer@[a-f0-9]+$'
+
+  compatible:
+    oneOf:
+      - items:
+          - const: qcom,kpss-timer
+          - enum:
+              - qcom,kpss-wdt-apq8064
+              - qcom,kpss-wdt-ipq8064
+              - qcom,kpss-wdt-msm8960
+          - const: qcom,msm-timer
+      - items:
+          - enum:
+              - qcom,kpss-timer  # Krait subsystem
+              - qcom,scss-timer  # Scorpion subsystem
+          - const: qcom,msm-timer
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    minItems: 1
+    items:
+      - description: 1st purpose timer
+      - description: 2nd general purpose timer
+      - description: 1st watchdog interrupt
+      - description: 2nd watchdog interrupt
+      - description: 3nd watchdog interrupt
+
+  clocks: true
+
+  clock-names: true
+
+  clock-frequency: true
+
+  cpu-offset:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: >
+      Per-cpu offset used when the timer is accessed without the
+      CPU remapping facilities. The offset is cpu-offset + (0x10000 * cpu-nr).
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clock-frequency
+
+additionalProperties: false
+
+examples:
+  - |
+    timer@200a000 {
+        compatible = "qcom,scss-timer", "qcom,msm-timer";
+        interrupts = <1 1 0x301>,
+                     <1 2 0x301>,
+                     <1 3 0x301>,
+                     <1 4 0x301>,
+                     <1 5 0x301>;
+        reg = <0x0200a000 0x100>;
+        clock-frequency = <19200000>,
+                          <32768>;
+        clocks = <&sleep_clk>;
+        clock-names = "sleep";
+        cpu-offset = <0x40000>;
+    };