Skip to content

config: rockchip64: build Motorcomm YT6801 drivers built-in for OOB Ethernet#9625

Open
c127dev wants to merge 3 commits intoarmbian:mainfrom
c127dev:fix-opi5pro-ethernet-builtin
Open

config: rockchip64: build Motorcomm YT6801 drivers built-in for OOB Ethernet#9625
c127dev wants to merge 3 commits intoarmbian:mainfrom
c127dev:fix-opi5pro-ethernet-builtin

Conversation

@c127dev
Copy link
Copy Markdown
Contributor

@c127dev c127dev commented Apr 1, 2026

Description

This is a follow-up fix for PR 9600.

In the previous PR, the Motorcomm YT6801 Ethernet driver was integrated, but it failed to initialize Out-Of-The-Box (OOB) on the Orange Pi 5 Pro. The primary network interface was configured as a module (=m), and the required PCI glue infrastructure (CONFIG_STMMAC_PCI) was missing from the unified rockchip64 family config, causing the network to silently fail at boot unless manually probed.

This PR fixes the configuration for both current (6.18) and edge (7.0) branches by setting the STMMAC PCI infrastructure and Motorcomm glue drivers to built-in (=y).

Justification for Built-in (=y):

  1. Primary Interface: The YT6801 is the sole onboard NIC for the Orange Pi 5 Pro, so building it as a module breaks early networking use cases (NFS-root, PXE boot).
  2. OOB Reliability: Ensuring the PCI bus infrastructure is built-in guarantees the network link comes up seamlessly as soon as the bus is enumerated.
  3. Negligible Footprint Impact (dwmac-motorcomm driver):
    • Unstripped module size: ~764 KB
    • Stripped binary size: ~42 KB
    • Compressed size inside initramfs: ~6 KB
    • Total image overhead: ~0.03%.
      The microscopic size increase is highly justified to provide a seamless OOB networking experience on RK3588 hardware.

How Has This Been Tested?

  • Compiled current (6.18) and edge (7.0) images locally using the updated rockchip64 configurations.
  • Flashed and booted on Orange Pi 5 Pro hardware.
  • Verified that the Ethernet link comes up automatically at 1Gbps during early boot without requiring manual modprobe or depmod interventions.
  • Verified the stmmac and dwmac_motorcomm initialization logs in dmesg.
  • Verified binary size impact using strip --strip-debug on the resulting .ko object.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Summary by CodeRabbit

  • Chores
    • Improved Ethernet/network driver support for Rockchip64 platforms via kernel configuration updates.
    • Enabled an additional Motorcomm-compatible Ethernet driver and converted select Ethernet drivers/platform variants from modules to built-in, enhancing out-of-the-box network compatibility and reliability.

Signed-off-by: c127dev <contact@c127.dev>
@github-actions github-actions bot added 05 Milestone: Second quarter release size/small PR with less then 50 lines Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... labels Apr 1, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: bb4f63ff-0a96-4cc9-843f-772450a1009f

📥 Commits

Reviewing files that changed from the base of the PR and between 0c86324 and 909f06e.

📒 Files selected for processing (1)
  • config/kernel/linux-rockchip64-edge.config
🚧 Files skipped from review as they are similar to previous changes (1)
  • config/kernel/linux-rockchip64-edge.config

📝 Walkthrough

Walkthrough

Two Rockchip64 kernel config files updated: linux-rockchip64-current.config enables CONFIG_DWMAC_MOTORCOMM=y; linux-rockchip64-edge.config changes CONFIG_STMMAC_ETH and CONFIG_MOTORCOMM_PHY from module to built-in and enables CONFIG_DWMAC_MOTORCOMM=y.

Changes

Cohort / File(s) Summary
Current kernel config
config/kernel/linux-rockchip64-current.config
Added CONFIG_DWMAC_MOTORCOMM=y next to existing CONFIG_MOTORCOMM_PHY=y. No other changes.
Edge kernel config
config/kernel/linux-rockchip64-edge.config
Changed CONFIG_STMMAC_ETH from my, changed CONFIG_MOTORCOMM_PHY from my, and added CONFIG_DWMAC_MOTORCOMM=y.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through configs, tweaking with care,
Built-ins now hum where modules were there.
Motorcomm and STMMAC snug in their nest,
Rockchip's network sleeps cozy and blessed.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: enabling Motorcomm YT6801 drivers as built-in for the Orange Pi 5 Pro Ethernet NIC.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@amazingfate
Copy link
Copy Markdown
Contributor

I can't understand, why the driver must be built in. What is the status of its dependency like STMMAC_PCI when it is built as module?

@c127dev
Copy link
Copy Markdown
Contributor Author

c127dev commented Apr 2, 2026

Hi @amazingfate , thanks for the review.

I did some deep testing and here are the findings:

1. About STMMAC_PCI:
You were right to question this. It turns out CONFIG_STMMAC_PCI is completely unnecessary (it seems tailored for specific Xilinx FPGA setups) so I am pushing a new commit removing it entirely, the YT6801 works perfectly without it.

2. Why DWMAC_MOTORCOMM must be built-in (=y):
I compiled the kernel with CONFIG_DWMAC_MOTORCOMM=m to test the auto-loading behavior, on a fresh boot, the network interface does not show up.

So checking lspci -knn, it shows OS detects the hardware and knows the module, but udev completely fails to auto-probe it:

0004:41:00.0 Ethernet controller [0200]: Motorcomm Microelectronics. YT6801 Gigabit Ethernet Controller [1f0a:6801] (rev 01)
        Subsystem: Device [2066:9806]
        Kernel modules: dwmac_motorcomm

Missing Kernel driver in use: line

I have to manually run sudo modprobe dwmac_motorcomm to trigger the probe and get the enP4p65s0 interface up.

Since the YT6801 is the only onboard NIC for the Orange Pi 5 Pro, leaving it as a module (=m) breaks headless OOB boots (and NFS/PXE) because the interface never comes up automatically, so setting it to =y bypasses this udev auto-load failure entirely.

Given that the stripped module is only ~42KB, keeping it as =y guarantees a seamless network initialization for OPi5 Pro users.

After testing, STMMAC_PCI proved to be unnecessary for the YT6801
PCIe controller as it relies on its own glue driver.

DWMAC_MOTORCOMM is kept as built-in (=y) to ensure OOB networking,
as module auto-loading fails during early boot.

Signed-off-by: c127dev <contact@c127.dev>
@amazingfate
Copy link
Copy Markdown
Contributor

I'm okay with setting the driver built-in, while I find CONFIG_STMMAC_PLATFORM can be module with CONFIG_DWMAC_MOTORCOMM built in. Is it necessary to set CONFIG_STMMAC_PLATFORM built in?

…configs

Signed-off-by: c127dev <contact@c127.dev>
@c127dev
Copy link
Copy Markdown
Contributor Author

c127dev commented Apr 2, 2026

You are right!

I performed tests after removing CONFIG_STMMAC_PLATFORM and confirmed it is not required for the PCIe-attached YT6801.

I've verified this on both current and edge kernels, and the Ethernet driver initialized correctly in both cases. Therefore, I have reverted the CONFIG_STMMAC_PLATFORM line from my modifications.

Thanks for the feedback!

Copy link
Copy Markdown
Member

@EvilOlaf EvilOlaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this can be squashed

@github-actions github-actions bot added the Ready to merge Reviewed, tested and ready for merge label Apr 2, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2026

✅ This PR has been reviewed and approved — all set for merge!

@github-actions github-actions bot removed the Needs review Seeking for review label Apr 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release Hardware Hardware related like kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

3 participants