diff mbox series

[net-next,v2,1/2] dt-bindings: net: marvell,aquantia: add properties to override MDI_CFG

Message ID 1cdfd174d3ac541f3968dfe9bd14d5b6b28e4ac6.1724885333.git.daniel@makrotopia.org (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2,1/2] dt-bindings: net: marvell,aquantia: add properties to override MDI_CFG | 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 9 of 9 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, 28 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 success net-next-2024-08-29--15-00 (tests: 711)

Commit Message

Daniel Golle Aug. 28, 2024, 10:51 p.m. UTC
Usually the MDI pair order reversal configuration is defined by
bootstrap pin MDI_CFG. Some designs, however, require overriding the MDI
pair order and force either normal or reverse order.

Add mutually exclusive properties 'marvell,force-mdi-order-normal' and
'marvell,force-mdi-order-reverse' for that purpose.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
v2: enforce mutually exclusive relationship of the two new properties in
    dt-schema.

 .../bindings/net/marvell,aquantia.yaml           | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Conor Dooley Aug. 29, 2024, 4:24 p.m. UTC | #1
On Wed, Aug 28, 2024 at 11:51:49PM +0100, Daniel Golle wrote:
> Usually the MDI pair order reversal configuration is defined by
> bootstrap pin MDI_CFG. Some designs, however, require overriding the MDI
> pair order and force either normal or reverse order.
> 
> Add mutually exclusive properties 'marvell,force-mdi-order-normal' and
> 'marvell,force-mdi-order-reverse' for that purpose.
> 
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
> v2: enforce mutually exclusive relationship of the two new properties in
>     dt-schema.
> 
>  .../bindings/net/marvell,aquantia.yaml           | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/marvell,aquantia.yaml b/Documentation/devicetree/bindings/net/marvell,aquantia.yaml
> index 9854fab4c4db0..03b0cff239f70 100644
> --- a/Documentation/devicetree/bindings/net/marvell,aquantia.yaml
> +++ b/Documentation/devicetree/bindings/net/marvell,aquantia.yaml
> @@ -22,6 +22,12 @@ description: |
>  
>  allOf:
>    - $ref: ethernet-phy.yaml#
> +  - if:
> +      required:
> +        - marvell,force-mdi-order-normal
> +    then:
> +      properties:
> +        marvell,force-mdi-order-reverse: false

Ordinarily, when there are property related constraints in here, the
allOf is moved after the property definitions, since it is odd to talk
about rules for properties prior to defining them. If you resend, please
move these down. Otherwise,
Acked-by: Conor Dooley <conor.dooley@microchip.com>

Thanks,
Conor.

>  
>  select:
>    properties:
> @@ -48,6 +54,16 @@ properties:
>    firmware-name:
>      description: specify the name of PHY firmware to load
>  
> +  marvell,force-mdi-order-normal:
> +    type: boolean
> +    description:
> +      force normal order of MDI pairs, overriding MDI_CFG bootstrap pin.
> +
> +  marvell,force-mdi-order-reverse:
> +    type: boolean
> +    description:
> +      force reverse order of MDI pairs, overriding MDI_CFG bootstrap pin.
> +
>    nvmem-cells:
>      description: phandle to the firmware nvmem cell
>      maxItems: 1
> -- 
> 2.46.0
Rob Herring Aug. 29, 2024, 7:53 p.m. UTC | #2
On Wed, Aug 28, 2024 at 11:51:49PM +0100, Daniel Golle wrote:
> Usually the MDI pair order reversal configuration is defined by
> bootstrap pin MDI_CFG. Some designs, however, require overriding the MDI
> pair order and force either normal or reverse order.
> 
> Add mutually exclusive properties 'marvell,force-mdi-order-normal' and
> 'marvell,force-mdi-order-reverse' for that purpose.
> 
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> ---
> v2: enforce mutually exclusive relationship of the two new properties in
>     dt-schema.
> 
>  .../bindings/net/marvell,aquantia.yaml           | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/net/marvell,aquantia.yaml b/Documentation/devicetree/bindings/net/marvell,aquantia.yaml
> index 9854fab4c4db0..03b0cff239f70 100644
> --- a/Documentation/devicetree/bindings/net/marvell,aquantia.yaml
> +++ b/Documentation/devicetree/bindings/net/marvell,aquantia.yaml
> @@ -22,6 +22,12 @@ description: |
>  
>  allOf:
>    - $ref: ethernet-phy.yaml#
> +  - if:
> +      required:
> +        - marvell,force-mdi-order-normal
> +    then:
> +      properties:
> +        marvell,force-mdi-order-reverse: false
>  
>  select:
>    properties:
> @@ -48,6 +54,16 @@ properties:
>    firmware-name:
>      description: specify the name of PHY firmware to load
>  
> +  marvell,force-mdi-order-normal:
> +    type: boolean
> +    description:
> +      force normal order of MDI pairs, overriding MDI_CFG bootstrap pin.
> +
> +  marvell,force-mdi-order-reverse:
> +    type: boolean
> +    description:
> +      force reverse order of MDI pairs, overriding MDI_CFG bootstrap pin.

Why 2 properties for 1 setting? Just do something like this:

marvell,mdi-cfg-order = <0|1>;

1 means reverse, 0 means normal (or vise-versa). Not present then means 
use MDI_CFG setting. Then the binding naturally avoids nonsensical 
combinations of properties without the schema having to enforce it.

Feel free to tweak the naming/values. I would make 0 and 1 align with 
MDI_CFG states, but I don't know what those are.

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/marvell,aquantia.yaml b/Documentation/devicetree/bindings/net/marvell,aquantia.yaml
index 9854fab4c4db0..03b0cff239f70 100644
--- a/Documentation/devicetree/bindings/net/marvell,aquantia.yaml
+++ b/Documentation/devicetree/bindings/net/marvell,aquantia.yaml
@@ -22,6 +22,12 @@  description: |
 
 allOf:
   - $ref: ethernet-phy.yaml#
+  - if:
+      required:
+        - marvell,force-mdi-order-normal
+    then:
+      properties:
+        marvell,force-mdi-order-reverse: false
 
 select:
   properties:
@@ -48,6 +54,16 @@  properties:
   firmware-name:
     description: specify the name of PHY firmware to load
 
+  marvell,force-mdi-order-normal:
+    type: boolean
+    description:
+      force normal order of MDI pairs, overriding MDI_CFG bootstrap pin.
+
+  marvell,force-mdi-order-reverse:
+    type: boolean
+    description:
+      force reverse order of MDI pairs, overriding MDI_CFG bootstrap pin.
+
   nvmem-cells:
     description: phandle to the firmware nvmem cell
     maxItems: 1