[PATCH 3/4] dt-bindings: mfd: add schema for 8ulp's SIM

Laurentiu Mihalcea posted 4 patches 1 year, 9 months ago
There is a newer version of this series
[PATCH 3/4] dt-bindings: mfd: add schema for 8ulp's SIM
Posted by Laurentiu Mihalcea 1 year, 9 months ago
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

Add schema for i.MX8ULP's SIM.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
---
 .../bindings/mfd/nxp,imx8ulp-sim.yaml         | 71 +++++++++++++++++++
 1 file changed, 71 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/nxp,imx8ulp-sim.yaml

diff --git a/Documentation/devicetree/bindings/mfd/nxp,imx8ulp-sim.yaml b/Documentation/devicetree/bindings/mfd/nxp,imx8ulp-sim.yaml
new file mode 100644
index 000000000000..fbb17c06e3c0
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/nxp,imx8ulp-sim.yaml
@@ -0,0 +1,71 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/nxp,imx8ulp-sim.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP i.MX8ULP System Integration Module
+
+maintainers:
+  - Liu Ying <victor.liu@nxp.com>
+
+description: |
+  8ULP's SIM provides control and configuration options for
+  some of the chip's components.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - nxp,imx8ulp-avd-sim
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  mux-controller:
+    $ref: ../mux/reg-mux.yaml
+
+  reset-controller:
+    $ref: ../reset/nxp,imx8ulp-sim-reset.yaml
+
+required:
+  - compatible
+  - reg
+  - clocks
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: nxp,imx8ulp-avd-sim
+    then:
+      required:
+        - reset-controller
+        - mux-controller
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/imx8ulp-clock.h>
+    syscon@2da50000 {
+      compatible = "nxp,imx8ulp-avd-sim", "syscon";
+      reg = <0x2da50000 0x38>;
+      clocks = <&pcc5 IMX8ULP_CLK_AVD_SIM>;
+
+      mux-controller {
+        compatible = "mmio-mux";
+        #mux-control-cells = <1>;
+        mux-reg-masks = <0x8 0x00000200>;
+      };
+
+      reset-controller {
+        compatible = "nxp,imx8ulp-avd-sim-reset";
+        #reset-cells = <1>;
+      };
+    };
-- 
2.34.1
Re: [PATCH 3/4] dt-bindings: mfd: add schema for 8ulp's SIM
Posted by Frank Li 1 year, 8 months ago
On Thu, May 16, 2024 at 11:40:30PM +0300, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> 
> Add schema for i.MX8ULP's SIM.
> 
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
>  .../bindings/mfd/nxp,imx8ulp-sim.yaml         | 71 +++++++++++++++++++
>  1 file changed, 71 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/nxp,imx8ulp-sim.yaml
> 
> diff --git a/Documentation/devicetree/bindings/mfd/nxp,imx8ulp-sim.yaml b/Documentation/devicetree/bindings/mfd/nxp,imx8ulp-sim.yaml
> new file mode 100644
> index 000000000000..fbb17c06e3c0
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/nxp,imx8ulp-sim.yaml
> @@ -0,0 +1,71 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/mfd/nxp,imx8ulp-sim.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP i.MX8ULP System Integration Module
> +
> +maintainers:
> +  - Liu Ying <victor.liu@nxp.com>
> +
> +description: |

Needn't "|"

> +  8ULP's SIM provides control and configuration options for
> +  some of the chip's components.
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - nxp,imx8ulp-avd-sim
> +      - const: syscon
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  mux-controller:
> +    $ref: ../mux/reg-mux.yaml
> +
> +  reset-controller:
> +    $ref: ../reset/nxp,imx8ulp-sim-reset.yaml

I think we directly use reset-ti-syscon.c 

> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: nxp,imx8ulp-avd-sim
> +    then:
> +      required:
> +        - reset-controller
> +        - mux-controller
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/clock/imx8ulp-clock.h>
> +    syscon@2da50000 {
> +      compatible = "nxp,imx8ulp-avd-sim", "syscon";
> +      reg = <0x2da50000 0x38>;
> +      clocks = <&pcc5 IMX8ULP_CLK_AVD_SIM>;
> +
> +      mux-controller {
> +        compatible = "mmio-mux";
> +        #mux-control-cells = <1>;
> +        mux-reg-masks = <0x8 0x00000200>;
> +      };
> +
> +      reset-controller {
> +        compatible = "nxp,imx8ulp-avd-sim-reset";
> +        #reset-cells = <1>;
> +      };
> +    };
> -- 
> 2.34.1
>
Re: [PATCH 3/4] dt-bindings: mfd: add schema for 8ulp's SIM
Posted by Rob Herring (Arm) 1 year, 9 months ago
On Thu, 16 May 2024 23:40:30 +0300, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> 
> Add schema for i.MX8ULP's SIM.
> 
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
>  .../bindings/mfd/nxp,imx8ulp-sim.yaml         | 71 +++++++++++++++++++
>  1 file changed, 71 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/nxp,imx8ulp-sim.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/reset/nxp,imx8ulp-sim-reset.example.dtb: syscon@2da50000: 'mux-controller' is a required property
	from schema $id: http://devicetree.org/schemas/mfd/nxp,imx8ulp-sim.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240516204031.171920-4-laurentiumihalcea111@gmail.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.