diff mbox series

[net-next,11/16] dt-bindings: net: dwmac: Add MTL Rx Queue properties constraints

Message ID 20230313225103.30512-12-Sergey.Semin@baikalelectronics.ru (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series dt-bindings: net: dwmac: Extend clocks, props desc and constraints | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/apply fail Patch does not apply to net-next

Commit Message

Serge Semin March 13, 2023, 10:50 p.m. UTC
Currently none of the MTL Rx Queues QoS-related DT-properties have been
equipped with the proper constraints. Meanwhile they can be specified at
least based on the corresponding CSR field sizes or the DW (x|xG)MAC
IP-core synthesize parameter constraints. Let's do that:
+ snps,rx-queues-to-use - number of Rx queues to utilise is limited with a
number of available queues. DW MAC/GMAC: no queues, DW Eth QoS: <= 8, DW
xGMAC: <= 12.
+ snps,map-to-dma-channel - DMA channel ID is limited with a number of
available DMA-channels. DW MAC/GMAC: <= 3, DW Eth QoS: <= 8, DW xGMAC: <=
16.
+ snps,priority - bitfield of the USP (user Priority) values of the tagged
packets is limited with the corresponding CSR field width or a maximum
possible VLAN tag PRI field value (it's 7). DW MAC/GMAC: no queues, DW Eth
QoS: 0xff, DW xGMAC: 0xff.

Since the constraints vary for different IP-cores and the DT-schema is
common for all of them the least restrictive values are chosen. The info
above can be used for the IP-core specific DT-schemas if anybody ever is
bothered with one to create.

Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
---
 .../devicetree/bindings/net/snps,dwmac.yaml          | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Krzysztof Kozlowski March 16, 2023, 8:07 a.m. UTC | #1
On 13/03/2023 23:50, Serge Semin wrote:
> Currently none of the MTL Rx Queues QoS-related DT-properties have been
> equipped with the proper constraints. Meanwhile they can be specified at
> least based on the corresponding CSR field sizes or the DW (x|xG)MAC
> IP-core synthesize parameter constraints. Let's do that:
> + snps,rx-queues-to-use - number of Rx queues to utilise is limited w

(...)

> +
>            snps,route-avcp:
>              type: boolean
>              description: AV Untagged Control packets
> @@ -166,6 +173,9 @@ properties:
>            snps,priority:
>              $ref: /schemas/types.yaml#/definitions/uint32
>              description: Bitmask of the tagged frames priorities assigned to the queue
> +            minimum: 0
> +            maximum: 0xFF
> +

lowercase hex

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

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index f24718a8d184..e5662b1498b7 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -115,6 +115,10 @@  properties:
       snps,rx-queues-to-use:
         $ref: /schemas/types.yaml#/definitions/uint32
         description: number of RX queues to be used in the driver
+        default: 1
+        minimum: 1
+        maximum: 12
+
       snps,rx-sched-sp:
         type: boolean
         description: Strict priority
@@ -135,7 +139,7 @@  properties:
           properties:
             snps,rx-sched-sp: false
     patternProperties:
-      "^queue[0-9]$":
+      "^queue([0-9]|1[0-1])$":
         description: Each subnode represents a queue.
         type: object
         properties:
@@ -148,6 +152,9 @@  properties:
           snps,map-to-dma-channel:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: DMA channel id to map
+            minimum: 0
+            maximum: 15
+
           snps,route-avcp:
             type: boolean
             description: AV Untagged Control packets
@@ -166,6 +173,9 @@  properties:
           snps,priority:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: Bitmask of the tagged frames priorities assigned to the queue
+            minimum: 0
+            maximum: 0xFF
+
         allOf:
           - if:
               required: