Skip to content

Commit fe38268

Browse files
authored
nanopi-m5: drop GMAC rx_delay to fix gigabit RX (#9901)
The on-board RTL8211F PHYs use rgmii-id and apply the RX delay internally, so a SoC-side rx_delay double-delayed RX and broke gigabit on switches that do not tolerate it. Drop rx_delay on gmac0 and gmac1 to match the vendor DTS, keeping the mainline rgmii-id, across 6.18/7.0/7.1. Reported-by: dva108 <zhnikita@gmail.com> Signed-off-by: SuperKali <hello@superkali.me>
1 parent 825209e commit fe38268

3 files changed

Lines changed: 38 additions & 65 deletions

File tree

patch/kernel/archive/rockchip64-6.18/board-nanopi-m5-add-wifi-bt-ufs-and-misc.patch

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: SuperKali <hello@superkali.me>
3-
Date: Sat, 16 May 2026 19:00:00 +0200
3+
Date: Thu, 28 May 2026 11:00:00 +0200
44
Subject: arm64: dts: rockchip: Complete NanoPi M5 board description (6.18)
55

66
The mainline rk3576-nanopi-m5.dts in 6.18 is a minimal first-cut that
@@ -25,17 +25,10 @@ schematics. Fill in the gaps:
2525
- Pinctrl: add the matching wireless-bluetooth and wireless-wlan
2626
groups for uart5_gpios / wifi_host_wake_irq / wifi_poweren_gpio.
2727

28-
- GMAC: set RGMII tx_delay / rx_delay to the values used by the
29-
FriendlyElec vendor kernel (0x21/0x3f on gmac0, 0x20/0x3f on
30-
gmac1). Without these the rockchip dwmac glue logs:
31-
32-
rk_gmac-dwmac 2a230000.ethernet: Can not read property: tx_delay.
33-
rk_gmac-dwmac 2a230000.ethernet: set tx_delay to 0x30
34-
rk_gmac-dwmac 2a230000.ethernet: Can not read property: rx_delay.
35-
rk_gmac-dwmac 2a230000.ethernet: set rx_delay to 0x10
36-
37-
and falls back to defaults that do not match the trace lengths to
38-
the on-board RTL8211F PHYs.
28+
- GMAC: set RGMII tx_delay (0x21 on gmac0, 0x20 on gmac1) to match
29+
the FriendlyElec vendor kernel. Leave rx_delay unset: the on-board
30+
RTL8211F PHYs use rgmii-id and apply the RX delay internally, so an
31+
extra SoC-side rx_delay double-delays RX and breaks gigabit.
3932

4033
- ADC keys: add the saradc back button on saradc channel 0
4134
(~17 mV press threshold) so the BACK key on the carrier works.
@@ -56,8 +49,8 @@ schematics. Fill in the gaps:
5649

5750
Signed-off-by: SuperKali <hello@superkali.me>
5851
---
59-
arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts | 112 +++++++++-
60-
1 file changed, 110 insertions(+), 2 deletions(-)
52+
arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts | 110 +++++++++-
53+
1 file changed, 108 insertions(+), 2 deletions(-)
6154

6255
diff --git a/arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts b/arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts
6356
index 111111111111..222222222222 100644
@@ -115,25 +108,23 @@ index 111111111111..222222222222 100644
115108
sound {
116109
compatible = "simple-audio-card";
117110
pinctrl-names = "default";
118-
@@ -288,6 +326,8 @@ &gmac0 {
111+
@@ -288,6 +326,7 @@ &gmac0 {
119112
<&eth0m0_rx_bus2>,
120113
<&eth0m0_rgmii_clk>,
121114
<&eth0m0_rgmii_bus>;
122115
+ tx_delay = <0x21>;
123-
+ rx_delay = <0x3f>;
124116
status = "okay";
125117
};
126118

127-
@@ -302,6 +342,8 @@ &gmac1 {
119+
@@ -302,6 +341,7 @@ &gmac1 {
128120
<&eth1m0_rx_bus2>,
129121
<&eth1m0_rgmii_clk>,
130122
<&eth1m0_rgmii_bus>;
131123
+ tx_delay = <0x20>;
132-
+ rx_delay = <0x3f>;
133124
status = "okay";
134125
};
135126

136-
@@ -846,6 +888,22 @@ usb_otg0_pwren_h: usb-otg0-pwren-h {
127+
@@ -846,6 +886,22 @@ usb_otg0_pwren_h: usb-otg0-pwren-h {
137128
rockchip,pins = <0 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
138129
};
139130
};
@@ -156,7 +147,7 @@ index 111111111111..222222222222 100644
156147
};
157148

158149
&sai2 {
159-
@@ -857,6 +915,24 @@ &saradc {
150+
@@ -857,6 +913,24 @@ &saradc {
160151
status = "okay";
161152
};
162153

@@ -181,7 +172,7 @@ index 111111111111..222222222222 100644
181172
&sdmmc {
182173
bus-width = <4>;
183174
cap-mmc-highspeed;
184-
@@ -910,13 +986,45 @@ &uart0 {
175+
@@ -910,13 +984,45 @@ &uart0 {
185176
status = "okay";
186177
};
187178

patch/kernel/archive/rockchip64-7.0/board-nanopi-m5-add-wifi-bt-and-misc.patch

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: SuperKali <hello@superkali.me>
3-
Date: Sat, 16 May 2026 19:00:00 +0200
3+
Date: Thu, 28 May 2026 11:00:00 +0200
44
Subject: arm64: dts: rockchip: Complete NanoPi M5 board description
55

66
The mainline rk3576-nanopi-m5.dts is a minimal first-cut that omits
@@ -18,17 +18,10 @@ Fill in the gaps:
1818
- Pinctrl: add the matching wireless-bluetooth and wireless-wlan
1919
groups for uart5_gpios / wifi_host_wake_irq / wifi_poweren_gpio.
2020

21-
- GMAC: set RGMII tx_delay / rx_delay to the values used by the
22-
FriendlyElec vendor kernel (0x21/0x3f on gmac0, 0x20/0x3f on
23-
gmac1). Without these the rockchip dwmac glue logs:
24-
25-
rk_gmac-dwmac 2a230000.ethernet: Can not read property: tx_delay.
26-
rk_gmac-dwmac 2a230000.ethernet: set tx_delay to 0x30
27-
rk_gmac-dwmac 2a230000.ethernet: Can not read property: rx_delay.
28-
rk_gmac-dwmac 2a230000.ethernet: set rx_delay to 0x10
29-
30-
and falls back to defaults that do not match the trace lengths to
31-
the on-board RTL8211F PHYs.
21+
- GMAC: set RGMII tx_delay (0x21 on gmac0, 0x20 on gmac1) to match
22+
the FriendlyElec vendor kernel. Leave rx_delay unset: the on-board
23+
RTL8211F PHYs use rgmii-id and apply the RX delay internally, so an
24+
extra SoC-side rx_delay double-delays RX and breaks gigabit.
3225

3326
- ADC keys: add the saradc back button on saradc channel 0
3427
(~17 mV press threshold) so the BACK key on the carrier works.
@@ -49,8 +42,8 @@ Fill in the gaps:
4942

5043
Signed-off-by: SuperKali <hello@superkali.me>
5144
---
52-
arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts | 88 +++++++++-
53-
1 file changed, 86 insertions(+), 2 deletions(-)
45+
arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts | 86 +++++++++-
46+
1 file changed, 84 insertions(+), 2 deletions(-)
5447

5548
diff --git a/arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts b/arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts
5649
index 111111111111..222222222222 100644
@@ -85,25 +78,23 @@ index 111111111111..222222222222 100644
8578
sound {
8679
compatible = "simple-audio-card";
8780
pinctrl-names = "default";
88-
@@ -304,6 +326,8 @@ &gmac0 {
81+
@@ -304,6 +326,7 @@ &gmac0 {
8982
<&eth0m0_rx_bus2>,
9083
<&eth0m0_rgmii_clk>,
9184
<&eth0m0_rgmii_bus>;
9285
+ tx_delay = <0x21>;
93-
+ rx_delay = <0x3f>;
9486
status = "okay";
9587
};
9688

97-
@@ -318,6 +342,8 @@ &gmac1 {
89+
@@ -318,6 +341,7 @@ &gmac1 {
9890
<&eth1m0_rx_bus2>,
9991
<&eth1m0_rgmii_clk>,
10092
<&eth1m0_rgmii_bus>;
10193
+ tx_delay = <0x20>;
102-
+ rx_delay = <0x3f>;
10394
status = "okay";
10495
};
10596

106-
@@ -866,6 +892,22 @@ usb_otg0_pwren_h: usb-otg0-pwren-h {
97+
@@ -866,6 +890,22 @@ usb_otg0_pwren_h: usb-otg0-pwren-h {
10798
rockchip,pins = <0 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
10899
};
109100
};
@@ -126,7 +117,7 @@ index 111111111111..222222222222 100644
126117
};
127118

128119
&sai2 {
129-
@@ -881,6 +923,24 @@ &saradc {
120+
@@ -881,6 +921,24 @@ &saradc {
130121
status = "okay";
131122
};
132123

@@ -151,7 +142,7 @@ index 111111111111..222222222222 100644
151142
&sdmmc {
152143
bus-width = <4>;
153144
cap-mmc-highspeed;
154-
@@ -934,6 +994,31 @@ &uart0 {
145+
@@ -934,6 +992,31 @@ &uart0 {
155146
status = "okay";
156147
};
157148

@@ -183,7 +174,7 @@ index 111111111111..222222222222 100644
183174
&ufshc {
184175
vcc-supply = <&vcc_3v3_s3>;
185176
vccq-supply = <&vcc1v2_ufs_vccq>;
186-
@@ -947,8 +1032,7 @@ &usbdp_phy {
177+
@@ -947,8 +1030,7 @@ &usbdp_phy {
187178
};
188179

189180
&usb_drd0_dwc3 {

patch/kernel/archive/rockchip64-7.1/board-nanopi-m5-add-wifi-bt-and-misc.patch

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
22
From: SuperKali <hello@superkali.me>
3-
Date: Sat, 16 May 2026 19:00:00 +0200
3+
Date: Thu, 28 May 2026 11:00:00 +0200
44
Subject: arm64: dts: rockchip: Complete NanoPi M5 board description
55

66
The mainline rk3576-nanopi-m5.dts is a minimal first-cut that omits
@@ -18,17 +18,10 @@ Fill in the gaps:
1818
- Pinctrl: add the matching wireless-bluetooth and wireless-wlan
1919
groups for uart5_gpios / wifi_host_wake_irq / wifi_poweren_gpio.
2020

21-
- GMAC: set RGMII tx_delay / rx_delay to the values used by the
22-
FriendlyElec vendor kernel (0x21/0x3f on gmac0, 0x20/0x3f on
23-
gmac1). Without these the rockchip dwmac glue logs:
24-
25-
rk_gmac-dwmac 2a230000.ethernet: Can not read property: tx_delay.
26-
rk_gmac-dwmac 2a230000.ethernet: set tx_delay to 0x30
27-
rk_gmac-dwmac 2a230000.ethernet: Can not read property: rx_delay.
28-
rk_gmac-dwmac 2a230000.ethernet: set rx_delay to 0x10
29-
30-
and falls back to defaults that do not match the trace lengths to
31-
the on-board RTL8211F PHYs.
21+
- GMAC: set RGMII tx_delay (0x21 on gmac0, 0x20 on gmac1) to match
22+
the FriendlyElec vendor kernel. Leave rx_delay unset: the on-board
23+
RTL8211F PHYs use rgmii-id and apply the RX delay internally, so an
24+
extra SoC-side rx_delay double-delays RX and breaks gigabit.
3225

3326
- ADC keys: add the saradc back button on saradc channel 0
3427
(~17 mV press threshold) so the BACK key on the carrier works.
@@ -49,8 +42,8 @@ Fill in the gaps:
4942

5043
Signed-off-by: SuperKali <hello@superkali.me>
5144
---
52-
arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts | 88 +++++++++-
53-
1 file changed, 86 insertions(+), 2 deletions(-)
45+
arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts | 86 +++++++++-
46+
1 file changed, 84 insertions(+), 2 deletions(-)
5447

5548
diff --git a/arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts b/arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts
5649
index 111111111111..222222222222 100644
@@ -85,25 +78,23 @@ index 111111111111..222222222222 100644
8578
sound {
8679
compatible = "simple-audio-card";
8780
pinctrl-names = "default";
88-
@@ -304,6 +326,8 @@ &gmac0 {
81+
@@ -304,6 +326,7 @@ &gmac0 {
8982
<&eth0m0_rx_bus2>,
9083
<&eth0m0_rgmii_clk>,
9184
<&eth0m0_rgmii_bus>;
9285
+ tx_delay = <0x21>;
93-
+ rx_delay = <0x3f>;
9486
status = "okay";
9587
};
9688

97-
@@ -318,6 +342,8 @@ &gmac1 {
89+
@@ -318,6 +341,7 @@ &gmac1 {
9890
<&eth1m0_rx_bus2>,
9991
<&eth1m0_rgmii_clk>,
10092
<&eth1m0_rgmii_bus>;
10193
+ tx_delay = <0x20>;
102-
+ rx_delay = <0x3f>;
10394
status = "okay";
10495
};
10596

106-
@@ -866,6 +892,22 @@ usb_otg0_pwren_h: usb-otg0-pwren-h {
97+
@@ -866,6 +890,22 @@ usb_otg0_pwren_h: usb-otg0-pwren-h {
10798
rockchip,pins = <0 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
10899
};
109100
};
@@ -126,7 +117,7 @@ index 111111111111..222222222222 100644
126117
};
127118

128119
&sai2 {
129-
@@ -881,6 +923,24 @@ &saradc {
120+
@@ -881,6 +921,24 @@ &saradc {
130121
status = "okay";
131122
};
132123

@@ -151,7 +142,7 @@ index 111111111111..222222222222 100644
151142
&sdmmc {
152143
bus-width = <4>;
153144
cap-mmc-highspeed;
154-
@@ -934,6 +994,31 @@ &uart0 {
145+
@@ -934,6 +992,31 @@ &uart0 {
155146
status = "okay";
156147
};
157148

@@ -183,7 +174,7 @@ index 111111111111..222222222222 100644
183174
&ufshc {
184175
vcc-supply = <&vcc_3v3_s3>;
185176
vccq-supply = <&vcc1v2_ufs_vccq>;
186-
@@ -947,8 +1032,7 @@ &usbdp_phy {
177+
@@ -947,8 +1030,7 @@ &usbdp_phy {
187178
};
188179

189180
&usb_drd0_dwc3 {

0 commit comments

Comments
 (0)