linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] arm64: dts: renesas: Add TSN support for V4H
@ 2024-01-22 16:04 Niklas Söderlund
  2024-01-22 16:04 ` [PATCH 1/2] arm64: dts: renesas: r8a779g0: R-Car Ethernet TSN support Niklas Söderlund
  2024-01-22 16:04 ` [PATCH 2/2] arm64: dts: renesas: white-hawk: Add Ethernet TSN overlay Niklas Söderlund
  0 siblings, 2 replies; 5+ messages in thread
From: Niklas Söderlund @ 2024-01-22 16:04 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-renesas-soc, Niklas Söderlund

Hi,

This series describes the Ethernet TSN on V4H. Patch 1 adds the device 
to the base DTSI while patch 2 adds an overlay that can be used when a 
PHY is mounted on the board.

Niklas Söderlund (2):
  arm64: dts: renesas: r8a779g0: R-Car Ethernet TSN support
  arm64: dts: renesas: white-hawk: Add Ethernet TSN overlay

 arch/arm64/boot/dts/renesas/Makefile          |  2 +
 .../dts/renesas/r8a779g0-white-hawk-tsn.dtso  | 53 +++++++++++++++++++
 arch/arm64/boot/dts/renesas/r8a779g0.dtsi     | 16 ++++++
 3 files changed, 71 insertions(+)
 create mode 100644 arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-tsn.dtso

-- 
2.43.0


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

* [PATCH 1/2] arm64: dts: renesas: r8a779g0: R-Car Ethernet TSN support
  2024-01-22 16:04 [PATCH 0/2] arm64: dts: renesas: Add TSN support for V4H Niklas Söderlund
@ 2024-01-22 16:04 ` Niklas Söderlund
  2024-02-15 16:11   ` Geert Uytterhoeven
  2024-01-22 16:04 ` [PATCH 2/2] arm64: dts: renesas: white-hawk: Add Ethernet TSN overlay Niklas Söderlund
  1 sibling, 1 reply; 5+ messages in thread
From: Niklas Söderlund @ 2024-01-22 16:04 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-renesas-soc, Niklas Söderlund

Add Ethernet TSN support for R-Car V4H.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
index d3d25e077c5d..e64a204f1f8a 100644
--- a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
@@ -538,6 +538,22 @@ tmu4: timer@ffc00000 {
 			status = "disabled";
 		};
 
+		tsn0: ethernet@e6460000 {
+			compatible = "renesas,r8a779g0-ethertsn", "renesas,rcar-gen4-ethertsn";
+			reg = <0 0xe6460000 0 0x7000>,
+			      <0 0xe6449000 0 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>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		i2c0: i2c@e6500000 {
 			compatible = "renesas,i2c-r8a779g0",
 				     "renesas,rcar-gen4-i2c";
-- 
2.43.0


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

* [PATCH 2/2] arm64: dts: renesas: white-hawk: Add Ethernet TSN overlay
  2024-01-22 16:04 [PATCH 0/2] arm64: dts: renesas: Add TSN support for V4H Niklas Söderlund
  2024-01-22 16:04 ` [PATCH 1/2] arm64: dts: renesas: r8a779g0: R-Car Ethernet TSN support Niklas Söderlund
@ 2024-01-22 16:04 ` Niklas Söderlund
  2024-02-15 16:37   ` Geert Uytterhoeven
  1 sibling, 1 reply; 5+ messages in thread
From: Niklas Söderlund @ 2024-01-22 16:04 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-renesas-soc, Niklas Söderlund

On the white-hawk development board the Ethernet TSN IP can be connected
to one of two different external PHYs. One PHY is located on the
breakout board, and the other on the Ethernet sub-board. Which PHY is
connected depends on what resistors are mounted on the board.

The default white-hawk configuration connect the TSN with the PHY on the
breakout board. Unfortunately the standard breakout board do not
populate the external PHY.

Add an overlay that can be applied to enable Ethernet TSN support for
those boards that do populate the breakout board, or mount the
appropriate resistors to connect TSN with the Ethernet sub-board.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 arch/arm64/boot/dts/renesas/Makefile          |  2 +
 .../dts/renesas/r8a779g0-white-hawk-tsn.dtso  | 53 +++++++++++++++++++
 2 files changed, 55 insertions(+)
 create mode 100644 arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-tsn.dtso

diff --git a/arch/arm64/boot/dts/renesas/Makefile b/arch/arm64/boot/dts/renesas/Makefile
index 8ea68d582710..c26047c9f84a 100644
--- a/arch/arm64/boot/dts/renesas/Makefile
+++ b/arch/arm64/boot/dts/renesas/Makefile
@@ -84,7 +84,9 @@ dtb-$(CONFIG_ARCH_R8A779F0) += r8a779f4-s4sk.dtb
 dtb-$(CONFIG_ARCH_R8A779G0) += r8a779g0-white-hawk.dtb
 dtb-$(CONFIG_ARCH_R8A779G0) += r8a779g0-white-hawk-ard-audio-da7212.dtbo
 r8a779g0-white-hawk-ard-audio-da7212-dtbs := r8a779g0-white-hawk.dtb r8a779g0-white-hawk-ard-audio-da7212.dtbo
+r8a779g0-white-hawk-tsn-dtbs := r8a779g0-white-hawk.dtb r8a779g0-white-hawk-tsn.dtbo
 dtb-$(CONFIG_ARCH_R8A779G0) += r8a779g0-white-hawk-ard-audio-da7212.dtb
+dtb-$(CONFIG_ARCH_R8A779G0) += r8a779g0-white-hawk-tsn.dtb
 
 dtb-$(CONFIG_ARCH_R8A77951) += r8a779m1-salvator-xs.dtb
 r8a779m1-salvator-xs-panel-aa104xd12-dtbs := r8a779m1-salvator-xs.dtb salvator-panel-aa104xd12.dtbo
diff --git a/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-tsn.dtso b/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-tsn.dtso
new file mode 100644
index 000000000000..d9b6c11c425c
--- /dev/null
+++ b/arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-tsn.dtso
@@ -0,0 +1,53 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+/*
+ * Device Tree Source for the White Hawk board with connected TSN PHY.
+ *
+ * Copyright (C) 2023 Niklas Söderlund <niklas.soderlund@ragnatech.se>
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/irq.h>
+
+&pfc {
+	tsn0_pins: tsn0 {
+		mux {
+			groups = "tsn0_link", "tsn0_mdio", "tsn0_rgmii",
+				 "tsn0_txcrefclk";
+			function = "tsn0";
+		};
+
+		pins_mdio {
+			groups = "tsn0_mdio";
+			drive-strength = <21>;
+		};
+
+		pins_mii {
+			groups = "tsn0_rgmii";
+			drive-strength = <21>;
+		};
+
+	};
+};
+
+&tsn0 {
+	pinctrl-0 = <&tsn0_pins>;
+	pinctrl-names = "default";
+	phy-mode = "rgmii";
+	phy-handle = <&phy3>;
+	tx-internal-delay-ps = <2000>;
+	status = "okay";
+
+	#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.43.0


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

* Re: [PATCH 1/2] arm64: dts: renesas: r8a779g0: R-Car Ethernet TSN support
  2024-01-22 16:04 ` [PATCH 1/2] arm64: dts: renesas: r8a779g0: R-Car Ethernet TSN support Niklas Söderlund
@ 2024-02-15 16:11   ` Geert Uytterhoeven
  0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2024-02-15 16:11 UTC (permalink / raw)
  To: Niklas Söderlund; +Cc: linux-renesas-soc

Hi Niklas,

On Mon, Jan 22, 2024 at 5:06 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> Add Ethernet TSN support for R-Car V4H.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Thanks for your patch!

> --- a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
> @@ -538,6 +538,22 @@ tmu4: timer@ffc00000 {
>                         status = "disabled";
>                 };
>
> +               tsn0: ethernet@e6460000 {
> +                       compatible = "renesas,r8a779g0-ethertsn", "renesas,rcar-gen4-ethertsn";
> +                       reg = <0 0xe6460000 0 0x7000>,
> +                             <0 0xe6449000 0 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>;
> +                       #address-cells = <1>;
> +                       #size-cells = <0>;
> +                       status = "disabled";
> +               };
> +
>                 i2c0: i2c@e6500000 {
>                         compatible = "renesas,i2c-r8a779g0",
>                                      "renesas,rcar-gen4-i2c";

Matches the bindings (for which I did have some comments), so
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

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 2/2] arm64: dts: renesas: white-hawk: Add Ethernet TSN overlay
  2024-01-22 16:04 ` [PATCH 2/2] arm64: dts: renesas: white-hawk: Add Ethernet TSN overlay Niklas Söderlund
@ 2024-02-15 16:37   ` Geert Uytterhoeven
  0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2024-02-15 16:37 UTC (permalink / raw)
  To: Niklas Söderlund; +Cc: linux-renesas-soc

Hi Niklas,

On Mon, Jan 22, 2024 at 5:06 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> On the white-hawk development board the Ethernet TSN IP can be connected
> to one of two different external PHYs. One PHY is located on the
> breakout board, and the other on the Ethernet sub-board. Which PHY is
> connected depends on what resistors are mounted on the board.

Actually there are three options:
  1. Breakout board,
  2. Ethernet sub-board,
  3. Ether module board.

> The default white-hawk configuration connect the TSN with the PHY on the
> breakout board. Unfortunately the standard breakout board do not
> populate the external PHY.

According to the schematics, this seems to depend on board revision:
  - rev. 0.909: TSN is wired to 3,
  - rev. 1.00: TSN is wired to 2.

> Add an overlay that can be applied to enable Ethernet TSN support for
> those boards that do populate the breakout board, or mount the
> appropriate resistors to connect TSN with the Ethernet sub-board.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Thanks for your patch!

> --- a/arch/arm64/boot/dts/renesas/Makefile
> +++ b/arch/arm64/boot/dts/renesas/Makefile
> @@ -84,7 +84,9 @@ dtb-$(CONFIG_ARCH_R8A779F0) += r8a779f4-s4sk.dtb
>  dtb-$(CONFIG_ARCH_R8A779G0) += r8a779g0-white-hawk.dtb
>  dtb-$(CONFIG_ARCH_R8A779G0) += r8a779g0-white-hawk-ard-audio-da7212.dtbo
>  r8a779g0-white-hawk-ard-audio-da7212-dtbs := r8a779g0-white-hawk.dtb r8a779g0-white-hawk-ard-audio-da7212.dtbo

Please add

    dtb-$(CONFIG_ARCH_R8A779G0) += r8a779g0-white-hawk-tsn.dtbo

so that the .dtbo is considered for installation, too.

> +r8a779g0-white-hawk-tsn-dtbs := r8a779g0-white-hawk.dtb r8a779g0-white-hawk-tsn.dtbo
>  dtb-$(CONFIG_ARCH_R8A779G0) += r8a779g0-white-hawk-ard-audio-da7212.dtb
> +dtb-$(CONFIG_ARCH_R8A779G0) += r8a779g0-white-hawk-tsn.dtb

The rest LGTM.

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

end of thread, other threads:[~2024-02-15 16:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-22 16:04 [PATCH 0/2] arm64: dts: renesas: Add TSN support for V4H Niklas Söderlund
2024-01-22 16:04 ` [PATCH 1/2] arm64: dts: renesas: r8a779g0: R-Car Ethernet TSN support Niklas Söderlund
2024-02-15 16:11   ` Geert Uytterhoeven
2024-01-22 16:04 ` [PATCH 2/2] arm64: dts: renesas: white-hawk: Add Ethernet TSN overlay Niklas Söderlund
2024-02-15 16:37   ` Geert Uytterhoeven

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