arm64: dts: rockchip: nanopi-m5: fix GMAC rgmii-id causing broken gig…#9901
arm64: dts: rockchip: nanopi-m5: fix GMAC rgmii-id causing broken gig…#9901dva108 wants to merge 1 commit into
Conversation
…abit RX RTL8211F in rgmii-id mode applies its own internal RX delay. Setting rx_delay on top of that causes double delay which breaks gigabit RX entirely (RX counters stuck at zero, DHCP never receives OFFER). Change phy-mode to rgmii-rxid and drop rx_delay for both gmac0 and gmac1. Tested on NanoPi M5 with kernel 6.18.33-current-rockchip64.
📝 WalkthroughWalkthroughThis PR patches the NanoPi M5 board device tree for kernel 6.18, enabling multiple on-board peripherals: UFS storage with voltage regulators, Wi-Fi/Bluetooth via SDIO and UART5, Ethernet MAC timing, SARADC input buttons, auxiliary serial ports, and USB host-only mode. ChangesNanoPi M5 Peripheral Enablement
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Hey @dva108! 👋Thanks for submitting your first pull request to the Armbian project — we're excited to have you contributing! 🧡 If you'd like to stay informed about project updates or collaborate more closely with the team, Also, don’t forget to ⭐ star the repo if you haven’t already — and welcome aboard! 🚀 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
patch/kernel/archive/rockchip64-6.18/board-nanopi-m5-add-wifi-bt-ufs-and-misc.patch (1)
194-205:⚠️ Potential issue | 🟠 Major | ⚡ Quick winAdd
uart-has-rtscts;to&uart5(DT binding correctness for serdev HW flow control)For UART-based serdev devices,
uart-has-rtscts;is the serial DT binding flag that declares the UART host has dedicated, pinmux-enabled RTS/CTS hardware flow-control lines. Having only the pinctrl entries for*_ctsn/*_rtsndoesn’t provide the explicit binding signal expected byserial-attached-device/serdev setups. [1] So adduart-has-rtscts;under&uart5.🔧 Proposed fix
&uart5 { pinctrl-names = "default"; pinctrl-0 = <&uart5m0_xfer>, <&uart5m0_ctsn>, <&uart5m0_rtsn>; + uart-has-rtscts; status = "okay";🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@patch/kernel/archive/rockchip64-6.18/board-nanopi-m5-add-wifi-bt-ufs-and-misc.patch` around lines 194 - 205, The DT node &uart5 is missing the serial-binding flag uart-has-rtscts which explicitly declares that the UART supports dedicated RTS/CTS pins for serdev hw flow control; to fix, add the property uart-has-rtscts; inside the &uart5 node (near pinctrl-0 / status) so the serial-attached-device/serdev bindings recognize the *_rtsn / *_ctsn pinctrl entries and enable hardware flow control for devices like the bluetooth child (compatible = "realtek,rtl8822cs-bt").
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In
`@patch/kernel/archive/rockchip64-6.18/board-nanopi-m5-add-wifi-bt-ufs-and-misc.patch`:
- Around line 194-205: The DT node &uart5 is missing the serial-binding flag
uart-has-rtscts which explicitly declares that the UART supports dedicated
RTS/CTS pins for serdev hw flow control; to fix, add the property
uart-has-rtscts; inside the &uart5 node (near pinctrl-0 / status) so the
serial-attached-device/serdev bindings recognize the *_rtsn / *_ctsn pinctrl
entries and enable hardware flow control for devices like the bluetooth child
(compatible = "realtek,rtl8822cs-bt").
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: d0984c6b-9b76-4adc-8e9b-fa0c3c7e43c9
📒 Files selected for processing (1)
patch/kernel/archive/rockchip64-6.18/board-nanopi-m5-add-wifi-bt-ufs-and-misc.patch
|
did you actually try to build with this particular adjustment? I predict the patch will fail. |
No, I did not build a full image. I applied the fix directly on a running NanoPi M5:
After reboot gigabit RX works correctly at 1Gbps. Before the fix RX counters were stuck at zero and DHCP never received an OFFER. I understand the patch format may need adjustment - happy to fix if you can point out what would break. |
That yes. |
|
✅ This PR has been reviewed and approved — all set for merge! |
RTL8211F in rgmii-id mode applies its own internal RX delay. Setting rx_delay on top of that causes double delay which breaks gigabit RX entirely (RX counters stuck at zero, DHCP never receives OFFER).
Change phy-mode to rgmii-rxid and drop rx_delay for both gmac0 and gmac1. Tested on NanoPi M5 with kernel 6.18.33-current-rockchip64.
Description
Without this fix, gigabit RX is completely non-functional on NanoPi M5 with kernel 6.18. The interface comes up at 1000Mb/s, TX works, but no packets are ever received. DHCP never gets an OFFER, ethtool -S shows RX counters stuck at zero.
Root cause: the DTB sets phy-mode = "rgmii-id" which means the RTL8211F PHY applies its own internal RX delay. The driver then also applies an additional hardware rx_delay = <0x3f> on top of it. The double delay breaks gigabit RX entirely.
Workaround that confirmed the root cause: forcing 100Mbps via ethtool -s end0 speed 100 duplex full autoneg off made RX work immediately.
Fix: change phy-mode to rgmii-rxid (PHY handles RX delay internally) and remove rx_delay for both gmac0 and gmac1.
Forum thread: https://forum.armbian.com/topic/59912-nanopi-m5-rk3576-gigabit-rx-broken-due-to-double-rgmii-delay-in-dtb/
How Has This Been Tested?
Checklist:
Summary by CodeRabbit