diff mbox series

[2/5] dt-bindings: arm: tegra: ahb: Convert to json-schema

Message ID 20220711152020.688461-2-thierry.reding@gmail.com
State Changes Requested
Headers show
Series [1/5] dt-bindings: arm: tegra: flowctrl: Convert to json-schema | expand

Commit Message

Thierry Reding July 11, 2022, 3:20 p.m. UTC
From: Thierry Reding <treding@nvidia.com>

Convert the NVIDIA Tegra AHB bindings from the free-form text format to
json-schema.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 .../bindings/arm/tegra/nvidia,tegra20-ahb.txt | 17 --------
 .../arm/tegra/nvidia,tegra20-ahb.yaml         | 39 +++++++++++++++++++
 2 files changed, 39 insertions(+), 17 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt
 create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.yaml

Comments

Krzysztof Kozlowski July 12, 2022, 8:20 a.m. UTC | #1
On 11/07/2022 17:20, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> Convert the NVIDIA Tegra AHB bindings from the free-form text format to
> json-schema.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  .../bindings/arm/tegra/nvidia,tegra20-ahb.txt | 17 --------
>  .../arm/tegra/nvidia,tegra20-ahb.yaml         | 39 +++++++++++++++++++
>  2 files changed, 39 insertions(+), 17 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt
>  create mode 100644 Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.yaml
> 
> diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt
> deleted file mode 100644
> index 9a4295b54539..000000000000
> --- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt
> +++ /dev/null
> @@ -1,17 +0,0 @@
> -NVIDIA Tegra AHB
> -
> -Required properties:
> -- compatible : For Tegra20, must contain "nvidia,tegra20-ahb".  For
> -  Tegra30, must contain "nvidia,tegra30-ahb".  Otherwise, must contain
> -  '"nvidia,<chip>-ahb", "nvidia,tegra30-ahb"' where <chip> is tegra124,
> -  tegra132, or tegra210.
> -- reg : Should contain 1 register ranges(address and length).  For
> -  Tegra20, Tegra30, and Tegra114 chips, the value must be <0x6000c004
> -  0x10c>.  For Tegra124, Tegra132 and Tegra210 chips, the value should
> -  be be <0x6000c000 0x150>.
> -
> -Example (for a Tegra20 chip):
> -	ahb: ahb@6000c004 {
> -		compatible = "nvidia,tegra20-ahb";
> -		reg = <0x6000c004 0x10c>; /* AHB Arbitration + Gizmo Controller */
> -	};
> diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.yaml b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.yaml
> new file mode 100644
> index 000000000000..6d9baab76258
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.yaml

Same comment as for #1 - move to "soc", please.

> @@ -0,0 +1,39 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/arm/tegra/nvidia,tegra20-ahb.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +maintainers:
> +  - Thierry Reding <thierry.reding@gmail.com>
> +  - Jon Hunter <jonathanh@nvidia.com>
> +
> +title: NVIDIA Tegra AHB
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: nvidia,tegra20-ahb
> +      - const: nvidia,tegra30-ahb

These two should be an enum.

> +      - items:
> +          - enum:
> +              - nvidia,tegra114-ahb
> +              - nvidia,tegra124-ahb
> +              - nvidia,tegra210-ahb
> +          - const: nvidia,tegra30-ahb
> +
> +  reg:
> +    maxItems: 1
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    ahb@6000c004 {
> +      compatible = "nvidia,tegra20-ahb";
> +      reg = <0x6000c004 0x10c>; /* AHB Arbitration + Gizmo Controller */
> +    };

In your first patch, you used 4-spaces indentation (preferred) for DTS
example. How about using 4-space also here?


Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt
deleted file mode 100644
index 9a4295b54539..000000000000
--- a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.txt
+++ /dev/null
@@ -1,17 +0,0 @@ 
-NVIDIA Tegra AHB
-
-Required properties:
-- compatible : For Tegra20, must contain "nvidia,tegra20-ahb".  For
-  Tegra30, must contain "nvidia,tegra30-ahb".  Otherwise, must contain
-  '"nvidia,<chip>-ahb", "nvidia,tegra30-ahb"' where <chip> is tegra124,
-  tegra132, or tegra210.
-- reg : Should contain 1 register ranges(address and length).  For
-  Tegra20, Tegra30, and Tegra114 chips, the value must be <0x6000c004
-  0x10c>.  For Tegra124, Tegra132 and Tegra210 chips, the value should
-  be be <0x6000c000 0x150>.
-
-Example (for a Tegra20 chip):
-	ahb: ahb@6000c004 {
-		compatible = "nvidia,tegra20-ahb";
-		reg = <0x6000c004 0x10c>; /* AHB Arbitration + Gizmo Controller */
-	};
diff --git a/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.yaml b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.yaml
new file mode 100644
index 000000000000..6d9baab76258
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/tegra/nvidia,tegra20-ahb.yaml
@@ -0,0 +1,39 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/tegra/nvidia,tegra20-ahb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+maintainers:
+  - Thierry Reding <thierry.reding@gmail.com>
+  - Jon Hunter <jonathanh@nvidia.com>
+
+title: NVIDIA Tegra AHB
+
+properties:
+  compatible:
+    oneOf:
+      - const: nvidia,tegra20-ahb
+      - const: nvidia,tegra30-ahb
+      - items:
+          - enum:
+              - nvidia,tegra114-ahb
+              - nvidia,tegra124-ahb
+              - nvidia,tegra210-ahb
+          - const: nvidia,tegra30-ahb
+
+  reg:
+    maxItems: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    ahb@6000c004 {
+      compatible = "nvidia,tegra20-ahb";
+      reg = <0x6000c004 0x10c>; /* AHB Arbitration + Gizmo Controller */
+    };