diff mbox series

[v2,06/11] dt-bindings: arm: convert vexpress-sysregs to DT schema

Message ID 20220506140533.3566431-7-andre.przywara@arm.com
State Accepted
Commit 47db321666cb88e1add876535da8aeb4e6c3a8dd
Headers show
Series dt-bindings: Convert Arm Ltd. peripherals to DT schema | expand

Commit Message

Andre Przywara May 6, 2022, 2:05 p.m. UTC
The Arm Versatile Express system control register block provides GPIO
functionality to some devices and is also used for board identification.

Extract the first half of the informal vexpress-sysreg.txt binding and
make it proper DT schema compliant.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
---
 .../bindings/arm/vexpress-sysreg.yaml         | 90 +++++++++++++++++++
 1 file changed, 90 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/vexpress-sysreg.yaml

Comments

Rob Herring (Arm) May 6, 2022, 10:39 p.m. UTC | #1
On Fri, 06 May 2022 15:05:28 +0100, Andre Przywara wrote:
> The Arm Versatile Express system control register block provides GPIO
> functionality to some devices and is also used for board identification.
> 
> Extract the first half of the informal vexpress-sysreg.txt binding and
> make it proper DT schema compliant.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> ---
>  .../bindings/arm/vexpress-sysreg.yaml         | 90 +++++++++++++++++++
>  1 file changed, 90 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/arm/vexpress-sysreg.yaml
> 

Running 'make dtbs_check' with the schema in this patch gives the
following warnings. Consider if they are expected or the schema is
incorrect. These may not be new warnings.

Note that it is not yet a requirement to have 0 warnings for dtbs_check.
This will change in the future.

Full log is available here: https://patchwork.ozlabs.org/patch/


sysreg@10000: '#address-cells' is a required property
	arch/arm64/boot/dts/arm/foundation-v8.dtb
	arch/arm64/boot/dts/arm/foundation-v8-gicv3.dtb
	arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dtb
	arch/arm64/boot/dts/arm/foundation-v8-psci.dtb
	arch/arm64/boot/dts/arm/fvp-base-revc.dtb
	arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dtb

sysreg@10000: '#gpio-cells', 'gpio-controller' do not match any of the regexes: '^gpio@[0-9a-f]+$', 'pinctrl-[0-9]+'
	arch/arm64/boot/dts/arm/fvp-base-revc.dtb
	arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dtb

sysreg@10000: '#size-cells' is a required property
	arch/arm64/boot/dts/arm/foundation-v8.dtb
	arch/arm64/boot/dts/arm/foundation-v8-gicv3.dtb
	arch/arm64/boot/dts/arm/foundation-v8-gicv3-psci.dtb
	arch/arm64/boot/dts/arm/foundation-v8-psci.dtb
	arch/arm64/boot/dts/arm/fvp-base-revc.dtb
	arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dtb
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/arm/vexpress-sysreg.yaml b/Documentation/devicetree/bindings/arm/vexpress-sysreg.yaml
new file mode 100644
index 0000000000000..b5e26e41f88c8
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/vexpress-sysreg.yaml
@@ -0,0 +1,90 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/vexpress-sysreg.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ARM Versatile Express system registers bindings
+
+maintainers:
+  - Andre Przywara <andre.przywara@arm.com>
+
+description:
+  This is a system control registers block, providing multiple low level
+  platform functions like board detection and identification, software
+  interrupt generation, MMC and NOR Flash control, etc.
+
+properties:
+  compatible:
+    const: arm,vexpress-sysreg
+
+  reg:
+    maxItems: 1
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 1
+
+  ranges: true
+
+additionalProperties: false
+
+patternProperties:
+  '^gpio@[0-9a-f]+$':
+    type: object
+    additionalProperties: false
+    description:
+      GPIO children
+
+    properties:
+      compatible:
+        enum:
+          - arm,vexpress-sysreg,sys_led
+          - arm,vexpress-sysreg,sys_mci
+          - arm,vexpress-sysreg,sys_flash
+
+      gpio-controller: true
+
+      "#gpio-cells":
+        const: 2
+        description: |
+          The first cell is the function number:
+          for sys_led : 0..7 = LED 0..7
+          for sys_mci : 0 = MMC CARDIN, 1 = MMC WPROT
+          for sys_flash : 0 = NOR FLASH WPn
+          The second cell can take standard GPIO flags.
+
+      reg:
+        maxItems: 1
+
+    required:
+      - compatible
+      - reg
+      - gpio-controller
+      - "#gpio-cells"
+
+required:
+  - compatible
+  - "#address-cells"
+  - "#size-cells"
+
+examples:
+  - |
+    sysreg@0 {
+        compatible = "arm,vexpress-sysreg";
+        reg = <0x00000 0x1000>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0 0 0x1000>;
+
+        v2m_led_gpios: gpio@8 {
+            compatible = "arm,vexpress-sysreg,sys_led";
+            reg = <0x008 4>;
+            gpio-controller;
+            #gpio-cells = <2>;
+        };
+    };
+
+...