Skip to contentSkip to conversation

dt-bindings: net: Add onsemi NCN26010 ethernet controller

PATCH In review Jay Monkman 2 participants 3 messages Sep 18, 2023 – Sep 19, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/4 dt-bindings: net: Add onsemi NCN26010 ethernet controller

Add devicetree bindings for onsemi's NCN26010 10BASE-T1S ethernet controller.

---
 .../devicetree/bindings/net/onnn,macphy.yaml  | 94 +++++++++++++++++++
 1 file changed, 94 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/onnn,macphy.yaml
Documentation/devicetree/bindings/net/onnn,macphy.yaml new file +94 -0
new file mode 100644
index 000000000000..1813da81b95f
@@ -0,0 +1,94 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/onnn,macphy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: onsemi 10BASE-T1S Ethernet Controller
+
+maintainers:
+  - Jay Monkman <[email protected]>
+
+description: |
+  Bindings for onsemi 10BASE-T1S ethernet controller.
+
+  Supported devices:
+    ncn26010
+
+allOf:
+  - $ref: ethernet-controller.yaml#
+
+properties:
+  compatible:
+    const: onnn,ncn26010
+
+  ctrl-protected:
+    description: |
+      Enables control data read/write protection mode.
+    type: boolean
+
+  poll-interval:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Defines how often the MACPHY thread runs in milliseconds.
+      If not specified, a default value of 5 is used.
+
+  tx-fcs-calc:
+    description: |
+      Enables driver calculation of the FCS on transmitted frames.
+    type: boolean
+
+  rx-fcs-check:
+    description: |
+      Enables driver checking of the FCS on received frames
+    type: boolean
+
+  interrupts:
+    maxItems: 1
+
+  reg:
+    maxItems: 1
+
+  mdio:
+    $ref: mdio.yaml#
+    unevaluatedProperties: false
+
+required:
+  - compatible
+
+additionalProperties: false
+
+examples:
+  - |
+    spi {
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      ethernet@0 {
+        compatible = "onnn,ncn26010";
+        reg = <0>; /* CE0 */
+        ctrl-protected;
+        tx-fcs-calc;
+        rx-fcs-check;
+        poll-interval = <5>;
+        pinctrl-names = "default";
+        pinctrl-0 = <&eth1_pins>;
+        interrupt-parent = <&gpio>;
+        interrupts = <25 0x2>;
+
+        mdio {
+          #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;
+          };
+        };
+      };
+    };
Signature · 1 line
2.40.1
#1 lore raw
Quoted 1 line · Jay Monkman

Drop stray blank line.

Quoted 2 lines

Add devicetree bindings for onsemi's NCN26010 10BASE-T1S ethernet controller.

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC (and consider --no-git-fallback argument). It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Quoted 15 lines
---
 .../devicetree/bindings/net/onnn,macphy.yaml  | 94 +++++++++++++++++++
 1 file changed, 94 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/onnn,macphy.yaml
Documentation/devicetree/bindings/net/onnn,macphy.yaml new file +2 -0
new file mode 100644
index 000000000000..1813da81b95f
@@ -0,0 +1,94 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2

Documentation/devicetree/bindings/net/onnn,macphy.yaml line 12

Quoted 10 lines
Documentation/devicetree/bindings/net/onnn,macphy.yaml new file +10 -0
+---
+$id: http://devicetree.org/schemas/net/onnn,macphy.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: onsemi 10BASE-T1S Ethernet Controller
+
+maintainers:
+  - Jay Monkman <[email protected]>
+
+description: |

Do not need '|' unless you need to preserve formatting.

Documentation/devicetree/bindings/net/onnn,macphy.yaml line 13

Quoted 1 line
Documentation/devicetree/bindings/net/onnn,macphy.yaml new file +1 -0
+  Bindings for onsemi 10BASE-T1S ethernet controller.

Drop "bindings for" and instead describe the hardware.

Documentation/devicetree/bindings/net/onnn,macphy.yaml line 16

Quoted 3 lines
Documentation/devicetree/bindings/net/onnn,macphy.yaml new file +3 -0
+
+  Supported devices:
+    ncn26010

Supported by what? By bindings? Or driver? Drop, instead, describe the hardware.

Documentation/devicetree/bindings/net/onnn,macphy.yaml line 26

Quoted 10 lines
Documentation/devicetree/bindings/net/onnn,macphy.yaml new file +10 -0
+
+allOf:
+  - $ref: ethernet-controller.yaml#
+
+properties:
+  compatible:
+    const: onnn,ncn26010
+
+  ctrl-protected:
+    description: |

Do not need '|' unless you need to preserve formatting.

Is it a generic property? Does not look like. All non-standard properties need vendor prefix.

Documentation/devicetree/bindings/net/onnn,macphy.yaml line 27

Quoted 1 line
Documentation/devicetree/bindings/net/onnn,macphy.yaml new file +1 -0
+      Enables control data read/write protection mode.

I don't understand this and it is very close to duplicate the property name. Describe what it does in the hardware, not in the driver, so it will be justified to have it in bindings in the first place.

Documentation/devicetree/bindings/net/onnn,macphy.yaml line 30

Quoted 3 lines
Documentation/devicetree/bindings/net/onnn,macphy.yaml new file +3 -0
+    type: boolean
+
+  poll-interval:

Missing units.

Documentation/devicetree/bindings/net/onnn,macphy.yaml line 33

Quoted 3 lines
Documentation/devicetree/bindings/net/onnn,macphy.yaml new file +3 -0
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Defines how often the MACPHY thread runs in milliseconds.

thread? So Linux kthread? Nope, not a bindings property.

Documentation/devicetree/bindings/net/onnn,macphy.yaml line 39

Quoted 6 lines
Documentation/devicetree/bindings/net/onnn,macphy.yaml new file +6 -0
+      If not specified, a default value of 5 is used.
+
+  tx-fcs-calc:
+    description: |
+      Enables driver calculation of the FCS on transmitted frames.
+    type: boolean

Driver? Not hardware? So drop the property.

Documentation/devicetree/bindings/net/onnn,macphy.yaml line 44

Quoted 5 lines
Documentation/devicetree/bindings/net/onnn,macphy.yaml new file +5 -0
+
+  rx-fcs-check:
+    description: |
+      Enables driver checking of the FCS on received frames
+    type: boolean

Not a bindings property.

Documentation/devicetree/bindings/net/onnn,macphy.yaml line 57

Quoted 13 lines
Documentation/devicetree/bindings/net/onnn,macphy.yaml new file +13 -0
+
+  interrupts:
+    maxItems: 1
+
+  reg:
+    maxItems: 1
+
+  mdio:
+    $ref: mdio.yaml#
+    unevaluatedProperties: false
+
+required:
+  - compatible

Nothing else is required?

Documentation/devicetree/bindings/net/onnn,macphy.yaml line 65

Quoted 8 lines
Documentation/devicetree/bindings/net/onnn,macphy.yaml new file +8 -0
+
+additionalProperties: false
+
+examples:
+  - |
+    spi {
+      #address-cells = <1>;
+      #size-cells = <0>;

If this is a SPI device, then you miss spi-peripheral-props.

Documentation/devicetree/bindings/net/onnn,macphy.yaml line 69

Quoted 4 lines
Documentation/devicetree/bindings/net/onnn,macphy.yaml new file +4 -0
+
+      ethernet@0 {
+        compatible = "onnn,ncn26010";
+        reg = <0>; /* CE0 */

CE0? Isn't chip select obvious from the reg=0?

Best regards,
Krzysztof

#2 lore raw
Quoted 5 lines · Krzysztof Kozlowski

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC (and consider --no-git-fallback argument). It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Will do. Thanks for your other comments - I've got some work to do.

Jay