Skip to content

Feat: Add support for the Mellow Fly C5 3D Printer board#9584

Open
deece wants to merge 2 commits intoarmbian:mainfrom
deece:mellowflyc5
Open

Feat: Add support for the Mellow Fly C5 3D Printer board#9584
deece wants to merge 2 commits intoarmbian:mainfrom
deece:mellowflyc5

Conversation

@deece
Copy link
Copy Markdown
Contributor

@deece deece commented Mar 25, 2026

Description

This PR adds preliminary support for the Mellow Fly C5 3D Printer board. It will probably work for the C8 board too.

The Mellow Fly C5 is an Allwinner H618 based mainboard designed for 3D printer control,
supporting Klipper and other embedded Linux applications.

- Board Docs: https://mellow.klipper.cn/en/docs/ProductDoc/MainBoard/fly-c/fly-c5/
- FlyOS: https://mellow.klipper.cn/en/docs/ResDownload/system-img/fly-c5
- Schematics: https://mellow.klipper.cn/en/docs/ProductDoc/MainBoard/fly-c/fly-c5/schematic/

Documentation summary for feature / change

This will require documentation as a community supported platform.

See the above linked documentation for platform specifics.

How Has This Been Tested?

I have built Armbian Minimal Trixie Current & Edge and successfully booted the board, and accessed it over WiFi.

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

Summary by CodeRabbit

  • New Features

    • Added support for Mellow Fly-C5 board with complete hardware configuration including Ethernet, WiFi, and power management.
    • Enabled Allwinner GMAC Ethernet driver support.
  • Bug Fixes

    • Fixed wireless driver compilation compatibility and missing function declarations.

deece added 2 commits March 25, 2026 18:55
Add function prototypes to resolve compiler warnings and ensure correct linkage.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
The Mellow Fly C5 is an Allwinner H618 based mainboard designed for 3D printer control,
supporting Klipper and other embedded Linux applications.

- Board Docs: https://mellow.klipper.cn/en/docs/ProductDoc/MainBoard/fly-c/fly-c5/
- FlyOS: https://mellow.klipper.cn/en/docs/ResDownload/system-img/fly-c5
- Schematics: https://mellow.klipper.cn/en/docs/ProductDoc/MainBoard/fly-c/fly-c5/schematic/

This implementation provides:
- U-Boot patches for DTS, Defconfig, and Makefile
- Production-ready PMIC, Ethernet, and MMC support in Kernel DTS (6.18/6.19)

Note: U-Boot config originated from Orange Pi Zero 3; DTS constructed from FlyOS environment analysis.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 25, 2026

📝 Walkthrough

Walkthrough

Introduces support for the Mellow Fly-C5 board, a Sun50i-H618-based single-board computer, with board configuration, device tree sources for multiple kernel versions, U-Boot support files, kernel configuration options, and driver patches.

Changes

Cohort / File(s) Summary
Board Configuration
config/boards/mellowflyc5.csc
New board configuration for Mellow Fly-C5 defining vendor, SoC family, boot configuration, kernel targets, and board-specific packages (Bluetooth, WiFi utilities).
Kernel Network Driver Configuration
config/kernel/linux-sunxi64-current.config, config/kernel/linux-sunxi64-edge.config
Added CONFIG_SUNXI_GMAC=m to enable Allwinner GMAC Ethernet driver as a loadable module in both kernel versions.
Wireless Driver Patches
lib/functions/compilation/patch/drivers_network.sh, patch/misc/wireless-uwe5622/uwe5622-missing-prototypes.patch
Added missing function prototypes for uwe5622 WiFi driver and integrated the patch into the compilation workflow to address missing-prototypes warnings.
Linux Device Tree Sources (Kernel 6.18)
patch/kernel/archive/sunxi-6.18/dt_64/sun50i-h618-mellow-fly-c5.dts, patch/kernel/archive/sunxi-6.18/patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch, patch/kernel/archive/sunxi-6.18/series.conf
New device tree for kernel 6.18 with board definition, regulators, WiFi power sequencing, Ethernet RMII config, LED definitions, and PMIC (AXP313) integration; updated build system to include the DTB.
Linux Device Tree Sources (Kernel 6.19)
patch/kernel/archive/sunxi-6.19/dt_64/sun50i-h618-mellow-fly-c5.dts, patch/kernel/archive/sunxi-6.19/patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch, patch/kernel/archive/sunxi-6.19/series.conf
New device tree for kernel 6.19 with similar hardware configurations (regulators, LEDs, Ethernet RMII, MMC/WiFi, PMIC); updated build system to include the DTB.
U-Boot Support
patch/u-boot/u-boot-sunxi/board_mellowflyc5/0001-add-dts.patch, patch/u-boot/u-boot-sunxi/board_mellowflyc5/0002-add-defconfig.patch, patch/u-boot/u-boot-sunxi/board_mellowflyc5/0003-update-makefile.patch
Added U-Boot device tree with RGMII Ethernet configuration, AXP313A PMIC setup, and DRAM tuning; new defconfig with H616 LPDDR4 memory and peripheral support; updated DTB build targets.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • igorpecovnik
  • krachlatte
  • pyavitz
  • TheSnowfield
  • JohnTheCoolingFan
  • schwar3kat

Poem

🐰 Hop, hop—a new board joins the pack,
Sun50i-H618 on the track!
Device trees bloom in 6.18, 6.19—
Fly-C5 soars, the finest seen!
With WiFi woes now patched so clean,
This rabbit cheers for Mellow's dream!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main purpose of the PR: adding support for the Mellow Fly C5 board, which is the primary objective across all file changes.

✏️ 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.

@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, ... Framework Framework components Patches Patches related to kernel, U-Boot, ... labels Mar 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🚫 Missing required board assets

This PR adds new board configuration(s). Required assets must already exist in github/armbian/armbian.github.io.
They are required by Armbian Imager to ensure all boards are displayed with proper images.

  • Board images: board-images/<board>.png (1920x1080 px transparent)
  • Vendor logos: board-vendor-logos/<vendor>-logo.png (512x512 px transparent)

Missing items

  • Board image missing for mellowflyc5

    • Expected: board-images/mellowflyc5.png
    • Fix: add the file to armbian/armbian.github.io (folder board-images/)
  • Vendor logo missing for vendor mellow (used by board mellowflyc5)

    • Expected: board-vendor-logos/mellow-logo.png
    • Fix: add the file to armbian/armbian.github.io (folder board-vendor-logos/)
    • Naming rules: lowercase, dashes (e.g. kobol-logo.png, not Kobol_logo.png)

Once the missing files are added (or a PR is opened in armbian/armbian.github.io), re-run this check.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@config/boards/mellowflyc5.csc`:
- Around line 16-17: PACKAGE_LIST_BOARD currently enables Bluetooth packages for
mellowflyc5 though the device tree (sun50i-h618-mellow-fly-c5.dts) only
describes RTL8821CS SDIO Wi‑Fi and lacks any Bluetooth transport/serdev/UART
nodes; either remove "bluetooth" and "bluez-tools" from PACKAGE_LIST_BOARD in
mellowflyc5.csc to avoid shipping unnecessary BlueZ packages, or add the
appropriate Bluetooth transport/serdev DT nodes and UART bindings in the DTS
(the change must reference PACKAGE_LIST_BOARD and the
sun50i-h618-mellow-fly-c5.dts Bluetooth/serdev UART node definitions) so the
package list matches actual hardware support.

In `@patch/kernel/archive/sunxi-6.18/series.conf`:
- Line 561: In series.conf remove the single leading space before the tab on the
line containing "patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch" so
the line begins with a tab only (matching surrounding entries); edit that
specific entry to align formatting with other lines to avoid parsing issues.

In `@patch/u-boot/u-boot-sunxi/board_mellowflyc5/0001-add-dts.patch`:
- Around line 22-30: U-Boot's new DTS selects emac0/ext_rgmii_phy with phy-mode
"rgmii-rxid" and PC=3.3V/PG=1.8V which conflicts with the kernel DTS that uses
emac1/RMII and PC=1.8V/PG=3.3V; pick the actual board wiring and make both
U-Boot and kernel DTS match: either change this patch's nodes (replace emac0 →
emac1, set phy-mode → "rmii", swap the PC/PG regulator references to match
1.8V/3.3V) or update the kernel DTs to use emac0/"rgmii-rxid" and
PC=3.3V/PG=1.8V; ensure the same regulator phandles (e.g., &reg_dldo1) and the
ext_rgmii_phy property motorcomm,clk-out-frequency-hz are consistent across both
trees so Ethernet bring-up and IO-bank voltages are identical.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d068140e-039d-4cde-9230-eee832c60d3e

📥 Commits

Reviewing files that changed from the base of the PR and between f15f594 and cbf0cf6.

📒 Files selected for processing (14)
  • config/boards/mellowflyc5.csc
  • config/kernel/linux-sunxi64-current.config
  • config/kernel/linux-sunxi64-edge.config
  • lib/functions/compilation/patch/drivers_network.sh
  • patch/kernel/archive/sunxi-6.18/dt_64/sun50i-h618-mellow-fly-c5.dts
  • patch/kernel/archive/sunxi-6.18/patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch
  • patch/kernel/archive/sunxi-6.18/series.conf
  • patch/kernel/archive/sunxi-6.19/dt_64/sun50i-h618-mellow-fly-c5.dts
  • patch/kernel/archive/sunxi-6.19/patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch
  • patch/kernel/archive/sunxi-6.19/series.conf
  • patch/misc/wireless-uwe5622/uwe5622-missing-prototypes.patch
  • patch/u-boot/u-boot-sunxi/board_mellowflyc5/0001-add-dts.patch
  • patch/u-boot/u-boot-sunxi/board_mellowflyc5/0002-add-defconfig.patch
  • patch/u-boot/u-boot-sunxi/board_mellowflyc5/0003-update-makefile.patch

Comment on lines +16 to +17
# WiFi RTL8821CS
PACKAGE_LIST_BOARD="rfkill bluetooth bluez bluez-tools"
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.

⚠️ Potential issue | 🟡 Minor

Bluetooth packages look premature here.

Both kernel DTS copies only model the SDIO Wi‑Fi side of the RTL8821CS; I don't see any Bluetooth transport or serdev node under the enabled UARTs in patch/kernel/archive/sunxi-6.18/dt_64/sun50i-h618-mellow-fly-c5.dts Line 159-Line 169 and Line 273-Line 277, nor in the identical 6.19 copy. As-is, images will ship BlueZ packages even though the board support added here only describes Wi‑Fi.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@config/boards/mellowflyc5.csc` around lines 16 - 17, PACKAGE_LIST_BOARD
currently enables Bluetooth packages for mellowflyc5 though the device tree
(sun50i-h618-mellow-fly-c5.dts) only describes RTL8821CS SDIO Wi‑Fi and lacks
any Bluetooth transport/serdev/UART nodes; either remove "bluetooth" and
"bluez-tools" from PACKAGE_LIST_BOARD in mellowflyc5.csc to avoid shipping
unnecessary BlueZ packages, or add the appropriate Bluetooth transport/serdev DT
nodes and UART bindings in the DTS (the change must reference PACKAGE_LIST_BOARD
and the sun50i-h618-mellow-fly-c5.dts Bluetooth/serdev UART node definitions) so
the package list matches actual hardware support.

patches.armbian/drv-usb-gadget-composite-rename-serial-manufacturer.patch
patches.armbian/drv-video-st7796s-fb-tft-driver.patch
patches.armbian/include-uapi-drm_fourcc-add-ARM-tiled-format-modifier.patch
patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch
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.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Inspect exact whitespace around Line 561 (showing control chars):"
sed -n '556,565p' patch/kernel/archive/sunxi-6.18/series.conf | cat -A

echo
echo "Show mellowflyc5 entry in both series files with visible whitespace:"
rg -n 'add-mellowflyc5-to-allwinner-makefile\.patch' \
  patch/kernel/archive/sunxi-6.18/series.conf \
  patch/kernel/archive/sunxi-6.19/series.conf | cat -A

Repository: armbian/build

Length of output: 822


Remove leading space before tab on Line 561.

Line 561 starts with a space followed by a tab, while all surrounding entries use only a tab. This inconsistency can cause parsing issues. Align with the standard format used elsewhere in the file.

Fix
- 	patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch
+	patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@patch/kernel/archive/sunxi-6.18/series.conf` at line 561, In series.conf
remove the single leading space before the tab on the line containing
"patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch" so the line begins
with a tab only (matching surrounding entries); edit that specific entry to
align formatting with other lines to avoid parsing issues.

Comment on lines +22 to +30
+&emac0 {
+ allwinner,tx-delay-ps = <700>;
+ phy-mode = "rgmii-rxid";
+ phy-supply = <&reg_dldo1>;
+};
+
+&ext_rgmii_phy {
+ motorcomm,clk-out-frequency-hz = <125000000>;
+};
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.

⚠️ Potential issue | 🟠 Major

U-Boot and Linux still disagree on fixed board wiring.

This patch selects emac0/ext_rgmii_phy and maps PC=3.3V, PG=1.8V, but both kernel DTS copies use emac1/RMII and PC=1.8V, PG=3.3V (patch/kernel/archive/sunxi-6.18/dt_64/sun50i-h618-mellow-fly-c5.dts Line 20, Line 111, and Line 198, with the same layout in the 6.19 copy). One of these descriptions is wrong, so Ethernet bring-up or IO-bank voltage programming can diverge across the U-Boot → Linux handoff.

Also applies to: 88-94

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@patch/u-boot/u-boot-sunxi/board_mellowflyc5/0001-add-dts.patch` around lines
22 - 30, U-Boot's new DTS selects emac0/ext_rgmii_phy with phy-mode "rgmii-rxid"
and PC=3.3V/PG=1.8V which conflicts with the kernel DTS that uses emac1/RMII and
PC=1.8V/PG=3.3V; pick the actual board wiring and make both U-Boot and kernel
DTS match: either change this patch's nodes (replace emac0 → emac1, set phy-mode
→ "rmii", swap the PC/PG regulator references to match 1.8V/3.3V) or update the
kernel DTs to use emac0/"rgmii-rxid" and PC=3.3V/PG=1.8V; ensure the same
regulator phandles (e.g., &reg_dldo1) and the ext_rgmii_phy property
motorcomm,clk-out-frequency-hz are consistent across both trees so Ethernet
bring-up and IO-bank voltages are identical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release Framework Framework components 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.

1 participant