[PATCH v3 6/9] dt-bindings: interrupt-controller: realtek,rtl-intc: Add rtl9300-intc

Chris Packham posted 9 patches 1 year, 5 months ago
There is a newer version of this series
[PATCH v3 6/9] dt-bindings: interrupt-controller: realtek,rtl-intc: Add rtl9300-intc
Posted by Chris Packham 1 year, 5 months ago
Add a compatible string for the interrupt controller found on the
rtl930x SoCs. The interrupt controller has registers for VPE1 so these
are added as a second reg cell.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---

Notes:
    Changes in v3:
    - Use items to describe the regs property
    Changes in v2:
    - Set reg:maxItems to 2 to allow for VPE1 registers on the rtl9300. Add
      a condition to enforce the old limit on other SoCs.
    - Connor and Krzysztof offered acks on v1 but I think the changes here
      are big enough to void those.

 .../interrupt-controller/realtek,rtl-intc.yaml | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
index fb5593724059..d0e5bdf45d05 100644
--- a/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
+++ b/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
@@ -25,6 +25,7 @@ properties:
       - items:
           - enum:
               - realtek,rtl8380-intc
+              - realtek,rtl9300-intc
           - const: realtek,rtl-intc
       - const: realtek,rtl-intc
         deprecated: true
@@ -35,7 +36,9 @@ properties:
     const: 1
 
   reg:
-    maxItems: 1
+    items:
+      - description: vpe0 registers
+      - description: vpe1 registers
 
   interrupts:
     minItems: 1
@@ -71,6 +74,19 @@ allOf:
     else:
       required:
         - interrupts
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: realtek,rtl9300-intc
+    then:
+      properties:
+        reg:
+          maxItems: 2
+    else:
+      properties:
+        reg:
+          maxItems: 1
 
 additionalProperties: false
 
-- 
2.45.2
Re: [PATCH v3 6/9] dt-bindings: interrupt-controller: realtek,rtl-intc: Add rtl9300-intc
Posted by Krzysztof Kozlowski 1 year, 5 months ago
On 27/06/2024 06:33, Chris Packham wrote:
> Add a compatible string for the interrupt controller found on the
> rtl930x SoCs. The interrupt controller has registers for VPE1 so these
> are added as a second reg cell.
> 
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
> 
> Notes:
>     Changes in v3:
>     - Use items to describe the regs property
>     Changes in v2:
>     - Set reg:maxItems to 2 to allow for VPE1 registers on the rtl9300. Add
>       a condition to enforce the old limit on other SoCs.
>     - Connor and Krzysztof offered acks on v1 but I think the changes here
>       are big enough to void those.
> 
>  .../interrupt-controller/realtek,rtl-intc.yaml | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
> index fb5593724059..d0e5bdf45d05 100644
> --- a/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
> +++ b/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
> @@ -25,6 +25,7 @@ properties:
>        - items:
>            - enum:
>                - realtek,rtl8380-intc
> +              - realtek,rtl9300-intc
>            - const: realtek,rtl-intc
>        - const: realtek,rtl-intc
>          deprecated: true
> @@ -35,7 +36,9 @@ properties:
>      const: 1
>  
>    reg:
> -    maxItems: 1

Missing minItems (as testing would tell you)

> +    items:
> +      - description: vpe0 registers
> +      - description: vpe1 registers
>  
>    interrupts:
>      minItems: 1
> @@ -71,6 +74,19 @@ allOf:
>      else:
>        required:
>          - interrupts
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: realtek,rtl9300-intc
> +    then:
> +      properties:
> +        reg:

Needed is: minItems: 2

> +          maxItems: 2
> +    else:
> +      properties:
> +        reg:
> +          maxItems: 1
>  
>  additionalProperties: false
>  

Best regards,
Krzysztof
Re: [PATCH v3 6/9] dt-bindings: interrupt-controller: realtek,rtl-intc: Add rtl9300-intc
Posted by Chris Packham 1 year, 5 months ago
On 27/06/24 19:41, Krzysztof Kozlowski wrote:
> On 27/06/2024 06:33, Chris Packham wrote:
>> Add a compatible string for the interrupt controller found on the
>> rtl930x SoCs. The interrupt controller has registers for VPE1 so these
>> are added as a second reg cell.
>>
>> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
>> ---
>>
>> Notes:
>>      Changes in v3:
>>      - Use items to describe the regs property
>>      Changes in v2:
>>      - Set reg:maxItems to 2 to allow for VPE1 registers on the rtl9300. Add
>>        a condition to enforce the old limit on other SoCs.
>>      - Connor and Krzysztof offered acks on v1 but I think the changes here
>>        are big enough to void those.
>>
>>   .../interrupt-controller/realtek,rtl-intc.yaml | 18 +++++++++++++++++-
>>   1 file changed, 17 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml b/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
>> index fb5593724059..d0e5bdf45d05 100644
>> --- a/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
>> +++ b/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
>> @@ -25,6 +25,7 @@ properties:
>>         - items:
>>             - enum:
>>                 - realtek,rtl8380-intc
>> +              - realtek,rtl9300-intc
>>             - const: realtek,rtl-intc
>>         - const: realtek,rtl-intc
>>           deprecated: true
>> @@ -35,7 +36,9 @@ properties:
>>       const: 1
>>   
>>     reg:
>> -    maxItems: 1
> Missing minItems (as testing would tell you)

Hmm I really did test this. Even now running

`make ARCH=mips O=build_mips 
DT_SCHEMA_FILES=realtek,rtl-intc.yaml:realtek-rtl.yaml:realtek,otto-timer.yaml 
clean dt_binding_check` doesn't seem to yield any complaints. Am I 
testing this properly?

>
>> +    items:
>> +      - description: vpe0 registers
>> +      - description: vpe1 registers
>>   
>>     interrupts:
>>       minItems: 1
>> @@ -71,6 +74,19 @@ allOf:
>>       else:
>>         required:
>>           - interrupts
>> +  - if:
>> +      properties:
>> +        compatible:
>> +          contains:
>> +            const: realtek,rtl9300-intc
>> +    then:
>> +      properties:
>> +        reg:
> Needed is: minItems: 2
>
>> +          maxItems: 2
>> +    else:
>> +      properties:
>> +        reg:
>> +          maxItems: 1
>>   
>>   additionalProperties: false
>>   
> Best regards,
> Krzysztof
>
Re: [PATCH v3 6/9] dt-bindings: interrupt-controller: realtek,rtl-intc: Add rtl9300-intc
Posted by Chris Packham 1 year, 5 months ago
On 1/07/24 10:12, Chris Packham wrote:
>
> On 27/06/24 19:41, Krzysztof Kozlowski wrote:
>> On 27/06/2024 06:33, Chris Packham wrote:
>>> Add a compatible string for the interrupt controller found on the
>>> rtl930x SoCs. The interrupt controller has registers for VPE1 so these
>>> are added as a second reg cell.
>>>
>>> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
>>> ---
>>>
>>> Notes:
>>>      Changes in v3:
>>>      - Use items to describe the regs property
>>>      Changes in v2:
>>>      - Set reg:maxItems to 2 to allow for VPE1 registers on the 
>>> rtl9300. Add
>>>        a condition to enforce the old limit on other SoCs.
>>>      - Connor and Krzysztof offered acks on v1 but I think the 
>>> changes here
>>>        are big enough to void those.
>>>
>>>   .../interrupt-controller/realtek,rtl-intc.yaml | 18 
>>> +++++++++++++++++-
>>>   1 file changed, 17 insertions(+), 1 deletion(-)
>>>
>>> diff --git 
>>> a/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml 
>>> b/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml 
>>>
>>> index fb5593724059..d0e5bdf45d05 100644
>>> --- 
>>> a/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
>>> +++ 
>>> b/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.yaml
>>> @@ -25,6 +25,7 @@ properties:
>>>         - items:
>>>             - enum:
>>>                 - realtek,rtl8380-intc
>>> +              - realtek,rtl9300-intc
>>>             - const: realtek,rtl-intc
>>>         - const: realtek,rtl-intc
>>>           deprecated: true
>>> @@ -35,7 +36,9 @@ properties:
>>>       const: 1
>>>       reg:
>>> -    maxItems: 1
>> Missing minItems (as testing would tell you)
>
> Hmm I really did test this. Even now running
>
> `make ARCH=mips O=build_mips 
> DT_SCHEMA_FILES=realtek,rtl-intc.yaml:realtek-rtl.yaml:realtek,otto-timer.yaml 
> clean dt_binding_check` doesn't seem to yield any complaints. Am I 
> testing this properly?

Looks like there is a difference between 
`DT_SCHEMA_FILES=realtek,rtl-intc.yaml` and 
`DT_SCHEMA_FILES=realtek,rtl-intc.yaml:realtek-rtl.yaml:realtek,otto-timer.yaml`.

>
>
>>
>>> +    items:
>>> +      - description: vpe0 registers
>>> +      - description: vpe1 registers
>>>       interrupts:
>>>       minItems: 1
>>> @@ -71,6 +74,19 @@ allOf:
>>>       else:
>>>         required:
>>>           - interrupts
>>> +  - if:
>>> +      properties:
>>> +        compatible:
>>> +          contains:
>>> +            const: realtek,rtl9300-intc
>>> +    then:
>>> +      properties:
>>> +        reg:
>> Needed is: minItems: 2
>>
>>> +          maxItems: 2
>>> +    else:
>>> +      properties:
>>> +        reg:
>>> +          maxItems: 1
>>>     additionalProperties: false
>> Best regards,
>> Krzysztof
>>
Re: [PATCH v3 6/9] dt-bindings: interrupt-controller: realtek,rtl-intc: Add rtl9300-intc
Posted by Rob Herring (Arm) 1 year, 5 months ago
On Thu, 27 Jun 2024 16:33:14 +1200, Chris Packham wrote:
> Add a compatible string for the interrupt controller found on the
> rtl930x SoCs. The interrupt controller has registers for VPE1 so these
> are added as a second reg cell.
> 
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
> 
> Notes:
>     Changes in v3:
>     - Use items to describe the regs property
>     Changes in v2:
>     - Set reg:maxItems to 2 to allow for VPE1 registers on the rtl9300. Add
>       a condition to enforce the old limit on other SoCs.
>     - Connor and Krzysztof offered acks on v1 but I think the changes here
>       are big enough to void those.
> 
>  .../interrupt-controller/realtek,rtl-intc.yaml | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
> 

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

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/interrupt-controller/realtek,rtl-intc.example.dtb: interrupt-controller@3000: reg: [[12288, 24]] is too short
	from schema $id: http://devicetree.org/schemas/interrupt-controller/realtek,rtl-intc.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240627043317.3751996-7-chris.packham@alliedtelesis.co.nz

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

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 after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.