[PATCH net] dt-bindings: net: sparx5: correct LAN969x register space windows

Robert Marko posted 1 patch 2 months, 3 weeks ago
.../bindings/net/microchip,sparx5-switch.yaml | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
[PATCH net] dt-bindings: net: sparx5: correct LAN969x register space windows
Posted by Robert Marko 2 months, 3 weeks ago
LAN969x needs only 2 register space windows as GCB is already covered by
the "devices" register space window, so expect only 2 "reg" and "reg-names"
properties.

Fixes: 41c6439fdc2b ("dt-bindings: net: add compatible strings for lan969x targets")
Signed-off-by: Robert Marko <robert.marko@sartura.hr>
---
 .../bindings/net/microchip,sparx5-switch.yaml | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml b/Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml
index 082982c59a55..5caa3779660d 100644
--- a/Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml
+++ b/Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml
@@ -55,12 +55,14 @@ properties:
           - const: microchip,lan9691-switch
 
   reg:
+    minItems: 2
     items:
       - description: cpu target
       - description: devices target
       - description: general control block target
 
   reg-names:
+    minItems: 2
     items:
       - const: cpu
       - const: devices
@@ -168,6 +170,26 @@ required:
   - interrupt-names
   - ethernet-ports
 
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - microchip,lan9691-switch
+    then:
+      properties:
+        reg:
+          minItems: 2
+        reg-names:
+          minItems: 2
+    else:
+      properties:
+        reg:
+          minItems: 3
+        reg-names:
+          minItems: 3
+
 additionalProperties: false
 
 examples:
-- 
2.51.0
Re: [PATCH net] dt-bindings: net: sparx5: correct LAN969x register space windows
Posted by Krzysztof Kozlowski 1 month, 3 weeks ago
On 25/09/2025 15:19, Robert Marko wrote:
> LAN969x needs only 2 register space windows as GCB is already covered by
> the "devices" register space window, so expect only 2 "reg" and "reg-names"
> properties.
> 
> Fixes: 41c6439fdc2b ("dt-bindings: net: add compatible strings for lan969x targets")
> Signed-off-by: Robert Marko <robert.marko@sartura.hr>
> ---
>  .../bindings/net/microchip,sparx5-switch.yaml | 22 +++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml b/Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml
> index 082982c59a55..5caa3779660d 100644
> --- a/Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml
> +++ b/Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml
> @@ -55,12 +55,14 @@ properties:
>            - const: microchip,lan9691-switch
>  
>    reg:
> +    minItems: 2
>      items:
>        - description: cpu target
>        - description: devices target
>        - description: general control block target
>  
>    reg-names:
> +    minItems: 2
>      items:
>        - const: cpu
>        - const: devices
> @@ -168,6 +170,26 @@ required:
>    - interrupt-names
>    - ethernet-ports
>  
> +allOf:
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - microchip,lan9691-switch
> +    then:
> +      properties:
> +        reg:
> +          minItems: 2

This is wrong. You wanted maxItems.

Best regards,
Krzysztof
Re: [PATCH net] dt-bindings: net: sparx5: correct LAN969x register space windows
Posted by Conor Dooley 2 months, 3 weeks ago
Acked-by: Conor Dooley <conor.dooley@microchip.com>