[RFC PATCH v3 10/37] dt-bindings: kalray: Add CPU bindings for Kalray kvx

ysionneau@kalrayinc.com posted 37 patches 1 year, 1 month ago
[RFC PATCH v3 10/37] dt-bindings: kalray: Add CPU bindings for Kalray kvx
Posted by ysionneau@kalrayinc.com 1 year, 1 month ago
From: Yann Sionneau <ysionneau@kalrayinc.com>

Add Kalray kvx CPU bindings.

Signed-off-by: Yann Sionneau <ysionneau@kalrayinc.com>
---

Notes:

V2 -> V3: New patch
---
 .../devicetree/bindings/kalray/cpus.yaml      | 105 ++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/kalray/cpus.yaml

diff --git a/Documentation/devicetree/bindings/kalray/cpus.yaml b/Documentation/devicetree/bindings/kalray/cpus.yaml
new file mode 100644
index 0000000000000..cdf1f10573da7
--- /dev/null
+++ b/Documentation/devicetree/bindings/kalray/cpus.yaml
@@ -0,0 +1,105 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/kalray/cpus.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Kalray CPUs
+
+maintainers:
+  - Jonathan Borne <jborne@kalrayinc.com>
+  - Julian Vetter <jvetter@kalrayinc.com>
+  - Yann Sionneau <ysionneau@kalrayinc.com>
+
+allOf:
+  - $ref: /schemas/cpu.yaml#
+
+properties:
+  reg:
+    maxItems: 1
+    description: |
+      Contains the CPU number.
+
+  compatible:
+    oneOf:
+      - items:
+          - const: kalray,kv3-1-pe
+          - const: kalray,kv3-pe
+
+  clocks:
+    maxItems: 1
+
+  enable-method:
+    const: "kalray,coolidge-pwr-ctrl"
+
+  interrupt-controller:
+    type: object
+    additionalProperties: false
+    description: Describes the CPU's local interrupt controller
+
+    properties:
+      '#interrupt-cells':
+        const: 1
+
+      compatible:
+        const: kalray,kv3-1-intc
+
+      interrupt-controller: true
+
+      '#address-cells':
+        const: 0
+
+    required:
+      - compatible
+      - '#interrupt-cells'
+      - '#address-cells'
+      - interrupt-controller
+
+if:
+  properties:
+    reg:
+      const: 0
+then:
+  required:
+    - clocks
+
+required:
+  - reg
+  - compatible
+  - interrupt-controller
+
+unevaluatedProperties: false
+
+examples:
+  - |
+
+    cpus {
+        #size-cells = <0>;
+        #address-cells = <1>;
+
+       cpu@0 {
+         compatible = "kalray,kv3-1-pe";
+         device_type = "cpu";
+         reg = <0>;
+         clocks = <&core_clk>;
+         cpu_intc0: interrupt-controller {
+           compatible = "kalray,kv3-1-intc";
+           #interrupt-cells = <1>;
+           #address-cells = <0>;
+           interrupt-controller;
+         };
+       };
+
+
+       cpu@1 {
+         compatible = "kalray,kv3-1-pe";
+         device_type = "cpu";
+         reg = <1>;
+         cpu_intc1: interrupt-controller {
+           compatible = "kalray,kv3-1-intc";
+           #interrupt-cells = <1>;
+           #address-cells = <0>;
+           interrupt-controller;
+         };
+       };
+    };
-- 
2.45.2
Re: [RFC PATCH v3 10/37] dt-bindings: kalray: Add CPU bindings for Kalray kvx
Posted by Rob Herring 1 year, 1 month ago
On Mon, Jul 22, 2024 at 11:41:21AM +0200, ysionneau@kalrayinc.com wrote:
> From: Yann Sionneau <ysionneau@kalrayinc.com>
> 
> Add Kalray kvx CPU bindings.
> 
> Signed-off-by: Yann Sionneau <ysionneau@kalrayinc.com>
> ---
> 
> Notes:
> 
> V2 -> V3: New patch
> ---
>  .../devicetree/bindings/kalray/cpus.yaml      | 105 ++++++++++++++++++
>  1 file changed, 105 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/kalray/cpus.yaml
> 
> diff --git a/Documentation/devicetree/bindings/kalray/cpus.yaml b/Documentation/devicetree/bindings/kalray/cpus.yaml
> new file mode 100644
> index 0000000000000..cdf1f10573da7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/kalray/cpus.yaml
> @@ -0,0 +1,105 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/kalray/cpus.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Kalray CPUs
> +
> +maintainers:
> +  - Jonathan Borne <jborne@kalrayinc.com>
> +  - Julian Vetter <jvetter@kalrayinc.com>
> +  - Yann Sionneau <ysionneau@kalrayinc.com>
> +
> +allOf:
> +  - $ref: /schemas/cpu.yaml#
> +
> +properties:
> +  reg:
> +    maxItems: 1
> +    description: |

Don't need '|' if no formatting.

> +      Contains the CPU number.

Ideally this is tied to something in the h/w and not just made up. If 
so, detail that here.

> +
> +  compatible:
> +    oneOf:
> +      - items:
> +          - const: kalray,kv3-1-pe
> +          - const: kalray,kv3-pe

What's the difference between these 2?

> +
> +  clocks:
> +    maxItems: 1
> +
> +  enable-method:
> +    const: "kalray,coolidge-pwr-ctrl"

Why is this needed if there's only 1 possible option?

It doesn't need quotes either.

> +
> +  interrupt-controller:
> +    type: object
> +    additionalProperties: false
> +    description: Describes the CPU's local interrupt controller
> +
> +    properties:
> +      '#interrupt-cells':
> +        const: 1
> +
> +      compatible:
> +        const: kalray,kv3-1-intc
> +
> +      interrupt-controller: true
> +
> +      '#address-cells':
> +        const: 0
> +
> +    required:
> +      - compatible
> +      - '#interrupt-cells'
> +      - '#address-cells'
> +      - interrupt-controller
> +
> +if:
> +  properties:
> +    reg:
> +      const: 0
> +then:
> +  required:
> +    - clocks
> +
> +required:
> +  - reg
> +  - compatible
> +  - interrupt-controller
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +
> +    cpus {
> +        #size-cells = <0>;
> +        #address-cells = <1>;
> +
> +       cpu@0 {
> +         compatible = "kalray,kv3-1-pe";
> +         device_type = "cpu";
> +         reg = <0>;
> +         clocks = <&core_clk>;
> +         cpu_intc0: interrupt-controller {
> +           compatible = "kalray,kv3-1-intc";
> +           #interrupt-cells = <1>;
> +           #address-cells = <0>;
> +           interrupt-controller;
> +         };
> +       };
> +
> +

One blank line.

> +       cpu@1 {
> +         compatible = "kalray,kv3-1-pe";
> +         device_type = "cpu";
> +         reg = <1>;
> +         cpu_intc1: interrupt-controller {
> +           compatible = "kalray,kv3-1-intc";
> +           #interrupt-cells = <1>;
> +           #address-cells = <0>;
> +           interrupt-controller;
> +         };
> +       };
> +    };
> -- 
> 2.45.2
> 
> 
> 
> 
>
Re: [RFC PATCH v3 10/37] dt-bindings: kalray: Add CPU bindings for Kalray kvx
Posted by Rob Herring (Arm) 1 year, 1 month ago
On Mon, 22 Jul 2024 11:41:21 +0200, ysionneau@kalrayinc.com wrote:
> From: Yann Sionneau <ysionneau@kalrayinc.com>
> 
> Add Kalray kvx CPU bindings.
> 
> Signed-off-by: Yann Sionneau <ysionneau@kalrayinc.com>
> ---
> 
> Notes:
> 
> V2 -> V3: New patch
> ---
>  .../devicetree/bindings/kalray/cpus.yaml      | 105 ++++++++++++++++++
>  1 file changed, 105 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/kalray/cpus.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/kalray/cpus.example.dtb: cpu@0: compatible: ['kalray,kv3-1-pe'] is too short
	from schema $id: http://devicetree.org/schemas/kalray/cpus.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/kalray/cpus.example.dtb: cpu@1: compatible: ['kalray,kv3-1-pe'] is too short
	from schema $id: http://devicetree.org/schemas/kalray/cpus.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240722094226.21602-11-ysionneau@kalrayinc.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

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 after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.