Feat: Add support for the Mellow Fly C5 3D Printer board#9584
Feat: Add support for the Mellow Fly C5 3D Printer board#9584deece wants to merge 2 commits intoarmbian:mainfrom
Conversation
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.
📝 WalkthroughWalkthroughIntroduces 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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 |
🚫 Missing required board assetsThis PR adds new board configuration(s). Required assets must already exist in github/armbian/armbian.github.io.
Missing items
Once the missing files are added (or a PR is opened in armbian/armbian.github.io), re-run this check. |
There was a problem hiding this comment.
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., ®_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
📒 Files selected for processing (14)
config/boards/mellowflyc5.cscconfig/kernel/linux-sunxi64-current.configconfig/kernel/linux-sunxi64-edge.configlib/functions/compilation/patch/drivers_network.shpatch/kernel/archive/sunxi-6.18/dt_64/sun50i-h618-mellow-fly-c5.dtspatch/kernel/archive/sunxi-6.18/patches.armbian/add-mellowflyc5-to-allwinner-makefile.patchpatch/kernel/archive/sunxi-6.18/series.confpatch/kernel/archive/sunxi-6.19/dt_64/sun50i-h618-mellow-fly-c5.dtspatch/kernel/archive/sunxi-6.19/patches.armbian/add-mellowflyc5-to-allwinner-makefile.patchpatch/kernel/archive/sunxi-6.19/series.confpatch/misc/wireless-uwe5622/uwe5622-missing-prototypes.patchpatch/u-boot/u-boot-sunxi/board_mellowflyc5/0001-add-dts.patchpatch/u-boot/u-boot-sunxi/board_mellowflyc5/0002-add-defconfig.patchpatch/u-boot/u-boot-sunxi/board_mellowflyc5/0003-update-makefile.patch
| # WiFi RTL8821CS | ||
| PACKAGE_LIST_BOARD="rfkill bluetooth bluez bluez-tools" |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
🧩 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 -ARepository: 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.
| +&emac0 { | ||
| + allwinner,tx-delay-ps = <700>; | ||
| + phy-mode = "rgmii-rxid"; | ||
| + phy-supply = <®_dldo1>; | ||
| +}; | ||
| + | ||
| +&ext_rgmii_phy { | ||
| + motorcomm,clk-out-frequency-hz = <125000000>; | ||
| +}; |
There was a problem hiding this comment.
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., ®_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.
Description
This PR adds preliminary support for the Mellow Fly C5 3D Printer board. It will probably work for the C8 board too.
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:
Summary by CodeRabbit
New Features
Bug Fixes