linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] dt-bindings: net: renesas,ethertsn: Add Ethernet TSN
@ 2023-11-21 18:37 Niklas Söderlund
  2023-11-22  8:31 ` Krzysztof Kozlowski
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Niklas Söderlund @ 2023-11-21 18:37 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, devicetree
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-renesas-soc, Niklas Söderlund

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

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
* 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

diff --git a/Documentation/devicetree/bindings/net/renesas,ethertsn.yaml b/Documentation/devicetree/bindings/net/renesas,ethertsn.yaml
new file mode 100644
index 000000000000..475aff7714d6
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/renesas,ethertsn.yaml
@@ -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 <niklas.soderlund@ragnatech.se>
+
+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>;
+        };
+    };
-- 
2.42.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] dt-bindings: net: renesas,ethertsn: Add Ethernet TSN
  2023-11-21 18:37 [PATCH v2] dt-bindings: net: renesas,ethertsn: Add Ethernet TSN Niklas Söderlund
@ 2023-11-22  8:31 ` Krzysztof Kozlowski
  2023-11-23 12:20 ` patchwork-bot+netdevbpf
  2024-02-15 16:03 ` Geert Uytterhoeven
  2 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2023-11-22  8:31 UTC (permalink / raw)
  To: Niklas Söderlund, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, devicetree
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-renesas-soc

On 21/11/2023 19:37, Niklas Söderlund wrote:
> Add bindings for Renesas R-Car Ethernet TSN End-station IP. The RTSN
> device provides Ethernet network.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

...

> +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'

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:

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] dt-bindings: net: renesas,ethertsn: Add Ethernet TSN
  2023-11-21 18:37 [PATCH v2] dt-bindings: net: renesas,ethertsn: Add Ethernet TSN Niklas Söderlund
  2023-11-22  8:31 ` Krzysztof Kozlowski
@ 2023-11-23 12:20 ` patchwork-bot+netdevbpf
  2024-02-15 16:03 ` Geert Uytterhoeven
  2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-11-23 12:20 UTC (permalink / raw)
  To: =?utf-8?q?Niklas_S=C3=B6derlund_=3Cniklas=2Esoderlund+renesas=40ragnatech=2E?=,
	=?utf-8?q?se=3E?=
  Cc: robh+dt, krzysztof.kozlowski+dt, conor+dt, geert, devicetree,
	davem, edumazet, kuba, pabeni, netdev, linux-renesas-soc

Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

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.
> 
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> * 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.
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] dt-bindings: net: renesas,ethertsn: Add Ethernet TSN
  2023-11-21 18:37 [PATCH v2] dt-bindings: net: renesas,ethertsn: Add Ethernet TSN Niklas Söderlund
  2023-11-22  8:31 ` Krzysztof Kozlowski
  2023-11-23 12:20 ` patchwork-bot+netdevbpf
@ 2024-02-15 16:03 ` Geert Uytterhoeven
  2024-02-23 20:21   ` Niklas Söderlund
  2 siblings, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2024-02-15 16:03 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, devicetree,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-renesas-soc

Hi Niklas,

On Tue, Nov 21, 2023 at 7:38 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> Add bindings for Renesas R-Car Ethernet TSN End-station IP. The RTSN
> device provides Ethernet network.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

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

> --- /dev/null
> +++ b/Documentation/devicetree/bindings/net/renesas,ethertsn.yaml

> +  interrupts:
> +    items:
> +      - description: TX data interrupt
> +      - description: RX data interrupt
> +
> +  interrupt-names:
> +    items:
> +      - const: tx
> +      - const: rx

What about the (17!) other interrupts?

> +  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

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] dt-bindings: net: renesas,ethertsn: Add Ethernet TSN
  2024-02-15 16:03 ` Geert Uytterhoeven
@ 2024-02-23 20:21   ` Niklas Söderlund
  0 siblings, 0 replies; 5+ messages in thread
From: Niklas Söderlund @ 2024-02-23 20:21 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, devicetree,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-renesas-soc

Hi Geert,

Thanks for your feedback.

On 2024-02-15 17:03:33 +0100, Geert Uytterhoeven wrote:
> Hi Niklas,
> 
> On Tue, Nov 21, 2023 at 7:38 PM Niklas Söderlund
> <niklas.soderlund+renesas@ragnatech.se> wrote:
> > Add bindings for Renesas R-Car Ethernet TSN End-station IP. The RTSN
> > device provides Ethernet network.
> >
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> 
> Thanks for your patch, which is now commit c5b9f4792ea6b9ab
> ("dt-bindings: net: renesas,ethertsn: Add Ethernet TSN") in v6.8-rc1.
> 
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/net/renesas,ethertsn.yaml
> 
> > +  interrupts:
> > +    items:
> > +      - description: TX data interrupt
> > +      - description: RX data interrupt
> > +
> > +  interrupt-names:
> > +    items:
> > +      - const: tx
> > +      - const: rx
> 
> 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?

> 
> > +  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.

> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> -- 
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> 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

-- 
Kind Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-23 20:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-21 18:37 [PATCH v2] dt-bindings: net: renesas,ethertsn: Add Ethernet TSN Niklas Söderlund
2023-11-22  8:31 ` Krzysztof Kozlowski
2023-11-23 12:20 ` patchwork-bot+netdevbpf
2024-02-15 16:03 ` Geert Uytterhoeven
2024-02-23 20:21   ` Niklas Söderlund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).