mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] Move RK3368 Lion ethernet phy to a mdio subnode
@ 2025-10-20 10:07 Heiko Stuebner
  2025-10-20 10:07 ` [PATCH 1/3] arm64: dts: rockchip: add gmac reset property to rk3368 Heiko Stuebner
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Heiko Stuebner @ 2025-10-20 10:07 UTC (permalink / raw)
  To: heiko; +Cc: quentin.schulz, linux-arm-kernel, linux-rockchip, linux-kernel

Don't use deprecated snps properties to describe the phy reset,
but instead add the mdio bus subnode to the gmac and correctly
describe the phy there.

This will also help us later to handle a lion-specific oddity where
the phy needs to enable its clock output for the needed mac clock.


Heiko Stuebner (3):
  arm64: dts: rockchip: add gmac reset property to rk3368
  arm64: dts: rockchip: add mdio subnode to gmac on rk3368
  arm64: dts: rockchip: Correctly describe the ethernet phy on
    rk3368-lion

 arch/arm64/boot/dts/rockchip/rk3368-lion.dtsi | 22 ++++++++++++++++---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi      |  8 +++++++
 2 files changed, 27 insertions(+), 3 deletions(-)

-- 
2.47.2


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

* [PATCH 1/3] arm64: dts: rockchip: add gmac reset property to rk3368
  2025-10-20 10:07 [PATCH 0/3] Move RK3368 Lion ethernet phy to a mdio subnode Heiko Stuebner
@ 2025-10-20 10:07 ` Heiko Stuebner
  2025-12-01 14:45   ` Quentin Schulz
  2025-10-20 10:07 ` [PATCH 2/3] arm64: dts: rockchip: add mdio subnode to gmac on rk3368 Heiko Stuebner
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Heiko Stuebner @ 2025-10-20 10:07 UTC (permalink / raw)
  To: heiko
  Cc: quentin.schulz, linux-arm-kernel, linux-rockchip, linux-kernel,
	Heiko Stuebner

From: Heiko Stuebner <heiko.stuebner@cherry.de>

Add the reset of the gmac controller block.

Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3368.dtsi b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
index 892d35242259..47968032afdc 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
@@ -498,6 +498,8 @@ gmac: ethernet@ff290000 {
 			"mac_clk_rx", "mac_clk_tx",
 			"clk_mac_ref", "clk_mac_refout",
 			"aclk_mac", "pclk_mac";
+		resets = <&cru SRST_MAC>;
+		reset-names = "stmmaceth";
 		status = "disabled";
 	};
 
-- 
2.47.2


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

* [PATCH 2/3] arm64: dts: rockchip: add mdio subnode to gmac on rk3368
  2025-10-20 10:07 [PATCH 0/3] Move RK3368 Lion ethernet phy to a mdio subnode Heiko Stuebner
  2025-10-20 10:07 ` [PATCH 1/3] arm64: dts: rockchip: add gmac reset property to rk3368 Heiko Stuebner
@ 2025-10-20 10:07 ` Heiko Stuebner
  2025-12-01 14:51   ` Quentin Schulz
  2025-10-20 10:07 ` [PATCH 3/3] arm64: dts: rockchip: Correctly describe the ethernet phy on rk3368-lion Heiko Stuebner
  2025-12-22 13:56 ` [PATCH 0/3] Move RK3368 Lion ethernet phy to a mdio subnode Heiko Stuebner
  3 siblings, 1 reply; 8+ messages in thread
From: Heiko Stuebner @ 2025-10-20 10:07 UTC (permalink / raw)
  To: heiko
  Cc: quentin.schulz, linux-arm-kernel, linux-rockchip, linux-kernel,
	Heiko Stuebner

From: Heiko Stuebner <heiko.stuebner@cherry.de>

This is needed to actually describe the per-board phys connected
to the gmac when needed.

Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
---
 arch/arm64/boot/dts/rockchip/rk3368.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3368.dtsi b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
index 47968032afdc..98d350768fd2 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3368.dtsi
@@ -501,6 +501,12 @@ gmac: ethernet@ff290000 {
 		resets = <&cru SRST_MAC>;
 		reset-names = "stmmaceth";
 		status = "disabled";
+
+		mdio: mdio {
+			compatible = "snps,dwmac-mdio";
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
 	};
 
 	usb_host0_ehci: usb@ff500000 {
-- 
2.47.2


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

* [PATCH 3/3] arm64: dts: rockchip: Correctly describe the ethernet phy on rk3368-lion
  2025-10-20 10:07 [PATCH 0/3] Move RK3368 Lion ethernet phy to a mdio subnode Heiko Stuebner
  2025-10-20 10:07 ` [PATCH 1/3] arm64: dts: rockchip: add gmac reset property to rk3368 Heiko Stuebner
  2025-10-20 10:07 ` [PATCH 2/3] arm64: dts: rockchip: add mdio subnode to gmac on rk3368 Heiko Stuebner
@ 2025-10-20 10:07 ` Heiko Stuebner
  2025-12-01 14:54   ` Quentin Schulz
  2025-12-22 13:56 ` [PATCH 0/3] Move RK3368 Lion ethernet phy to a mdio subnode Heiko Stuebner
  3 siblings, 1 reply; 8+ messages in thread
From: Heiko Stuebner @ 2025-10-20 10:07 UTC (permalink / raw)
  To: heiko
  Cc: quentin.schulz, linux-arm-kernel, linux-rockchip, linux-kernel,
	Heiko Stuebner

From: Heiko Stuebner <heiko.stuebner@cherry.de>

So far, the board used the phy implicitly using the deprecated snps reset
properties. Improve that and describe the PHY correctly under the new
mdio node.

Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>
---
 arch/arm64/boot/dts/rockchip/rk3368-lion.dtsi | 22 ++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3368-lion.dtsi b/arch/arm64/boot/dts/rockchip/rk3368-lion.dtsi
index 8ccc3184a836..61c52bd91784 100644
--- a/arch/arm64/boot/dts/rockchip/rk3368-lion.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3368-lion.dtsi
@@ -154,13 +154,11 @@ &gmac {
 	assigned-clocks = <&cru SCLK_MAC>;
 	assigned-clock-parents = <&ext_gmac>;
 	clock_in_out = "input";
+	phy-handle = <&vsc8531_2>;
 	phy-supply = <&vcc33_io>;
 	phy-mode = "rgmii";
 	pinctrl-names = "default";
 	pinctrl-0 = <&rgmii_pins>;
-	snps,reset-active-low;
-	snps,reset-delays-us = <0 10000 50000>;
-	snps,reset-gpio = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>;
 	tx_delay = <0x10>;
 	rx_delay = <0x10>;
 	status = "okay";
@@ -285,7 +283,25 @@ &io_domains {
 	status = "okay";
 };
 
+&mdio {
+	vsc8531_2: ethernet-phy@0 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x0>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&phy_rst>;
+		reset-assert-us = <10000>;
+		reset-deassert-us = <50000>;
+		reset-gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_LOW>;
+	};
+};
+
 &pinctrl {
+	ethernet {
+		phy_rst: phy-rst {
+			rockchip,pins = <3 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
 	leds {
 		module_led_pins: module-led-pins {
 			rockchip,pins =
-- 
2.47.2


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

* Re: [PATCH 1/3] arm64: dts: rockchip: add gmac reset property to rk3368
  2025-10-20 10:07 ` [PATCH 1/3] arm64: dts: rockchip: add gmac reset property to rk3368 Heiko Stuebner
@ 2025-12-01 14:45   ` Quentin Schulz
  0 siblings, 0 replies; 8+ messages in thread
From: Quentin Schulz @ 2025-12-01 14:45 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: linux-arm-kernel, linux-rockchip, linux-kernel, Heiko Stuebner

Hi Heiko,

On 10/20/25 12:07 PM, Heiko Stuebner wrote:
> From: Heiko Stuebner <heiko.stuebner@cherry.de>
> 
> Add the reset of the gmac controller block.
> 
> Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>

Thanks!
Quentin

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

* Re: [PATCH 2/3] arm64: dts: rockchip: add mdio subnode to gmac on rk3368
  2025-10-20 10:07 ` [PATCH 2/3] arm64: dts: rockchip: add mdio subnode to gmac on rk3368 Heiko Stuebner
@ 2025-12-01 14:51   ` Quentin Schulz
  0 siblings, 0 replies; 8+ messages in thread
From: Quentin Schulz @ 2025-12-01 14:51 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: linux-arm-kernel, linux-rockchip, linux-kernel, Heiko Stuebner

Hi Heiko,

On 10/20/25 12:07 PM, Heiko Stuebner wrote:
> From: Heiko Stuebner <heiko.stuebner@cherry.de>
> 
> This is needed to actually describe the per-board phys connected
> to the gmac when needed.
> 
> Signed-off-by: Heiko Stuebner <heiko.stuebner@cherry.de>

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>

Thanks!
Quentin

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

* Re: [PATCH 3/3] arm64: dts: rockchip: Correctly describe the ethernet phy on rk3368-lion
  2025-10-20 10:07 ` [PATCH 3/3] arm64: dts: rockchip: Correctly describe the ethernet phy on rk3368-lion Heiko Stuebner
@ 2025-12-01 14:54   ` Quentin Schulz
  0 siblings, 0 replies; 8+ messages in thread
From: Quentin Schulz @ 2025-12-01 14:54 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: linux-arm-kernel, linux-rockchip, linux-kernel, Heiko Stuebner

Hi Heiko,

On 10/20/25 12:07 PM, Heiko Stuebner wrote:
> From: Heiko Stuebner <heiko.stuebner@cherry.de>
> 
> So far, the board used the phy implicitly using the deprecated snps reset
> properties. Improve that and describe the PHY correctly under the new
> mdio node.
> 

Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>

Thanks!
Quentin

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

* Re: [PATCH 0/3] Move RK3368 Lion ethernet phy to a mdio subnode
  2025-10-20 10:07 [PATCH 0/3] Move RK3368 Lion ethernet phy to a mdio subnode Heiko Stuebner
                   ` (2 preceding siblings ...)
  2025-10-20 10:07 ` [PATCH 3/3] arm64: dts: rockchip: Correctly describe the ethernet phy on rk3368-lion Heiko Stuebner
@ 2025-12-22 13:56 ` Heiko Stuebner
  3 siblings, 0 replies; 8+ messages in thread
From: Heiko Stuebner @ 2025-12-22 13:56 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: quentin.schulz, linux-arm-kernel, linux-rockchip, linux-kernel


On Mon, 20 Oct 2025 12:07:54 +0200, Heiko Stuebner wrote:
> Don't use deprecated snps properties to describe the phy reset,
> but instead add the mdio bus subnode to the gmac and correctly
> describe the phy there.
> 
> This will also help us later to handle a lion-specific oddity where
> the phy needs to enable its clock output for the needed mac clock.
> 
> [...]

Applied, thanks!

[1/3] arm64: dts: rockchip: add gmac reset property to rk3368
      commit: 396870f53c4e736366b4ed2e127874c30ce2f965
[2/3] arm64: dts: rockchip: add mdio subnode to gmac on rk3368
      commit: bce933a74b8e785a8090da74bee8ec3f38be40b7
[3/3] arm64: dts: rockchip: Correctly describe the ethernet phy on rk3368-lion
      commit: 1cb0958a26aeffe315a60b3cbbc56b94246cc25a

Best regards,
-- 
Heiko Stuebner <heiko@sntech.de>

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

end of thread, other threads:[~2025-12-22 13:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-20 10:07 [PATCH 0/3] Move RK3368 Lion ethernet phy to a mdio subnode Heiko Stuebner
2025-10-20 10:07 ` [PATCH 1/3] arm64: dts: rockchip: add gmac reset property to rk3368 Heiko Stuebner
2025-12-01 14:45   ` Quentin Schulz
2025-10-20 10:07 ` [PATCH 2/3] arm64: dts: rockchip: add mdio subnode to gmac on rk3368 Heiko Stuebner
2025-12-01 14:51   ` Quentin Schulz
2025-10-20 10:07 ` [PATCH 3/3] arm64: dts: rockchip: Correctly describe the ethernet phy on rk3368-lion Heiko Stuebner
2025-12-01 14:54   ` Quentin Schulz
2025-12-22 13:56 ` [PATCH 0/3] Move RK3368 Lion ethernet phy to a mdio subnode Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®