diff mbox series

[2/2] arm64: dts: renesas: white-hawk: Add Ethernet TSN overlay

Message ID 20240122160441.759620-3-niklas.soderlund+renesas@ragnatech.se (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show
Series arm64: dts: renesas: Add TSN support for V4H | expand

Commit Message

Niklas Söderlund Jan. 22, 2024, 4:04 p.m. UTC
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

Comments

Geert Uytterhoeven Feb. 15, 2024, 4:37 p.m. UTC | #1
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
diff mbox series

Patch

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