diff mbox series

[v2,1/2] dt-bindings: interrupt-controller: Add Realtek RTL838x/RTL839x support

Message ID 20210104131755.2979203-2-bert@biot.com
State Changes Requested, archived
Headers show
Series Realtek RTL838x/RTL839x IRQ driver | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 1 warnings, 57 lines checked
robh/dt-meta-schema fail build log
robh/checkpatch warning total: 0 errors, 1 warnings, 57 lines checked
robh/dt-meta-schema fail build log

Commit Message

Bert Vermeulen Jan. 4, 2021, 1:17 p.m. UTC
Signed-off-by: Bert Vermeulen <bert@biot.com>
---
 .../realtek,rtl-intc.yaml                     | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml

Comments

Rob Herring (Arm) Jan. 5, 2021, 5:04 p.m. UTC | #1
On Mon, 04 Jan 2021 14:17:54 +0100, Bert Vermeulen wrote:
> Signed-off-by: Bert Vermeulen <bert@biot.com>
> ---
>  .../realtek,rtl-intc.yaml                     | 57 +++++++++++++++++++
>  1 file changed, 57 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml: properties: 'interrupt-map-mask' is a dependency of 'interrupt-map'
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml: ignoring, error in schema: properties
warning: no schema found in file: ./Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
Error: Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.example.dts:30.5-6 syntax error
FATAL ERROR: Unable to parse input tree
make[1]: *** [scripts/Makefile.lib:344: Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.example.dt.yaml] Error 1
make: *** [Makefile:1370: dt_binding_check] Error 2

See https://patchwork.ozlabs.org/patch/1422078

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
Bert Vermeulen Jan. 6, 2021, 9:54 a.m. UTC | #2
On 1/5/21 6:04 PM, Rob Herring wrote:
> On Mon, 04 Jan 2021 14:17:54 +0100, Bert Vermeulen wrote:
>> Signed-off-by: Bert Vermeulen <bert@biot.com>
>> ---
>>  .../realtek,rtl-intc.yaml                     | 57 +++++++++++++++++++
>>  1 file changed, 57 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
>> 
> 
> My bot found errors running 'make dt_binding_check' on your patch:

I fixed the syntax error that caused this to fail. But running the test now 
produces some errors that are not so obvious:

   interrupt-controller@3000: interrupt-map: [[31, 4294967295, 2], [30, 
4294967295, 1], [29, 4294967295, 5]] is too short

Not sure where this comes from, but running dt-validate -v gives this:

   Failed validating 'minItems' in schema['properties']['interrupt-map']:
     {'maxItems': 24, 'minItems': 24}

Where did that 24 come from? I don't even have 24 initerrupts to map :-)

Another error is this:

   interrupt-controller@3000: 'interrupt-map-mask' is a dependency of 
'interrupt-map'

I can see this in your dtschema package's schemas/interrupt-controller.yaml 
where it's defined as a dependency, but why? I don't need that property.
Rob Herring (Arm) Jan. 6, 2021, 3:19 p.m. UTC | #3
On Wed, Jan 6, 2021 at 2:55 AM Bert Vermeulen <bert@biot.com> wrote:
>
> On 1/5/21 6:04 PM, Rob Herring wrote:
> > On Mon, 04 Jan 2021 14:17:54 +0100, Bert Vermeulen wrote:
> >> Signed-off-by: Bert Vermeulen <bert@biot.com>
> >> ---
> >>  .../realtek,rtl-intc.yaml                     | 57 +++++++++++++++++++
> >>  1 file changed, 57 insertions(+)
> >>  create mode 100644 Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
> >>
> >
> > My bot found errors running 'make dt_binding_check' on your patch:
>
> I fixed the syntax error that caused this to fail. But running the test now
> produces some errors that are not so obvious:
>
>    interrupt-controller@3000: interrupt-map: [[31, 4294967295, 2], [30,
> 4294967295, 1], [29, 4294967295, 5]] is too short
>
> Not sure where this comes from, but running dt-validate -v gives this:
>
>    Failed validating 'minItems' in schema['properties']['interrupt-map']:
>      {'maxItems': 24, 'minItems': 24}
>
> Where did that 24 come from? I don't even have 24 initerrupts to map :-)

If you don't define minItems, then the default is the same as
maxItems. So you need to set 'minItems'.

>
> Another error is this:
>
>    interrupt-controller@3000: 'interrupt-map-mask' is a dependency of
> 'interrupt-map'
>
> I can see this in your dtschema package's schemas/interrupt-controller.yaml
> where it's defined as a dependency, but why? I don't need that property.

This should be the other way around. I'll fix it.

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
new file mode 100644
index 000000000000..e9b18a65cafb
--- /dev/null
+++ b/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
@@ -0,0 +1,57 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/interrupt-controller/realtek,rtl-intc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Realtek RTL SoC interrupt controller devicetree bindings
+
+maintainers:
+  - Birger Koblitz <mail@birger-koblitz.de>
+  - Bert Vermeulen <bert@biot.com>
+  - John Crispin <john@phrozen.org>
+
+properties:
+  compatible:
+    const: realtek,rtl-intc
+
+  "#interrupt-cells":
+    const: 1
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-controller: true
+
+  "#address-cells":
+    const: 0
+
+  interrupt-map:
+    maxItems: 24
+    description: Describes mapping from SoC interrupts to CPU interrupts
+
+required:
+  - compatible
+  - reg
+  - "#interrupt-cells"
+  - interrupt-controller
+  - "#address-cells"
+  - interrupt-map
+
+additionalProperties: false
+
+examples:
+  - |
+    intc: interrupt-controller@3000 {
+      compatible = "realtek,rtl-intc";
+      #interrupt-cells = <1>;
+      interrupt-controller;
+      reg = <0x3000 0x20>;
+      #address-cells = <0>;
+      interrupt-map =
+              <31 &cpuintc 2>,
+              <30 &cpuintc 1>;
+    }