Skip to content

orangepizero2w: fix ethernet using sunxi-gmac driver#9815

Open
EvilOlaf wants to merge 1 commit into
armbian:mainfrom
EvilOlaf:sunxi-network-mess
Open

orangepizero2w: fix ethernet using sunxi-gmac driver#9815
EvilOlaf wants to merge 1 commit into
armbian:mainfrom
EvilOlaf:sunxi-network-mess

Conversation

@EvilOlaf
Copy link
Copy Markdown
Member

@EvilOlaf EvilOlaf commented May 12, 2026

Description

Micha did some cleanup after my mess with the sunxi patchset. Well, it is what it is when no professional wants to tackle an issue but leave it to an amateur like myself to do it 😁 . Anyway below is the commit message.

It is patched into Armbian kernel sources, and was enabled in Linux 6.12, but has not been enabled anymore with Linux 6.18 and above.

Additionally, a possible attempt to split the AC200 related patch ended up with half of sunxi-gmac dependencies missing, including such which are explicitly enabled in defconfs, including e.g. CONFIG_AC200_PHY_SUNXI.

The mainline driver dwmac-sun8i, that might have been seen as possible replacement for sunxi-gmac, does not support the Ethernet chip of the Orange Pi Zero 2W expansion board yet.

How Has This Been Tested?

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

Release Notes

  • New Features
    • Added support for the AC200 mixed-signal device, enabling audio codec and Ethernet PHY functionality
    • Enabled GMAC network driver for improved Ethernet support
    • Updated kernel driver integration across multiple kernel versions (6.18 and 7.0)

It is patched into Armbian kernel sources, and was enabled in Linux 6.12, but has not been enabled anymore with Linux 6.18 and above.

Additionally, a possible attempt to split the AC200 related patch ended up with half of sunxi-gmac dependencies missing, including such which are explicitly enabled in defconfs, including e.g. CONFIG_AC200_PHY_SUNXI.

The mainline driver dwmac-sun8i, that might have been seen as possible replacement for sunxi-gmac, does not support the Ethernet chip of the Orange Pi Zero 2W expansion board yet.

Signed-off-by: MichaIng <micha@dietpi.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 12, 2026

📝 Walkthrough

Walkthrough

This PR adds kernel network driver configuration and device support for two distinct components: the SUNXI GMAC Ethernet driver is enabled as a loadable module in current and edge kernel configurations, while support for the X-Powers AC200 mixed-signal chip (with MFD core, Ethernet PHY, and codec capability) is added via new driver patches for both the 6.18 and 7.0 kernel archives.

Changes

SUNXI GMAC Ethernet Driver Enablement

Layer / File(s) Summary
GMAC driver module configuration
config/kernel/linux-sunxi64-current.config, config/kernel/linux-sunxi64-edge.config
CONFIG_SUNXI_GMAC is enabled as a loadable module in both current and edge kernel configurations, placed in the network device driver section.

AC200 Mixed-Signal Chip Driver Support

Layer / File(s) Summary
AC200 MFD core driver (Kernel 6.18)
patch/kernel/archive/sunxi-6.18/patches.armbian/0201-drv-mfd-ac200-add-support.patch
Adds MFD Kconfig option MFD_AC200 and core I2C driver that initializes the AC200 regmap, manages clock and NVMEM bandgap values, and registers child devices (codec, EPHY control).
AC200 Ethernet PHY driver (Kernel 6.18)
patch/kernel/archive/sunxi-6.18/patches.armbian/0202-drv-net-phy-ac200-ephy-add.patch
Adds AC200_PHY Kconfig option and PHY driver with config_init register programming, optional clock acquisition, and standard suspend/resume handlers.
Kernel 6.18 patch series reorganization
patch/kernel/archive/sunxi-6.18/series.conf
Removes numbered patch references (0201/0202) and adds drv-mfd-ac200-add-support.patch with a new networking stmmac patch in the Armbian driver block.
AC200 MFD core driver (Kernel 7.0)
patch/kernel/archive/sunxi-7.0/patches.armbian/0201-drv-mfd-ac200-add-support.patch
Adds MFD Kconfig option MFD_AC200 and core I2C driver; identical in functionality to the 6.18 version.
AC200 Ethernet PHY driver (Kernel 7.0)
patch/kernel/archive/sunxi-7.0/patches.armbian/0202-drv-net-phy-ac200-ephy-add.patch
Adds AC200_PHY Kconfig option and PHY driver; identical in functionality to the 6.18 version.
Kernel 7.0 patch series reorganization
patch/kernel/archive/sunxi-7.0/series.conf
Removes numbered patch references (0201/0202) and adds drv-mfd-ac200-add-support.patch while replacing an existing stmmac patch with drv-net-stmmac-sun8i-add-h618-emac.patch.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

Poem

🐰 A rabbit hops through kernel trees,
Where GMAC flows on Ethernet breeze,
AC200 chips now join the song,
With patches new and drivers strong!
hop hop

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and specifically identifies the main change: enabling the sunxi-gmac driver to fix Ethernet support for Orange Pi Zero 2W, which aligns with the core purpose of the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

@github-actions github-actions Bot added 05 Milestone: Second quarter release size/large PR with 250 lines or more Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels May 12, 2026
coderabbitai[bot]

This comment was marked as low quality.

@EvilOlaf

This comment was marked as resolved.

@coderabbitai

This comment was marked as resolved.

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, ... Needs review Seeking for review Patches Patches related to kernel, U-Boot, ... size/large PR with 250 lines or more

Development

Successfully merging this pull request may close these issues.

2 participants