diff mbox series

[1/4] dt-bindings: net: Add bindings for onsemi NCN26000 PHY

Message ID ZQf1LMnICzEnt9XK@lopingdog.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series net: Add NCN26010 driver | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Guessed tree name to be net-next, async
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: 9 this patch: 9
netdev/cc_maintainers warning 7 maintainers not CCed: robh+dt@kernel.org krzysztof.kozlowski+dt@linaro.org pabeni@redhat.com davem@davemloft.net edumazet@google.com conor+dt@kernel.org kuba@kernel.org
netdev/build_clang success Errors and warnings before: 9 this patch: 9
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: 9 this patch: 9
netdev/checkpatch warning WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Jay Monkman Sept. 18, 2023, 6:58 a.m. UTC
Add devicetree bindings for onsemi's NCN26000 10BASE-T1S PHY.

Signed-off-by: Jay Monkman <jtm@lopingdog.com>
---
 .../bindings/net/onnn,ncn26000.yaml           | 177 ++++++++++++++++++
 1 file changed, 177 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/onnn,ncn26000.yaml

Comments

Andrew Lunn Sept. 18, 2023, 4:31 p.m. UTC | #1
> +properties:
> +  description: |
> +    Sets the transmitter amplitude gain. If not specified,
> +    gain is set to 1.0V (1v0)
> +  tx-gain:
> +    enum:
> +      - 1v1
> +      - 1v0
> +      - 0v9
> +      - 0v8

How is a gain in volts? Isn't gain just a multiplier, so it unitless?

> +  tx-slew:
> +    description: |
> +      Sets the slew rate of the TX line driver output. Defaults
> +      to slow if not set.
> +    enum:
> +      - fast
> +      - slow

How does this map to a standard? I would expect the standard to
specify the slew. So why is this needed?

> +  dig-slew:
> +    description: |
> +      Sets the slew rate of the digital output pins. Defaults
> +      to slow if not set.

By Digital output pins, do you them the GPO pins you are adding a GPIO
driver for?

> +  cmc-comp:
> +    description: |
> +      Sets the common mode choke resistance (CMC compensation).
> +      Defaults to 0-0.5 ohm (0p25) if not set.
> +    enum:
> +      - 0p25
> +      - 1p38
> +      - 3p00
> +      - 3p37

What is the mapping between 0-0.5 ohm and 0p25? Can we just use ohms
here?

> +  plca-precedence:
> +    description: |
> +      Enables PLCA precedence mode. Defaults to off if not
> +      set.
> +    type: boolean

What is PLCA precedence? Should this be an ethtool parameter, along
side all the other PLCA controls?

> +  eni-mode:
> +    description: |
> +      Enables Enhanced Noise Immunity mode. Defaults to off if
> +      not set.
> +    enum:
> +      - force-on
> +      - force-off
> +      - auto

phy tunable?

> +
> +  tx-pkt-loop:
> +    description: |
> +      Enables packet loopback mode. Defaults to off is not set.
> +    type: boolean

How does this differ from struct phy_driver::set_loopback()?

> +  unjab-tmr-disable:
> +    description: |
> +      Disables the Unjab Timer. When disabled, device transmission
> +      will be stopped due to a jabber error and only restarted on
> +      device reset. If not set, this defaults to enabled.
> +    type: boolean
> +
> +  col-disable:
> +    description: |
> +      Disables collision masking. Defaults to enabled if not set.
> +    type: boolean

I could be wrong, but this feels like an SDK dump of all the features
the device has, but nobody will ever user in reality. We need some
justification why all these properties are really needed, and ideally
a .dts file for a board actually using them. If there is no user, i
suggest waiting until somebody really does need them.

	Andrew
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/net/onnn,ncn26000.yaml b/Documentation/devicetree/bindings/net/onnn,ncn26000.yaml
new file mode 100644
index 000000000000..b0b1e1ea86f2
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/onnn,ncn26000.yaml
@@ -0,0 +1,177 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/onnn,ncn26000.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: onsemi NCN26000 10BASE-T1S Ethernet PHY
+
+maintainers:
+  - Jay Monkman <jtm@lopingdog.com>
+
+description: |
+  Bindings for onsemi NCN26000 10BASE-T1S ethernet PHY.
+
+allOf:
+  - $ref: ethernet-phy.yaml#
+
+properties:
+  description: |
+    Sets the transmitter amplitude gain. If not specified,
+    gain is set to 1.0V (1v0)
+  tx-gain:
+    enum:
+      - 1v1
+      - 1v0
+      - 0v9
+      - 0v8
+
+  tx-slew:
+    description: |
+      Sets the slew rate of the TX line driver output. Defaults
+      to slow if not set.
+    enum:
+      - fast
+      - slow
+
+  dig-slew:
+    description: |
+      Sets the slew rate of the digital output pins. Defaults
+      to slow if not set.
+    enum:
+      - fast
+      - slow
+
+  cmc-comp:
+    description: |
+      Sets the common mode choke resistance (CMC compensation).
+      Defaults to 0-0.5 ohm (0p25) if not set.
+    enum:
+      - 0p25
+      - 1p38
+      - 3p00
+      - 3p37
+
+  plca-precedence:
+    description: |
+      Enables PLCA precedence mode. Defaults to off if not
+      set.
+    type: boolean
+
+  eni-mode:
+    description: |
+      Enables Enhanced Noise Immunity mode. Defaults to off if
+      not set.
+    enum:
+      - force-on
+      - force-off
+      - auto
+
+  tx-pkt-loop:
+    description: |
+      Enables packet loopback mode. Defaults to off is not set.
+    type: boolean
+
+  unjab-tmr-disable:
+    description: |
+      Disables the Unjab Timer. When disabled, device transmission
+      will be stopped due to a jabber error and only restarted on
+      device reset. If not set, this defaults to enabled.
+    type: boolean
+
+  col-disable:
+    description: |
+      Disables collision masking. Defaults to enabled if not set.
+    type: boolean
+
+  no-rx-delay:
+    description: |
+      Disables the RX internal path delay. Defaults to enabled if
+      not set.
+    type: boolean
+
+  dio0-fn:
+    description: |
+      Selects the DIO0 pin output function. Defaults to disabled if
+      not set.
+    enum:
+      - sfd-tx
+      - sfd-rx
+      - sfd-rxtx
+      - led-link
+      - led-plca
+      - led-tx
+      - led-rx
+      - led-rxtx
+      - clk25m
+
+  dio0-pullup:
+    description: |
+      Enables the DIO0 pin pullup. Defaults to no pull up if not
+      set.
+    type: boolean
+
+  dio0-active-high:
+    description: |
+      Sets DIO0 pin output state. Defaults to low if not set
+    type: boolean
+
+  dio0-slew:
+    description: |
+      Sets the slew rate of the DIO0 pin. Defaults to slow if not set.
+    enum:
+      - fast
+      - slow
+
+  dio1-fn:
+    description: |
+      Selects the DIO1 pin output function. Defaults to disabled if
+      not set.
+    enum:
+      - sfd-tx
+      - sfd-rx
+      - sfd-rxtx
+      - led-link
+      - led-plca
+      - led-tx
+      - led-rx
+      - led-rxtx
+      - clk25m
+
+  dio1-pullup:
+    description: |
+      Enables the DIO1 pin pullup. Defaults to no pull up if not
+      set.
+    type: boolean
+
+  dio1-active-high:
+    description: |
+      Sets DIO1 pin output state. Defaults to low if not set
+    type: boolean
+
+  dio1-slew:
+    description: |
+      Sets the slew rate of the DIO1 pin. Defaults to slow if not set.
+    enum:
+      - fast
+      - slow
+
+additionalProperties: false
+
+examples:
+  - |
+    spi {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      ephy0: ethernet-phy@0 {
+        compatible = "ethernet-phy-ieee802.3-c22";
+        reg = <0>;
+        dio0-fn = "gpio";
+        dio0-slew = "slow";
+        dio1-fn = "gpio";
+        dio1-slew = "slow";
+        eni-enable;
+        device_type = "ethernet-phy";
+      };
+    };