Skip to contentSkip to conversation

dt-bindings: irqchip: renesas: intc-irqpin: convert bindings to json-schema

PATCH Superseded Yoshihiro Kaneko 2 participants 3 messages Sep 20, 2019 – Sep 26, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: irqchip: renesas: intc-irqpin: convert bindings to json-schema

Convert R-/SH-Mobile IRQPin Controller bindings documentation to json-schema.

---
 .../interrupt-controller/renesas,intc-irqpin.txt   |  62 -------------
 .../interrupt-controller/renesas,intc-irqpin.yaml  | 102 +++++++++++++++++++++
 2 files changed, 102 insertions(+), 62 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt deleted +0 -62
deleted file mode 100644
index 772c550..0000000
@@ -1,62 +0,0 @@
-DT bindings for the R-/SH-Mobile irqpin controller
-
-Required properties:
-
-- compatible: has to be "renesas,intc-irqpin-<soctype>", "renesas,intc-irqpin"
-  as fallback.
-  Examples with soctypes are:
-    - "renesas,intc-irqpin-r8a7740" (R-Mobile A1)
-    - "renesas,intc-irqpin-r8a7778" (R-Car M1A)
-    - "renesas,intc-irqpin-r8a7779" (R-Car H1)
-    - "renesas,intc-irqpin-sh73a0" (SH-Mobile AG5)
-
-- reg: Base address and length of each register bank used by the external
-  IRQ pins driven by the interrupt controller hardware module. The base
-  addresses, length and number of required register banks varies with soctype.
-- interrupt-controller: Identifies the node as an interrupt controller.
-- #interrupt-cells: has to be <2>: an interrupt index and flags, as defined in
-  interrupts.txt in this directory.
-- interrupts: Must contain a list of interrupt specifiers. For each interrupt
-  provided by this irqpin controller instance, there must be one entry,
-  referring to the corresponding parent interrupt.
-
-Optional properties:
-
-- any properties, listed in interrupts.txt, and any standard resource allocation
-  properties
-- sense-bitfield-width: width of a single sense bitfield in the SENSE register,
-  if different from the default 4 bits
-- control-parent: disable and enable interrupts on the parent interrupt
-  controller, needed for some broken implementations
-- clocks: Must contain a reference to the functional clock.  This property is
-  mandatory if the hardware implements a controllable functional clock for
-  the irqpin controller instance.
-- power-domains: Must contain a reference to the power domain. This property is
-  mandatory if the irqpin controller instance is part of a controllable power
-  domain.
-
-
-Example
--------
-
-	irqpin1: interrupt-controller@e6900004 {
-		compatible = "renesas,intc-irqpin-r8a7740",
-			     "renesas,intc-irqpin";
-		#interrupt-cells = <2>;
-		interrupt-controller;
-		reg = <0xe6900004 4>,
-			<0xe6900014 4>,
-			<0xe6900024 1>,
-			<0xe6900044 1>,
-			<0xe6900064 1>;
-		interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH
-			      0 149 IRQ_TYPE_LEVEL_HIGH
-			      0 149 IRQ_TYPE_LEVEL_HIGH
-			      0 149 IRQ_TYPE_LEVEL_HIGH
-			      0 149 IRQ_TYPE_LEVEL_HIGH
-			      0 149 IRQ_TYPE_LEVEL_HIGH
-			      0 149 IRQ_TYPE_LEVEL_HIGH
-			      0 149 IRQ_TYPE_LEVEL_HIGH>;
-		clocks = <&mstp2_clks R8A7740_CLK_INTCA>;
-		power-domains = <&pd_a4s>;
-	};
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +102 -0

102 lines not on this page · raw message

Signature · 1 line
1.9.1
#1 lore raw
Quoted 84 lines · Yoshihiro Kaneko

Convert R-/SH-Mobile IRQPin Controller bindings documentation to json-schema.

---
 .../interrupt-controller/renesas,intc-irqpin.txt   |  62 -------------
 .../interrupt-controller/renesas,intc-irqpin.yaml  | 102 +++++++++++++++++++++
 2 files changed, 102 insertions(+), 62 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt deleted +0 -62
deleted file mode 100644
index 772c550..0000000
@@ -1,62 +0,0 @@
-DT bindings for the R-/SH-Mobile irqpin controller
-
-Required properties:
-
-- compatible: has to be "renesas,intc-irqpin-<soctype>", "renesas,intc-irqpin"
-  as fallback.
-  Examples with soctypes are:
-    - "renesas,intc-irqpin-r8a7740" (R-Mobile A1)
-    - "renesas,intc-irqpin-r8a7778" (R-Car M1A)
-    - "renesas,intc-irqpin-r8a7779" (R-Car H1)
-    - "renesas,intc-irqpin-sh73a0" (SH-Mobile AG5)
-
-- reg: Base address and length of each register bank used by the external
-  IRQ pins driven by the interrupt controller hardware module. The base
-  addresses, length and number of required register banks varies with soctype.
-- interrupt-controller: Identifies the node as an interrupt controller.
-- #interrupt-cells: has to be <2>: an interrupt index and flags, as defined in
-  interrupts.txt in this directory.
-- interrupts: Must contain a list of interrupt specifiers. For each interrupt
-  provided by this irqpin controller instance, there must be one entry,
-  referring to the corresponding parent interrupt.
-
-Optional properties:
-
-- any properties, listed in interrupts.txt, and any standard resource allocation
-  properties
-- sense-bitfield-width: width of a single sense bitfield in the SENSE register,
-  if different from the default 4 bits
-- control-parent: disable and enable interrupts on the parent interrupt
-  controller, needed for some broken implementations
-- clocks: Must contain a reference to the functional clock.  This property is
-  mandatory if the hardware implements a controllable functional clock for
-  the irqpin controller instance.
-- power-domains: Must contain a reference to the power domain. This property is
-  mandatory if the irqpin controller instance is part of a controllable power
-  domain.
-
-
-Example
--------
-
-	irqpin1: interrupt-controller@e6900004 {
-		compatible = "renesas,intc-irqpin-r8a7740",
-			     "renesas,intc-irqpin";
-		#interrupt-cells = <2>;
-		interrupt-controller;
-		reg = <0xe6900004 4>,
-			<0xe6900014 4>,
-			<0xe6900024 1>,
-			<0xe6900044 1>,
-			<0xe6900064 1>;
-		interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH
-			      0 149 IRQ_TYPE_LEVEL_HIGH
-			      0 149 IRQ_TYPE_LEVEL_HIGH
-			      0 149 IRQ_TYPE_LEVEL_HIGH
-			      0 149 IRQ_TYPE_LEVEL_HIGH
-			      0 149 IRQ_TYPE_LEVEL_HIGH
-			      0 149 IRQ_TYPE_LEVEL_HIGH
-			      0 149 IRQ_TYPE_LEVEL_HIGH>;
-		clocks = <&mstp2_clks R8A7740_CLK_INTCA>;
-		power-domains = <&pd_a4s>;
-	};
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +0 -0
new file mode 100644
index 0000000..d4d3cf8

Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml line 10

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +10 -0
@@ -0,0 +1,102 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/renesas,intc-irqpin.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: DT bindings for the R-/SH-Mobile irqpin controller
+
+maintainers:
+  - Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

I guess Geert's email address got fuzzed somehow.

Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml line 11

Quoted 1 line
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +1 -0
+  - Guennadi Liakhovetski <[email protected]>

I believe that its been a while since Guennadi worked in this area. I'd suggest not including him as a maintainer of this binding.

Quoted 27 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +27 -0
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - renesas,intc-irqpin-r8a7740  # R-Mobile A1
+          - renesas,intc-irqpin-r8a7778  # R-Car M1A
+          - renesas,intc-irqpin-r8a7779  # R-Car H1
+          - renesas,intc-irqpin-sh73a0   # SH-Mobile AG5
+      - const: renesas,intc-irqpin
+
+  reg:
+    # Base address and length of each register bank used by the external
+    # IRQ pins driven by the interrupt controller hardware module. The base
+    # addresses, length and number of required register banks varies with
+    # soctype.
+    minItems: 1
+    maxItems: 6
+
+  interrupt-controller: true
+    # Identifies the node as an interrupt controller.
+
+  '#interrupt-cells':
+    # an interrupt index and flags, as defined in interrupts.txt in this
+    # directory.
+    const: 2
+

Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml line 48

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +10 -0
+  interrupts:
+    # Must contain a list of interrupt specifiers. For each interrupt
+    # provided by this irqpin controller instance, there must be one entry,
+    # referring to the corresponding parent interrupt.
+    maxItems: 1
+
+  sense-bitfield-width:
+    # width of a single sense bitfield in the SENSE register, if different
+    # from the default 4 bits
+    maxItems: 1

I wonder if we need to give this field a type, something like this?

sense-bitfield-width:
# Comment
$ref: /schemas/types.yaml#/definitions/uint32
maxItems: 1

Also, I wonder if there should be some constraints on the values. (I don't know if these constraints are correct)

minimum: 1
maximum: 64
default: 4

Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml line 53

Quoted 5 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +5 -0
+
+  control-parent:
+    # disable and enable interrupts on the parent interrupt controller,
+    # needed for some broken implementations
+    maxItems: 1

I think we can describe this as a boolean.

control-parent:
# Comment
type: boolean

Quoted 9 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +9 -0
+
+  clocks:
+    # Must contain a reference to the functional clock.  This property is
+    # mandatory if the hardware implements a controllable functional clock for
+    # the irqpin controller instance.
+    maxItems: 1
+
+  power-domains:
+    # Must contain a reference to the power domain. This property is

Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml line 72

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +10 -0
+    # mandatory if the irqpin controller instance is part of a controllable
+    # power domain.
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - '#interrupt-cells'
+  - interrupts

Is 'clocks' also required?

Quoted 33 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +30 -0
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/r8a7740-clock.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    irqpin1: interrupt-controller@e6900004 {
+        compatible = "renesas,intc-irqpin-r8a7740",
+                     "renesas,intc-irqpin";
+        #interrupt-cells = <2>;
+        interrupt-controller;
+        reg = <0xe6900004 4>,
+              <0xe6900014 4>,
+              <0xe6900024 1>,
+              <0xe6900044 1>,
+              <0xe6900064 1>;
+        interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH
+                      GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH
+                      GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH
+                      GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH
+                      GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH
+                      GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH
+                      GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH
+                      GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&mstp2_clks R8A7740_CLK_INTCA>;
+        power-domains = <&pd_a4s>;
+    };
Signature · 1 line
1.9.1
#2 lore raw

Hi Simon-san,

Thank you for your review.

2019年9月23日(月) 20:30 Simon Horman <[email protected]>:

Quoted 90 lines · Yoshihiro Kaneko
Quoted 88 lines

Convert R-/SH-Mobile IRQPin Controller bindings documentation to json-schema.

---
 .../interrupt-controller/renesas,intc-irqpin.txt   |  62 -------------
 .../interrupt-controller/renesas,intc-irqpin.yaml  | 102 +++++++++++++++++++++
 2 files changed, 102 insertions(+), 62 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.txt deleted +0 -62
deleted file mode 100644
index 772c550..0000000
@@ -1,62 +0,0 @@
-DT bindings for the R-/SH-Mobile irqpin controller
-
-Required properties:
-
-- compatible: has to be "renesas,intc-irqpin-<soctype>", "renesas,intc-irqpin"
-  as fallback.
-  Examples with soctypes are:
-    - "renesas,intc-irqpin-r8a7740" (R-Mobile A1)
-    - "renesas,intc-irqpin-r8a7778" (R-Car M1A)
-    - "renesas,intc-irqpin-r8a7779" (R-Car H1)
-    - "renesas,intc-irqpin-sh73a0" (SH-Mobile AG5)
-
-- reg: Base address and length of each register bank used by the external
-  IRQ pins driven by the interrupt controller hardware module. The base
-  addresses, length and number of required register banks varies with soctype.
-- interrupt-controller: Identifies the node as an interrupt controller.
-- #interrupt-cells: has to be <2>: an interrupt index and flags, as defined in
-  interrupts.txt in this directory.
-- interrupts: Must contain a list of interrupt specifiers. For each interrupt
-  provided by this irqpin controller instance, there must be one entry,
-  referring to the corresponding parent interrupt.
-
-Optional properties:
-
-- any properties, listed in interrupts.txt, and any standard resource allocation
-  properties
-- sense-bitfield-width: width of a single sense bitfield in the SENSE register,
-  if different from the default 4 bits
-- control-parent: disable and enable interrupts on the parent interrupt
-  controller, needed for some broken implementations
-- clocks: Must contain a reference to the functional clock.  This property is
-  mandatory if the hardware implements a controllable functional clock for
-  the irqpin controller instance.
-- power-domains: Must contain a reference to the power domain. This property is
-  mandatory if the irqpin controller instance is part of a controllable power
-  domain.
-
-
-Example
--------
-
-     irqpin1: interrupt-controller@e6900004 {
-             compatible = "renesas,intc-irqpin-r8a7740",
-                          "renesas,intc-irqpin";
-             #interrupt-cells = <2>;
-             interrupt-controller;
-             reg = <0xe6900004 4>,
-                     <0xe6900014 4>,
-                     <0xe6900024 1>,
-                     <0xe6900044 1>,
-                     <0xe6900064 1>;
-             interrupts = <0 149 IRQ_TYPE_LEVEL_HIGH
-                           0 149 IRQ_TYPE_LEVEL_HIGH
-                           0 149 IRQ_TYPE_LEVEL_HIGH
-                           0 149 IRQ_TYPE_LEVEL_HIGH
-                           0 149 IRQ_TYPE_LEVEL_HIGH
-                           0 149 IRQ_TYPE_LEVEL_HIGH
-                           0 149 IRQ_TYPE_LEVEL_HIGH
-                           0 149 IRQ_TYPE_LEVEL_HIGH>;
-             clocks = <&mstp2_clks R8A7740_CLK_INTCA>;
-             power-domains = <&pd_a4s>;
-     };
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +4 -0
new file mode 100644
index 0000000..d4d3cf8
@@ -0,0 +1,102 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/renesas,intc-irqpin.yaml#
Quoted 8 lines

Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml line 10

Quoted 6 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +6 -0
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: DT bindings for the R-/SH-Mobile irqpin controller
+
+maintainers:
+  - Geert Uytterhoeven <geert+renesas@xxxxxxxxx>

I guess Geert's email address got fuzzed somehow.

I will fix it...

Quoted 5 lines

Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml line 11

Quoted 2 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +1 -0
+  - Guennadi Liakhovetski <[email protected]>

I believe that its been a while since Guennadi worked in this area. I'd suggest not including him as a maintainer of this binding.

I understood.

Quoted 41 lines
Quoted 28 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +27 -0
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - renesas,intc-irqpin-r8a7740  # R-Mobile A1
+          - renesas,intc-irqpin-r8a7778  # R-Car M1A
+          - renesas,intc-irqpin-r8a7779  # R-Car H1
+          - renesas,intc-irqpin-sh73a0   # SH-Mobile AG5
+      - const: renesas,intc-irqpin
+
+  reg:
+    # Base address and length of each register bank used by the external
+    # IRQ pins driven by the interrupt controller hardware module. The base
+    # addresses, length and number of required register banks varies with
+    # soctype.
+    minItems: 1
+    maxItems: 6
+
+  interrupt-controller: true
+    # Identifies the node as an interrupt controller.
+
+  '#interrupt-cells':
+    # an interrupt index and flags, as defined in interrupts.txt in this
+    # directory.
+    const: 2
+

Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml line 48

Quoted 10 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +10 -0
+  interrupts:
+    # Must contain a list of interrupt specifiers. For each interrupt
+    # provided by this irqpin controller instance, there must be one entry,
+    # referring to the corresponding parent interrupt.
+    maxItems: 1
+
+  sense-bitfield-width:
+    # width of a single sense bitfield in the SENSE register, if different
+    # from the default 4 bits
+    maxItems: 1

I wonder if we need to give this field a type, something like this?

Quoted 4 lines

sense-bitfield-width:
# Comment
$ref: /schemas/types.yaml#/definitions/uint32
maxItems: 1

I will do it.

Quoted 7 lines

Also, I wonder if there should be some constraints on the values. (I don't know if these constraints are correct)

minimum: 1
maximum: 64
default: 4

I don't know the correct maximum value.

Quoted 7 lines

Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml line 53

Quoted 6 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +5 -0
+
+  control-parent:
+    # disable and enable interrupts on the parent interrupt controller,
+    # needed for some broken implementations
+    maxItems: 1
Quoted 5 lines

I think we can describe this as a boolean.

control-parent:
# Comment
type: boolean

I will do it.

Quoted 15 lines
Quoted 15 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +13 -0
+
+  clocks:
+    # Must contain a reference to the functional clock.  This property is
+    # mandatory if the hardware implements a controllable functional clock for
+    # the irqpin controller instance.
+    maxItems: 1
+
+  power-domains:
+    # Must contain a reference to the power domain. This property is
+    # mandatory if the irqpin controller instance is part of a controllable
+    # power domain.
+    maxItems: 1
+
Quoted 8 lines

Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml line 72

Quoted 6 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +6 -0
+required:
+  - compatible
+  - reg
+  - interrupt-controller
+  - '#interrupt-cells'
+  - interrupts

Is 'clocks' also required?

It is explained that 'clocks' is optional in renesas,intc-irqpin.txt. In fact, 'clocks' is not defined in the irqpin node of r8a7778.dtsi and r8a7779.dtsi.

Regards,
Kaneko

Quoted 34 lines
Quoted 34 lines
Documentation/devicetree/bindings/interrupt-controller/renesas,intc-irqpin.yaml new file +30 -1
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/r8a7740-clock.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    irqpin1: interrupt-controller@e6900004 {
+        compatible = "renesas,intc-irqpin-r8a7740",
+                     "renesas,intc-irqpin";
+        #interrupt-cells = <2>;
+        interrupt-controller;
+        reg = <0xe6900004 4>,
+              <0xe6900014 4>,
+              <0xe6900024 1>,
+              <0xe6900044 1>,
+              <0xe6900064 1>;
+        interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH
+                      GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH
+                      GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH
+                      GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH
+                      GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH
+                      GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH
+                      GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH
+                      GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&mstp2_clks R8A7740_CLK_INTCA>;
+        power-domains = <&pd_a4s>;
+    };
--

1.9.1