Skip to contentSkip to conversation

arm64: dts: rockchip: odroid-m1: use rgmii-id for gmac0

PATCH Applied Miguel Jesus Seron Gonzalez 3 participants 3 messages Oct 19 – Nov 1

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: rockchip: odroid-m1: use rgmii-id for gmac0

The gmac0 node uses phy-mode "rgmii" with the MAC delays tx_delay = <0x4f> and rx_delay = <0x2d>. On some boards this TX delay does not work at 1000 Mbit/s. Dongjin Kim reported iperf3 throughput below 200 Mbit/s on REV 1.0 20220613 boards. On a REV 1.0 20211112 board, TX from the board stalls completely in iperf3 and ping loss grows with frame size (5% at 56 bytes, 20% at 1472 bytes), while RX is unaffected. Other boards work with the current value, so it seems to be marginal rather than wrong everywhere.

Instead of tuning the MAC TX delay again, switch to phy-mode "rgmii-id", so that the RTL8211F PHY adds both RGMII delays, and drop the MAC delay properties, as suggested by Chukun Pan. Dongjin confirmed in the same thread that rgmii-id works.

With this change, on the REV 1.0 20211112 board at 1000 Mbit/s full duplex, there were 3 retransmitted TCP segments out of 24929 (0.012%) over almost four hours, no RX/TX errors and no ping loss.

Fixes fd3583267703 ("arm64: dts: rockchip: Add Hardkernel ODROID-M1 board")
Assisted-by Claude:claude-opus-5-5

---

Notes:
Sent as a standalone patch because Home Assistant OS needs an upstream reference for the same change. Dongjin confirmed in the v2 thread that rgmii-id works. Dongjin, if you would rather send your own version, I'll withdraw this one.

The debugging, the changelog and the patch were prepared with the help of Claude (Anthropic). I reviewed all of it, and the test results above are from my own board.

 arch/arm64/boot/dts/rockchip/rk3568-odroid-m1.dts | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
arch/arm64/boot/dts/rockchip/rk3568-odroid-m1.dts +1 -4
index 442a2bc43..a3cd21aa0 100644
@@ -200,7 +200,7 @@ &gmac0 {
 	assigned-clock-rates = <0>, <125000000>;
 	clock_in_out = "output";
 	phy-handle = <&rgmii_phy0>;
-	phy-mode = "rgmii";
+	phy-mode = "rgmii-id";
 	phy-supply = <&vcc3v3_sys>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&gmac0_miim
@@ -209,9 +209,6 @@ &gmac0_rx_bus2
 		     &gmac0_rgmii_clk
 		     &gmac0_rgmii_bus>;
 	status = "okay";
-
-	tx_delay = <0x4f>;
-	rx_delay = <0x2d>;
 };
 
 &gpu {

base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222

Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 34 lines · Miguel Jesus Seron Gonzalez

The gmac0 node uses phy-mode "rgmii" with the MAC delays tx_delay = <0x4f> and rx_delay = <0x2d>. On some boards this TX delay does not work at 1000 Mbit/s. Dongjin Kim reported iperf3 throughput below 200 Mbit/s on REV 1.0 20220613 boards. On a REV 1.0 20211112 board, TX from the board stalls completely in iperf3 and ping loss grows with frame size (5% at 56 bytes, 20% at 1472 bytes), while RX is unaffected. Other boards work with the current value, so it seems to be marginal rather than wrong everywhere.

Instead of tuning the MAC TX delay again, switch to phy-mode "rgmii-id", so that the RTL8211F PHY adds both RGMII delays, and drop the MAC delay properties, as suggested by Chukun Pan. Dongjin confirmed in the same thread that rgmii-id works.

With this change, on the REV 1.0 20211112 board at 1000 Mbit/s full duplex, there were 3 retransmitted TCP segments out of 24929 (0.012%) over almost four hours, no RX/TX errors and no ping loss.

Fixes fd3583267703 ("arm64: dts: rockchip: Add Hardkernel ODROID-M1 board")
Assisted-by Claude:claude-opus-5-5
arch/arm64/boot/dts/rockchip/rk3568-odroid-m1.dts +1 -1
@@ -200,7 +200,7 @@ &gmac0 {
 	assigned-clock-rates = <0>, <125000000>;
 	clock_in_out = "output";
 	phy-handle = <&rgmii_phy0>;
-	phy-mode = "rgmii";
+	phy-mode = "rgmii-id";
 	phy-supply = <&vcc3v3_sys>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&gmac0_miim

arch/arm64/boot/dts/rockchip/rk3568-odroid-m1.dts &gmac0_rx_bus2 · line 214

Quoted 6 lines
arch/arm64/boot/dts/rockchip/rk3568-odroid-m1.dts +0 -3
@@ -209,9 +209,6 @@ &gmac0_rx_bus2
 		     &gmac0_rgmii_clk
 		     &gmac0_rgmii_bus>;
 	status = "okay";
-
-	tx_delay = <0x4f>;
-	rx_delay = <0x2d>;

Correct from the DT binding point of few.

Andrew

maintainer Applied
#2 lore raw
In reply to Miguel Jesus Seron Gonzalez
Quoted 10 lines · Miguel Jesus Seron Gonzalez

The gmac0 node uses phy-mode "rgmii" with the MAC delays tx_delay = <0x4f> and rx_delay = <0x2d>. On some boards this TX delay does not work at 1000 Mbit/s. Dongjin Kim reported iperf3 throughput below 200 Mbit/s on REV 1.0 20220613 boards. On a REV 1.0 20211112 board, TX from the board stalls completely in iperf3 and ping loss grows with frame size (5% at 56 bytes, 20% at 1472 bytes), while RX is unaffected. Other boards work with the current value, so it seems to be marginal rather than wrong everywhere.

[...]

Applied, thanks!

[1/1] arm64: dts: rockchip: odroid-m1: use rgmii-id for gmac0

      commit: 781227c237f16eaf14c57124cca854a5faf8a121

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>