diff mbox series

[v4,2/3] dt-bindings: gpio: gpio-mvebu: deprecate armadaxp-gpio

Message ID 20220526012946.3862776-3-chris.packham@alliedtelesis.co.nz
State Not Applicable, archived
Headers show
Series dt-bindings: gpio: gpio-mvebu: Convert to DT schema format | expand

Checks

Context Check Description
robh/checkpatch warning total: 0 errors, 1 warnings, 43 lines checked
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Chris Packham May 26, 2022, 1:29 a.m. UTC
Commit 5f79c651e81e ("arm: mvebu: use global interrupts for GPIOs on
Armada XP") the marvell,armadaxp-gpio compatible obsolete.

The driver code still exists to handle the armadaxp behaviour but all
the in-tree boards use the marvell,armada-370-gpio.  Document the
marvell,armadaxp-gpio compatible as deprecated.

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

Notes:
    This could potentially be squashed into the first commit but it seemed
    more proper to do a straight 1:1 conversion of the old binding then
    clean things up to match reality.
    
    Changes in v4:
    - New

 .../devicetree/bindings/gpio/gpio-mvebu.yaml  | 24 +++++++------------
 1 file changed, 8 insertions(+), 16 deletions(-)

Comments

Krzysztof Kozlowski May 26, 2022, 12:27 p.m. UTC | #1
On 26/05/2022 03:29, Chris Packham wrote:
> Commit 5f79c651e81e ("arm: mvebu: use global interrupts for GPIOs on
> Armada XP") the marvell,armadaxp-gpio compatible obsolete.
> 
> The driver code still exists to handle the armadaxp behaviour but all
> the in-tree boards use the marvell,armada-370-gpio.  Document the
> marvell,armadaxp-gpio compatible as deprecated.
> 
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof
Pali Rohár Nov. 28, 2022, 7:59 a.m. UTC | #2
On Thursday 26 May 2022 13:29:45 Chris Packham wrote:
> Commit 5f79c651e81e ("arm: mvebu: use global interrupts for GPIOs on
> Armada XP") the marvell,armadaxp-gpio compatible obsolete.

No, marvell,armadaxp-gpio is required for per-cpu interrupt support. I fixed it recently:
https://lore.kernel.org/linux-devicetree/20220714115515.5748-2-pali@kernel.org/
https://lore.kernel.org/linux-devicetree/20220714183328.4137-3-pali@kernel.org/

> The driver code still exists to handle the armadaxp behaviour but all
> the in-tree boards use the marvell,armada-370-gpio.  Document the
> marvell,armadaxp-gpio compatible as deprecated.

For per-cpu interrupt support is marvell,armadaxp-gpio needed and
therefore it cannot be deprecated.

What can be deprecated is marvell,armada-370-gpio and it can be replaced
by marvell,orion-gpio, which covers _all_ SoCs starting from the oldest
one = Orion. See discussion for more details:
https://lore.kernel.org/linux-devicetree/20220725200417.nwthxzvdv2bzd5ej@pengutronix.de/

> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
> 
> Notes:
>     This could potentially be squashed into the first commit but it seemed
>     more proper to do a straight 1:1 conversion of the old binding then
>     clean things up to match reality.
>     
>     Changes in v4:
>     - New
> 
>  .../devicetree/bindings/gpio/gpio-mvebu.yaml  | 24 +++++++------------
>  1 file changed, 8 insertions(+), 16 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-mvebu.yaml b/Documentation/devicetree/bindings/gpio/gpio-mvebu.yaml
> index d1695e7bd825..459ec35864fe 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-mvebu.yaml
> +++ b/Documentation/devicetree/bindings/gpio/gpio-mvebu.yaml
> @@ -21,17 +21,21 @@ properties:
>            - enum:
>                - marvell,mv78200-gpio
>                - marvell,armada-370-gpio
> -              - marvell,armadaxp-gpio
>            - const: marvell,orion-gpio
>  
> +      - description: Deprecated binding
> +        items:
> +          - const: marvell,armadaxp-gpio
> +          - const: marvell,orion-gpio
> +        deprecated: true
> +
>    reg:
>      description: |
>        Address and length of the register set for the device. Not used for
>        marvell,armada-8k-gpio.
>  
> -      For the "marvell,armadaxp-gpio" variant a second entry is expected for
> -      the per-cpu registers. For other variants second entry can be provided,
> -      for the PWM function using the GPIO Blink Counter on/off registers.
> +      A second entry can be provided, for the PWM function using the GPIO Blink
> +      Counter on/off registers.
>      minItems: 1
>      maxItems: 2
>  
> @@ -103,18 +107,6 @@ allOf:
>        required:
>          - reg
>  
> -  - if:
> -      properties:
> -        compatible:
> -          contains:
> -            const: marvell,armadaxp-gpio
> -    then:
> -      properties:
> -        reg:
> -          minItems: 2
> -        reg-names:
> -          minItems: 2
> -
>  unevaluatedProperties: true
>  
>  examples:
> -- 
> 2.36.1
>
Chris Packham Nov. 28, 2022, 8:16 p.m. UTC | #3
Hi Pali,

On 28/11/22 20:59, Pali Rohár wrote:
> On Thursday 26 May 2022 13:29:45 Chris Packham wrote:
>> Commit 5f79c651e81e ("arm: mvebu: use global interrupts for GPIOs on
>> Armada XP") the marvell,armadaxp-gpio compatible obsolete.
> No, marvell,armadaxp-gpio is required for per-cpu interrupt support. I fixed it recently:
> https://lore.kernel.org/linux-devicetree/20220714115515.5748-2-pali@kernel.org/
> https://lore.kernel.org/linux-devicetree/20220714183328.4137-3-pali@kernel.org/

I'll reply to these directly but when you changed the compatible to 
armadaxp you changed the meaning of the 2nd reg property.

>
>> The driver code still exists to handle the armadaxp behaviour but all
>> the in-tree boards use the marvell,armada-370-gpio.  Document the
>> marvell,armadaxp-gpio compatible as deprecated.
> For per-cpu interrupt support is marvell,armadaxp-gpio needed and
> therefore it cannot be deprecated.
OK. We can make it un-deprecated (as you say the code exists, just no 
board uses it currently).
>
> What can be deprecated is marvell,armada-370-gpio and it can be replaced
> by marvell,orion-gpio, which covers _all_ SoCs starting from the oldest
> one = Orion. See discussion for more details:
> https://lore.kernel.org/linux-devicetree/20220725200417.nwthxzvdv2bzd5ej@pengutronix.de/

Yes I can see that they're treated the same internally. There had been a 
trend of adding specialization compatible strings just in case they were 
needed in the future even if there was currently no difference between 
the base variant and the newer version. That argument falls a bit flat 
since we never added armada-38x-gpio.

So what path forward would you like to see? I'd happily send a patch 
un-deprecating the armadaxp compatible. I'm a little hesitant to mark 
the armada-370 as deprecated given it's current usage with the in-tree 
dtses.

>
>> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
>> ---
>>
>> Notes:
>>      This could potentially be squashed into the first commit but it seemed
>>      more proper to do a straight 1:1 conversion of the old binding then
>>      clean things up to match reality.
>>      
>>      Changes in v4:
>>      - New
>>
>>   .../devicetree/bindings/gpio/gpio-mvebu.yaml  | 24 +++++++------------
>>   1 file changed, 8 insertions(+), 16 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/gpio/gpio-mvebu.yaml b/Documentation/devicetree/bindings/gpio/gpio-mvebu.yaml
>> index d1695e7bd825..459ec35864fe 100644
>> --- a/Documentation/devicetree/bindings/gpio/gpio-mvebu.yaml
>> +++ b/Documentation/devicetree/bindings/gpio/gpio-mvebu.yaml
>> @@ -21,17 +21,21 @@ properties:
>>             - enum:
>>                 - marvell,mv78200-gpio
>>                 - marvell,armada-370-gpio
>> -              - marvell,armadaxp-gpio
>>             - const: marvell,orion-gpio
>>   
>> +      - description: Deprecated binding
>> +        items:
>> +          - const: marvell,armadaxp-gpio
>> +          - const: marvell,orion-gpio
>> +        deprecated: true
>> +
>>     reg:
>>       description: |
>>         Address and length of the register set for the device. Not used for
>>         marvell,armada-8k-gpio.
>>   
>> -      For the "marvell,armadaxp-gpio" variant a second entry is expected for
>> -      the per-cpu registers. For other variants second entry can be provided,
>> -      for the PWM function using the GPIO Blink Counter on/off registers.
>> +      A second entry can be provided, for the PWM function using the GPIO Blink
>> +      Counter on/off registers.
>>       minItems: 1
>>       maxItems: 2
>>   
>> @@ -103,18 +107,6 @@ allOf:
>>         required:
>>           - reg
>>   
>> -  - if:
>> -      properties:
>> -        compatible:
>> -          contains:
>> -            const: marvell,armadaxp-gpio
>> -    then:
>> -      properties:
>> -        reg:
>> -          minItems: 2
>> -        reg-names:
>> -          minItems: 2
>> -
>>   unevaluatedProperties: true
>>   
>>   examples:
>> -- 
>> 2.36.1
>>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/gpio/gpio-mvebu.yaml b/Documentation/devicetree/bindings/gpio/gpio-mvebu.yaml
index d1695e7bd825..459ec35864fe 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-mvebu.yaml
+++ b/Documentation/devicetree/bindings/gpio/gpio-mvebu.yaml
@@ -21,17 +21,21 @@  properties:
           - enum:
               - marvell,mv78200-gpio
               - marvell,armada-370-gpio
-              - marvell,armadaxp-gpio
           - const: marvell,orion-gpio
 
+      - description: Deprecated binding
+        items:
+          - const: marvell,armadaxp-gpio
+          - const: marvell,orion-gpio
+        deprecated: true
+
   reg:
     description: |
       Address and length of the register set for the device. Not used for
       marvell,armada-8k-gpio.
 
-      For the "marvell,armadaxp-gpio" variant a second entry is expected for
-      the per-cpu registers. For other variants second entry can be provided,
-      for the PWM function using the GPIO Blink Counter on/off registers.
+      A second entry can be provided, for the PWM function using the GPIO Blink
+      Counter on/off registers.
     minItems: 1
     maxItems: 2
 
@@ -103,18 +107,6 @@  allOf:
       required:
         - reg
 
-  - if:
-      properties:
-        compatible:
-          contains:
-            const: marvell,armadaxp-gpio
-    then:
-      properties:
-        reg:
-          minItems: 2
-        reg-names:
-          minItems: 2
-
 unevaluatedProperties: true
 
 examples: