Skip to contentSkip to conversation

dt-bindings: net: dwmac: Extend clocks, props desc and constraints

PATCH In review Serge Semin 4 participants 38 messages Mar 13, 2023 – Mar 23, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover dt-bindings: net: dwmac: Extend clocks, props desc and constraints

This patchset is the fourth one in the series of updates implemented in the framework of activity to simplify the DW MAC/STMMAC driver code and provide Baikal GMAC/X-GMAC support after all:

[1: In-review v1]: net: stmmac: Fixes bundle #1

[2: Stalled v1]: net: stmmac: Fixes bundle #2
Link: ---not submitted yet---
[3: Stalled v1]: net: stmmac: Fixes bundle #3
Link: ---not submitted yet---
+> [4: In-review v1]: dt-bindings: net: dwmac: Extend clocks, props desc and constraints +> Link: ---you are looking at it---
[5: Stalled v1]: dt-bindings: net: dwmac: Fix MTL queues and AXI-bus props
Link: ---not submitted yet---
[6: Stalled v1]: net: stmmac: Generic platform res, props and DMA cleanups
Link: ---not submitted yet---
[7: Stalled v1]: net: stmmac: Generic platform rst, phy and clk cleanups
Link: ---not submitted yet---
[8: Stalled v1]: net: stmmac: Main driver code cleanups bundle #1
Link: ---not submitted yet---
[9: Stalled v1]: net: stmmac: Main driver code cleanups bundle #2
Link: ---not submitted yet---
[10: Stalled v1]: net: stmmac: DW MAC HW info init refactoring
Link: ---not submitted yet---
[11: Stalled v1]: net: stmmac: Convert to using HW capabilities bundle #1
Link: ---not submitted yet---
[12: Stalled v1]: net: stmmac: Convert to using HW capabilities bundle #2
Link: ---not submitted yet---
[13: Stalled v1]: net: stmmac: Convert to using HW capabilities bundle #3
Link: ---not submitted yet---
[14: Stalled v1]: net: stmmac: Convert to using HW capabilities bundle #4
Link: ---not submitted yet---
[15: Stalled v1]: net: stmmac: Unify/simplify HW-interface
Link: ---not submitted yet---
[16: Stalled v1]: net: stmmac: Norm/Enh/etc DMA descriptor init fixes
Link: ---not submitted yet---
[17: Stalled v1]: net: stmmac: Norm/Enh/etc DMA descriptor init cleanups
Link: ---not submitted yet---
[18: Stalled v1]: net: stmmac: Main driver code cleanups bundle #3
Link: ---not submitted yet---
[..: In-prep] to be continued (IRQ handling refactoring, SW-reset-less config,
generic GPIO support, ARP offload support, In-band RGMII link state, etc)
[..: In-prep] to be continued (Baikal-{T,M,L,S} SoCs GMAC, X-GMAC and XPCS
support)

Please visit the next link for the detailed justification of the changes series introduced in the list above:

Here is a short summary of what is introduced in this patchset.

The series starts with fixes of the PBL (Programmable DMA Burst length) DT-property, which is supposed to be defined for each DW *MAC IP-core, but not only for a Allwinner sun* and Ingenic GMAC and DW xGMAC. The number of possible PBL values need to be also extended in accordance with the DW *MAC manual. Then the TSO flag property should be also declared free of the vendor-specific conditional schema, because the driver expects the compatible string to have the IP-core version specified anyway and none of the glue-drivers refer to the property directly. Moreover the original Allwinner sunXi bindings file didn't have the TSO-related property declared. So we can freely do that.

Then in order to improve the DT-bindings maintainability we suggest to split up the generic DT-properties and generic DT-nodes schema leaving the properties definition in the "snps,dwmac.yaml" file and moving the generic DW *MAC DT-nodes bindings validation in the dedicated DT-schema "snps,dwmac-generic.yaml".

We've found out that the DW MAC bindings don't provide a correct description of the System/CSR clocks and a comprehensive enough description of the clock-related "snps,clk-csr" property. So in order to have more descriptive bindings we suggest to add a bit more details about the App/CSR clocks and CSR-MDC divider property.

Then seeing the any DW MAC IP-core revision can be equipped with an external Tx/Rx clock sources we suggest to add the "tx"/"rx" clocks declaration into the generic DW MAC DT-schema.

Afterwards a set of the AXI-bus config property cleanups are introduced. First we suggest to drop the "snps,axi-config" property description since it duplicates the stmmac-axi-config sub-node DT-bindings. Second the unevaluatedProperties property is replaced with additionalProperties as more suitable for the "stmmac-axi-config" schema. Third the proper constraints are added to the properties of the "stmmac-axi-config" sub-node.

Then three patches concerning the MTL Tx/Rx queue configs go, which add the sub-nodes properties constraints and fix the MTL Tx queue properties description.

The next patch converts the DW MAC DT-bindings to using the "flag" definition instead of the native boolean type for relevant properties. It's done for the sake of the DT-schema unification.

The series is closed with the two patches concerning the MTL queue config properties dependencies. First one provides a simpler construction for the MTL queue properties inter-dependencies. The second one adds the dependencies definition for the MTL Tx queue CBS-algo properties.

Serge Semin (16):
dt-bindings: net: dwmac: Validate PBL for all IP-cores
dt-bindings: net: dwmac: Extend number of PBL values
dt-bindings: net: dwmac: Fix the TSO property declaration
dt-bindings: net: dwmac: Detach Generic DW MAC bindings
dt-bindings: net: dwmac: Elaborate snps,clk-csr description
dt-bindings: net: dwmac: Elaborate stmmaceth/pclk clocks description
dt-bindings: net: dwmac: Add Tx/Rx clock sources
dt-bindings: net: dwmac: Drop prop names from snps,axi-config
description
dt-bindings: net: dwmac: Prohibit additional props in AXI-config
dt-bindings: net: dwmac: Add AXI-bus properties constraints
dt-bindings: net: dwmac: Add MTL Rx Queue properties constraints
dt-bindings: net: dwmac: Add MTL Tx Queue properties constraints
dt-bindings: net: dwmac: Fix MTL Tx Queue props description
dt-bindings: net: dwmac: Use flag definition instead of booleans
dt-bindings: net: dwmac: Simplify MTL queue props dependencies
dt-bindings: net: dwmac: Add MTL Tx queue CBS-algo props dependencies

 .../bindings/net/snps,dwmac-generic.yaml      | 155 +++++
 .../devicetree/bindings/net/snps,dwmac.yaml   | 586 +++++++-----------
 MAINTAINERS                                   |   1 +
 3 files changed, 381 insertions(+), 361 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml
Signature · 1 line
2.39.2
#1 lore raw

PATCH 1/16 dt-bindings: net: dwmac: Validate PBL for all IP-cores

Indeed the maximum DMA burst length can be programmed not only for DW xGMACs, Allwinner EMACs and Spear SoC GMAC, but in accordance with [1] for Generic DW *MAC IP-cores. Moreover the STMMAC set of drivers parse the property and then apply the configuration for all supported DW MAC devices. All of that makes the property being available for all IP-cores the bindings supports. Let's make sure the PBL-related properties are validated for all of them by the common DW MAC DT schema.

[1] DesignWare Cores Ethernet MAC Universal Databook, Revision 3.73a,

    October 2013, p. 380.

---

Changelog v1:
- Use correct syntax of the JSON pointers, so the later would begin with a '/' after the '#'.

---
 .../devicetree/bindings/net/snps,dwmac.yaml   | 77 +++++++------------
 1 file changed, 26 insertions(+), 51 deletions(-)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +26 -51
index 16b7d2904696..a0a0437eb4f0 100644
@@ -426,6 +426,32 @@ properties:
     description:
       Use Address-Aligned Beats
 
+  snps,pbl:
+    description:
+      Programmable Burst Length (tx and rx)
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [2, 4, 8]
+
+  snps,txpbl:
+    description:
+      Tx Programmable Burst Length. If set, DMA tx will use this
+      value rather than snps,pbl.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [2, 4, 8]
+
+  snps,rxpbl:
+    description:
+      Rx Programmable Burst Length. If set, DMA rx will use this
+      value rather than snps,pbl.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [2, 4, 8]
+
+  snps,no-pbl-x8:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Don\'t multiply the pbl/txpbl/rxpbl values by 8. For core
+      rev < 3.50, don\'t multiply the values by 4.
+
   snps,fixed-burst:
     $ref: /schemas/types.yaml#/definitions/flag
     description:
@@ -556,57 +582,6 @@ dependencies:
 
 allOf:
   - $ref: "ethernet-controller.yaml#"
-  - if:
-      properties:
-        compatible:
-          contains:
-            enum:
-              - allwinner,sun7i-a20-gmac
-              - allwinner,sun8i-a83t-emac
-              - allwinner,sun8i-h3-emac
-              - allwinner,sun8i-r40-gmac
-              - allwinner,sun8i-v3s-emac
-              - allwinner,sun50i-a64-emac
-              - ingenic,jz4775-mac
-              - ingenic,x1000-mac
-              - ingenic,x1600-mac
-              - ingenic,x1830-mac
-              - ingenic,x2000-mac
-              - snps,dwmac-3.50a
-              - snps,dwmac-4.10a
-              - snps,dwmac-4.20a
-              - snps,dwxgmac
-              - snps,dwxgmac-2.10
-              - st,spear600-gmac
-
-    then:
-      properties:
-        snps,pbl:
-          description:
-            Programmable Burst Length (tx and rx)
-          $ref: /schemas/types.yaml#/definitions/uint32
-          enum: [1, 2, 4, 8, 16, 32]
-
-        snps,txpbl:
-          description:
-            Tx Programmable Burst Length. If set, DMA tx will use this
-            value rather than snps,pbl.
-          $ref: /schemas/types.yaml#/definitions/uint32
-          enum: [1, 2, 4, 8, 16, 32]
-
-        snps,rxpbl:
-          description:
-            Rx Programmable Burst Length. If set, DMA rx will use this
-            value rather than snps,pbl.
-          $ref: /schemas/types.yaml#/definitions/uint32
-          enum: [1, 2, 4, 8, 16, 32]
-
-        snps,no-pbl-x8:
-          $ref: /schemas/types.yaml#/definitions/flag
-          description:
-            Don\'t multiply the pbl/txpbl/rxpbl values by 8. For core
-            rev < 3.50, don\'t multiply the values by 4.
-
   - if:
       properties:
         compatible:
Signature · 1 line
2.39.2
maintainer
#2 lore raw

Re: [PATCH net-next 01/16] dt-bindings: net: dwmac: Validate PBL for all IP-cores

Quoted 14 lines · Serge Semin

Indeed the maximum DMA burst length can be programmed not only for DW xGMACs, Allwinner EMACs and Spear SoC GMAC, but in accordance with [1] for Generic DW *MAC IP-cores. Moreover the STMMAC set of drivers parse the property and then apply the configuration for all supported DW MAC devices. All of that makes the property being available for all IP-cores the bindings supports. Let's make sure the PBL-related properties are validated for all of them by the common DW MAC DT schema.

[1] DesignWare Cores Ethernet MAC Universal Databook, Revision 3.73a,

    October 2013, p. 380.
Quoted 9 lines

---

Changelog v1:
- Use correct syntax of the JSON pointers, so the later would begin with a '/' after the '#'.

---
 .../devicetree/bindings/net/snps,dwmac.yaml   | 77 +++++++------------
 1 file changed, 26 insertions(+), 51 deletions(-)

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,txpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/snps,dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,rxpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/snps,dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,txpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,rxpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: Unevaluated properties are not allowed ('interrupt-names', 'interrupts', 'mac-address', 'phy-mode', 'reg', 'snps,reset-delays-us', 'snps,reset-gpio', 'snps,rxpbl', 'snps,txpbl' were unexpected)
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

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.

#3 lore raw

Re: [PATCH net-next 01/16] dt-bindings: net: dwmac: Validate PBL for all IP-cores

Quoted 31 lines · Rob Herring
Quoted 14 lines · Serge Semin

Indeed the maximum DMA burst length can be programmed not only for DW xGMACs, Allwinner EMACs and Spear SoC GMAC, but in accordance with [1] for Generic DW *MAC IP-cores. Moreover the STMMAC set of drivers parse the property and then apply the configuration for all supported DW MAC devices. All of that makes the property being available for all IP-cores the bindings supports. Let's make sure the PBL-related properties are validated for all of them by the common DW MAC DT schema.

[1] DesignWare Cores Ethernet MAC Universal Databook, Revision 3.73a,

    October 2013, p. 380.
Quoted 9 lines

---

Changelog v1:
- Use correct syntax of the JSON pointers, so the later would begin with a '/' after the '#'.

---
 .../devicetree/bindings/net/snps,dwmac.yaml   | 77 +++++++------------
 1 file changed, 26 insertions(+), 51 deletions(-)

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

Quoted 11 lines

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,txpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/snps,dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,rxpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/snps,dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,txpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,rxpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: Unevaluated properties are not allowed ('interrupt-names', 'interrupts', 'mac-address', 'phy-mode', 'reg', 'snps,reset-delays-us', 'snps,reset-gpio', 'snps,rxpbl', 'snps,txpbl' were unexpected)
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml

Oops, on rebasing my work from older kernel I missed that the PBL properties constraints have already been extended. I'll drop the next patch in the series then and fix this one so the already defined constraints would be preserved.

-Serge(y)

Quoted 18 lines

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

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.

#4 lore raw

Re: [PATCH net-next 01/16] dt-bindings: net: dwmac: Validate PBL for all IP-cores

Quoted 44 lines · Serge Semin
Quoted 31 lines · Rob Herring
Quoted 14 lines · Serge Semin

Indeed the maximum DMA burst length can be programmed not only for DW xGMACs, Allwinner EMACs and Spear SoC GMAC, but in accordance with [1] for Generic DW *MAC IP-cores. Moreover the STMMAC set of drivers parse the property and then apply the configuration for all supported DW MAC devices. All of that makes the property being available for all IP-cores the bindings supports. Let's make sure the PBL-related properties are validated for all of them by the common DW MAC DT schema.

[1] DesignWare Cores Ethernet MAC Universal Databook, Revision 3.73a,

    October 2013, p. 380.
Quoted 9 lines

---

Changelog v1:
- Use correct syntax of the JSON pointers, so the later would begin with a '/' after the '#'.

---
 .../devicetree/bindings/net/snps,dwmac.yaml   | 77 +++++++------------
 1 file changed, 26 insertions(+), 51 deletions(-)

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

Quoted 11 lines

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,txpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/snps,dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,rxpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/snps,dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,txpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,rxpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: Unevaluated properties are not allowed ('interrupt-names', 'interrupts', 'mac-address', 'phy-mode', 'reg', 'snps,reset-delays-us', 'snps,reset-gpio', 'snps,rxpbl', 'snps,txpbl' were unexpected)
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml

Quoted 4 lines

Oops, on rebasing my work from older kernel I missed that the PBL properties constraints have already been extended. I'll drop the next patch in the series then and fix this one so the already defined constraints would be preserved.

BTW it's strange I didn't have that bug spotted during my dt_binding_check run...

-Serge(y)

Quoted 21 lines

-Serge(y)

Quoted 18 lines

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

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.

maintainer
#5 lore raw

Re: [PATCH net-next 01/16] dt-bindings: net: dwmac: Validate PBL for all IP-cores

Quoted 45 lines · Serge Semin
Quoted 44 lines · Serge Semin
Quoted 42 lines · Rob Herring
Quoted 14 lines · Serge Semin

Indeed the maximum DMA burst length can be programmed not only for DW xGMACs, Allwinner EMACs and Spear SoC GMAC, but in accordance with [1] for Generic DW *MAC IP-cores. Moreover the STMMAC set of drivers parse the property and then apply the configuration for all supported DW MAC devices. All of that makes the property being available for all IP-cores the bindings supports. Let's make sure the PBL-related properties are validated for all of them by the common DW MAC DT schema.

[1] DesignWare Cores Ethernet MAC Universal Databook, Revision 3.73a,

    October 2013, p. 380.
Quoted 9 lines

---

Changelog v1:
- Use correct syntax of the JSON pointers, so the later would begin with a '/' after the '#'.

---
 .../devicetree/bindings/net/snps,dwmac.yaml   | 77 +++++++------------
 1 file changed, 26 insertions(+), 51 deletions(-)

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,txpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/snps,dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,rxpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/snps,dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,txpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,rxpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: Unevaluated properties are not allowed ('interrupt-names', 'interrupts', 'mac-address', 'phy-mode', 'reg', 'snps,reset-delays-us', 'snps,reset-gpio', 'snps,rxpbl', 'snps,txpbl' were unexpected)
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml

Quoted 7 lines
Quoted 4 lines

Oops, on rebasing my work from older kernel I missed that the PBL properties constraints have already been extended. I'll drop the next patch in the series then and fix this one so the already defined constraints would be preserved.

BTW it's strange I didn't have that bug spotted during my dt_binding_check run...

Perhaps because you set DT_SCHEMA_FILES?

#6 lore raw

Re: [PATCH net-next 01/16] dt-bindings: net: dwmac: Validate PBL for all IP-cores

Quoted 51 lines · Rob Herring
Quoted 50 lines · Serge Semin
Quoted 48 lines · Serge Semin
Quoted 31 lines · Rob Herring
Quoted 14 lines · Serge Semin

Indeed the maximum DMA burst length can be programmed not only for DW xGMACs, Allwinner EMACs and Spear SoC GMAC, but in accordance with [1] for Generic DW *MAC IP-cores. Moreover the STMMAC set of drivers parse the property and then apply the configuration for all supported DW MAC devices. All of that makes the property being available for all IP-cores the bindings supports. Let's make sure the PBL-related properties are validated for all of them by the common DW MAC DT schema.

[1] DesignWare Cores Ethernet MAC Universal Databook, Revision 3.73a,

    October 2013, p. 380.
Quoted 9 lines

---

Changelog v1:
- Use correct syntax of the JSON pointers, so the later would begin with a '/' after the '#'.

---
 .../devicetree/bindings/net/snps,dwmac.yaml   | 77 +++++++------------
 1 file changed, 26 insertions(+), 51 deletions(-)

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check' on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

Quoted 11 lines

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,txpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/snps,dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,rxpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/snps,dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,txpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: snps,rxpbl:0:0: 1 is not one of [2, 4, 8]
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.example.dtb: ethernet@1101c000: Unevaluated properties are not allowed ('interrupt-names', 'interrupts', 'mac-address', 'phy-mode', 'reg', 'snps,reset-delays-us', 'snps,reset-gpio', 'snps,rxpbl', 'snps,txpbl' were unexpected)
From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mediatek-dwmac.yaml

Oops, on rebasing my work from older kernel I missed that the PBL properties constraints have already been extended. I'll drop the next patch in the series then and fix this one so the already defined constraints would be preserved.

Quoted 5 lines
Quoted 2 lines

BTW it's strange I didn't have that bug spotted during my dt_binding_check run...

Perhaps because you set DT_SCHEMA_FILES?

Can't remember now. I might have missed that in the long log as well. Anyway I'll test it out one more time before fixing. Thanks for your response.

-Serge(y)

#7 lore raw

PATCH 2/16 dt-bindings: net: dwmac: Extend number of PBL values

In reply to Serge Semin

In accordance with [1] the permitted PBL values can be set as one of [1, 2, 4, 8, 16, 32]. The rest of the values result in undefined behavior. At the same time some of the permitted values can be also invalid depending on the controller FIFOs size and the data bus width. Due to having too many variables all the possible PBL property constraints can't be implemented in the bindings schema, let's extend the set of permitted PBL values to be as much as the configuration register supports leaving the undefined behaviour cases for developers to handle.

[1] DesignWare Cores Ethernet MAC Universal Databook, Revision 3.73a,

    October 2013, p. 380.

---

Changelog v1:
- Use correct syntax of the JSON pointers, so the later would begin with a '/' after the '#'.

---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +7 -4
index a0a0437eb4f0..fb9b8506a48f 100644
@@ -428,23 +428,26 @@ properties:
 
   snps,pbl:
     description:
-      Programmable Burst Length (tx and rx)
+      Programmable Burst Length (tx and rx). Note some of these values
+      can be still invalid due to HW limitations connected with the data
+      bus width and the FIFOs depth, so a total length of a single DMA
+      burst shouldn't exceed half the FIFO depth.
     $ref: /schemas/types.yaml#/definitions/uint32
-    enum: [2, 4, 8]
+    enum: [1, 2, 4, 8, 16, 32]
 
   snps,txpbl:
     description:
       Tx Programmable Burst Length. If set, DMA tx will use this
       value rather than snps,pbl.
     $ref: /schemas/types.yaml#/definitions/uint32
-    enum: [2, 4, 8]
+    enum: [1, 2, 4, 8, 16, 32]
 
   snps,rxpbl:
     description:
       Rx Programmable Burst Length. If set, DMA rx will use this
       value rather than snps,pbl.
     $ref: /schemas/types.yaml#/definitions/uint32
-    enum: [2, 4, 8]
+    enum: [1, 2, 4, 8, 16, 32]
 
   snps,no-pbl-x8:
     $ref: /schemas/types.yaml#/definitions/flag
Signature · 1 line
2.39.2
#8 lore raw

PATCH 3/16 dt-bindings: net: dwmac: Fix the TSO property declaration

In reply to Serge Semin

Indeed the STMMAC driver doesn't take the vendor-specific compatible string into account to parse the "snps,tso" boolean property. It just makes sure the node is compatible with DW MAC 4.x, 5.x and DW xGMAC IP-cores. The original allwinner sunXi bindings file also didn't have the TSO-related property declared. Neither Ingenic nor Loongson LLD drivers activate the GMAC4/5/etc-specific core code. Taking all of that into account fix the conditional statement so the TSO-property would be evaluated for the compatibles having the corresponding IP-core version by dropping all of the vendor-specific compatibles from the property conditional statement.

---

Note this won't break the bindings description, since the "snps,tso" property isn't parsed by the denoted glue drivers, but only by the generic platform DT-parser.

Changelog v1:
- Use correct syntax of the JSON pointers, so the later would begin with a '/' after the '#'.

---
 .../devicetree/bindings/net/snps,dwmac.yaml       | 15 ---------------
 1 file changed, 15 deletions(-)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +0 -15
index fb9b8506a48f..92feed3c29bc 100644
@@ -590,27 +590,12 @@ allOf:
         compatible:
           contains:
             enum:
-              - allwinner,sun7i-a20-gmac
-              - allwinner,sun8i-a83t-emac
-              - allwinner,sun8i-h3-emac
-              - allwinner,sun8i-r40-gmac
-              - allwinner,sun8i-v3s-emac
-              - allwinner,sun50i-a64-emac
-              - loongson,ls2k-dwmac
-              - loongson,ls7a-dwmac
-              - ingenic,jz4775-mac
-              - ingenic,x1000-mac
-              - ingenic,x1600-mac
-              - ingenic,x1830-mac
-              - ingenic,x2000-mac
               - snps,dwmac-4.00
               - snps,dwmac-4.10a
               - snps,dwmac-4.20a
               - snps,dwmac-5.10a
               - snps,dwxgmac
               - snps,dwxgmac-2.10
-              - st,spear600-gmac
-
     then:
       properties:
         snps,tso:
Signature · 1 line
2.39.2
#9 lore raw

PATCH 4/16 dt-bindings: net: dwmac: Detach Generic DW MAC bindings

In reply to Serge Semin

Currently the snps,dwmac.yaml DT bindings file is used for both DT nodes describing generic DW MAC devices and as DT schema with common properties to be evaluated against a vendor-specific DW MAC IP-cores. Due to such dual-purpose design the "compatible" property of the common DW MAC schema needs to contain the vendor-specific strings to successfully pass the schema evaluation in case if it's referenced from the vendor-specific DT bindings. That's a bad design from maintainability point of view, since adding/removing any DW MAC-based device bindings requires the common schema modification. In order to fix that let's detach the schema which provides the generic DW MAC DT nodes evaluation into a dedicated DT bindings file preserving the common DW MAC properties declaration in the snps,dwmac.yaml file. By doing so we'll still provide a common properties evaluation for each vendor-specific MAC bindings which refer to the common bindings file, while the generic DW MAC DT nodes will be checked against the new snps,dwmac-generic.yaml DT schema.

While at it extend the DW GMAC and xGMAC compatibles set with known to be released DW GMAC v3.72a, 3.73a, 3.74a and DW xGMAC v2.11a IP-cores.

---

Changelog v1:
- Add a note to the snps,dwmac-generic.yaml bindings file description of a requirement to create a new DT bindings file for the vendor-specific versions of the DW MAC.

Changelog v2:
- Replace double quotes with single ones in the select pattern strings. After doing so we can discard escaping the backslash in the regexpes.
- Add DW GMAC v3.72a, 3.73a, 3.74a and DW xGMAC v2.11a compatibles.

---
 .../bindings/net/snps,dwmac-generic.yaml      | 155 ++++++++++++++++++
 .../devicetree/bindings/net/snps,dwmac.yaml   | 149 +----------------
 MAINTAINERS                                   |   1 +
 3 files changed, 158 insertions(+), 147 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml
Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml new file +155 -0
new file mode 100644
index 000000000000..ae740a1ab213
@@ -0,0 +1,155 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/snps,dwmac-generic.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Synopsys DesignWare Generic MAC Device Tree Bindings
+
+maintainers:
+  - Alexandre Torgue <[email protected]>
+  - Giuseppe Cavallaro <[email protected]>
+  - Jose Abreu <[email protected]>
+
+description:
+  The primary purpose of this bindings file is to validate the Generic
+  Synopsys Desginware MAC DT nodes defined in accordance with the select
+  schema. All new vendor-specific versions of the DW *MAC IP-cores must
+  be described in a dedicated DT bindings file.
+
+# Select the DT nodes, which have got compatible strings either as just a
+# single string with IP-core name optionally followed by the IP version or
+# two strings: one with IP-core name plus the IP version, another as just
+# the IP-core name.
+select:
+  properties:
+    compatible:
+      oneOf:
+        - items:
+            - pattern: '^snps,dw(xg)+mac(-[0-9]+\.[0-9]+a?)?$'
+        - items:
+            - pattern: '^snps,dwmac-[0-9]+\.[0-9]+a?$'
+            - const: snps,dwmac
+        - items:
+            - pattern: '^snps,dwxgmac-[0-9]+\.[0-9]+a?$'
+            - const: snps,dwxgmac
+
+  required:
+    - compatible
+
+allOf:
+  - $ref: snps,dwmac.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - description: Generic Synopsys DW MAC
+        oneOf:
+          - items:
+              - enum:
+                  - snps,dwmac-3.40a
+                  - snps,dwmac-3.50a
+                  - snps,dwmac-3.610
+                  - snps,dwmac-3.70a
+                  - snps,dwmac-3.710
+                  - snps,dwmac-3.72a
+                  - snps,dwmac-3.73a
+                  - snps,dwmac-3.74a
+                  - snps,dwmac-4.00
+                  - snps,dwmac-4.10a
+                  - snps,dwmac-4.20a
+              - const: snps,dwmac
+          - const: snps,dwmac
+      - description: Generic Synopsys DW xGMAC
+        oneOf:
+          - items:
+              - enum:
+                  - snps,dwxgmac-2.10
+                  - snps,dwxgmac-2.11a
+              - const: snps,dwxgmac
+          - const: snps,dwxgmac
+      - description: ST SPEAr SoC Family GMAC
+        deprecated: true
+        const: st,spear600-gmac
+
+  reg:
+    maxItems: 1
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    ethernet@e0800000 {
+        compatible = "snps,dwxgmac-2.10", "snps,dwxgmac";
+        reg = <0xe0800000 0x8000>;
+
+        interrupt-parent = <&vic1>;
+        interrupts = <24 23 22>;
+        interrupt-names = "macirq", "eth_wake_irq", "eth_lpi";
+
+        mac-address = [000000000000]; /* Filled in by U-Boot */
+        max-frame-size = <3800>;
+
+        snps,multicast-filter-bins = <256>;
+        snps,perfect-filter-entries = <128>;
+
+        rx-fifo-depth = <16384>;
+        tx-fifo-depth = <16384>;
+
+        clocks = <&clock>;
+        clock-names = "stmmaceth";
+
+        phy-mode = "gmii";
+
+        snps,axi-config = <&stmmac_axi_setup>;
+        snps,mtl-rx-config = <&mtl_rx_setup>;
+        snps,mtl-tx-config = <&mtl_tx_setup>;
+
+        stmmac_axi_setup: stmmac-axi-config {
+            snps,wr_osr_lmt = <0xf>;
+            snps,rd_osr_lmt = <0xf>;
+            snps,blen = <256 128 64 32 0 0 0>;
+        };
+
+        mtl_rx_setup: rx-queues-config {
+            snps,rx-queues-to-use = <1>;
+            snps,rx-sched-sp;
+
+            queue0 {
+                snps,dcb-algorithm;
+                snps,map-to-dma-channel = <0x0>;
+                snps,priority = <0x0>;
+            };
+        };
+
+        mtl_tx_setup: tx-queues-config {
+            snps,tx-queues-to-use = <2>;
+            snps,tx-sched-wrr;
+
+            queue0 {
+                snps,weight = <0x10>;
+                snps,dcb-algorithm;
+                snps,priority = <0x0>;
+            };
+
+            queue1 {
+                snps,avb-algorithm;
+                snps,send_slope = <0x1000>;
+                snps,idle_slope = <0x1000>;
+                snps,high_credit = <0x3E800>;
+                snps,low_credit = <0xFFC18000>;
+                snps,priority = <0x1>;
+            };
+        };
+
+        mdio {
+            compatible = "snps,dwmac-mdio";
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            phy0: ethernet-phy@0 {
+                reg = <0>;
+            };
+        };
+    };
+...
Documentation/devicetree/bindings/net/snps,dwmac.yaml +2 -147

167 lines not on this page · raw message

MAINTAINERS +1 -0
index ec57c42ed544..30d90d9daa9c 100644
@@ -20017,6 +20017,7 @@ M:	Jose Abreu <[email protected]>
 L:	[email protected]
 S:	Supported
 W:	http://www.stlinux.com
+F:	Documentation/devicetree/bindings/net/snps,dwmac*.yaml
 F:	Documentation/networking/device_drivers/ethernet/stmicro/
 F:	drivers/net/ethernet/stmicro/stmmac/
 
Signature · 8 lines
2.39.2



_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#10 lore raw

PATCH 5/16 dt-bindings: net: dwmac: Elaborate snps,clk-csr description

In reply to Serge Semin

The property is utilized to set the CSR-MDC clock selector in the STMMAC driver. The specified value is used instead of auto-detecting the CSR/application clocks divider based on the reference clock rate. Let's add a more detailed description to clarify the property purpose and permitted values. In the later case the constraints are specified based on the DW *MAC CR registers permitted values.

---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +9 -1
index 224f8f70db85..edef405766e4 100644
@@ -427,7 +427,15 @@ properties:
   snps,clk-csr:
     $ref: /schemas/types.yaml#/definitions/uint32
     description:
-      Frequency division factor for MDC clock.
+      CSR-MDC clock selector. It sets up a divider of the CSR/application
+      clock to create an MDC signal with desired frequency. Note the
+      property value doesn't specify the divider itself by encodes the
+      corresponding divider value specific to the IP-core.
+      DW GMAC 0 - 42, 1 - 62, 2 - 16, 3 - 26, 4 - 102, 5 - 124, 8 - 4,
+              9 - 6, 10 - 8, 11 - 10, 12 - 12, 13 - 14, 14 - 16, 15 - 18.
+      DW xGMAC 0 - 62, 1 - 102, 2 - 122, 3 - 142, 4 - 162, 5 - 202.
+    minimum: 0
+    maximum: 15
 
   mdio:
     $ref: mdio.yaml#
Signature · 1 line
2.39.2
Acked-by on v1 5/16
#11 lore raw

Re: [PATCH net-next 05/16] dt-bindings: net: dwmac: Elaborate snps,clk-csr description

Quoted 10 lines · Serge Semin

The property is utilized to set the CSR-MDC clock selector in the STMMAC driver. The specified value is used instead of auto-detecting the CSR/application clocks divider based on the reference clock rate. Let's add a more detailed description to clarify the property purpose and permitted values. In the later case the constraints are specified based on the DW *MAC CR registers permitted values.

---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 10 +++++

Best regards,
Krzysztof

#12 lore raw

PATCH 6/16 dt-bindings: net: dwmac: Elaborate stmmaceth/pclk clocks description

In reply to Serge Semin

Current clocks description doesn't provide a comprehensive notion about what "stmmaceth" and "pclk" actually represent from the IP-core manual point of view. The bindings file states:
stmmaceth - "GMAC main clock",
apb - "Peripheral registers interface clock".
It isn't that easy to understand what they actually mean especially seeing the DW *MAC manual operates with clock definitions like Application, System, Host, CSR, Transmit, Receive, etc clocks. Moreover the clocks usage in the driver doesn't shade a full light on their essence. What inferred from there is that the "stmmaceth" name has been assigned to the common clock, which feeds both system and CSR interfaces. But what about "apb"? The bindings defines it as the clock for "peripheral registers interface". So it's close to the CSR clock in the IP-core manual notation. If so then when "apb" clock is specified aside with the "stmmaceth", it represents a case when the DW *MAC is synthesized with CSR_SLV_CLK=y (separate system and CSR clocks). But even though the "apb" clock is requested in the MAC driver, the driver doesn't actually use it as a separate CSR clock where the IP-core manual requires. All of that makes me thinking that the case of separate system and CSR clocks isn't correctly implemented in the driver.

Let's start with elaborating the clocks description so anyone reading the DW *MAC bindings file would understand that "stmmaceth" is the system clock and "pclk" is actually the CSR clock. Indeed in accordance with sheets depicted in [1]:
system/application clock can be either of: hclk_i, aclk_i, clk_app_i; CSR clock can be either of: hclk_i, aclk_i, clk_app_i, clk_csr_i. (Similar definitions present in the others IP-core manuals.) So the CSR clock can be tied to the application clock considering the later as the main clock, but not the other way around. In case if there is only "stmmaceth" clock specified in a DT node, then it will be considered as a source of clock signal for both application and CSR. But if "pclk" is also specified in the list of the device clocks, then it will be perceived as the separate CSR clock.

[1] DesignWare Cores Ethernet MAC Universal Databook, Revision 3.73a,

    October 2013, p. 564.
---
 .../devicetree/bindings/net/snps,dwmac.yaml          | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +10 -2
index edef405766e4..3e3fbc1dfafa 100644
@@ -37,8 +37,16 @@ properties:
     maxItems: 8
     additionalItems: true
     items:
-      - description: GMAC main clock
-      - description: Peripheral registers interface clock
+      - description:
+          GMAC main clock, also called as system/application clock.
+          This clock is used to provide a periodic signal for the DMA/MTL
+          interface and optionally for CSR, if the later isn't separately
+          clocked.
+      - description:
+          Peripheral registers interface clock, also called as CSR clock.
+          MCI, CSR and SMA interfaces run on this clock. If it's omitted,
+          the CSR interfaces are considered as synchronous to the system
+          clock domain.
       - description:
           PTP reference clock. This clock is used for programming the
           Timestamp Addend Register. If not passed then the system
Signature · 1 line
2.39.2
#13 lore raw

PATCH 7/16 dt-bindings: net: dwmac: Add Tx/Rx clock sources

In reply to Serge Semin

Generic DW *MAC can be connected to an external Transmit and Receive clock generators. Add the corresponding clocks description and clock-names to the generic bindings schema so new DW *MAC-based bindings wouldn't declare its own names of the same clocks.

---
 .../devicetree/bindings/net/snps,dwmac.yaml        | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +14 -0
index 3e3fbc1dfafa..01f385867c3a 100644
@@ -47,6 +47,18 @@ properties:
           MCI, CSR and SMA interfaces run on this clock. If it's omitted,
           the CSR interfaces are considered as synchronous to the system
           clock domain.
+      - description:
+          GMAC Tx clock or so called Transmit clock. The clock is supplied
+          by an external with respect to the DW MAC clock generator.
+          The clock source and its frequency depends on the DW MAC xMII mode.
+          In case if it's supplied by PHY/SerDes this property can be
+          omitted.
+      - description:
+          GMAC Rx clock or so called Receive clock. The clock is supplied
+          by an external with respect to the DW MAC clock generator.
+          The clock source and its frequency depends on the DW MAC xMII mode.
+          In case if it's supplied by PHY/SerDes or it's synchronous to
+          the Tx clock this property can be omitted.
       - description:
           PTP reference clock. This clock is used for programming the
           Timestamp Addend Register. If not passed then the system
@@ -60,6 +72,8 @@ properties:
       enum:
         - stmmaceth
         - pclk
+        - tx
+        - rx
         - ptp_ref
 
   resets:
Signature · 1 line
2.39.2
#14 lore raw

PATCH 8/16 dt-bindings: net: dwmac: Drop prop names from snps,axi-config description

In reply to Serge Semin

The property is supposed to contain a phandle reference to the DT-node with the AXI-bus parameters. Such DT-node is described in the same DT-bindings schema by means of the sub-node with the name "stmmac-axi-config". Similarly to MTL Tx/Rx config phandle properties let's drop the target DT-node properties list from the "snps,axi-config" property description since having that duplicate is not only pointless, but also worsens the bindings maintainability by causing a need to support the two identical lists. Instead the reference to the target DT-node is added to the description.

---
 .../devicetree/bindings/net/snps,dwmac.yaml        | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +3 -11
index 01f385867c3a..89be67e55c3e 100644
@@ -98,17 +98,9 @@ properties:
   snps,axi-config:
     $ref: /schemas/types.yaml#/definitions/phandle
     description:
-      AXI BUS Mode parameters. Phandle to a node that can contain the
-      following properties
-        * snps,lpi_en, enable Low Power Interface
-        * snps,xit_frm, unlock on WoL
-        * snps,wr_osr_lmt, max write outstanding req. limit
-        * snps,rd_osr_lmt, max read outstanding req. limit
-        * snps,kbbe, do not cross 1KiB boundary.
-        * snps,blen, this is a vector of supported burst length.
-        * snps,fb, fixed-burst
-        * snps,mb, mixed-burst
-        * snps,rb, rebuild INCRx Burst
+      AXI BUS Mode parameters. Phandle to a node that
+      implements the 'stmmac-axi-config' object described in
+      this binding.
 
   snps,mtl-rx-config:
     $ref: /schemas/types.yaml#/definitions/phandle
Signature · 1 line
2.39.2
Acked-by on v1 8/16
#15 lore raw

Re: [PATCH net-next 08/16] dt-bindings: net: dwmac: Drop prop names from snps,axi-config description

Quoted 10 lines · Serge Semin

The property is supposed to contain a phandle reference to the DT-node with the AXI-bus parameters. Such DT-node is described in the same DT-bindings schema by means of the sub-node with the name "stmmac-axi-config". Similarly to MTL Tx/Rx config phandle properties let's drop the target DT-node properties list from the "snps,axi-config" property description since having that duplicate is not only pointless, but also worsens the bindings maintainability by causing a need to support the two identical lists. Instead the reference to the target DT-node is added to the description.

Best regards,
Krzysztof

#16 lore raw

PATCH 9/16 dt-bindings: net: dwmac: Prohibit additional props in AXI-config

In reply to Serge Semin

Currently DT-schema of the AXI-bus config sub-node prohibits to have unknown properties by using the unevaluatedProperties property. It's overkill for the sub-node which doesn't use any combining schemas keywords (allOf, anyOf, etc). Instead more natural is to use additionalProperties to prohibit for that.

---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +2 -1
index 89be67e55c3e..d1b2910b799b 100644
@@ -466,7 +466,6 @@ properties:
 
   stmmac-axi-config:
     type: object
-    unevaluatedProperties: false
     description:
       AXI BUS Mode parameters.
 
@@ -518,6 +517,8 @@ properties:
         description:
           rebuild INCRx Burst
 
+    additionalProperties: false
+
 required:
   - compatible
   - reg
Signature · 1 line
2.39.2
#17 lore raw

Re: [PATCH net-next 09/16] dt-bindings: net: dwmac: Prohibit additional props in AXI-config

Quoted 24 lines · Serge Semin

Currently DT-schema of the AXI-bus config sub-node prohibits to have unknown properties by using the unevaluatedProperties property. It's overkill for the sub-node which doesn't use any combining schemas keywords (allOf, anyOf, etc). Instead more natural is to use additionalProperties to prohibit for that.

---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +0 -1
index 89be67e55c3e..d1b2910b799b 100644
@@ -466,7 +466,6 @@ properties:
 
   stmmac-axi-config:
     type: object
-    unevaluatedProperties: false
     description:
       AXI BUS Mode parameters.
 

Documentation/devicetree/bindings/net/snps,dwmac.yaml properties: · line 520

Quoted 4 lines
Documentation/devicetree/bindings/net/snps,dwmac.yaml +1 -0
@@ -518,6 +517,8 @@ properties:
         description:
           rebuild INCRx Burst
 
+    additionalProperties: false

But why moving it? Keep the same placement.

Best regards,
Krzysztof

#18 lore raw

Re: [PATCH net-next 09/16] dt-bindings: net: dwmac: Prohibit additional props in AXI-config

Quoted 24 lines · Krzysztof Kozlowski
Quoted 23 lines · Serge Semin

Currently DT-schema of the AXI-bus config sub-node prohibits to have unknown properties by using the unevaluatedProperties property. It's overkill for the sub-node which doesn't use any combining schemas keywords (allOf, anyOf, etc). Instead more natural is to use additionalProperties to prohibit for that.

---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +0 -1
index 89be67e55c3e..d1b2910b799b 100644
@@ -466,7 +466,6 @@ properties:
 
   stmmac-axi-config:
     type: object
-    unevaluatedProperties: false
     description:
       AXI BUS Mode parameters.
 
Quoted 7 lines

Documentation/devicetree/bindings/net/snps,dwmac.yaml properties: · line 520

Quoted 5 lines
Documentation/devicetree/bindings/net/snps,dwmac.yaml +1 -0
@@ -518,6 +517,8 @@ properties:
         description:
           rebuild INCRx Burst
 
+    additionalProperties: false

But why moving it? Keep the same placement.

No firm justification except that vast majority of DT bindings have that keyword placed at the tail of the schema body. Anyway I'll get the it back to the original line.

-Serge(y)

Quoted 4 lines

Best regards,
Krzysztof

#19 lore raw

PATCH 10/16 dt-bindings: net: dwmac: Add AXI-bus properties constraints

In reply to Serge Semin

Currently none of the AXI-bus non-boolean DT-properties have constraints defined meanwhile they can be specified at least based on the corresponding device configs. Let's do that:
+ snps,wr_osr_lm/snps,rd_osr_lmt - maximum number of outstanding AXI-bus read/write requests is limited with the IP-core synthesize parameter AXI_MAX_{RD,WR}_REQ. DW MAC/GMAC: <= 16, DW Eth QoS: <= 32, DW xGMAC: <=
64. The least restrictive constraint is defined since the DT-schema is common for all IP-cores.
+ snps,blen - array of the burst lengths supported by the AXI-bus. Values are limited by the AXI3/4 bus standard, available AXI/System bus CSR flags and the AXI-bus IP-core synthesize config . All DW *MACs support setting the burst length within the set: 4, 8, 16, 32, 64, 128, 256. If some burst length is unsupported a zero value can be specified instead in the array.

---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 8 ++++++++
 1 file changed, 8 insertions(+)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +8 -0
index d1b2910b799b..f24718a8d184 100644
@@ -484,11 +484,17 @@ properties:
         $ref: /schemas/types.yaml#/definitions/uint32
         description:
           max write outstanding req. limit
+        default: 1
+        minimum: 1
+        maximum: 64
 
       snps,rd_osr_lmt:
         $ref: /schemas/types.yaml#/definitions/uint32
         description:
           max read outstanding req. limit
+        default: 1
+        minimum: 1
+        maximum: 64
 
       snps,kbbe:
         $ref: /schemas/types.yaml#/definitions/uint32
@@ -501,6 +507,8 @@ properties:
           this is a vector of supported burst length.
         minItems: 7
         maxItems: 7
+        items:
+          enum: [256, 128, 64, 32, 16, 8, 4, 0]
 
       snps,fb:
         $ref: /schemas/types.yaml#/definitions/flag
Signature · 1 line
2.39.2
#20 lore raw

Re: [PATCH net-next 10/16] dt-bindings: net: dwmac: Add AXI-bus properties constraints

Quoted 21 lines · Serge Semin

Currently none of the AXI-bus non-boolean DT-properties have constraints defined meanwhile they can be specified at least based on the corresponding device configs. Let's do that:
+ snps,wr_osr_lm/snps,rd_osr_lmt - maximum number of outstanding AXI-bus read/write requests is limited with the IP-core synthesize parameter AXI_MAX_{RD,WR}_REQ. DW MAC/GMAC: <= 16, DW Eth QoS: <= 32, DW xGMAC: <=
64. The least restrictive constraint is defined since the DT-schema is common for all IP-cores.
+ snps,blen - array of the burst lengths supported by the AXI-bus. Values are limited by the AXI3/4 bus standard, available AXI/System bus CSR flags and the AXI-bus IP-core synthesize config . All DW *MACs support setting the burst length within the set: 4, 8, 16, 32, 64, 128, 256. If some burst length is unsupported a zero value can be specified instead in the array.

snps,kbbe:
$ref: /schemas/types.yaml#/definitions/uint32

Documentation/devicetree/bindings/net/snps,dwmac.yaml properties: · line 511

Quoted 5 lines
Documentation/devicetree/bindings/net/snps,dwmac.yaml +2 -0
@@ -501,6 +507,8 @@ properties:
           this is a vector of supported burst length.
         minItems: 7
         maxItems: 7
+        items:
+          enum: [256, 128, 64, 32, 16, 8, 4, 0]

Increasing order.

Best regards,
Krzysztof

#21 lore raw

Re: [PATCH net-next 10/16] dt-bindings: net: dwmac: Add AXI-bus properties constraints

Quoted 19 lines · Krzysztof Kozlowski
Quoted 18 lines · Serge Semin

Currently none of the AXI-bus non-boolean DT-properties have constraints defined meanwhile they can be specified at least based on the corresponding device configs. Let's do that:
+ snps,wr_osr_lm/snps,rd_osr_lmt - maximum number of outstanding AXI-bus read/write requests is limited with the IP-core synthesize parameter AXI_MAX_{RD,WR}_REQ. DW MAC/GMAC: <= 16, DW Eth QoS: <= 32, DW xGMAC: <=
64. The least restrictive constraint is defined since the DT-schema is common for all IP-cores.
+ snps,blen - array of the burst lengths supported by the AXI-bus. Values are limited by the AXI3/4 bus standard, available AXI/System bus CSR flags and the AXI-bus IP-core synthesize config . All DW *MACs support setting the burst length within the set: 4, 8, 16, 32, 64, 128, 256. If some burst length is unsupported a zero value can be specified instead in the array.

Quoted 11 lines

Documentation/devicetree/bindings/net/snps,dwmac.yaml properties: · line 511

Quoted 8 lines

snps,kbbe:
$ref: /schemas/types.yaml#/definitions/uint32

Documentation/devicetree/bindings/net/snps,dwmac.yaml +2 -0
@@ -501,6 +507,8 @@ properties:
           this is a vector of supported burst length.
         minItems: 7
         maxItems: 7
+        items:
+          enum: [256, 128, 64, 32, 16, 8, 4, 0]

Increasing order.

Ok.

-Serge(y)

Quoted 4 lines

Best regards,
Krzysztof

#22 lore raw

PATCH 11/16 dt-bindings: net: dwmac: Add MTL Rx Queue properties constraints

In reply to Serge Semin

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.

---
 .../devicetree/bindings/net/snps,dwmac.yaml          | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +11 -1
index f24718a8d184..e5662b1498b7 100644
@@ -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:
Signature · 1 line
2.39.2
Acked-by on v1 11/16
#23 lore raw

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

Quoted 5 lines · Serge Semin

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

(...)

Documentation/devicetree/bindings/net/snps,dwmac.yaml properties: · line 178

Quoted 11 lines
Documentation/devicetree/bindings/net/snps,dwmac.yaml +4 -0
+
           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

Best regards,
Krzysztof

#24 lore raw

PATCH 12/16 dt-bindings: net: dwmac: Add MTL Tx Queue properties constraints

In reply to Serge Semin

Currently none of the MTL Tx 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,tx-queues-to-use - number of Tx queues to utilise is limited with a number of available queues. DW MAC/GMAC: no queues, DW Eth QoS: <= 8, DW
xGMAC: <= 16.
+ snps,weight - Tx Queue/Traffic Class quantum/weight utilised depending on enabled algorithm for the Data Center Bridging feature: DWRR (up to 0x1312D0 bytes to add to credit) or WFQ (up to 0x3FFF - least bandwidth) or WFQ (up to 0x64). DW MAC/GMAC: no queues, DW Eth QoS: <= 0x1312D0, DW
xGMAC: <= 0x1312D0.
+ snps,send_slope - Tx Queue/Traffic Class Send-Slope credit value subtracted from the accumulated credit for the Audio/Video bridging feature (CBS algorithm, bits per cycle scaled up by 1,024). DW MAC/GMAC:
no queues, DW Eth QoS: <= 0x2000, DW xGMAC: <= 0x3FFF.
+ snps,idle_slope - same meaning as snps,send_slope except it's determines the Idle-Slope credit of CBS algorithm. DW MAC/GMAC: no queues, DW Eth
QoS: <= 0x2000, DW xGMAC: <= 0x8000.
+ snps,high_credit/snps,low_credit - maximum and minimum values accumulated in the credit for the Audio/Video bridging feature (CBS algorithm, bits scaled up by 1,024). DW MAC/GMAC: no queues, DW Eth
QoS: <= 0x1FFFFFFF, DW xGMAC: <= 0x1FFFFFFF.
+ snps,priority - Tx Queue/Traffic Class priority (enabled by the PFC-packets) limits determined by the VLAN tag PRI field width (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.

---
 .../bindings/net/snps,dwmac-generic.yaml      |  2 +-
 .../devicetree/bindings/net/snps,dwmac.yaml   | 24 ++++++++++++++++++-
 2 files changed, 24 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml +1 -1
index ae740a1ab213..2974af79511d 100644
@@ -137,7 +137,7 @@ examples:
                 snps,send_slope = <0x1000>;
                 snps,idle_slope = <0x1000>;
                 snps,high_credit = <0x3E800>;
-                snps,low_credit = <0xFFC18000>;
+                snps,low_credit = <0x1FC18000>;
                 snps,priority = <0x1>;
             };
         };
Documentation/devicetree/bindings/net/snps,dwmac.yaml +23 -1
index e5662b1498b7..2ebf7995426b 100644
@@ -250,6 +250,10 @@ properties:
       snps,tx-queues-to-use:
         $ref: /schemas/types.yaml#/definitions/uint32
         description: number of TX queues to be used in the driver
+        default: 1
+        minimum: 1
+        maximum: 16
+
       snps,tx-sched-wrr:
         type: boolean
         description: Weighted Round Robin
@@ -296,13 +300,16 @@ properties:
             snps,tx-sched-wfq: false
             snps,tx-sched-dwrr: false
     patternProperties:
-      "^queue[0-9]$":
+      "^queue([0-9]|1[0-5])$":
         description: Each subnode represents a queue.
         type: object
         properties:
           snps,weight:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: TX queue weight (if using a DCB weight algorithm)
+            minimum: 0
+            maximum: 0x1312D0
+
           snps,dcb-algorithm:
             type: boolean
             description: TX queue will be working in DCB
@@ -315,15 +322,27 @@ properties:
           snps,send_slope:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: enable Low Power Interface
+            minimum: 0
+            maximum: 0x3FFF
+
           snps,idle_slope:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: unlock on WoL
+            minimum: 0
+            maximum: 0x8000
+
           snps,high_credit:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: max write outstanding req. limit
+            minimum: 0
+            maximum: 0x1FFFFFFF
+
           snps,low_credit:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: max read outstanding req. limit
+            minimum: 0
+            maximum: 0x1FFFFFFF
+
           snps,priority:
             $ref: /schemas/types.yaml#/definitions/uint32
             description:
@@ -331,6 +350,9 @@ properties:
               When a PFC frame is received with priorities matching the bitmask,
               the queue is blocked from transmitting for the pause time specified
               in the PFC frame.
+            minimum: 0
+            maximum: 0xFF
+
         allOf:
           - if:
               required:
Signature · 8 lines
2.39.2



_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#25 lore raw

Re: [PATCH net-next 12/16] dt-bindings: net: dwmac: Add MTL Tx Queue properties constraints

Quoted 85 lines · Serge Semin

Currently none of the MTL Tx 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,tx-queues-to-use - number of Tx queues to utilise is limited with a number of available queues. DW MAC/GMAC: no queues, DW Eth QoS: <= 8, DW
xGMAC: <= 16.
+ snps,weight - Tx Queue/Traffic Class quantum/weight utilised depending on enabled algorithm for the Data Center Bridging feature: DWRR (up to 0x1312D0 bytes to add to credit) or WFQ (up to 0x3FFF - least bandwidth) or WFQ (up to 0x64). DW MAC/GMAC: no queues, DW Eth QoS: <= 0x1312D0, DW
xGMAC: <= 0x1312D0.
+ snps,send_slope - Tx Queue/Traffic Class Send-Slope credit value subtracted from the accumulated credit for the Audio/Video bridging feature (CBS algorithm, bits per cycle scaled up by 1,024). DW MAC/GMAC:
no queues, DW Eth QoS: <= 0x2000, DW xGMAC: <= 0x3FFF.
+ snps,idle_slope - same meaning as snps,send_slope except it's determines the Idle-Slope credit of CBS algorithm. DW MAC/GMAC: no queues, DW Eth
QoS: <= 0x2000, DW xGMAC: <= 0x8000.
+ snps,high_credit/snps,low_credit - maximum and minimum values accumulated in the credit for the Audio/Video bridging feature (CBS algorithm, bits scaled up by 1,024). DW MAC/GMAC: no queues, DW Eth
QoS: <= 0x1FFFFFFF, DW xGMAC: <= 0x1FFFFFFF.
+ snps,priority - Tx Queue/Traffic Class priority (enabled by the PFC-packets) limits determined by the VLAN tag PRI field width (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.

---
 .../bindings/net/snps,dwmac-generic.yaml      |  2 +-
 .../devicetree/bindings/net/snps,dwmac.yaml   | 24 ++++++++++++++++++-
 2 files changed, 24 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml +1 -1
index ae740a1ab213..2974af79511d 100644
@@ -137,7 +137,7 @@ examples:
                 snps,send_slope = <0x1000>;
                 snps,idle_slope = <0x1000>;
                 snps,high_credit = <0x3E800>;
-                snps,low_credit = <0xFFC18000>;
+                snps,low_credit = <0x1FC18000>;
                 snps,priority = <0x1>;
             };
         };
Documentation/devicetree/bindings/net/snps,dwmac.yaml +8 -1
index e5662b1498b7..2ebf7995426b 100644
@@ -250,6 +250,10 @@ properties:
       snps,tx-queues-to-use:
         $ref: /schemas/types.yaml#/definitions/uint32
         description: number of TX queues to be used in the driver
+        default: 1
+        minimum: 1
+        maximum: 16
+
       snps,tx-sched-wrr:
         type: boolean
         description: Weighted Round Robin
@@ -296,13 +300,16 @@ properties:
             snps,tx-sched-wfq: false
             snps,tx-sched-dwrr: false
     patternProperties:
-      "^queue[0-9]$":
+      "^queue([0-9]|1[0-5])$":
         description: Each subnode represents a queue.
         type: object
         properties:
           snps,weight:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: TX queue weight (if using a DCB weight algorithm)
+            minimum: 0
+            maximum: 0x1312D0
+
           snps,dcb-algorithm:
             type: boolean
             description: TX queue will be working in DCB

Documentation/devicetree/bindings/net/snps,dwmac.yaml properties: · line 326

Quoted 5 lines
Documentation/devicetree/bindings/net/snps,dwmac.yaml +2 -0
@@ -315,15 +322,27 @@ properties:
           snps,send_slope:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: enable Low Power Interface
+            minimum: 0
+            maximum: 0x3FFF

lowercase hex everywhere.

Best regards,
Krzysztof

#26 lore raw

Re: [PATCH net-next 12/16] dt-bindings: net: dwmac: Add MTL Tx Queue properties constraints

Quoted 85 lines · Krzysztof Kozlowski
Quoted 84 lines · Serge Semin

Currently none of the MTL Tx 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,tx-queues-to-use - number of Tx queues to utilise is limited with a number of available queues. DW MAC/GMAC: no queues, DW Eth QoS: <= 8, DW
xGMAC: <= 16.
+ snps,weight - Tx Queue/Traffic Class quantum/weight utilised depending on enabled algorithm for the Data Center Bridging feature: DWRR (up to 0x1312D0 bytes to add to credit) or WFQ (up to 0x3FFF - least bandwidth) or WFQ (up to 0x64). DW MAC/GMAC: no queues, DW Eth QoS: <= 0x1312D0, DW
xGMAC: <= 0x1312D0.
+ snps,send_slope - Tx Queue/Traffic Class Send-Slope credit value subtracted from the accumulated credit for the Audio/Video bridging feature (CBS algorithm, bits per cycle scaled up by 1,024). DW MAC/GMAC:
no queues, DW Eth QoS: <= 0x2000, DW xGMAC: <= 0x3FFF.
+ snps,idle_slope - same meaning as snps,send_slope except it's determines the Idle-Slope credit of CBS algorithm. DW MAC/GMAC: no queues, DW Eth
QoS: <= 0x2000, DW xGMAC: <= 0x8000.
+ snps,high_credit/snps,low_credit - maximum and minimum values accumulated in the credit for the Audio/Video bridging feature (CBS algorithm, bits scaled up by 1,024). DW MAC/GMAC: no queues, DW Eth
QoS: <= 0x1FFFFFFF, DW xGMAC: <= 0x1FFFFFFF.
+ snps,priority - Tx Queue/Traffic Class priority (enabled by the PFC-packets) limits determined by the VLAN tag PRI field width (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.

---
 .../bindings/net/snps,dwmac-generic.yaml      |  2 +-
 .../devicetree/bindings/net/snps,dwmac.yaml   | 24 ++++++++++++++++++-
 2 files changed, 24 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/net/snps,dwmac-generic.yaml +1 -1
index ae740a1ab213..2974af79511d 100644
@@ -137,7 +137,7 @@ examples:
                 snps,send_slope = <0x1000>;
                 snps,idle_slope = <0x1000>;
                 snps,high_credit = <0x3E800>;
-                snps,low_credit = <0xFFC18000>;
+                snps,low_credit = <0x1FC18000>;
                 snps,priority = <0x1>;
             };
         };
Documentation/devicetree/bindings/net/snps,dwmac.yaml +8 -1
index e5662b1498b7..2ebf7995426b 100644
@@ -250,6 +250,10 @@ properties:
       snps,tx-queues-to-use:
         $ref: /schemas/types.yaml#/definitions/uint32
         description: number of TX queues to be used in the driver
+        default: 1
+        minimum: 1
+        maximum: 16
+
       snps,tx-sched-wrr:
         type: boolean
         description: Weighted Round Robin
@@ -296,13 +300,16 @@ properties:
             snps,tx-sched-wfq: false
             snps,tx-sched-dwrr: false
     patternProperties:
-      "^queue[0-9]$":
+      "^queue([0-9]|1[0-5])$":
         description: Each subnode represents a queue.
         type: object
         properties:
           snps,weight:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: TX queue weight (if using a DCB weight algorithm)
+            minimum: 0
+            maximum: 0x1312D0
+
           snps,dcb-algorithm:
             type: boolean
             description: TX queue will be working in DCB
Quoted 8 lines

Documentation/devicetree/bindings/net/snps,dwmac.yaml properties: · line 326

Quoted 6 lines
Documentation/devicetree/bindings/net/snps,dwmac.yaml +2 -0
@@ -315,15 +322,27 @@ properties:
           snps,send_slope:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: enable Low Power Interface
+            minimum: 0
+            maximum: 0x3FFF

lowercase hex everywhere.

Got it. Thanks.

-Serge(y)

Quoted 4 lines

Best regards,
Krzysztof

#27 lore raw

PATCH 13/16 dt-bindings: net: dwmac: Fix MTL Tx Queue props description

In reply to Serge Semin

Invalid MTL Tx Queues DT-properties description was added right at the initial DCB/AVB features patch. Most likely due to copy-paste mistake the text currently matches to what is specified for the AXI-bus config properties. Let's fix that by providing correct descriptions for MTL Tx Queue DT-properties utilized for the AVB feature (CBS algorithm) tuning.

Fixes 19d918731797 ("net: stmmac: configuration of CBS in case of a TX AVB queue")
---
 .../devicetree/bindings/net/snps,dwmac.yaml   | 20 +++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +16 -4
index 2ebf7995426b..69be39d55403 100644
@@ -321,25 +321,37 @@ properties:
               available in this queue.
           snps,send_slope:
             $ref: /schemas/types.yaml#/definitions/uint32
-            description: enable Low Power Interface
+            description:
+              Send-Slope credit value subtracted from the accumulated credit
+              in the Queue for the Audio/Video bridging traffic. This is the
+              rate of the credit change in bits per cycle (40 ns, 8 ns and
+              3.2 ns for 100 Mbps, 1000 Mbps and 2.5/10 Gbps respectively).
             minimum: 0
             maximum: 0x3FFF
 
           snps,idle_slope:
             $ref: /schemas/types.yaml#/definitions/uint32
-            description: unlock on WoL
+            description:
+              Idle-Slope credit value added to the accumulated credit in the
+              Queue with the Audio/Video bridging enabled. This is the
+              rate of the credit change in bits per cycle (40 ns, 8 ns and
+              3.2 ns for 100 Mbps, 1000 Mbps and 2.5/10 Gbps respectively).
             minimum: 0
             maximum: 0x8000
 
           snps,high_credit:
             $ref: /schemas/types.yaml#/definitions/uint32
-            description: max write outstanding req. limit
+            description:
+              Maximum value accumulated in the credit parameter for the
+              Audio/Video bridging feature (specified in bits scaled by 1,024).
             minimum: 0
             maximum: 0x1FFFFFFF
 
           snps,low_credit:
             $ref: /schemas/types.yaml#/definitions/uint32
-            description: max read outstanding req. limit
+            description:
+              Minimum value accumulated in the credit parameter for the
+              Audio/Video bridging feature (specified in bits scaled by 1,024).
             minimum: 0
             maximum: 0x1FFFFFFF
 
Signature · 1 line
2.39.2
#28 lore raw

Re: [PATCH net-next 13/16] dt-bindings: net: dwmac: Fix MTL Tx Queue props description

Quoted 7 lines · Serge Semin

Invalid MTL Tx Queues DT-properties description was added right at the initial DCB/AVB features patch. Most likely due to copy-paste mistake the text currently matches to what is specified for the AXI-bus config properties. Let's fix that by providing correct descriptions for MTL Tx Queue DT-properties utilized for the AVB feature (CBS algorithm) tuning.

Fixes 19d918731797 ("net: stmmac: configuration of CBS in case of a TX AVB queue")

Fixes must be first in the patchset.

Quoted 2 lines

---

Best regards,
Krzysztof

#29 lore raw

Re: [PATCH net-next 13/16] dt-bindings: net: dwmac: Fix MTL Tx Queue props description

Quoted 10 lines · Krzysztof Kozlowski
Quoted 7 lines · Serge Semin

Invalid MTL Tx Queues DT-properties description was added right at the initial DCB/AVB features patch. Most likely due to copy-paste mistake the text currently matches to what is specified for the AXI-bus config properties. Let's fix that by providing correct descriptions for MTL Tx Queue DT-properties utilized for the AVB feature (CBS algorithm) tuning.

Fixes 19d918731797 ("net: stmmac: configuration of CBS in case of a TX AVB queue")

Fixes must be first in the patchset.

Ok.

-Serge(y)

Quoted 8 lines
Quoted 3 lines

---

Best regards,
Krzysztof

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#30 lore raw

PATCH 14/16 dt-bindings: net: dwmac: Use flag definition instead of booleans

In reply to Serge Semin

Currently some of the boolean properties defined in the DT-schema are marked to have the basic boolean type meanwhile the rest referencing the /schemas/types.yaml#/definitions/flag schema. For the sake of unification let's convert the first group to referencing the pre-defined flag schema. Thus bindings will look a bit more coherent and the DT-bindings maintainers will have a better control over the booleans defined in the schema (if ever needed).

---
 .../devicetree/bindings/net/snps,dwmac.yaml   | 45 ++++++++++++-------
 1 file changed, 30 insertions(+), 15 deletions(-)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +30 -15
index 69be39d55403..a863b5860566 100644
@@ -120,11 +120,13 @@ properties:
         maximum: 12
 
       snps,rx-sched-sp:
-        type: boolean
+        $ref: /schemas/types.yaml#/definitions/flag
         description: Strict priority
+
       snps,rx-sched-wsp:
-        type: boolean
+        $ref: /schemas/types.yaml#/definitions/flag
         description: Weighted Strict priority
+
     allOf:
       - if:
           required:
@@ -144,11 +146,13 @@ properties:
         type: object
         properties:
           snps,dcb-algorithm:
-            type: boolean
+            $ref: /schemas/types.yaml#/definitions/flag
             description: Queue to be enabled as DCB
+
           snps,avb-algorithm:
-            type: boolean
+            $ref: /schemas/types.yaml#/definitions/flag
             description: Queue to be enabled as AVB
+
           snps,map-to-dma-channel:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: DMA channel id to map
@@ -156,20 +160,25 @@ properties:
             maximum: 15
 
           snps,route-avcp:
-            type: boolean
+            $ref: /schemas/types.yaml#/definitions/flag
             description: AV Untagged Control packets
+
           snps,route-ptp:
-            type: boolean
+            $ref: /schemas/types.yaml#/definitions/flag
             description: PTP Packets
+
           snps,route-dcbcp:
-            type: boolean
+            $ref: /schemas/types.yaml#/definitions/flag
             description: DCB Control Packets
+
           snps,route-up:
-            type: boolean
+            $ref: /schemas/types.yaml#/definitions/flag
             description: Untagged Packets
+
           snps,route-multi-broad:
-            type: boolean
+            $ref: /schemas/types.yaml#/definitions/flag
             description: Multicast & Broadcast Packets
+
           snps,priority:
             $ref: /schemas/types.yaml#/definitions/uint32
             description: Bitmask of the tagged frames priorities assigned to the queue
@@ -255,17 +264,21 @@ properties:
         maximum: 16
 
       snps,tx-sched-wrr:
-        type: boolean
+        $ref: /schemas/types.yaml#/definitions/flag
         description: Weighted Round Robin
+
       snps,tx-sched-wfq:
-        type: boolean
+        $ref: /schemas/types.yaml#/definitions/flag
         description: Weighted Fair Queuing
+
       snps,tx-sched-dwrr:
-        type: boolean
+        $ref: /schemas/types.yaml#/definitions/flag
         description: Deficit Weighted Round Robin
+
       snps,tx-sched-sp:
-        type: boolean
+        $ref: /schemas/types.yaml#/definitions/flag
         description: Strict priority
+
     allOf:
       - if:
           required:
@@ -311,14 +324,16 @@ properties:
             maximum: 0x1312D0
 
           snps,dcb-algorithm:
-            type: boolean
+            $ref: /schemas/types.yaml#/definitions/flag
             description: TX queue will be working in DCB
+
           snps,avb-algorithm:
-            type: boolean
+            $ref: /schemas/types.yaml#/definitions/flag
             description:
               TX queue will be working in AVB.
               Queue 0 is reserved for legacy traffic and so no AVB is
               available in this queue.
+
           snps,send_slope:
             $ref: /schemas/types.yaml#/definitions/uint32
             description:
Signature · 1 line
2.39.2
#31 lore raw

Re: [PATCH net-next 14/16] dt-bindings: net: dwmac: Use flag definition instead of booleans

Quoted 18 lines · Serge Semin

Currently some of the boolean properties defined in the DT-schema are marked to have the basic boolean type meanwhile the rest referencing the /schemas/types.yaml#/definitions/flag schema. For the sake of unification let's convert the first group to referencing the pre-defined flag schema. Thus bindings will look a bit more coherent and the DT-bindings maintainers will have a better control over the booleans defined in the schema (if ever needed).

---
 .../devicetree/bindings/net/snps,dwmac.yaml   | 45 ++++++++++++-------
 1 file changed, 30 insertions(+), 15 deletions(-)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +0 -0
index 69be39d55403..a863b5860566 100644

Documentation/devicetree/bindings/net/snps,dwmac.yaml properties: · line 124

Quoted 6 lines
Documentation/devicetree/bindings/net/snps,dwmac.yaml +1 -1
@@ -120,11 +120,13 @@ properties:
         maximum: 12
 
       snps,rx-sched-sp:
-        type: boolean
+        $ref: /schemas/types.yaml#/definitions/flag
         description: Strict priority

If ever touching this, it should be other way -> boolean.

Best regards,
Krzysztof

#32 lore raw

Re: [PATCH net-next 14/16] dt-bindings: net: dwmac: Use flag definition instead of booleans

Quoted 21 lines · Krzysztof Kozlowski
Quoted 20 lines · Serge Semin

Currently some of the boolean properties defined in the DT-schema are marked to have the basic boolean type meanwhile the rest referencing the /schemas/types.yaml#/definitions/flag schema. For the sake of unification let's convert the first group to referencing the pre-defined flag schema. Thus bindings will look a bit more coherent and the DT-bindings maintainers will have a better control over the booleans defined in the schema (if ever needed).

---
 .../devicetree/bindings/net/snps,dwmac.yaml   | 45 ++++++++++++-------
 1 file changed, 30 insertions(+), 15 deletions(-)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +0 -0
index 69be39d55403..a863b5860566 100644
@@ -120,11 +120,13 @@ properties:
         maximum: 12
 
Quoted 7 lines

Documentation/devicetree/bindings/net/snps,dwmac.yaml properties: · line 124

Quoted 4 lines
Documentation/devicetree/bindings/net/snps,dwmac.yaml +1 -1
       snps,rx-sched-sp:
-        type: boolean
+        $ref: /schemas/types.yaml#/definitions/flag
         description: Strict priority

If ever touching this, it should be other way -> boolean.

Ok. I'll drop the patch then.

-Serge(y)

Quoted 4 lines

Best regards,
Krzysztof

#33 lore raw

PATCH 15/16 dt-bindings: net: dwmac: Simplify MTL queue props dependencies

In reply to Serge Semin

Currently the Tx/Rx queues properties interdependencies are described by means of the pattern: "if: required: X, then: properties: Y: false, Z:
false, etc". Due to very unfortunate MTL Tx/Rx queue DT-node design the resultant sub-nodes schemas look very bulky and thus hard to read. The situation can be improved by using the "allOf:/oneOf: required: X,
required: Y, etc" pattern instead thus getting shorter and a bit easier to comprehend constructions.

---

Note the solution can be shortened out a bit further by replacing the single-entry allOf statements with just the "not: required: etc" pattern. But in order to do that the DT-schema validation tool must be fixed like this:

meta-schemas/nodes.yaml +1 -0
@@ -22,6 +22,7 @@
     - unevaluatedProperties
     - deprecated
     - required
+    - not
     - allOf
     - anyOf
     - oneOf

Thus all the patterns like
allOf:
- not:
required:
- X
could be replaced with just
not:
required:
- X

---
 .../devicetree/bindings/net/snps,dwmac.yaml   | 175 +++++++-----------
 1 file changed, 63 insertions(+), 112 deletions(-)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +63 -112

211 lines not on this page · raw message

Signature · 8 lines
2.39.2



_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer Reviewed-by on v1 15/16
#34 lore raw

Re: [PATCH net-next 15/16] dt-bindings: net: dwmac: Simplify MTL queue props dependencies

Quoted 11 lines · Serge Semin

Currently the Tx/Rx queues properties interdependencies are described by means of the pattern: "if: required: X, then: properties: Y: false, Z:
false, etc". Due to very unfortunate MTL Tx/Rx queue DT-node design the resultant sub-nodes schemas look very bulky and thus hard to read. The situation can be improved by using the "allOf:/oneOf: required: X,
required: Y, etc" pattern instead thus getting shorter and a bit easier to comprehend constructions.

---

Quoted 9 lines

Note the solution can be shortened out a bit further by replacing the single-entry allOf statements with just the "not: required: etc" pattern. But in order to do that the DT-schema validation tool must be fixed like this:

meta-schemas/nodes.yaml line 28

Quoted 7 lines
meta-schemas/nodes.yaml +1 -0
@@ -22,6 +22,7 @@
     - unevaluatedProperties
     - deprecated
     - required
+    - not
     - allOf
     - anyOf
     - oneOf

This should be added regardless. Can you send a patch to devicetree-spec or a GH PR. But I'd skip using that here for now because then we require a new version of dtschema.

Rob

#35 lore raw

Re: [PATCH net-next 15/16] dt-bindings: net: dwmac: Simplify MTL queue props dependencies

Quoted 21 lines · Rob Herring
Quoted 11 lines · Serge Semin

Currently the Tx/Rx queues properties interdependencies are described by means of the pattern: "if: required: X, then: properties: Y: false, Z:
false, etc". Due to very unfortunate MTL Tx/Rx queue DT-node design the resultant sub-nodes schemas look very bulky and thus hard to read. The situation can be improved by using the "allOf:/oneOf: required: X,
required: Y, etc" pattern instead thus getting shorter and a bit easier to comprehend constructions.

---

Quoted 6 lines

Note the solution can be shortened out a bit further by replacing the single-entry allOf statements with just the "not: required: etc" pattern. But in order to do that the DT-schema validation tool must be fixed like this:

Quoted 15 lines

meta-schemas/nodes.yaml line 28

Quoted 10 lines
meta-schemas/nodes.yaml +1 -0
@@ -22,6 +22,7 @@
     - unevaluatedProperties
     - deprecated
     - required
+    - not
     - allOf
     - anyOf
     - oneOf

This should be added regardless. Can you send a patch to devicetree-spec or a GH PR. But I'd skip using that here for now because then we require a new version of dtschema.

Ok. I'll send the patch to the devicetree-spec mailing list.

* Note meta-schemas/base.yaml will be fixed in the similar way.

-Serge(y)

Quoted 2 lines

Rob

#36 lore raw

PATCH 16/16 dt-bindings: net: dwmac: Add MTL Tx queue CBS-algo props dependencies

In reply to Serge Semin

Currently the CBS algorithm specific properties could be used unconditionally in the MTL Tx queue sub-nodes. It's definitely wrong from the correct Tx queue description point of view. Let's fix that in a way so the "snps,send_slope", "snps,idle_slope", "snps,high_credit" and "snps,low_credit" properties would be allowed only if the CBS TC algorithm is enabled for the MTL Tx queue.

---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/net/snps,dwmac.yaml +5 -0
index 9df301cf674e..c6a9b44650c3 100644
@@ -322,7 +322,12 @@ properties:
                 - snps,dcb-algorithm
                 - snps,avb-algorithm
 
+        # Credit Base Shaper is configurable for AVB algo only
         dependencies:
+          snps,send_slope: ["snps,avb-algorithm"]
+          snps,idle_slope: ["snps,avb-algorithm"]
+          snps,high_credit: ["snps,avb-algorithm"]
+          snps,low_credit: ["snps,avb-algorithm"]
           snps,weight: ["snps,dcb-algorithm"]
 
     additionalProperties: false
Signature · 1 line
2.39.2
maintainer Reviewed-by on v1 16/16
#37 lore raw

Re: [PATCH net-next 16/16] dt-bindings: net: dwmac: Add MTL Tx queue CBS-algo props dependencies

Quoted 7 lines · Serge Semin

Currently the CBS algorithm specific properties could be used unconditionally in the MTL Tx queue sub-nodes. It's definitely wrong from the correct Tx queue description point of view. Let's fix that in a way so the "snps,send_slope", "snps,idle_slope", "snps,high_credit" and "snps,low_credit" properties would be allowed only if the CBS TC algorithm is enabled for the MTL Tx queue.

Quoted 5 lines
---
 Documentation/devicetree/bindings/net/snps,dwmac.yaml | 5 +++++
 1 file changed, 5 insertions(+)