Skip to contentSkip to conversation

dt-bindings: net: renesas,ethertsn: Add Ethernet TSN

PATCH Applied Niklas Söderlund 4 participants 5 messages Nov 21, 2023 – Feb 23, 2024

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

PATCH v2 1/1 dt-bindings: net: renesas,ethertsn: Add Ethernet TSN

Add bindings for Renesas R-Car Ethernet TSN End-station IP. The RTSN device provides Ethernet network.

---
* Changes since v1
- Update patch subject, was "dt-bindings: net: renesas,ethertsn: Add bindings for Ethernet TSN".
- Add top-level $ref to ethernet-controller.yaml.
- Rework compatible node to have a fallback, renesas,rcar-gen4-ethertsn.
- Change compatible value to match renesas style, was renesas,ethertsn-r8a779g0.
- Change interrupt names from "tx_data", "rx_data" to "tx", "rx".
- Add missing unevaluatedProperties.
- Use the generic properties for internal delay tx-internal-delay-ps and rx-internal-delay-ps instead of vendor specific ones.

---
 .../bindings/net/renesas,ethertsn.yaml        | 133 ++++++++++++++++++
 1 file changed, 133 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/renesas,ethertsn.yaml
Documentation/devicetree/bindings/net/renesas,ethertsn.yaml new file +133 -0
new file mode 100644
index 000000000000..475aff7714d6
@@ -0,0 +1,133 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/renesas,ethertsn.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas Ethernet TSN End-station
+
+maintainers:
+  - Niklas Söderlund <[email protected]>
+
+description:
+  The RTSN device provides Ethernet network using a 10 Mbps, 100 Mbps, or 1
+  Gbps full-duplex link via MII/GMII/RMII/RGMII. Depending on the connected PHY.
+
+allOf:
+  - $ref: ethernet-controller.yaml#
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - renesas,r8a779g0-ethertsn       # R-Car V4H
+      - const: renesas,rcar-gen4-ethertsn
+
+  reg:
+    items:
+      - description: TSN End Station target
+      - description: generalized Precision Time Protocol target
+
+  reg-names:
+    items:
+      - const: tsnes
+      - const: gptp
+
+  interrupts:
+    items:
+      - description: TX data interrupt
+      - description: RX data interrupt
+
+  interrupt-names:
+    items:
+      - const: tx
+      - const: rx
+
+  clocks:
+    maxItems: 1
+
+  power-domains:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+  phy-mode:
+    contains:
+      enum:
+        - mii
+        - rgmii
+
+  phy-handle:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description:
+      Specifies a reference to a node representing a PHY device.
+
+  rx-internal-delay-ps:
+    enum: [0, 1800]
+
+  tx-internal-delay-ps:
+    enum: [0, 2000]
+
+  '#address-cells':
+    const: 1
+
+  '#size-cells':
+    const: 0
+
+patternProperties:
+  "^ethernet-phy@[0-9a-f]$":
+    type: object
+    $ref: ethernet-phy.yaml#
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+  - reg-names
+  - interrupts
+  - interrupt-names
+  - clocks
+  - power-domains
+  - resets
+  - phy-mode
+  - phy-handle
+  - '#address-cells'
+  - '#size-cells'
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/r8a779g0-cpg-mssr.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/power/r8a779g0-sysc.h>
+    #include <dt-bindings/gpio/gpio.h>
+
+    tsn0: ethernet@e6460000 {
+        compatible = "renesas,r8a779g0-ethertsn", "renesas,rcar-gen4-ethertsn";
+        reg = <0xe6460000 0x7000>,
+              <0xe6449000 0x500>;
+        reg-names = "tsnes", "gptp";
+        interrupts = <GIC_SPI 429 IRQ_TYPE_LEVEL_HIGH>,
+                     <GIC_SPI 430 IRQ_TYPE_LEVEL_HIGH>;
+        interrupt-names = "tx", "rx";
+        clocks = <&cpg CPG_MOD 2723>;
+        power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>;
+        resets = <&cpg 2723>;
+
+        phy-mode = "rgmii";
+        tx-internal-delay-ps = <2000>;
+        phy-handle = <&phy3>;
+
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        phy3: ethernet-phy@3 {
+            compatible = "ethernet-phy-ieee802.3-c45";
+            reg = <0>;
+            interrupt-parent = <&gpio4>;
+            interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+            reset-gpios = <&gpio1 23 GPIO_ACTIVE_LOW>;
+        };
+    };
Signature · 1 line
2.42.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 4 lines · Niklas Söderlund

Add bindings for Renesas R-Car Ethernet TSN End-station IP. The RTSN device provides Ethernet network.

...

Quoted 9 lines
Documentation/devicetree/bindings/net/renesas,ethertsn.yaml new file +9 -0
+patternProperties:
+  "^ethernet-phy@[0-9a-f]$":
+    type: object
+    $ref: ethernet-phy.yaml#
+    unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg

Documentation/devicetree/bindings/net/renesas,ethertsn.yaml line 96

Quoted 10 lines
Documentation/devicetree/bindings/net/renesas,ethertsn.yaml new file +10 -0
+  - reg-names
+  - interrupts
+  - interrupt-names
+  - clocks
+  - power-domains
+  - resets
+  - phy-mode
+  - phy-handle
+  - '#address-cells'
+  - '#size-cells'

If there is going to be respin, please use consistent quotes - either ' or " (see pattern a bit above). You also need net-next in PATCH. In any case:

Best regards,
Krzysztof

#2 lore raw
In reply to Niklas Söderlund
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 17 lines · On Tue, 21 Nov 2023 19:37:38 +0100 you wrote:

Add bindings for Renesas R-Car Ethernet TSN End-station IP. The RTSN device provides Ethernet network.

---
* Changes since v1
- Update patch subject, was "dt-bindings: net: renesas,ethertsn: Add bindings for Ethernet TSN".
- Add top-level $ref to ethernet-controller.yaml.
- Rework compatible node to have a fallback, renesas,rcar-gen4-ethertsn.
- Change compatible value to match renesas style, was renesas,ethertsn-r8a779g0.
- Change interrupt names from "tx_data", "rx_data" to "tx", "rx".
- Add missing unevaluatedProperties.
- Use the generic properties for internal delay tx-internal-delay-ps and rx-internal-delay-ps instead of vendor specific ones.

Quoted 1 line

[...]

Here is the summary with links:
- [v2] dt-bindings: net: renesas,ethertsn: Add Ethernet TSN

    https://git.kernel.org/netdev/net-next/c/c5b9f4792ea6

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#3 lore raw
In reply to Niklas Söderlund

Hi Niklas,

Quoted 4 lines · Niklas Söderlund

Add bindings for Renesas R-Car Ethernet TSN End-station IP. The RTSN device provides Ethernet network.

Thanks for your patch, which is now commit c5b9f4792ea6b9ab ("dt-bindings: net: renesas,ethertsn: Add Ethernet TSN") in v6.8-rc1.

Documentation/devicetree/bindings/net/renesas,ethertsn.yaml line 44

Quoted 12 lines
Documentation/devicetree/bindings/net/renesas,ethertsn.yaml new file +9 -0
 
+  interrupts:
+    items:
+      - description: TX data interrupt
+      - description: RX data interrupt
+
+  interrupt-names:
+    items:
+      - const: tx
+      - const: rx

What about the (17!) other interrupts?

Documentation/devicetree/bindings/net/renesas,ethertsn.yaml line 70

Quoted 5 lines
Documentation/devicetree/bindings/net/renesas,ethertsn.yaml new file +5 -0
+  rx-internal-delay-ps:
+    enum: [0, 1800]
+
+  tx-internal-delay-ps:
+    enum: [0, 2000]

These two should either have a default, or be required (like on EtherAVB, where we couldn't have a default because the absence of
these properties is used to enable a legacy fallback).

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#4 lore raw

Hi Geert,

Thanks for your feedback.

Quoted 25 lines · Geert Uytterhoeven

Hi Niklas,

Quoted 4 lines · Niklas Söderlund

Add bindings for Renesas R-Car Ethernet TSN End-station IP. The RTSN device provides Ethernet network.

Thanks for your patch, which is now commit c5b9f4792ea6b9ab ("dt-bindings: net: renesas,ethertsn: Add Ethernet TSN") in v6.8-rc1.

Documentation/devicetree/bindings/net/renesas,ethertsn.yaml line 44

Quoted 12 lines
Documentation/devicetree/bindings/net/renesas,ethertsn.yaml new file +9 -0
 
+  interrupts:
+    items:
+      - description: TX data interrupt
+      - description: RX data interrupt
+
+  interrupt-names:
+    items:
+      - const: tx
+      - const: rx
Quoted 1 line

What about the (17!) other interrupts?

I did consider them but compared to say ravb each rtsn interrupt have a rather lose description and no easy to define name. So I reasoned it was better to only name the ones we use as we can give them sane names and then as the driver grows with features we can extend the binding.

As each interrupt have a name this would not cause any backward compatibility issues right?

Quoted 10 lines

Documentation/devicetree/bindings/net/renesas,ethertsn.yaml line 70

Quoted 6 lines
Documentation/devicetree/bindings/net/renesas,ethertsn.yaml new file +5 -0
+  rx-internal-delay-ps:
+    enum: [0, 1800]
+
+  tx-internal-delay-ps:
+    enum: [0, 2000]

These two should either have a default, or be required (like on EtherAVB, where we couldn't have a default because the absence of
these properties is used to enable a legacy fallback).

This is a good point, I have sent a patch to address this by adding a default value.

Quoted 11 lines

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Signature · 2 lines
Kind Regards,
Niklas Söderlund