diff mbox series

[1/4] dt-bindings: reset: add schema for imx8ulp SIM reset

Message ID 20240516204031.171920-2-laurentiumihalcea111@gmail.com (mailing list archive)
State Superseded
Headers show
Series Add support for imx8ulp's SIM | expand

Commit Message

Laurentiu Mihalcea May 16, 2024, 8:40 p.m. UTC
From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>

Add schema for imx8ulp's SIM reset controller.

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

Comments

Rob Herring (Arm) May 16, 2024, 9:22 p.m. UTC | #1
On Thu, 16 May 2024 23:40:28 +0300, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> 
> Add schema for imx8ulp's SIM reset controller.
> 
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
>  .../bindings/reset/nxp,imx8ulp-sim-reset.yaml | 43 +++++++++++++++++++
>  1 file changed, 43 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/reset/nxp,imx8ulp-sim-reset.yaml
> 

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

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/reset/nxp,imx8ulp-sim-reset.example.dtb: /example-0/syscon@2da50000: failed to match any schema with compatible: ['nxp,imx8ulp-avd-sim', 'syscon']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240516204031.171920-2-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.
Rob Herring (Arm) May 17, 2024, 7:59 p.m. UTC | #2
On Thu, May 16, 2024 at 11:40:28PM +0300, Laurentiu Mihalcea wrote:
> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> 
> Add schema for imx8ulp's SIM reset controller.
> 
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
> ---
>  .../bindings/reset/nxp,imx8ulp-sim-reset.yaml | 43 +++++++++++++++++++
>  1 file changed, 43 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/reset/nxp,imx8ulp-sim-reset.yaml
> 
> diff --git a/Documentation/devicetree/bindings/reset/nxp,imx8ulp-sim-reset.yaml b/Documentation/devicetree/bindings/reset/nxp,imx8ulp-sim-reset.yaml
> new file mode 100644
> index 000000000000..ec9a5c73e83c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/reset/nxp,imx8ulp-sim-reset.yaml
> @@ -0,0 +1,43 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/reset/nxp,imx8ulp-sim-reset.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NXP i.MX8ULP System Integration Module Reset Controller
> +
> +maintainers:
> +  - Liu Ying <victor.liu@nxp.com>
> +
> +description: |
> +  Some instances of i.MX8ULP's SIM may offer control over the
> +  reset of some components of a certain domain (e.g: AVD-SIM).
> +  As far as the DT is concerned, this means that the reset
> +  controller needs to be a child of the SIM node.
> +
> +properties:
> +  compatible:
> +    const: nxp,imx8ulp-avd-sim-reset
> +
> +  '#reset-cells':
> +    const: 1
> +
> +required:
> +  - compatible
> +  - '#reset-cells'
> +
> +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>;
> +
> +      reset-controller {
> +        compatible = "nxp,imx8ulp-avd-sim-reset";
> +        #reset-cells = <1>;
> +      };
> +    };

Why do you need a child node here? No DT resources or anything for this 
'sub-block'. Just put "#reset-cells" in the parent node.

(Note that examples for MFDs like this go in the MFD binding rather than 
having incomplete examples here.)

Rob
Laurentiu Mihalcea May 22, 2024, 6:43 p.m. UTC | #3
On 5/17/2024 10:59 PM, Rob Herring wrote:
> On Thu, May 16, 2024 at 11:40:28PM +0300, Laurentiu Mihalcea wrote:
>> From: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>>
>> Add schema for imx8ulp's SIM reset controller.
>>
>> Signed-off-by: Liu Ying <victor.liu@nxp.com>
>> Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
>> ---
>>  .../bindings/reset/nxp,imx8ulp-sim-reset.yaml | 43 +++++++++++++++++++
>>  1 file changed, 43 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/reset/nxp,imx8ulp-sim-reset.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/reset/nxp,imx8ulp-sim-reset.yaml b/Documentation/devicetree/bindings/reset/nxp,imx8ulp-sim-reset.yaml
>> new file mode 100644
>> index 000000000000..ec9a5c73e83c
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/reset/nxp,imx8ulp-sim-reset.yaml
>> @@ -0,0 +1,43 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/reset/nxp,imx8ulp-sim-reset.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: NXP i.MX8ULP System Integration Module Reset Controller
>> +
>> +maintainers:
>> +  - Liu Ying <victor.liu@nxp.com>
>> +
>> +description: |
>> +  Some instances of i.MX8ULP's SIM may offer control over the
>> +  reset of some components of a certain domain (e.g: AVD-SIM).
>> +  As far as the DT is concerned, this means that the reset
>> +  controller needs to be a child of the SIM node.
>> +
>> +properties:
>> +  compatible:
>> +    const: nxp,imx8ulp-avd-sim-reset
>> +
>> +  '#reset-cells':
>> +    const: 1
>> +
>> +required:
>> +  - compatible
>> +  - '#reset-cells'
>> +
>> +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>;
>> +
>> +      reset-controller {
>> +        compatible = "nxp,imx8ulp-avd-sim-reset";
>> +        #reset-cells = <1>;
>> +      };
>> +    };
> Why do you need a child node here? No DT resources or anything for this 
> 'sub-block'. Just put "#reset-cells" in the parent node.
You're right, we don't need the child here. In fact, the reset controller will never
get probed anyways since "simple-mfd" was removed from the compatible
list of the parent. Will remove it and turn the parent into a syscon + reset controller
in V2.
>
> (Note that examples for MFDs like this go in the MFD binding rather than 
> having incomplete examples here.)
>
> Rob
Noted, thank you!
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/reset/nxp,imx8ulp-sim-reset.yaml b/Documentation/devicetree/bindings/reset/nxp,imx8ulp-sim-reset.yaml
new file mode 100644
index 000000000000..ec9a5c73e83c
--- /dev/null
+++ b/Documentation/devicetree/bindings/reset/nxp,imx8ulp-sim-reset.yaml
@@ -0,0 +1,43 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/reset/nxp,imx8ulp-sim-reset.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP i.MX8ULP System Integration Module Reset Controller
+
+maintainers:
+  - Liu Ying <victor.liu@nxp.com>
+
+description: |
+  Some instances of i.MX8ULP's SIM may offer control over the
+  reset of some components of a certain domain (e.g: AVD-SIM).
+  As far as the DT is concerned, this means that the reset
+  controller needs to be a child of the SIM node.
+
+properties:
+  compatible:
+    const: nxp,imx8ulp-avd-sim-reset
+
+  '#reset-cells':
+    const: 1
+
+required:
+  - compatible
+  - '#reset-cells'
+
+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>;
+
+      reset-controller {
+        compatible = "nxp,imx8ulp-avd-sim-reset";
+        #reset-cells = <1>;
+      };
+    };