linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] arm64: dts: allwinner: h616: move emac delay back to Orange Pi Zero 2 DT
@ 2023-10-10 15:38 Chukun Pan
  2023-10-10 15:38 ` [PATCH 2/2] arm64: dts: allwinner: h616: update emac properties for Orange Pi Zero 3 Chukun Pan
  0 siblings, 1 reply; 4+ messages in thread
From: Chukun Pan @ 2023-10-10 15:38 UTC (permalink / raw)
  To: Andre Przywara
  Cc: Samuel Holland, Jernej Skrabec, Chen-Yu Tsai, Rob Herring,
	Conor Dooley, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-sunxi, linux-kernel, Chukun Pan

The current emac delay value is not suitable for Orange Pi
Zero 3, move it back to Orange Pi Zero 2 DT.

Fixes: 322bf103204b ("arm64: dts: allwinner: h616: Split Orange Pi Zero 2 DT")
Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
---
 arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi | 2 --
 arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi
index 15290e6892fc..02a4776c9f2b 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi
@@ -70,8 +70,6 @@ &emac0 {
 	pinctrl-0 = <&ext_rgmii_pins>;
 	phy-mode = "rgmii";
 	phy-handle = <&ext_rgmii_phy>;
-	allwinner,rx-delay-ps = <3100>;
-	allwinner,tx-delay-ps = <700>;
 	status = "okay";
 };
 
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
index d83852e72f06..84daa309893b 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
@@ -13,6 +13,8 @@ / {
 };
 
 &emac0 {
+	allwinner,rx-delay-ps = <3100>;
+	allwinner,tx-delay-ps = <700>;
 	phy-supply = <&reg_dcdce>;
 };
 
-- 
2.25.1


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

* [PATCH 2/2] arm64: dts: allwinner: h616: update emac properties for Orange Pi Zero 3
  2023-10-10 15:38 [PATCH 1/2] arm64: dts: allwinner: h616: move emac delay back to Orange Pi Zero 2 DT Chukun Pan
@ 2023-10-10 15:38 ` Chukun Pan
  2023-10-13 18:45   ` Jernej Škrabec
  0 siblings, 1 reply; 4+ messages in thread
From: Chukun Pan @ 2023-10-10 15:38 UTC (permalink / raw)
  To: Andre Przywara
  Cc: Samuel Holland, Jernej Skrabec, Chen-Yu Tsai, Rob Herring,
	Conor Dooley, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-sunxi, linux-kernel, Chukun Pan

Add the correct delay value to emac. Also add missing mdio
properties for the YT8531 PHY (clock output required).
With these changes, Ethernet now looks stable.

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
---
 arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts
index 00fe28caac93..02c7836b624a 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts
@@ -13,10 +13,14 @@ / {
 };
 
 &emac0 {
+	allwinner,rx-delay-ps = <1800>;
+	allwinner,tx-delay-ps = <700>;
 	phy-supply = <&reg_dldo1>;
 };
 
 &ext_rgmii_phy {
+	motorcomm,keep-pll-enabled;
+	motorcomm,auto-sleep-disabled;
 	motorcomm,clk-out-frequency-hz = <125000000>;
 };
 
-- 
2.25.1


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

* Re: [PATCH 2/2] arm64: dts: allwinner: h616: update emac properties for Orange Pi Zero 3
  2023-10-10 15:38 ` [PATCH 2/2] arm64: dts: allwinner: h616: update emac properties for Orange Pi Zero 3 Chukun Pan
@ 2023-10-13 18:45   ` Jernej Škrabec
  2023-10-22 11:08     ` Chukun Pan
  0 siblings, 1 reply; 4+ messages in thread
From: Jernej Škrabec @ 2023-10-13 18:45 UTC (permalink / raw)
  To: Andre Przywara, Chukun Pan
  Cc: Samuel Holland, Chen-Yu Tsai, Rob Herring, Conor Dooley,
	Krzysztof Kozlowski, devicetree, linux-arm-kernel, linux-sunxi,
	linux-kernel, Chukun Pan

Hi!

Dne torek, 10. oktober 2023 ob 17:38:12 CEST je Chukun Pan napisal(a):
> Add the correct delay value to emac. Also add missing mdio
> properties for the YT8531 PHY (clock output required).
> With these changes, Ethernet now looks stable.

This is also a fix, so it would also deserve Fixes tag. In fact, please merge
previous and this patch into one. After all, you are fixing only one thing -
ethernet on OrangePi Zero 3 board.

Can you also explain how did you figure out that additional PHY properties
are needed? At first glance, based on description of motorcomm,keep-pll-enabled,
it's not immediately clear why it should be needed. Same goes for second
property.

1800 ps delay basically means that rgmii is not correct type and rgmii-rxid
should be used instead. Indeed, schematic confirms that's the case. With that,
allwinner,rx-delay-ps can be 0 and thus ommited from DT file.

Since there is many differences, I suggest that you remove whole emac0
node from common DTSI file and put specific ones to each board. It will
be less confusing that way.

Best regards,
Jernej

> 
> Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
> ---
>  arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts
> index 00fe28caac93..02c7836b624a 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero3.dts
> @@ -13,10 +13,14 @@ / {
>  };
>  
>  &emac0 {
> +	allwinner,rx-delay-ps = <1800>;
> +	allwinner,tx-delay-ps = <700>;
>  	phy-supply = <&reg_dldo1>;
>  };
>  
>  &ext_rgmii_phy {
> +	motorcomm,keep-pll-enabled;
> +	motorcomm,auto-sleep-disabled;
>  	motorcomm,clk-out-frequency-hz = <125000000>;
>  };
>  
> 





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

* Re: [PATCH 2/2] arm64: dts: allwinner: h616: update emac properties for Orange Pi Zero 3
  2023-10-13 18:45   ` Jernej Škrabec
@ 2023-10-22 11:08     ` Chukun Pan
  0 siblings, 0 replies; 4+ messages in thread
From: Chukun Pan @ 2023-10-22 11:08 UTC (permalink / raw)
  To: jernej.skrabec
  Cc: andre.przywara, conor+dt, robh+dt, samuel, wens, devicetree,
	krzysztof.kozlowski+dt, linux-arm-kernel, linux-kernel,
	linux-sunxi, Chukun Pan

> Can you also explain how did you figure out that additional PHY properties
> are needed? At first glance, based on description of motorcomm,keep-pll-enabled,
> it's not immediately clear why it should be needed. Same goes for second
> property.

This is based on a search for
'motorcomm,clk-out-frequency-hz = <125000000>' in the kernel.
Refer to device tree of other devices with the same properties.
After a simple short test, it seems that it is unnecessary.
I will delete these two properties in patch v2.

> 1800 ps delay basically means that rgmii is not correct type and rgmii-rxid
> should be used instead. Indeed, schematic confirms that's the case. With that,
> allwinner,rx-delay-ps can be 0 and thus ommited from DT file.

Thanks, rgmii-rxid works for me. Will be corrected in patch v2.

Thanks,
Chukun

-- 
2.25.1


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

end of thread, other threads:[~2023-10-22 11:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-10 15:38 [PATCH 1/2] arm64: dts: allwinner: h616: move emac delay back to Orange Pi Zero 2 DT Chukun Pan
2023-10-10 15:38 ` [PATCH 2/2] arm64: dts: allwinner: h616: update emac properties for Orange Pi Zero 3 Chukun Pan
2023-10-13 18:45   ` Jernej Škrabec
2023-10-22 11:08     ` Chukun Pan

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