Skip to content

Fix ethernet on BigTreeTech CB1#10155

Merged
JohnTheCoolingFan merged 3 commits into
armbian:mainfrom
JohnTheCoolingFan:btt-cb1-emac1-fix
Jul 11, 2026
Merged

Fix ethernet on BigTreeTech CB1#10155
JohnTheCoolingFan merged 3 commits into
armbian:mainfrom
JohnTheCoolingFan:btt-cb1-emac1-fix

Conversation

@JohnTheCoolingFan

@JohnTheCoolingFan JohnTheCoolingFan commented Jul 10, 2026

Copy link
Copy Markdown
Member

Description

Issue is described in #10084 and reached a solution thanks to help from @deece

How Has This Been Tested?

  • Build and boot to test Ethernet connectivity on current (6.18) and edge (7.0)

Checklist:

  • My code follows the style guidelines of this project
  • My changes generate no new warnings

Summary by CodeRabbit

  • New Features
    • Added AC300 Ethernet PHY support for the BigTreeTech CB1 on Allwinner H616 systems.
    • Enabled supporting clock generation and calibration data, with updated Ethernet/MDIO routing.
    • Included the hardware support in both the 6.18 and 7.0 kernel patch series.
  • Bug Fixes
    • Improved Ethernet bring-up and PHY calibration for the CB1’s EMAC1 interface.
  • Chores
    • Updated kernel patch series ordering/whitespace and appended the CB1 AC300 device-tree patch.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The changes configure the BigTreeTech CB1 H616 EMAC1 for an AC300 Ethernet PHY, adding PWM clocking, SID calibration data, an internal MDIO mux, and updated PHY bindings. The patch is included in both sunxi 6.18 and 7.0 kernel series.

Changes

CB1 AC300 Ethernet PHY

Layer / File(s) Summary
PHY clock and calibration data
patch/kernel/archive/sunxi-6.18/patches.armbian/*, patch/kernel/archive/sunxi-7.0/patches.armbian/*
Adds a 2 MHz PWM-derived AC300 clock, SID calibration cells, and enabled PWM5 pin configuration.
EMAC1 and MDIO topology
patch/kernel/archive/sunxi-6.18/patches.armbian/*, patch/kernel/archive/sunxi-7.0/patches.armbian/*
Switches EMAC1 to the H616 internal EMAC, adds the AC300 PHY through an MDIO mux, and connects the EMAC, PWM-clock, and SID calibration bindings.
Kernel patch-series integration
patch/kernel/archive/sunxi-6.18/series.conf, patch/kernel/archive/sunxi-7.0/series.conf, patch/kernel/archive/sunxi-7.0/patches.armbian/*
Registers the AC300 device-tree patch in both kernel series and updates related patch-list formatting and metadata.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant EMAC1
  participant MDIO_Mux
  participant AC300_EPHY
  participant SID
  participant AC300_PWM_Clock
  EMAC1->>MDIO_Mux: access internal MDIO bus
  MDIO_Mux->>AC300_EPHY: expose AC300 PHY
  AC300_EPHY->>SID: read ephy_calibration
  AC300_EPHY->>AC300_PWM_Clock: consume 2 MHz clock
Loading

Possibly related PRs

  • armbian/build#9952: Adds the AC300 PHY driver configuration used by this device-tree wiring.

Suggested labels: 05

Suggested reviewers: igorpecovnik, AGM1968, TheSnowfield, Tonymac32, PanderMusubi, chraac, janprunk, pyavitz, schwar3kat

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely reflects the main change: fixing Ethernet on the BigTreeTech CB1.
✨ 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.

@github-actions github-actions Bot added size/medium PR with more then 50 and less then 250 lines 08 Milestone: Third quarter release Needs review Seeking for review Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... labels Jul 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 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.

Inline comments:
In
`@patch/kernel/archive/sunxi-6.18/patches.armbian/arm64-dts-sun50i-h616-bigtreetech-cb1-emac1-ac300.patch`:
- Around line 64-68: Update the compatible string in the mdio-mux node to the
comma-separated form "allwinner,sun8i-h3-mdio-mux" so the mux driver binds and
the internal MDIO bus with ac300_ephy can probe.

In
`@patch/kernel/archive/sunxi-7.0/patches.armbian/arm64-dts-sun50i-h616-bigtreetech-cb1-emac1-ac300.patch`:
- Around line 64-68: Update the `mdio-mux` node’s `compatible` property to
`allwinner,sun8i-h3-mdio-mux`, replacing the incorrect hyphenated value so the
MDIO mux driver can bind and expose `ac300_ephy`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b57a6464-c838-4658-b97d-2e96cd0a43a2

📥 Commits

Reviewing files that changed from the base of the PR and between d18ee3a and 31ce038.

📒 Files selected for processing (4)
  • patch/kernel/archive/sunxi-6.18/patches.armbian/arm64-dts-sun50i-h616-bigtreetech-cb1-emac1-ac300.patch
  • patch/kernel/archive/sunxi-6.18/series.conf
  • patch/kernel/archive/sunxi-7.0/patches.armbian/arm64-dts-sun50i-h616-bigtreetech-cb1-emac1-ac300.patch
  • patch/kernel/archive/sunxi-7.0/series.conf

@deece

deece commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Off topic: are you adding this as a new platform?

If so, I had to do a bit of tuning to get the MELLOW Fly C5 stable.

I added a smart plug to the machine so it could be hard power cycled, connected the serial port (actually hung an OPi off it), increased the kernel verbosity, and gave them to Antigravity with instructions to write a script to reboot the target 100 times, and record and anaylse the kernel logs on the serial port each time the machine failed to reboot cleanly.

It identified a few RCU stalls (already committed), mistuned voltages, capped the clock speeds as the PMIC was incapable of providing the voltages for higher speeds.

There is a seperate commit where I asked it to bisect the EMMC frequencies to find the fastest stable speed.

@JohnTheCoolingFan

Copy link
Copy Markdown
Member Author

BTT CB1 support was added a while ago

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added Ready to merge Reviewed, tested and ready for merge and removed Needs review Seeking for review labels Jul 11, 2026
@JohnTheCoolingFan JohnTheCoolingFan merged commit 4dd96aa into armbian:main Jul 11, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third quarter release Hardware Hardware related like kernel, U-Boot, ... Patches Patches related to kernel, U-Boot, ... Ready to merge Reviewed, tested and ready for merge size/medium PR with more then 50 and less then 250 lines

Development

Successfully merging this pull request may close these issues.

3 participants