diff mbox series

[net-next,v6,1/2] dt-bindings: net: microchip,ksz: document microchip,rmii-clk-internal

Message ID 7f1f89010743a06c4880fd224149ea495fe32512.1701091042.git.ante.knezic@helmholz.de (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: dsa: microchip: enable setting rmii reference | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/codegen success Generated files up to date
netdev/tree_selection success Clearly marked for net-next
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: 8 this patch: 8
netdev/cc_maintainers success CCed 14 of 14 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
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: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 50 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

Commit Message

Ante Knezic Nov. 27, 2023, 1:20 p.m. UTC
Add documentation for selecting reference rmii clock on KSZ88X3 devices

Signed-off-by: Ante Knezic <ante.knezic@helmholz.de>
---
 .../devicetree/bindings/net/dsa/microchip,ksz.yaml | 38 +++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

Comments

Rob Herring Nov. 28, 2023, 3:02 p.m. UTC | #1
On Mon, Nov 27, 2023 at 02:20:42PM +0100, Ante Knezic wrote:
> Add documentation for selecting reference rmii clock on KSZ88X3 devices
> 
> Signed-off-by: Ante Knezic <ante.knezic@helmholz.de>
> ---
>  .../devicetree/bindings/net/dsa/microchip,ksz.yaml | 38 +++++++++++++++++++++-
>  1 file changed, 37 insertions(+), 1 deletion(-)

You forgot Conor's ack.

> 
> diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
> index b3029c64d0d5..6fd482f2656b 100644
> --- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
> @@ -11,7 +11,6 @@ maintainers:
>    - Woojung Huh <Woojung.Huh@microchip.com>
>  
>  allOf:
> -  - $ref: dsa.yaml#/$defs/ethernet-ports
>    - $ref: /schemas/spi/spi-peripheral-props.yaml#
>  
>  properties:
> @@ -78,6 +77,43 @@ required:
>    - compatible
>    - reg
>  
> +if:
> +  not:
> +    properties:
> +      compatible:
> +        enum:
> +          - microchip,ksz8863
> +          - microchip,ksz8873
> +then:
> +  $ref: dsa.yaml#/$defs/ethernet-ports
> +else:
> +  patternProperties:
> +    "^(ethernet-)?ports$":
> +      patternProperties:
> +        "^(ethernet-)?port@[0-2]$":
> +          $ref: dsa-port.yaml#
> +          properties:
> +            microchip,rmii-clk-internal:
> +              $ref: /schemas/types.yaml#/definitions/flag
> +              description:
> +                When ksz88x3 is acting as clock provier (via REFCLKO) it
> +                can select between internal and external RMII reference
> +                clock. Internal reference clock means that the clock for
> +                the RMII of ksz88x3 is provided by the ksz88x3 internally
> +                and the REFCLKI pin is unconnected. For the external
> +                reference clock, the clock needs to be fed back to ksz88x3
> +                via REFCLKI.
> +                If microchip,rmii-clk-internal is set, ksz88x3 will provide
> +                rmii reference clock internally, otherwise reference clock
> +                should be provided externally.

> +          if:
> +            not:
> +              required: [ ethernet ]
> +          then:
> +            properties:
> +              microchip,rmii-clk-internal: false

This can be expressed as:

dependencies:
  microchip,rmii-clk-internal: [ethernet]


> +          unevaluatedProperties: false

Move this under the $ref.

> +
>  unevaluatedProperties: false
>  
>  examples:
> -- 
> 2.11.0
>
Conor Dooley Nov. 28, 2023, 5:29 p.m. UTC | #2
On Tue, Nov 28, 2023 at 09:02:03AM -0600, Rob Herring wrote:
> On Mon, Nov 27, 2023 at 02:20:42PM +0100, Ante Knezic wrote:
> > Add documentation for selecting reference rmii clock on KSZ88X3 devices
> > 
> > Signed-off-by: Ante Knezic <ante.knezic@helmholz.de>
> > ---
> >  .../devicetree/bindings/net/dsa/microchip,ksz.yaml | 38 +++++++++++++++++++++-
> >  1 file changed, 37 insertions(+), 1 deletion(-)
> 
> You forgot Conor's ack.

I think that's for the better, v5 and v6 look to have changed a decent
amount from what I acked in v4.
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
index b3029c64d0d5..6fd482f2656b 100644
--- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml
@@ -11,7 +11,6 @@  maintainers:
   - Woojung Huh <Woojung.Huh@microchip.com>
 
 allOf:
-  - $ref: dsa.yaml#/$defs/ethernet-ports
   - $ref: /schemas/spi/spi-peripheral-props.yaml#
 
 properties:
@@ -78,6 +77,43 @@  required:
   - compatible
   - reg
 
+if:
+  not:
+    properties:
+      compatible:
+        enum:
+          - microchip,ksz8863
+          - microchip,ksz8873
+then:
+  $ref: dsa.yaml#/$defs/ethernet-ports
+else:
+  patternProperties:
+    "^(ethernet-)?ports$":
+      patternProperties:
+        "^(ethernet-)?port@[0-2]$":
+          $ref: dsa-port.yaml#
+          properties:
+            microchip,rmii-clk-internal:
+              $ref: /schemas/types.yaml#/definitions/flag
+              description:
+                When ksz88x3 is acting as clock provier (via REFCLKO) it
+                can select between internal and external RMII reference
+                clock. Internal reference clock means that the clock for
+                the RMII of ksz88x3 is provided by the ksz88x3 internally
+                and the REFCLKI pin is unconnected. For the external
+                reference clock, the clock needs to be fed back to ksz88x3
+                via REFCLKI.
+                If microchip,rmii-clk-internal is set, ksz88x3 will provide
+                rmii reference clock internally, otherwise reference clock
+                should be provided externally.
+          if:
+            not:
+              required: [ ethernet ]
+          then:
+            properties:
+              microchip,rmii-clk-internal: false
+          unevaluatedProperties: false
+
 unevaluatedProperties: false
 
 examples: