Message ID | 20210208135609.7685-4-Sergey.Semin@baikalelectronics.ru (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | net: stmmac: Fix clocks/reset-related procedures | expand |
On Mon, 08 Feb 2021 16:55:47 +0300, Serge Semin wrote: > 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. 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. > > While at it move the whole allOf-block from the tail of the binding file > to the head of it, as it's normally done in the most of the DT schemas. > > Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> > > --- > > Note this won't break the bindings description, since the "snps,tso" > property isn't parsed by the Allwinner SunX GMAC glue driver, but only > by the generic platform DT-parser. > > Changelog v2: > - Use correct syntax of the JSON pointers, so the later would begin > with a '/' after the '#'. > --- > .../devicetree/bindings/net/snps,dwmac.yaml | 52 +++++++++---------- > 1 file changed, 24 insertions(+), 28 deletions(-) > Reviewed-by: Rob Herring <robh@kernel.org>
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index cb68a8dcafd7..03d58bf9965f 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -37,6 +37,30 @@ select: required: - compatible +allOf: + - $ref: "ethernet-controller.yaml#" + - if: + properties: + compatible: + contains: + enum: + - snps,dwmac-4.00 + - snps,dwmac-4.10a + - snps,dwmac-4.20a + - snps,dwmac-5.10a + - snps,dwxgmac + - snps,dwxgmac-2.10 + + required: + - compatible + then: + properties: + snps,tso: + $ref: /schemas/types.yaml#/definitions/flag + description: + Enables the TSO feature otherwise it will be managed by + MAC HW capability register. + properties: # We need to include all the compatibles from schemas that will @@ -317,34 +341,6 @@ dependencies: snps,reset-active-low: ["snps,reset-gpio"] snps,reset-delay-us: ["snps,reset-gpio"] -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-emac - - allwinner,sun8i-v3s-emac - - allwinner,sun50i-a64-emac - - snps,dwmac-4.00 - - snps,dwmac-4.10a - - snps,dwmac-4.20a - - snps,dwxgmac - - snps,dwxgmac-2.10 - - st,spear600-gmac - - then: - properties: - snps,tso: - $ref: /schemas/types.yaml#/definitions/flag - description: - Enables the TSO feature otherwise it will be managed by - MAC HW capability register. - additionalProperties: true examples:
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. 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. While at it move the whole allOf-block from the tail of the binding file to the head of it, as it's normally done in the most of the DT schemas. Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> --- Note this won't break the bindings description, since the "snps,tso" property isn't parsed by the Allwinner SunX GMAC glue driver, but only by the generic platform DT-parser. Changelog v2: - Use correct syntax of the JSON pointers, so the later would begin with a '/' after the '#'. --- .../devicetree/bindings/net/snps,dwmac.yaml | 52 +++++++++---------- 1 file changed, 24 insertions(+), 28 deletions(-)