diff mbox series

[net-next,v2,2/2] dt-bindings: net: dsa: vsc73xx: add {rx,tx}-internal-delay-ps

Message ID 20240717212732.1775267-2-paweldembicki@gmail.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2,1/2] net: dsa: vsc73xx: make RGMII delays configurable | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 7 this patch: 7
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 12 of 12 maintainers
netdev/build_clang success Errors and warnings before: 7 this patch: 7
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 7 this patch: 7
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 57 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest fail net-next-2024-07-18--00-00 (tests: 699)

Commit Message

Pawel Dembicki July 17, 2024, 9:27 p.m. UTC
Add a schema validator to vitesse,vsc73xx.yaml for MAC-level RGMII delays
in the CPU port. Additionally, valid values for VSC73XX were defined,
and a common definition for the RX and TX valid range was created.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>

---
v2:
  - added info about default value when the rx/tx delay property
    is missing
---
 .../bindings/net/dsa/vitesse,vsc73xx.yaml     | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)

Comments

Andrew Lunn July 18, 2024, 1:36 a.m. UTC | #1
On Wed, Jul 17, 2024 at 11:27:33PM +0200, Pawel Dembicki wrote:
> Add a schema validator to vitesse,vsc73xx.yaml for MAC-level RGMII delays
> in the CPU port. Additionally, valid values for VSC73XX were defined,
> and a common definition for the RX and TX valid range was created.
> 
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Rob Herring (Arm) July 23, 2024, 2:47 a.m. UTC | #2
On Wed, Jul 17, 2024 at 11:27:33PM +0200, Pawel Dembicki wrote:
> Add a schema validator to vitesse,vsc73xx.yaml for MAC-level RGMII delays
> in the CPU port. Additionally, valid values for VSC73XX were defined,
> and a common definition for the RX and TX valid range was created.
> 
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
> 
> ---
> v2:
>   - added info about default value when the rx/tx delay property
>     is missing
> ---
>  .../bindings/net/dsa/vitesse,vsc73xx.yaml     | 33 +++++++++++++++++++
>  1 file changed, 33 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/dsa/vitesse,vsc73xx.yaml b/Documentation/devicetree/bindings/net/dsa/vitesse,vsc73xx.yaml
> index b99d7a694b70..7022a6afde5c 100644
> --- a/Documentation/devicetree/bindings/net/dsa/vitesse,vsc73xx.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/vitesse,vsc73xx.yaml
> @@ -52,6 +52,25 @@ properties:
>  allOf:
>    - $ref: dsa.yaml#/$defs/ethernet-ports
>  
> +patternProperties:
> +  "^(ethernet-)?ports$":
> +    additionalProperties: true
> +    patternProperties:
> +      "^(ethernet-)?port@6$":
> +        allOf:
> +          - if:
> +              properties:
> +                phy-mode:
> +                  contains:
> +                    enum:
> +                      - rgmii
> +            then:
> +              properties:
> +                rx-internal-delay-ps:
> +                  $ref: "#/$defs/internal-delay-ps"
> +                tx-internal-delay-ps:
> +                  $ref: "#/$defs/internal-delay-ps"
> +
>  # This checks if reg is a chipselect so the device is on an SPI
>  # bus, the if-clause will fail if reg is a tuple such as for a
>  # platform device.
> @@ -67,6 +86,16 @@ required:
>    - compatible
>    - reg
>  
> +$defs:
> +  internal-delay-ps:
> +    description:
> +      Disable tunable delay lines using 0 ps, or enable them and select
> +      the phase between 1400 ps and 2000 ps in increments of 300 ps.
> +      When the property is missing, the delay value is set to 2000 ps
> +      by default.

       default: 2000

Not freeform text.

> +    enum:
> +      [0, 1400, 1700, 2000]
> +
>  unevaluatedProperties: false
>  
>  examples:
> @@ -108,6 +137,8 @@ examples:
>              reg = <6>;
>              ethernet = <&gmac1>;
>              phy-mode = "rgmii";
> +            rx-internal-delay-ps = <0>;
> +            tx-internal-delay-ps = <0>;
>              fixed-link {
>                speed = <1000>;
>                full-duplex;
> @@ -150,6 +181,8 @@ examples:
>            ethernet-port@6 {
>              reg = <6>;
>              ethernet = <&enet0>;
> +            rx-internal-delay-ps = <0>;
> +            tx-internal-delay-ps = <0>;
>              phy-mode = "rgmii";
>              fixed-link {
>                speed = <1000>;
> -- 
> 2.34.1
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/dsa/vitesse,vsc73xx.yaml b/Documentation/devicetree/bindings/net/dsa/vitesse,vsc73xx.yaml
index b99d7a694b70..7022a6afde5c 100644
--- a/Documentation/devicetree/bindings/net/dsa/vitesse,vsc73xx.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/vitesse,vsc73xx.yaml
@@ -52,6 +52,25 @@  properties:
 allOf:
   - $ref: dsa.yaml#/$defs/ethernet-ports
 
+patternProperties:
+  "^(ethernet-)?ports$":
+    additionalProperties: true
+    patternProperties:
+      "^(ethernet-)?port@6$":
+        allOf:
+          - if:
+              properties:
+                phy-mode:
+                  contains:
+                    enum:
+                      - rgmii
+            then:
+              properties:
+                rx-internal-delay-ps:
+                  $ref: "#/$defs/internal-delay-ps"
+                tx-internal-delay-ps:
+                  $ref: "#/$defs/internal-delay-ps"
+
 # This checks if reg is a chipselect so the device is on an SPI
 # bus, the if-clause will fail if reg is a tuple such as for a
 # platform device.
@@ -67,6 +86,16 @@  required:
   - compatible
   - reg
 
+$defs:
+  internal-delay-ps:
+    description:
+      Disable tunable delay lines using 0 ps, or enable them and select
+      the phase between 1400 ps and 2000 ps in increments of 300 ps.
+      When the property is missing, the delay value is set to 2000 ps
+      by default.
+    enum:
+      [0, 1400, 1700, 2000]
+
 unevaluatedProperties: false
 
 examples:
@@ -108,6 +137,8 @@  examples:
             reg = <6>;
             ethernet = <&gmac1>;
             phy-mode = "rgmii";
+            rx-internal-delay-ps = <0>;
+            tx-internal-delay-ps = <0>;
             fixed-link {
               speed = <1000>;
               full-duplex;
@@ -150,6 +181,8 @@  examples:
           ethernet-port@6 {
             reg = <6>;
             ethernet = <&enet0>;
+            rx-internal-delay-ps = <0>;
+            tx-internal-delay-ps = <0>;
             phy-mode = "rgmii";
             fixed-link {
               speed = <1000>;