All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: interrupt-controller: Convert ARM VIC to json-schema
@ 2021-06-10 13:57 Sudeep Holla
  2021-06-10 20:01 ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Sudeep Holla @ 2021-06-10 13:57 UTC (permalink / raw)
  To: devicetree, Rob Herring; +Cc: Sudeep Holla, Linus Walleij, Rob Herring

Convert the ARM VIC binding document to DT schema format using
json-schema.

Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
---
 .../bindings/interrupt-controller/arm,vic.txt | 41 ---------
 .../interrupt-controller/arm,vic.yaml         | 92 +++++++++++++++++++
 2 files changed, 92 insertions(+), 41 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/arm,vic.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/arm,vic.yaml

Hi Rob,

This also helps to get rid of this warning.

	bus/arm,integrator-ap-lm.example.dt.yaml:0:0:
	/example-0/bus@c0000000/bus@c0000000/interrupt-controller@3000000:
	failed to match any schema with compatible: ['arm,pl192-vic']

Regards,
Sudeep

diff --git a/Documentation/devicetree/bindings/interrupt-controller/arm,vic.txt b/Documentation/devicetree/bindings/interrupt-controller/arm,vic.txt
deleted file mode 100644
index dd527216c5fb..000000000000
--- a/Documentation/devicetree/bindings/interrupt-controller/arm,vic.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-* ARM Vectored Interrupt Controller
-
-One or more Vectored Interrupt Controllers (VIC's) can be connected in an ARM
-system for interrupt routing.  For multiple controllers they can either be
-nested or have the outputs wire-OR'd together.
-
-Required properties:
-
-- compatible : should be one of
-	"arm,pl190-vic"
-	"arm,pl192-vic"
-- interrupt-controller : Identifies the node as an interrupt controller
-- #interrupt-cells : The number of cells to define the interrupts.  Must be 1 as
-  the VIC has no configuration options for interrupt sources.  The cell is a u32
-  and defines the interrupt number.
-- reg : The register bank for the VIC.
-
-Optional properties:
-
-- interrupts : Interrupt source for parent controllers if the VIC is nested.
-- valid-mask : A one cell big bit mask of valid interrupt sources. Each bit
-  represents single interrupt source, starting from source 0 at LSb and ending
-  at source 31 at MSb. A bit that is set means that the source is wired and
-  clear means otherwise. If unspecified, defaults to all valid.
-- valid-wakeup-mask : A one cell big bit mask of interrupt sources that can be
-  configured as wake up source for the system. Order of bits is the same as for
-  valid-mask property. A set bit means that this interrupt source can be
-  configured as a wake up source for the system. If unspecied, defaults to all
-  interrupt sources configurable as wake up sources.
-
-Example:
-
-	vic0: interrupt-controller@60000 {
-		compatible = "arm,pl192-vic";
-		interrupt-controller;
-		#interrupt-cells = <1>;
-		reg = <0x60000 0x1000>;
-
-		valid-mask = <0xffffff7f>;
-		valid-wakeup-mask = <0x0000ff7f>;
-	};
diff --git a/Documentation/devicetree/bindings/interrupt-controller/arm,vic.yaml b/Documentation/devicetree/bindings/interrupt-controller/arm,vic.yaml
new file mode 100644
index 000000000000..aeadbd2d9398
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/arm,vic.yaml
@@ -0,0 +1,92 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/arm,vic.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ARM Vectored Interrupt Controller
+
+maintainers:
+  - Rob Herring <robh@kernel.org>
+
+description: |+
+  One or more Vectored Interrupt Controllers (VIC's) can be connected in an
+  ARM system for interrupt routing.  For multiple controllers they can either
+  be nested or have the outputs wire-OR'd together.
+
+allOf:
+  - $ref: /schemas/interrupt-controller.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - const: arm,pl190-vic
+      - const: arm,pl192-vic
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 1
+    description:
+      The number of cells to define the interrupts.  It must be 1 as the
+      VIC has no configuration options for interrupt sources. The single
+      cell defines the interrupt number.
+
+  reg:
+    description: The register bank for the VIC.
+    maxItems: 1
+
+  interrupts:
+    description:
+      Interrupt source for the parent interrupt controller if the VIC
+      is nested.
+    maxItems: 1
+
+  interrupts-extended:
+    description:
+      Interrupt source for the parent interrupt controllers if the VIC
+      is nested.
+    maxItems: 1
+
+  valid-mask:
+    description:
+      A one cell big bit mask of valid interrupt sources. Each bit
+      represents single interrupt source, starting from source 0 at
+      LSb and ending at source 31 at MSb. A bit that is set means
+      that the source is wired and clear means otherwise. If unspecified,
+      defaults to all valid.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+  valid-wakeup-mask:
+    description:
+      A one cell big bit mask of interrupt sources that can be configured
+      as wake up source for the system. Order of bits is the same as for
+      valid-mask property. A set bit means that this interrupt source
+      can be configured as a wake up source for the system. If unspecied,
+      defaults to all interrupt sources configurable as wake up sources.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - "#interrupt-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    // GICv1
+    vic0: interrupt-controller@60000 {
+      compatible = "arm,pl192-vic";
+      interrupt-controller;
+      #interrupt-cells = <1>;
+      reg = <0x60000 0x1000>;
+
+      valid-mask = <0xffffff7f>;
+      valid-wakeup-mask = <0x0000ff7f>;
+    };
+
+...
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dt-bindings: interrupt-controller: Convert ARM VIC to json-schema
  2021-06-10 13:57 [PATCH] dt-bindings: interrupt-controller: Convert ARM VIC to json-schema Sudeep Holla
@ 2021-06-10 20:01 ` Linus Walleij
  2021-06-11 11:15   ` Sudeep Holla
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2021-06-10 20:01 UTC (permalink / raw)
  To: Sudeep Holla
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Rob Herring, Rob Herring

Hi Sudeep,

thanks for looking into this!

On Thu, Jun 10, 2021 at 3:57 PM Sudeep Holla <sudeep.holla@arm.com> wrote:

> Convert the ARM VIC binding document to DT schema format using
> json-schema.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Rob Herring <robh@kernel.org>
> Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>

> +allOf:
> +  - $ref: /schemas/interrupt-controller.yaml#
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: arm,pl190-vic
> +      - const: arm,pl192-vic

Please also add the legacy compatible arm,versatile-vic
used in arch/arm/boot/dts/versatile-ab.dts
(Missing in the old bindings, but used in DTS and drivers.)

With that added:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dt-bindings: interrupt-controller: Convert ARM VIC to json-schema
  2021-06-10 20:01 ` Linus Walleij
@ 2021-06-11 11:15   ` Sudeep Holla
  0 siblings, 0 replies; 3+ messages in thread
From: Sudeep Holla @ 2021-06-11 11:15 UTC (permalink / raw)
  To: Linus Walleij
  Cc: open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Rob Herring, Rob Herring, Sudeep Holla

On Thu, Jun 10, 2021 at 10:01:35PM +0200, Linus Walleij wrote:
> Hi Sudeep,
> 
> thanks for looking into this!
> 
> On Thu, Jun 10, 2021 at 3:57 PM Sudeep Holla <sudeep.holla@arm.com> wrote:
> 
> > Convert the ARM VIC binding document to DT schema format using
> > json-schema.
> >
> > Cc: Linus Walleij <linus.walleij@linaro.org>
> > Cc: Rob Herring <robh@kernel.org>
> > Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
> 
> > +allOf:
> > +  - $ref: /schemas/interrupt-controller.yaml#
> > +
> > +properties:
> > +  compatible:
> > +    oneOf:
> > +      - const: arm,pl190-vic
> > +      - const: arm,pl192-vic
> 
> Please also add the legacy compatible arm,versatile-vic
> used in arch/arm/boot/dts/versatile-ab.dts
> (Missing in the old bindings, but used in DTS and drivers.)
>

Right, even arch/arm/boot/dts/ste-nomadik-stn8815.dtsi uses it, now pushed v2

> With that added:
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> 


Thanks.

-- 
Regards,
Sudeep

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-11 11:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10 13:57 [PATCH] dt-bindings: interrupt-controller: Convert ARM VIC to json-schema Sudeep Holla
2021-06-10 20:01 ` Linus Walleij
2021-06-11 11:15   ` Sudeep Holla

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.