2024-03-01 17:48:49

by Animesh Agarwal

[permalink] [raw]
Subject: [PATCH] dt-bindings: imx-pata: Convert to dtschema

Convert the imx-pata bindings to DT schema.

Signed-off-by: Animesh Agarwal <[email protected]>
---
.../devicetree/bindings/ata/imx-pata.txt | 16 ---------
.../devicetree/bindings/ata/imx-pata.yaml | 34 +++++++++++++++++++
2 files changed, 34 insertions(+), 16 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/ata/imx-pata.txt
create mode 100644 Documentation/devicetree/bindings/ata/imx-pata.yaml

diff --git a/Documentation/devicetree/bindings/ata/imx-pata.txt b/Documentation/devicetree/bindings/ata/imx-pata.txt
deleted file mode 100644
index f1172f00188a..000000000000
--- a/Documentation/devicetree/bindings/ata/imx-pata.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-* Freescale i.MX PATA Controller
-
-Required properties:
-- compatible: "fsl,imx27-pata"
-- reg: Address range of the PATA Controller
-- interrupts: The interrupt of the PATA Controller
-- clocks: the clocks for the PATA Controller
-
-Example:
-
- pata: pata@83fe0000 {
- compatible = "fsl,imx51-pata", "fsl,imx27-pata";
- reg = <0x83fe0000 0x4000>;
- interrupts = <70>;
- clocks = <&clks 161>;
- };
diff --git a/Documentation/devicetree/bindings/ata/imx-pata.yaml b/Documentation/devicetree/bindings/ata/imx-pata.yaml
new file mode 100644
index 000000000000..78a562587fb5
--- /dev/null
+++ b/Documentation/devicetree/bindings/ata/imx-pata.yaml
@@ -0,0 +1,34 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/ata/imx-pata.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX PATA Controller
+
+maintainers:
+ - Animesh Agarwal <[email protected]>
+
+properties:
+ compatible:
+ enum:
+ - fsl,imx27
+ reg:
+ maxItems: 1
+ interrupts:
+ items:
+ - description: PATA Controller interrupts
+ clocks:
+ items:
+ - description: PATA Controller clocks
+
+additionalProperties: false
+
+examples:
+ - |
+ pata: pata@83fe0000 {
+ compatible = "fsl,imx51-pata", "fsl,imx27-pata";
+ reg = <0x83fe0000 0x4000>;
+ interrupts = <70>;
+ clocks = <&clks 161>;
+ };
--
2.44.0



2024-03-01 19:30:58

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: imx-pata: Convert to dtschema


On Fri, 01 Mar 2024 23:17:21 +0530, Animesh Agarwal wrote:
> Convert the imx-pata bindings to DT schema.
>
> Signed-off-by: Animesh Agarwal <[email protected]>
> ---
> .../devicetree/bindings/ata/imx-pata.txt | 16 ---------
> .../devicetree/bindings/ata/imx-pata.yaml | 34 +++++++++++++++++++
> 2 files changed, 34 insertions(+), 16 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/ata/imx-pata.txt
> create mode 100644 Documentation/devicetree/bindings/ata/imx-pata.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:
Documentation/devicetree/bindings/ata/imx-pata.example.dtb: /example-0/pata@83fe0000: failed to match any schema with compatible: ['fsl,imx51-pata', 'fsl,imx27-pata']
Documentation/devicetree/bindings/ata/imx-pata.example.dtb: /example-0/pata@83fe0000: failed to match any schema with compatible: ['fsl,imx51-pata', 'fsl,imx27-pata']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

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.


2024-03-01 20:10:15

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH] dt-bindings: imx-pata: Convert to dtschema

On 01/03/2024 18:47, Animesh Agarwal wrote:
> Convert the imx-pata bindings to DT schema.

It does not look like you tested the bindings, at least after quick
look. Please run `make dt_binding_check` (see
Documentation/devicetree/bindings/writing-schema.rst for instructions).
Maybe you need to update your dtschema and yamllint.

>
> Signed-off-by: Animesh Agarwal <[email protected]>
> ---
> .../devicetree/bindings/ata/imx-pata.txt | 16 ---------
> .../devicetree/bindings/ata/imx-pata.yaml | 34 +++++++++++++++++++

Filename like compatible, so fsl,imx27-pata.yaml

> 2 files changed, 34 insertions(+), 16 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/ata/imx-pata.txt
> create mode 100644 Documentation/devicetree/bindings/ata/imx-pata.yaml
>
> diff --git a/Documentation/devicetree/bindings/ata/imx-pata.txt b/Documentation/devicetree/bindings/ata/imx-pata.txt
> deleted file mode 100644
> index f1172f00188a..000000000000
> --- a/Documentation/devicetree/bindings/ata/imx-pata.txt
> +++ /dev/null
> @@ -1,16 +0,0 @@
> -* Freescale i.MX PATA Controller
> -
> -Required properties:
> -- compatible: "fsl,imx27-pata"
> -- reg: Address range of the PATA Controller
> -- interrupts: The interrupt of the PATA Controller
> -- clocks: the clocks for the PATA Controller
> -
> -Example:
> -
> - pata: pata@83fe0000 {
> - compatible = "fsl,imx51-pata", "fsl,imx27-pata";
> - reg = <0x83fe0000 0x4000>;
> - interrupts = <70>;
> - clocks = <&clks 161>;
> - };
> diff --git a/Documentation/devicetree/bindings/ata/imx-pata.yaml b/Documentation/devicetree/bindings/ata/imx-pata.yaml
> new file mode 100644
> index 000000000000..78a562587fb5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/ata/imx-pata.yaml
> @@ -0,0 +1,34 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/ata/imx-pata.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale i.MX PATA Controller
> +
> +maintainers:
> + - Animesh Agarwal <[email protected]>
> +
> +properties:
> + compatible:
> + enum:
> + - fsl,imx27

What are you documenting here?

> + reg:
> + maxItems: 1

Blank line

> + interrupts:
> + items:
> + - description: PATA Controller interrupts

Blank line... just open example-schema or any other recent bindings
which were reviewed. Don't create entirely different style, but learn
from recent code.

> + clocks:
> + items:
> + - description: PATA Controller clocks
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + pata: pata@83fe0000 {
> + compatible = "fsl,imx51-pata", "fsl,imx27-pata";

And now please tell me how does it make sense with respect to your
compatible in this binding?

> + reg = <0x83fe0000 0x4000>;
> + interrupts = <70>;
> + clocks = <&clks 161>;
> + };

Best regards,
Krzysztof


2024-03-09 13:48:57

by Animesh Agarwal

[permalink] [raw]
Subject: [PATCH v2] dt-bindings: imx-pata: Convert to dtschema

Convert the imx-pata bindings to DT schema.

Signed-off-by: Animesh <[email protected]>
---
.../devicetree/bindings/ata/fsl,imx-pata.yaml | 38 +++++++++++++++++++
.../devicetree/bindings/ata/imx-pata.txt | 16 --------
2 files changed, 38 insertions(+), 16 deletions(-)
create mode 100644 Documentation/devicetree/bindings/ata/fsl,imx-pata.yaml
delete mode 100644 Documentation/devicetree/bindings/ata/imx-pata.txt

diff --git a/Documentation/devicetree/bindings/ata/fsl,imx-pata.yaml b/Documentation/devicetree/bindings/ata/fsl,imx-pata.yaml
new file mode 100644
index 000000000000..ee7892bf963b
--- /dev/null
+++ b/Documentation/devicetree/bindings/ata/fsl,imx-pata.yaml
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/ata/fsl,imx-pata.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale i.MX PATA Controller
+
+maintainers:
+ - Animesh Agarwal <[email protected]>
+
+properties:
+ compatible:
+ contains:
+ const: fsl,imx27-pata
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ items:
+ - description: PATA Controller interrupts
+
+ clocks:
+ items:
+ - description: PATA Controller clocks
+
+additionalProperties: false
+
+examples:
+ - |
+ pata: pata@83fe0000 {
+ compatible = "fsl,imx51-pata", "fsl,imx27-pata";
+ reg = <0x83fe0000 0x4000>;
+ interrupts = <70>;
+ clocks = <&clks 161>;
+ };
+
diff --git a/Documentation/devicetree/bindings/ata/imx-pata.txt b/Documentation/devicetree/bindings/ata/imx-pata.txt
deleted file mode 100644
index f1172f00188a..000000000000
--- a/Documentation/devicetree/bindings/ata/imx-pata.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-* Freescale i.MX PATA Controller
-
-Required properties:
-- compatible: "fsl,imx27-pata"
-- reg: Address range of the PATA Controller
-- interrupts: The interrupt of the PATA Controller
-- clocks: the clocks for the PATA Controller
-
-Example:
-
- pata: pata@83fe0000 {
- compatible = "fsl,imx51-pata", "fsl,imx27-pata";
- reg = <0x83fe0000 0x4000>;
- interrupts = <70>;
- clocks = <&clks 161>;
- };
--
2.44.0


2024-03-09 14:35:47

by Fabio Estevam

[permalink] [raw]
Subject: Re: [PATCH v2] dt-bindings: imx-pata: Convert to dtschema

On Sat, Mar 9, 2024 at 10:48 AM Animesh <[email protected]> wrote:

> +properties:
> + compatible:
> + contains:
> + const: fsl,imx27-pata

You haven't documented fsl,imx51-pata.

> +examples:
> + - |
> + pata: pata@83fe0000 {
> + compatible = "fsl,imx51-pata", "fsl,imx27-pata";

but it is present here...

2024-03-09 14:51:32

by Fabio Estevam

[permalink] [raw]
Subject: Re: [PATCH v2] dt-bindings: imx-pata: Convert to dtschema

On Sat, Mar 9, 2024 at 11:44 AM Animesh Agarwal
<[email protected]> wrote:
>
> fsl,imx51-pata isn't present in the txt binding as well. Should i add it?

Yes, you need to add it and make sure to test it with 'make dt_binding_check'.

2024-03-09 15:24:05

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2] dt-bindings: imx-pata: Convert to dtschema

On 09/03/2024 14:48, Animesh wrote:
> Convert the imx-pata bindings to DT schema.
>
> Signed-off-by: Animesh <[email protected]>

Do not attach (thread) your patchsets to some other threads (unrelated
or older versions). This buries them deep in the mailbox and might
interfere with applying entire sets.

> ---

Where is the changelog? What happened here? What changed?


> .../devicetree/bindings/ata/fsl,imx-pata.yaml | 38 +++++++++++++++++++
> .../devicetree/bindings/ata/imx-pata.txt | 16 --------
> 2 files changed, 38 insertions(+), 16 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/ata/fsl,imx-pata.yaml
> delete mode 100644 Documentation/devicetree/bindings/ata/imx-pata.txt
>
> diff --git a/Documentation/devicetree/bindings/ata/fsl,imx-pata.yaml b/Documentation/devicetree/bindings/ata/fsl,imx-pata.yaml
> new file mode 100644
> index 000000000000..ee7892bf963b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/ata/fsl,imx-pata.yaml
> @@ -0,0 +1,38 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/ata/fsl,imx-pata.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Freescale i.MX PATA Controller
> +
> +maintainers:
> + - Animesh Agarwal <[email protected]>
> +
> +properties:
> + compatible:
> + contains:
> + const: fsl,imx27-pata
> +
> + reg:
> + maxItems: 1
> +
> + interrupts:
> + items:
> + - description: PATA Controller interrupts
> +
> + clocks:
> + items:
> + - description: PATA Controller clocks
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + pata: pata@83fe0000 {
> + compatible = "fsl,imx51-pata", "fsl,imx27-pata";


The same problem as before. How did you resolve test failure?

Best regards,
Krzysztof