diff mbox series

[01/12] dt-bindings: arm: bcm: Convert Cygnus to YAML

Message ID 20200202211827.27682-2-f.fainelli@gmail.com (mailing list archive)
State New, archived
Headers show
Series dt-bindings: arm: bcm: Convert boards to YAML | expand

Commit Message

Florian Fainelli Feb. 2, 2020, 9:18 p.m. UTC
Update the Broadocom Cygnus SoC binding document for boards/SoCs to use
YAML. Verified with dt_binding_check and dtbs_check.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 .../bindings/arm/bcm/brcm,cygnus.txt          | 31 ---------
 .../bindings/arm/bcm/brcm,cygnus.yaml         | 66 +++++++++++++++++++
 2 files changed, 66 insertions(+), 31 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.txt
 create mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.yaml

Comments

Maxime Ripard Feb. 3, 2020, 8:29 a.m. UTC | #1
Hi Florian,

On Sun, Feb 02, 2020 at 01:18:16PM -0800, Florian Fainelli wrote:
> Update the Broadocom Cygnus SoC binding document for boards/SoCs to use
> YAML. Verified with dt_binding_check and dtbs_check.
>
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  .../bindings/arm/bcm/brcm,cygnus.txt          | 31 ---------
>  .../bindings/arm/bcm/brcm,cygnus.yaml         | 66 +++++++++++++++++++
>  2 files changed, 66 insertions(+), 31 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.txt
>  create mode 100644 Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.yaml
>
> diff --git a/Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.txt b/Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.txt
> deleted file mode 100644
> index 4c77169bb534..000000000000
> --- a/Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.txt
> +++ /dev/null
> @@ -1,31 +0,0 @@
> -Broadcom Cygnus device tree bindings
> -------------------------------------
> -
> -
> -Boards with Cygnus SoCs shall have the following properties:
> -
> -Required root node property:
> -
> -BCM11300
> -compatible = "brcm,bcm11300", "brcm,cygnus";
> -
> -BCM11320
> -compatible = "brcm,bcm11320", "brcm,cygnus";
> -
> -BCM11350
> -compatible = "brcm,bcm11350", "brcm,cygnus";
> -
> -BCM11360
> -compatible = "brcm,bcm11360", "brcm,cygnus";
> -
> -BCM58300
> -compatible = "brcm,bcm58300", "brcm,cygnus";
> -
> -BCM58302
> -compatible = "brcm,bcm58302", "brcm,cygnus";
> -
> -BCM58303
> -compatible = "brcm,bcm58303", "brcm,cygnus";
> -
> -BCM58305
> -compatible = "brcm,bcm58305", "brcm,cygnus";
> diff --git a/Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.yaml b/Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.yaml
> new file mode 100644
> index 000000000000..2606ca956caf
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.yaml
> @@ -0,0 +1,66 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/arm/bcm/brcm,cygnus.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Broadcom Cygnus device tree bindings
> +
> +maintainers:
> +   - Ray Jui <rjui@broadcom.com>
> +   - Scott Branden <sbranden@broadcom.com>
> +
> +properties:
> +  $nodename:
> +    const: '/'
> +  compatible:
> +    oneOf:
> +      - description: BCM11300 based boards
> +        items:
> +          - enum:
> +              - brcm,bcm11300
> +          - const: brcm,cygnus
> +
> +      - description: BCM11320 based boards
> +        items:
> +          - enum:
> +              - brcm,bcm11320
> +          - const: brcm,cygnus

This applies to other patches in your series too, but this can be
simplified to either (removing the description to make the example
simpler):

oneOf:
  - items:
    - const: brcm,bcm11300
    - const: brcm,cygnus
  - items:
    - const: brcm,bcm11320
    - const: brcm,cygnus

Or

items:
  - enum:
    - brcm,bcm11300
    - brcm,bcm11320
  - const: brcm,cygnus

The latter will provide more meaningful errors, so you should probably
pick this one over the former.

Maxime
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.txt b/Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.txt
deleted file mode 100644
index 4c77169bb534..000000000000
--- a/Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.txt
+++ /dev/null
@@ -1,31 +0,0 @@ 
-Broadcom Cygnus device tree bindings
-------------------------------------
-
-
-Boards with Cygnus SoCs shall have the following properties:
-
-Required root node property:
-
-BCM11300
-compatible = "brcm,bcm11300", "brcm,cygnus";
-
-BCM11320
-compatible = "brcm,bcm11320", "brcm,cygnus";
-
-BCM11350
-compatible = "brcm,bcm11350", "brcm,cygnus";
-
-BCM11360
-compatible = "brcm,bcm11360", "brcm,cygnus";
-
-BCM58300
-compatible = "brcm,bcm58300", "brcm,cygnus";
-
-BCM58302
-compatible = "brcm,bcm58302", "brcm,cygnus";
-
-BCM58303
-compatible = "brcm,bcm58303", "brcm,cygnus";
-
-BCM58305
-compatible = "brcm,bcm58305", "brcm,cygnus";
diff --git a/Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.yaml b/Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.yaml
new file mode 100644
index 000000000000..2606ca956caf
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/bcm/brcm,cygnus.yaml
@@ -0,0 +1,66 @@ 
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/bcm/brcm,cygnus.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom Cygnus device tree bindings
+
+maintainers:
+   - Ray Jui <rjui@broadcom.com>
+   - Scott Branden <sbranden@broadcom.com>
+
+properties:
+  $nodename:
+    const: '/'
+  compatible:
+    oneOf:
+      - description: BCM11300 based boards
+        items:
+          - enum:
+              - brcm,bcm11300
+          - const: brcm,cygnus
+
+      - description: BCM11320 based boards
+        items:
+          - enum:
+              - brcm,bcm11320
+          - const: brcm,cygnus
+
+      - description: BCM11350 based boards
+        items:
+          - enum:
+              - brcm,bcm11350
+          - const: brcm,cygnus
+
+      - description: BCM11360 based boards
+        items:
+          - enum:
+              - brcm,bcm11360
+          - const: brcm,cygnus
+
+      - description: BCM58300 based boards
+        items:
+          - enum:
+              - brcm,bcm58300
+          - const: brcm,cygnus
+
+      - description: BCM58302 based boards
+        items:
+          - enum:
+              - brcm,bcm58302
+          - const: brcm,cygnus
+
+      - description: BCM58303 based boards
+        items:
+          - enum:
+              - brcm,bcm58303
+          - const: brcm,cygnus
+
+      - description: BCM58305 based boards
+        items:
+          - enum:
+              - brcm,bcm58305
+          - const: brcm,cygnus
+
+...