diff mbox series

[2/2] arm64: dts: allwinner: h616: update emac properties for Orange Pi Zero 3

Message ID 20231010153812.2869633-2-amadeus@jmu.edu.cn
State New
Headers show
Series [1/2] arm64: dts: allwinner: h616: move emac delay back to Orange Pi Zero 2 DT | expand

Commit Message

Chukun Pan Oct. 10, 2023, 3:38 p.m. UTC
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(+)

Comments

Jernej Škrabec Oct. 13, 2023, 6:45 p.m. UTC | #1
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>;
>  };
>  
>
Chukun Pan Oct. 22, 2023, 11:08 a.m. UTC | #2
> 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
diff mbox series

Patch

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