linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: renesas: r8a779f0: Disable rswitch ports by default
@ 2025-01-23 16:37 Geert Uytterhoeven
  2025-01-23 18:37 ` Niklas Söderlund
  2025-01-23 21:17 ` Marek Vasut
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2025-01-23 16:37 UTC (permalink / raw)
  To: Magnus Damm, Marek Vasut, Yoshihiro Shimoda, Kuninori Morimoto,
	Niklas Söderlund
  Cc: linux-renesas-soc, linux-arm-kernel, devicetree,
	Geert Uytterhoeven

The Renesas Ethernet Switch has three independent ports.  Each port can
act as a separate interface, and can be enabled or disabled
independently.  Currently all ports are enabled by default, hence board
DTS files that enable the switch must disable all unused ports
explicitly.

Disable all ports by default, and explicitly enable ports that are used,
next to their configuration.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This is similar to how Ethernet switch ports are handled on RZ/N1D, and
CAN-FD channels on R-Car Gen3/4.

If accepted, I'm wondering if I should move it forward, before "[PATCH
3/5] arm64: dts: renesas: s4sk: Access rswitch ports via phandles"[1],
which would become slightly simpler.

[1] https://lore.kernel.org/all/20250118111344.361617-3-marek.vasut+renesas@mailbox.org
---
 arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi | 3 +++
 arch/arm64/boot/dts/renesas/r8a779f0.dtsi                 | 3 +++
 arch/arm64/boot/dts/renesas/r8a779f4-s4sk.dts             | 6 ++----
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi b/arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi
index 892729786d00b36e..ad2b0398d35431a1 100644
--- a/arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi
@@ -57,6 +57,7 @@ &rswitch_port0 {
 	phy-handle = <&u101>;
 	phy-mode = "sgmii";
 	phys = <&eth_serdes 0>;
+	status = "okay";
 
 	mdio {
 		#address-cells = <1>;
@@ -75,6 +76,7 @@ &rswitch_port1 {
 	phy-handle = <&u201>;
 	phy-mode = "sgmii";
 	phys = <&eth_serdes 1>;
+	status = "okay";
 
 	mdio {
 		#address-cells = <1>;
@@ -93,6 +95,7 @@ &rswitch_port2 {
 	phy-handle = <&u301>;
 	phy-mode = "sgmii";
 	phys = <&eth_serdes 2>;
+	status = "okay";
 
 	mdio {
 		#address-cells = <1>;
diff --git a/arch/arm64/boot/dts/renesas/r8a779f0.dtsi b/arch/arm64/boot/dts/renesas/r8a779f0.dtsi
index 840ba73c03f1b6f4..06be9f7720d64179 100644
--- a/arch/arm64/boot/dts/renesas/r8a779f0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779f0.dtsi
@@ -989,14 +989,17 @@ ethernet-ports {
 				rswitch_port0: port@0 {
 					reg = <0>;
 					phys = <&eth_serdes 0>;
+					status = "disabled";
 				};
 				rswitch_port1: port@1 {
 					reg = <1>;
 					phys = <&eth_serdes 1>;
+					status = "disabled";
 				};
 				rswitch_port2: port@2 {
 					reg = <2>;
 					phys = <&eth_serdes 2>;
+					status = "disabled";
 				};
 			};
 		};
diff --git a/arch/arm64/boot/dts/renesas/r8a779f4-s4sk.dts b/arch/arm64/boot/dts/renesas/r8a779f4-s4sk.dts
index 24ecdf6e8476a945..df652e7b85c95ebe 100644
--- a/arch/arm64/boot/dts/renesas/r8a779f4-s4sk.dts
+++ b/arch/arm64/boot/dts/renesas/r8a779f4-s4sk.dts
@@ -187,6 +187,7 @@ &rswitch_port0 {
 	phy-handle = <&ic99>;
 	phy-mode = "sgmii";
 	phys = <&eth_serdes 0>;
+	status = "okay";
 
 	mdio {
 		#address-cells = <1>;
@@ -205,6 +206,7 @@ &rswitch_port1 {
 	phy-handle = <&ic102>;
 	phy-mode = "sgmii";
 	phys = <&eth_serdes 1>;
+	status = "okay";
 
 	mdio {
 		#address-cells = <1>;
@@ -218,10 +220,6 @@ ic102: ethernet-phy@2 {
 	};
 };
 
-&rswitch_port2 {
-	status = "disabled";
-};
-
 &rwdt {
 	timeout-sec = <60>;
 	status = "okay";
-- 
2.43.0



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

* Re: [PATCH] arm64: dts: renesas: r8a779f0: Disable rswitch ports by default
  2025-01-23 16:37 [PATCH] arm64: dts: renesas: r8a779f0: Disable rswitch ports by default Geert Uytterhoeven
@ 2025-01-23 18:37 ` Niklas Söderlund
  2025-01-23 21:17 ` Marek Vasut
  1 sibling, 0 replies; 3+ messages in thread
From: Niklas Söderlund @ 2025-01-23 18:37 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Magnus Damm, Marek Vasut, Yoshihiro Shimoda, Kuninori Morimoto,
	linux-renesas-soc, linux-arm-kernel, devicetree

Hello Geert,

Thanks for your work.

On 2025-01-23 17:37:10 +0100, Geert Uytterhoeven wrote:
> The Renesas Ethernet Switch has three independent ports.  Each port can
> act as a separate interface, and can be enabled or disabled
> independently.  Currently all ports are enabled by default, hence board
> DTS files that enable the switch must disable all unused ports
> explicitly.
> 
> Disable all ports by default, and explicitly enable ports that are used,
> next to their configuration.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> This is similar to how Ethernet switch ports are handled on RZ/N1D, and
> CAN-FD channels on R-Car Gen3/4.
> 
> If accepted, I'm wondering if I should move it forward, before "[PATCH
> 3/5] arm64: dts: renesas: s4sk: Access rswitch ports via phandles"[1],
> which would become slightly simpler.

I let you and Marek figure that out, for the content of this patch.

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> 
> [1] https://lore.kernel.org/all/20250118111344.361617-3-marek.vasut+renesas@mailbox.org
> ---
>  arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi | 3 +++
>  arch/arm64/boot/dts/renesas/r8a779f0.dtsi                 | 3 +++
>  arch/arm64/boot/dts/renesas/r8a779f4-s4sk.dts             | 6 ++----
>  3 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi b/arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi
> index 892729786d00b36e..ad2b0398d35431a1 100644
> --- a/arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a779f0-spider-ethernet.dtsi
> @@ -57,6 +57,7 @@ &rswitch_port0 {
>  	phy-handle = <&u101>;
>  	phy-mode = "sgmii";
>  	phys = <&eth_serdes 0>;
> +	status = "okay";
>  
>  	mdio {
>  		#address-cells = <1>;
> @@ -75,6 +76,7 @@ &rswitch_port1 {
>  	phy-handle = <&u201>;
>  	phy-mode = "sgmii";
>  	phys = <&eth_serdes 1>;
> +	status = "okay";
>  
>  	mdio {
>  		#address-cells = <1>;
> @@ -93,6 +95,7 @@ &rswitch_port2 {
>  	phy-handle = <&u301>;
>  	phy-mode = "sgmii";
>  	phys = <&eth_serdes 2>;
> +	status = "okay";
>  
>  	mdio {
>  		#address-cells = <1>;
> diff --git a/arch/arm64/boot/dts/renesas/r8a779f0.dtsi b/arch/arm64/boot/dts/renesas/r8a779f0.dtsi
> index 840ba73c03f1b6f4..06be9f7720d64179 100644
> --- a/arch/arm64/boot/dts/renesas/r8a779f0.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a779f0.dtsi
> @@ -989,14 +989,17 @@ ethernet-ports {
>  				rswitch_port0: port@0 {
>  					reg = <0>;
>  					phys = <&eth_serdes 0>;
> +					status = "disabled";
>  				};
>  				rswitch_port1: port@1 {
>  					reg = <1>;
>  					phys = <&eth_serdes 1>;
> +					status = "disabled";
>  				};
>  				rswitch_port2: port@2 {
>  					reg = <2>;
>  					phys = <&eth_serdes 2>;
> +					status = "disabled";
>  				};
>  			};
>  		};
> diff --git a/arch/arm64/boot/dts/renesas/r8a779f4-s4sk.dts b/arch/arm64/boot/dts/renesas/r8a779f4-s4sk.dts
> index 24ecdf6e8476a945..df652e7b85c95ebe 100644
> --- a/arch/arm64/boot/dts/renesas/r8a779f4-s4sk.dts
> +++ b/arch/arm64/boot/dts/renesas/r8a779f4-s4sk.dts
> @@ -187,6 +187,7 @@ &rswitch_port0 {
>  	phy-handle = <&ic99>;
>  	phy-mode = "sgmii";
>  	phys = <&eth_serdes 0>;
> +	status = "okay";
>  
>  	mdio {
>  		#address-cells = <1>;
> @@ -205,6 +206,7 @@ &rswitch_port1 {
>  	phy-handle = <&ic102>;
>  	phy-mode = "sgmii";
>  	phys = <&eth_serdes 1>;
> +	status = "okay";
>  
>  	mdio {
>  		#address-cells = <1>;
> @@ -218,10 +220,6 @@ ic102: ethernet-phy@2 {
>  	};
>  };
>  
> -&rswitch_port2 {
> -	status = "disabled";
> -};
> -
>  &rwdt {
>  	timeout-sec = <60>;
>  	status = "okay";
> -- 
> 2.43.0
> 

-- 
Kind Regards,
Niklas Söderlund


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

* Re: [PATCH] arm64: dts: renesas: r8a779f0: Disable rswitch ports by default
  2025-01-23 16:37 [PATCH] arm64: dts: renesas: r8a779f0: Disable rswitch ports by default Geert Uytterhoeven
  2025-01-23 18:37 ` Niklas Söderlund
@ 2025-01-23 21:17 ` Marek Vasut
  1 sibling, 0 replies; 3+ messages in thread
From: Marek Vasut @ 2025-01-23 21:17 UTC (permalink / raw)
  To: Geert Uytterhoeven, Magnus Damm, Marek Vasut, Yoshihiro Shimoda,
	Kuninori Morimoto, Niklas Söderlund
  Cc: linux-renesas-soc, linux-arm-kernel, devicetree

On 1/23/25 5:37 PM, Geert Uytterhoeven wrote:
> The Renesas Ethernet Switch has three independent ports.  Each port can
> act as a separate interface, and can be enabled or disabled
> independently.  Currently all ports are enabled by default, hence board
> DTS files that enable the switch must disable all unused ports
> explicitly.
> 
> Disable all ports by default, and explicitly enable ports that are used,
> next to their configuration.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> This is similar to how Ethernet switch ports are handled on RZ/N1D, and
> CAN-FD channels on R-Car Gen3/4.
> 
> If accepted, I'm wondering if I should move it forward, before "[PATCH
> 3/5] arm64: dts: renesas: s4sk: Access rswitch ports via phandles"[1],
> which would become slightly simpler.
> 
> [1] https://lore.kernel.org/all/20250118111344.361617-3-marek.vasut+renesas@mailbox.org
Reviewed-by: Marek Vasut <marek.vasut+renesas@mailbox.org>

I don't mind either ordering, but please keep in mind that 5/5 in [1] 
has Fixes: tag and it is already overloading that tag by pulling in most 
of the series as dependencies .


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

end of thread, other threads:[~2025-01-23 21:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-23 16:37 [PATCH] arm64: dts: renesas: r8a779f0: Disable rswitch ports by default Geert Uytterhoeven
2025-01-23 18:37 ` Niklas Söderlund
2025-01-23 21:17 ` Marek Vasut

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