linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] arm64: dts: renesas: white-hawk: Add AVB1 and AVB2
@ 2024-04-13 14:18 Niklas Söderlund
  2024-04-13 14:18 ` [PATCH v3 1/2] arm64: dts: renesas: r8a779g0: Use MDIO node for all AVB devices Niklas Söderlund
  2024-04-13 14:18 ` [PATCH v3 2/2] arm64: dts: renesas: white-hawk: ethernet: Describe AVB1 and AVB2 Niklas Söderlund
  0 siblings, 2 replies; 5+ messages in thread
From: Niklas Söderlund @ 2024-04-13 14:18 UTC (permalink / raw)
  To: Geert Uytterhoeven, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-renesas-soc, devicetree
  Cc: Niklas Söderlund

Hello Geert,

This small series describes the AVB1 and AVB2 found on White-Hawk.

Patch 1/2 prepares the AVB base nodes for r8a779g0 to use a dedicated 
MDIO node and switches to use this for AVB0, which is the only node who 
currently describes a PHY. The driver and binding change needed to use a 
MDIO node are merged in net-next already.

Patch 2/2 add the description for AVB1 and AVB2 found on the Ethernet 
sub-board.

See individual patch for change log.

Niklas Söderlund (2):
  arm64: dts: renesas: r8a779g0: Use MDIO node for all AVB devices
  arm64: dts: renesas: white-hawk: ethernet: Describe AVB1 and AVB2

 arch/arm64/boot/dts/renesas/r8a779g0.dtsi     |   6 -
 .../dts/renesas/white-hawk-cpu-common.dtsi    |  23 ++--
 .../boot/dts/renesas/white-hawk-ethernet.dtsi | 103 ++++++++++++++++++
 3 files changed, 117 insertions(+), 15 deletions(-)

-- 
2.44.0


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

* [PATCH v3 1/2] arm64: dts: renesas: r8a779g0: Use MDIO node for all AVB devices
  2024-04-13 14:18 [PATCH v3 0/2] arm64: dts: renesas: white-hawk: Add AVB1 and AVB2 Niklas Söderlund
@ 2024-04-13 14:18 ` Niklas Söderlund
  2024-04-24 15:18   ` Geert Uytterhoeven
  2024-04-13 14:18 ` [PATCH v3 2/2] arm64: dts: renesas: white-hawk: ethernet: Describe AVB1 and AVB2 Niklas Söderlund
  1 sibling, 1 reply; 5+ messages in thread
From: Niklas Söderlund @ 2024-04-13 14:18 UTC (permalink / raw)
  To: Geert Uytterhoeven, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-renesas-soc, devicetree
  Cc: Niklas Söderlund

Switch from defining the PHY inside the AVB node itself and create a
dedicated MDIO node for AVB0, the only AVB describing a PHY. This is
needed as adding PHYs to AVB1 and AVB2 will require setting MDIO bus
parapets and thus requires a dedicated node.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
* Changes since v2
- New in v2.
---
 arch/arm64/boot/dts/renesas/r8a779g0.dtsi     |  6 -----
 .../dts/renesas/white-hawk-cpu-common.dtsi    | 23 +++++++++++--------
 2 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
index 9bc542bc6169..2ee306305d83 100644
--- a/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779g0.dtsi
@@ -815,8 +815,6 @@ avb0: ethernet@e6800000 {
 			phy-mode = "rgmii";
 			rx-internal-delay-ps = <0>;
 			tx-internal-delay-ps = <0>;
-			#address-cells = <1>;
-			#size-cells = <0>;
 			status = "disabled";
 		};
 
@@ -862,8 +860,6 @@ avb1: ethernet@e6810000 {
 			phy-mode = "rgmii";
 			rx-internal-delay-ps = <0>;
 			tx-internal-delay-ps = <0>;
-			#address-cells = <1>;
-			#size-cells = <0>;
 			status = "disabled";
 		};
 
@@ -909,8 +905,6 @@ avb2: ethernet@e6820000 {
 			phy-mode = "rgmii";
 			rx-internal-delay-ps = <0>;
 			tx-internal-delay-ps = <0>;
-			#address-cells = <1>;
-			#size-cells = <0>;
 			status = "disabled";
 		};
 
diff --git a/arch/arm64/boot/dts/renesas/white-hawk-cpu-common.dtsi b/arch/arm64/boot/dts/renesas/white-hawk-cpu-common.dtsi
index 8ac17370ff36..b671bfab049b 100644
--- a/arch/arm64/boot/dts/renesas/white-hawk-cpu-common.dtsi
+++ b/arch/arm64/boot/dts/renesas/white-hawk-cpu-common.dtsi
@@ -142,18 +142,23 @@ reg_3p3v: regulator-3p3v {
 &avb0 {
 	pinctrl-0 = <&avb0_pins>;
 	pinctrl-names = "default";
-	phy-handle = <&phy0>;
+	phy-handle = <&avb0_phy>;
 	tx-internal-delay-ps = <2000>;
 	status = "okay";
 
-	phy0: ethernet-phy@0 {
-		compatible = "ethernet-phy-id0022.1622",
-			     "ethernet-phy-ieee802.3-c22";
-		rxc-skew-ps = <1500>;
-		reg = <0>;
-		interrupt-parent = <&gpio7>;
-		interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
-		reset-gpios = <&gpio7 10 GPIO_ACTIVE_LOW>;
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		avb0_phy: ethernet-phy@0 {
+			compatible = "ethernet-phy-id0022.1622",
+				     "ethernet-phy-ieee802.3-c22";
+			rxc-skew-ps = <1500>;
+			reg = <0>;
+			interrupt-parent = <&gpio7>;
+			interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
+			reset-gpios = <&gpio7 10 GPIO_ACTIVE_LOW>;
+		};
 	};
 };
 
-- 
2.44.0


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

* [PATCH v3 2/2] arm64: dts: renesas: white-hawk: ethernet: Describe AVB1 and AVB2
  2024-04-13 14:18 [PATCH v3 0/2] arm64: dts: renesas: white-hawk: Add AVB1 and AVB2 Niklas Söderlund
  2024-04-13 14:18 ` [PATCH v3 1/2] arm64: dts: renesas: r8a779g0: Use MDIO node for all AVB devices Niklas Söderlund
@ 2024-04-13 14:18 ` Niklas Söderlund
  2024-04-24 15:19   ` Geert Uytterhoeven
  1 sibling, 1 reply; 5+ messages in thread
From: Niklas Söderlund @ 2024-04-13 14:18 UTC (permalink / raw)
  To: Geert Uytterhoeven, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, linux-renesas-soc, devicetree
  Cc: Niklas Söderlund

Describe the two Marvell 88Q2110/QFN40 PHYs available on the R-Car V4H
White Hawk RAVB/Ethernet(1000Base-T1) sub-board. The two PHYs are wired
up on the board by default, there is no need to move any resistors which
are needed to access other PHYs available on this sub-board.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
* Changes since v2
- Fix spelling in commit message.
- Add pinconf for link pin for both AVBs.
- Rename the phy node to make it clear which AVB it relates too.
- Add aliases for ethernet1 and ethernet2 so U-Boot can set MAC
  addresses.
- Rebase to reflect updated of filename for white-hawk-ethernet.dtsi.

* Changes since v1
- Correct typo in commit s/adv1/avb1/.
- Do not use underscores in node names.
- Move the MDIO bus properties into a septate child mdio node. This
  change depends on updates to the driver and bindings posted
  separately.
---
 .../boot/dts/renesas/white-hawk-ethernet.dtsi | 103 ++++++++++++++++++
 1 file changed, 103 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/white-hawk-ethernet.dtsi b/arch/arm64/boot/dts/renesas/white-hawk-ethernet.dtsi
index a218fda337cf..595ec4ff4cdd 100644
--- a/arch/arm64/boot/dts/renesas/white-hawk-ethernet.dtsi
+++ b/arch/arm64/boot/dts/renesas/white-hawk-ethernet.dtsi
@@ -6,6 +6,57 @@
  * Copyright (C) 2022 Glider bv
  */
 
+/ {
+	aliases {
+		ethernet1 = &avb1;
+		ethernet2 = &avb2;
+	};
+};
+
+&avb1 {
+	pinctrl-0 = <&avb1_pins>;
+	pinctrl-names = "default";
+	phy-handle = <&avb1_phy>;
+	status = "okay";
+
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		reset-gpios = <&gpio6 1 GPIO_ACTIVE_LOW>;
+		reset-post-delay-us = <4000>;
+
+		avb1_phy: ethernet-phy@0 {
+			compatible = "ethernet-phy-ieee802.3-c45";
+			reg = <0>;
+			interrupt-parent = <&gpio6>;
+			interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+		};
+	};
+};
+
+&avb2 {
+	pinctrl-0 = <&avb2_pins>;
+	pinctrl-names = "default";
+	phy-handle = <&avb2_phy>;
+	status = "okay";
+
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		reset-gpios = <&gpio5 5 GPIO_ACTIVE_LOW>;
+		reset-post-delay-us = <4000>;
+
+		avb2_phy: ethernet-phy@0 {
+			compatible = "ethernet-phy-ieee802.3-c45";
+			reg = <0>;
+			interrupt-parent = <&gpio5>;
+			interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
+		};
+	};
+};
+
 &i2c0 {
 	eeprom@53 {
 		compatible = "rohm,br24g01", "atmel,24c01";
@@ -14,3 +65,55 @@ eeprom@53 {
 		pagesize = <8>;
 	};
 };
+
+&pfc {
+	avb1_pins: avb1 {
+		mux {
+			groups = "avb1_link", "avb1_mdio", "avb1_rgmii",
+				 "avb1_txcrefclk";
+			function = "avb1";
+		};
+
+		mdio {
+			groups = "avb1_mdio";
+			drive-strength = <24>;
+			bias-disable;
+		};
+
+		rgmii {
+			groups = "avb1_rgmii";
+			drive-strength = <24>;
+			bias-disable;
+		};
+
+		link {
+			groups = "avb1_link";
+			bias-disable;
+		};
+	};
+
+	avb2_pins: avb2 {
+		mux {
+			groups = "avb2_link", "avb2_mdio", "avb2_rgmii",
+				 "avb2_txcrefclk";
+			function = "avb2";
+		};
+
+		mdio {
+			groups = "avb2_mdio";
+			drive-strength = <24>;
+			bias-disable;
+		};
+
+		rgmii {
+			groups = "avb2_rgmii";
+			drive-strength = <24>;
+			bias-disable;
+		};
+
+		link {
+			groups = "avb2_link";
+			bias-disable;
+		};
+	};
+};
-- 
2.44.0


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

* Re: [PATCH v3 1/2] arm64: dts: renesas: r8a779g0: Use MDIO node for all AVB devices
  2024-04-13 14:18 ` [PATCH v3 1/2] arm64: dts: renesas: r8a779g0: Use MDIO node for all AVB devices Niklas Söderlund
@ 2024-04-24 15:18   ` Geert Uytterhoeven
  0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2024-04-24 15:18 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-renesas-soc, devicetree

On Sat, Apr 13, 2024 at 4:19 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> Switch from defining the PHY inside the AVB node itself and create a
> dedicated MDIO node for AVB0, the only AVB describing a PHY. This is
> needed as adding PHYs to AVB1 and AVB2 will require setting MDIO bus
> parapets and thus requires a dedicated node.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> * Changes since v2
> - New in v2.

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
As this has a hard dependency on commit 2c60c4c008d4b05b ("ravb: Add
support for an optional MDIO mode") in net-next, this is postponed
to v6.11.

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 v3 2/2] arm64: dts: renesas: white-hawk: ethernet: Describe AVB1 and AVB2
  2024-04-13 14:18 ` [PATCH v3 2/2] arm64: dts: renesas: white-hawk: ethernet: Describe AVB1 and AVB2 Niklas Söderlund
@ 2024-04-24 15:19   ` Geert Uytterhoeven
  0 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2024-04-24 15:19 UTC (permalink / raw)
  To: Niklas Söderlund
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-renesas-soc, devicetree

On Sat, Apr 13, 2024 at 4:19 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> Describe the two Marvell 88Q2110/QFN40 PHYs available on the R-Car V4H
> White Hawk RAVB/Ethernet(1000Base-T1) sub-board. The two PHYs are wired
> up on the board by default, there is no need to move any resistors which
> are needed to access other PHYs available on this sub-board.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> ---
> * Changes since v2
> - Fix spelling in commit message.
> - Add pinconf for link pin for both AVBs.
> - Rename the phy node to make it clear which AVB it relates too.
> - Add aliases for ethernet1 and ethernet2 so U-Boot can set MAC
>   addresses.
> - Rebase to reflect updated of filename for white-hawk-ethernet.dtsi.

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

end of thread, other threads:[~2024-04-24 15:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-13 14:18 [PATCH v3 0/2] arm64: dts: renesas: white-hawk: Add AVB1 and AVB2 Niklas Söderlund
2024-04-13 14:18 ` [PATCH v3 1/2] arm64: dts: renesas: r8a779g0: Use MDIO node for all AVB devices Niklas Söderlund
2024-04-24 15:18   ` Geert Uytterhoeven
2024-04-13 14:18 ` [PATCH v3 2/2] arm64: dts: renesas: white-hawk: ethernet: Describe AVB1 and AVB2 Niklas Söderlund
2024-04-24 15:19   ` 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).