From 80fcb8ae9a161805d34a7f37a53b523e836cc9e0 Mon Sep 17 00:00:00 2001 From: Alastair D'Silva Date: Wed, 25 Mar 2026 13:49:18 +1100 Subject: [PATCH 1/2] sunxi: uwe5622: fix compile warnings -Wmissing-prototypes Add function prototypes to resolve compiler warnings and ensure correct linkage. Signed-off-by: Alastair D'Silva --- lib/functions/compilation/patch/drivers_network.sh | 1 + .../uwe5622-missing-prototypes.patch | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 patch/misc/wireless-uwe5622/uwe5622-missing-prototypes.patch diff --git a/lib/functions/compilation/patch/drivers_network.sh b/lib/functions/compilation/patch/drivers_network.sh index 929c4a961950..1edc9085cb9b 100644 --- a/lib/functions/compilation/patch/drivers_network.sh +++ b/lib/functions/compilation/patch/drivers_network.sh @@ -584,6 +584,7 @@ driver_uwe5622() { process_patch_file "${SRC}/patch/misc/wireless-uwe5622/wireless-uwe5622-Fix-compilation-with-6.7-kernel.patch" "applying" process_patch_file "${SRC}/patch/misc/wireless-uwe5622/wireless-uwe5622-reduce-system-load.patch" "applying" + process_patch_file "${SRC}/patch/misc/wireless-uwe5622/uwe5622-missing-prototypes.patch" "applying" if linux-version compare "${version}" ge 6.9; then process_patch_file "${SRC}/patch/misc/wireless-uwe5622/uwe5622-v6.9.patch" "applying" diff --git a/patch/misc/wireless-uwe5622/uwe5622-missing-prototypes.patch b/patch/misc/wireless-uwe5622/uwe5622-missing-prototypes.patch new file mode 100644 index 000000000000..139a57740ca7 --- /dev/null +++ b/patch/misc/wireless-uwe5622/uwe5622-missing-prototypes.patch @@ -0,0 +1,13 @@ +From b758478655da935b50a973b0aa2ddbc20893b789 Mon Sep 17 00:00:00 2001 +From: Alastair D'Silva +Date: Wed, 25 Mar 2026 18:40:00 +1100 +Subject: [PATCH] uwe5622: add missing prototypes to fix -Wmissing-prototypes + +Add unisoc_wifi_init and unisoc_wifi_exit prototypes to unisocwifi/main.c. + +--- a/drivers/net/wireless/uwe5622/unisocwifi/main.c ++++ b/drivers/net/wireless/uwe5622/unisocwifi/main.c +@@ -1,0 +1,3 @@ ++int unisoc_wifi_init(void); ++void unisoc_wifi_exit(void); ++ From cbf0cf6a39ec7d401b928a361bce9553197eae94 Mon Sep 17 00:00:00 2001 From: Alastair D'Silva Date: Wed, 25 Mar 2026 18:50:42 +1100 Subject: [PATCH 2/2] Add support for Mellow Fly C5 board 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. --- config/boards/mellowflyc5.csc | 19 ++ config/kernel/linux-sunxi64-current.config | 1 + config/kernel/linux-sunxi64-edge.config | 1 + .../dt_64/sun50i-h618-mellow-fly-c5.dts | 284 ++++++++++++++++++ ...dd-mellowflyc5-to-allwinner-makefile.patch | 12 + patch/kernel/archive/sunxi-6.18/series.conf | 1 + .../dt_64/sun50i-h618-mellow-fly-c5.dts | 284 ++++++++++++++++++ ...dd-mellowflyc5-to-allwinner-makefile.patch | 12 + patch/kernel/archive/sunxi-6.19/series.conf | 1 + .../board_mellowflyc5/0001-add-dts.patch | 94 ++++++ .../0002-add-defconfig.patch | 38 +++ .../0003-update-makefile.patch | 12 + 12 files changed, 759 insertions(+) create mode 100644 config/boards/mellowflyc5.csc create mode 100644 patch/kernel/archive/sunxi-6.18/dt_64/sun50i-h618-mellow-fly-c5.dts create mode 100644 patch/kernel/archive/sunxi-6.18/patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch create mode 100644 patch/kernel/archive/sunxi-6.19/dt_64/sun50i-h618-mellow-fly-c5.dts create mode 100644 patch/kernel/archive/sunxi-6.19/patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch create mode 100644 patch/u-boot/u-boot-sunxi/board_mellowflyc5/0001-add-dts.patch create mode 100644 patch/u-boot/u-boot-sunxi/board_mellowflyc5/0002-add-defconfig.patch create mode 100644 patch/u-boot/u-boot-sunxi/board_mellowflyc5/0003-update-makefile.patch diff --git a/config/boards/mellowflyc5.csc b/config/boards/mellowflyc5.csc new file mode 100644 index 000000000000..8c649b211ebb --- /dev/null +++ b/config/boards/mellowflyc5.csc @@ -0,0 +1,19 @@ +# Allwinner H618 quad core 1GB RAM SoC 100M Ethernet WiFi +BOARD_NAME="Mellow Fly-C5" +BOOTPATCHDIR="u-boot-sunxi" + +BOARD_VENDOR="mellow" +BOARDFAMILY="sun50iw9" +BOARD_MAINTAINER="" +BOOTCONFIG="mellow_fly_c5_defconfig" +OVERLAY_PREFIX="sun50i-h616" +BOOT_FDT_FILE="allwinner/sun50i-h618-mellow-fly-c5.dtb" +BOOT_LOGO="desktop" +KERNEL_TARGET="current,edge" +KERNEL_TEST_TARGET="current" +FORCE_BOOTSCRIPT_UPDATE="yes" + +# WiFi RTL8821CS +PACKAGE_LIST_BOARD="rfkill bluetooth bluez bluez-tools" + + diff --git a/config/kernel/linux-sunxi64-current.config b/config/kernel/linux-sunxi64-current.config index 341363e5cd57..ecd9500b292b 100644 --- a/config/kernel/linux-sunxi64-current.config +++ b/config/kernel/linux-sunxi64-current.config @@ -734,6 +734,7 @@ CONFIG_R8169=m # CONFIG_NET_VENDOR_SMSC is not set # CONFIG_NET_VENDOR_SOCIONEXT is not set CONFIG_STMMAC_ETH=y +CONFIG_SUNXI_GMAC=m CONFIG_DWMAC_DWC_QOS_ETH=m CONFIG_STMMAC_PCI=m # CONFIG_NET_VENDOR_SUN is not set diff --git a/config/kernel/linux-sunxi64-edge.config b/config/kernel/linux-sunxi64-edge.config index 576342bab4cf..11bbfc84df84 100644 --- a/config/kernel/linux-sunxi64-edge.config +++ b/config/kernel/linux-sunxi64-edge.config @@ -734,6 +734,7 @@ CONFIG_R8169=m # CONFIG_NET_VENDOR_SMSC is not set # CONFIG_NET_VENDOR_SOCIONEXT is not set CONFIG_STMMAC_ETH=y +CONFIG_SUNXI_GMAC=m CONFIG_DWMAC_DWC_QOS_ETH=m CONFIG_STMMAC_PCI=m # CONFIG_NET_VENDOR_SUN is not set diff --git a/patch/kernel/archive/sunxi-6.18/dt_64/sun50i-h618-mellow-fly-c5.dts b/patch/kernel/archive/sunxi-6.18/dt_64/sun50i-h618-mellow-fly-c5.dts new file mode 100644 index 000000000000..226ca11c4323 --- /dev/null +++ b/patch/kernel/archive/sunxi-6.18/dt_64/sun50i-h618-mellow-fly-c5.dts @@ -0,0 +1,284 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2026 Alastair D'Silva + */ + +/dts-v1/; + +#include "sun50i-h616.dtsi" +#include "sun50i-h616-cpu-opp.dtsi" + +#include +#include +#include + +/ { + model = "Mellow Fly-C5"; + compatible = "mellow,fly-c5", "allwinner,sun50i-h618"; + + aliases { + ethernet0 = &emac1; + ethernet1 = &rtl8821cs; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + reg_vcc5v: regulator-vcc5v { + /* Board wide 5V supply */ + compatible = "regulator-fixed"; + regulator-always-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-name = "vcc-5v"; + }; + + reg_vcc3v3: regulator-vcc3v3 { + /* Fixed 3.3V for internal modules */ + compatible = "regulator-fixed"; + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-3v3"; + vin-supply = <®_vcc5v>; + }; + + reg_vcc1v8: regulator-vcc1v8 { + /* Fixed 1.8V for internal modules */ + compatible = "regulator-fixed"; + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc-1v8"; + vin-supply = <®_vcc3v3>; + }; + + wifi_pwrseq: wifi-pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&rtc CLK_OSC32K_FANOUT>; + clock-names = "ext_clock"; + pinctrl-0 = <&x32clk_fanout_pin>; + pinctrl-names = "default"; + post-power-on-delay-ms = <200>; + reset-gpios = <&pio 6 18 GPIO_ACTIVE_LOW>; /* PG18 */ + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ + linux,default-trigger = "heartbeat"; + }; + + led-1 { + function = LED_FUNCTION_ACTIVITY; + color = ; + gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ + linux,default-trigger = "disk-activity"; + }; + }; +}; + +&cpu0 { + cpu-supply = <®_dcdc2>; +}; + +&de { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&ehci2 { + status = "okay"; +}; + +&ehci3 { + status = "okay"; +}; + +&emac1 { + pinctrl-names = "default"; + pinctrl-0 = <&rmii_pins>; + phy-mode = "rmii"; + phy-handle = <&rmii_phy1>; + phy-supply = <®_dldo1>; + allwinner,rx-delay-ps = <3100>; + allwinner,tx-delay-ps = <700>; + phy-rst; + gmac-power0; + gmac-power1; + gmac-power2; + status = "okay"; +}; + +&mdio1 { + rmii_phy1: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; +}; + +&gpu { + mali-supply = <®_dcdc1>; + status = "okay"; +}; + +&hdmi { + hvcc-supply = <®_aldo1>; + vcc-hdmi-supply = <®_dldo1>; + status = "okay"; +}; + +&hdmi_phy { + status = "okay"; +}; + +&ir { + status = "okay"; +}; + +&mmc0 { + vmmc-supply = <®_vcc3v3>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ + bus-width = <4>; + status = "okay"; +}; + +&mmc1 { + vmmc-supply = <®_vcc3v3>; + vqmmc-supply = <®_vcc1v8>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + rtl8821cs: wifi@1 { + reg = <1>; + }; +}; + +&mmc2 { + vmmc-supply = <®_vcc3v3>; + vqmmc-supply = <®_vcc1v8>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&ohci2 { + status = "okay"; +}; + +&ohci3 { + status = "okay"; +}; + +&pio { + vcc-pc-supply = <®_aldo1>; + vcc-pf-supply = <®_dldo1>; + vcc-pg-supply = <®_dldo1>; + vcc-ph-supply = <®_dldo1>; + vcc-pi-supply = <®_dldo1>; +}; + +&pwm3 { + /* Disable PWM3 to avoid conflict with UART0 on PH0 */ + status = "disabled"; +}; + +&r_i2c { + status = "okay"; + + axp313: pmic@36 { + compatible = "x-powers,axp313a"; + reg = <0x36>; + #interrupt-cells = <1>; + interrupt-controller; + /* + * Omit interrupt to break dependency cycle with &pio. + * reg_dldo1 supplies &pio, so &pio depends on PMIC. + * PMIC interrupt on PC9 depends on &pio. + */ + + vin1-supply = <®_vcc5v>; + vin2-supply = <®_vcc5v>; + vin3-supply = <®_vcc5v>; + + regulators { + /* Supplies VCC-PLL and DRAM */ + reg_aldo1: aldo1 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc1v8"; + }; + + /* Supplies VCC-IO, so needs to be always on. */ + reg_dldo1: dldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc3v3"; + }; + + reg_dcdc1: dcdc1 { + regulator-always-on; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <990000>; + regulator-name = "vdd-gpu-sys"; + }; + + reg_dcdc2: dcdc2 { + regulator-always-on; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-cpu"; + }; + + reg_dcdc3: dcdc3 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-dram"; + }; + }; + }; +}; + +&ths { + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_ph_pins>; + status = "okay"; +}; + +&usbphy { + usb1_vbus-supply = <®_vcc5v>; + usb2_vbus-supply = <®_vcc5v>; + usb3_vbus-supply = <®_vcc5v>; + status = "okay"; +}; diff --git a/patch/kernel/archive/sunxi-6.18/patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch b/patch/kernel/archive/sunxi-6.18/patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch new file mode 100644 index 000000000000..4049fdb31b67 --- /dev/null +++ b/patch/kernel/archive/sunxi-6.18/patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch @@ -0,0 +1,12 @@ +diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile +index 2edfa7bf4ab3..2f33c2f2aad3 100644 +--- a/arch/arm64/boot/dts/allwinner/Makefile ++++ b/arch/arm64/boot/dts/allwinner/Makefile +@@ -45,6 +45,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h313-x96q.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-bigtreetech-cb1-manta.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-bigtreetech-pi.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb ++dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-mellow-fly-c5.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-x96-mate.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-longanpi-3h.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-orangepi-zero2w.dtb diff --git a/patch/kernel/archive/sunxi-6.18/series.conf b/patch/kernel/archive/sunxi-6.18/series.conf index 99036e5b634d..7aa198e17168 100644 --- a/patch/kernel/archive/sunxi-6.18/series.conf +++ b/patch/kernel/archive/sunxi-6.18/series.conf @@ -558,3 +558,4 @@ 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 diff --git a/patch/kernel/archive/sunxi-6.19/dt_64/sun50i-h618-mellow-fly-c5.dts b/patch/kernel/archive/sunxi-6.19/dt_64/sun50i-h618-mellow-fly-c5.dts new file mode 100644 index 000000000000..226ca11c4323 --- /dev/null +++ b/patch/kernel/archive/sunxi-6.19/dt_64/sun50i-h618-mellow-fly-c5.dts @@ -0,0 +1,284 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2026 Alastair D'Silva + */ + +/dts-v1/; + +#include "sun50i-h616.dtsi" +#include "sun50i-h616-cpu-opp.dtsi" + +#include +#include +#include + +/ { + model = "Mellow Fly-C5"; + compatible = "mellow,fly-c5", "allwinner,sun50i-h618"; + + aliases { + ethernet0 = &emac1; + ethernet1 = &rtl8821cs; + serial0 = &uart0; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + reg_vcc5v: regulator-vcc5v { + /* Board wide 5V supply */ + compatible = "regulator-fixed"; + regulator-always-on; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + regulator-name = "vcc-5v"; + }; + + reg_vcc3v3: regulator-vcc3v3 { + /* Fixed 3.3V for internal modules */ + compatible = "regulator-fixed"; + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc-3v3"; + vin-supply = <®_vcc5v>; + }; + + reg_vcc1v8: regulator-vcc1v8 { + /* Fixed 1.8V for internal modules */ + compatible = "regulator-fixed"; + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc-1v8"; + vin-supply = <®_vcc3v3>; + }; + + wifi_pwrseq: wifi-pwrseq { + compatible = "mmc-pwrseq-simple"; + clocks = <&rtc CLK_OSC32K_FANOUT>; + clock-names = "ext_clock"; + pinctrl-0 = <&x32clk_fanout_pin>; + pinctrl-names = "default"; + post-power-on-delay-ms = <200>; + reset-gpios = <&pio 6 18 GPIO_ACTIVE_LOW>; /* PG18 */ + }; + + leds { + compatible = "gpio-leds"; + + led-0 { + function = LED_FUNCTION_STATUS; + color = ; + gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */ + linux,default-trigger = "heartbeat"; + }; + + led-1 { + function = LED_FUNCTION_ACTIVITY; + color = ; + gpios = <&pio 6 11 GPIO_ACTIVE_HIGH>; /* PG11 */ + linux,default-trigger = "disk-activity"; + }; + }; +}; + +&cpu0 { + cpu-supply = <®_dcdc2>; +}; + +&de { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci1 { + status = "okay"; +}; + +&ehci2 { + status = "okay"; +}; + +&ehci3 { + status = "okay"; +}; + +&emac1 { + pinctrl-names = "default"; + pinctrl-0 = <&rmii_pins>; + phy-mode = "rmii"; + phy-handle = <&rmii_phy1>; + phy-supply = <®_dldo1>; + allwinner,rx-delay-ps = <3100>; + allwinner,tx-delay-ps = <700>; + phy-rst; + gmac-power0; + gmac-power1; + gmac-power2; + status = "okay"; +}; + +&mdio1 { + rmii_phy1: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + }; +}; + +&gpu { + mali-supply = <®_dcdc1>; + status = "okay"; +}; + +&hdmi { + hvcc-supply = <®_aldo1>; + vcc-hdmi-supply = <®_dldo1>; + status = "okay"; +}; + +&hdmi_phy { + status = "okay"; +}; + +&ir { + status = "okay"; +}; + +&mmc0 { + vmmc-supply = <®_vcc3v3>; + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ + bus-width = <4>; + status = "okay"; +}; + +&mmc1 { + vmmc-supply = <®_vcc3v3>; + vqmmc-supply = <®_vcc1v8>; + mmc-pwrseq = <&wifi_pwrseq>; + bus-width = <4>; + non-removable; + status = "okay"; + + rtl8821cs: wifi@1 { + reg = <1>; + }; +}; + +&mmc2 { + vmmc-supply = <®_vcc3v3>; + vqmmc-supply = <®_vcc1v8>; + bus-width = <8>; + non-removable; + cap-mmc-hw-reset; + status = "okay"; +}; + +&ohci0 { + status = "okay"; +}; + +&ohci1 { + status = "okay"; +}; + +&ohci2 { + status = "okay"; +}; + +&ohci3 { + status = "okay"; +}; + +&pio { + vcc-pc-supply = <®_aldo1>; + vcc-pf-supply = <®_dldo1>; + vcc-pg-supply = <®_dldo1>; + vcc-ph-supply = <®_dldo1>; + vcc-pi-supply = <®_dldo1>; +}; + +&pwm3 { + /* Disable PWM3 to avoid conflict with UART0 on PH0 */ + status = "disabled"; +}; + +&r_i2c { + status = "okay"; + + axp313: pmic@36 { + compatible = "x-powers,axp313a"; + reg = <0x36>; + #interrupt-cells = <1>; + interrupt-controller; + /* + * Omit interrupt to break dependency cycle with &pio. + * reg_dldo1 supplies &pio, so &pio depends on PMIC. + * PMIC interrupt on PC9 depends on &pio. + */ + + vin1-supply = <®_vcc5v>; + vin2-supply = <®_vcc5v>; + vin3-supply = <®_vcc5v>; + + regulators { + /* Supplies VCC-PLL and DRAM */ + reg_aldo1: aldo1 { + regulator-always-on; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; + regulator-name = "vcc1v8"; + }; + + /* Supplies VCC-IO, so needs to be always on. */ + reg_dldo1: dldo1 { + regulator-always-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + regulator-name = "vcc3v3"; + }; + + reg_dcdc1: dcdc1 { + regulator-always-on; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <990000>; + regulator-name = "vdd-gpu-sys"; + }; + + reg_dcdc2: dcdc2 { + regulator-always-on; + regulator-min-microvolt = <810000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-cpu"; + }; + + reg_dcdc3: dcdc3 { + regulator-always-on; + regulator-min-microvolt = <1100000>; + regulator-max-microvolt = <1100000>; + regulator-name = "vdd-dram"; + }; + }; + }; +}; + +&ths { + status = "okay"; +}; + +&uart0 { + pinctrl-names = "default"; + pinctrl-0 = <&uart0_ph_pins>; + status = "okay"; +}; + +&usbphy { + usb1_vbus-supply = <®_vcc5v>; + usb2_vbus-supply = <®_vcc5v>; + usb3_vbus-supply = <®_vcc5v>; + status = "okay"; +}; diff --git a/patch/kernel/archive/sunxi-6.19/patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch b/patch/kernel/archive/sunxi-6.19/patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch new file mode 100644 index 000000000000..4049fdb31b67 --- /dev/null +++ b/patch/kernel/archive/sunxi-6.19/patches.armbian/add-mellowflyc5-to-allwinner-makefile.patch @@ -0,0 +1,12 @@ +diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile +index 2edfa7bf4ab3..2f33c2f2aad3 100644 +--- a/arch/arm64/boot/dts/allwinner/Makefile ++++ b/arch/arm64/boot/dts/allwinner/Makefile +@@ -45,6 +45,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h313-x96q.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-bigtreetech-cb1-manta.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-bigtreetech-pi.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb ++dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-mellow-fly-c5.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-x96-mate.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-longanpi-3h.dtb + dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-orangepi-zero2w.dtb diff --git a/patch/kernel/archive/sunxi-6.19/series.conf b/patch/kernel/archive/sunxi-6.19/series.conf index f196dd2b22c0..f452d331963b 100644 --- a/patch/kernel/archive/sunxi-6.19/series.conf +++ b/patch/kernel/archive/sunxi-6.19/series.conf @@ -500,3 +500,4 @@ 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 diff --git a/patch/u-boot/u-boot-sunxi/board_mellowflyc5/0001-add-dts.patch b/patch/u-boot/u-boot-sunxi/board_mellowflyc5/0001-add-dts.patch new file mode 100644 index 000000000000..0357f695b681 --- /dev/null +++ b/patch/u-boot/u-boot-sunxi/board_mellowflyc5/0001-add-dts.patch @@ -0,0 +1,94 @@ +diff --git a/arch/arm/dts/sun50i-h618-mellow-fly-c5.dts b/arch/arm/dts/sun50i-h618-mellow-fly-c5.dts +new file mode 100644 +index 00000000000..cad13317c5e +--- /dev/null ++++ b/arch/arm/dts/sun50i-h618-mellow-fly-c5.dts +@@ -0,0 +1,88 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (C) 2023 Arm Ltd. ++ * Copyright (c) 2026 Alastair D'Silva ++ */ ++ ++/dts-v1/; ++ ++#include "sun50i-h616-orangepi-zero.dtsi" ++ ++/ { ++ model = "Mellow Fly-C5"; ++ compatible = "mellow,fly-c5", "allwinner,sun50i-h618"; ++}; ++ ++&emac0 { ++ allwinner,tx-delay-ps = <700>; ++ phy-mode = "rgmii-rxid"; ++ phy-supply = <®_dldo1>; ++}; ++ ++&ext_rgmii_phy { ++ motorcomm,clk-out-frequency-hz = <125000000>; ++}; ++ ++&r_i2c { ++ status = "okay"; ++ ++ axp313: pmic@36 { ++ compatible = "x-powers,axp313a"; ++ reg = <0x36>; ++ #interrupt-cells = <1>; ++ interrupt-controller; ++ interrupt-parent = <&pio>; ++ interrupts = <2 9 IRQ_TYPE_LEVEL_LOW>; /* PC9 */ ++ ++ vin1-supply = <®_vcc5v>; ++ vin2-supply = <®_vcc5v>; ++ vin3-supply = <®_vcc5v>; ++ ++ regulators { ++ /* Supplies VCC-PLL, so needs to be always on. */ ++ reg_aldo1: aldo1 { ++ regulator-always-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ regulator-name = "vcc1v8"; ++ }; ++ ++ /* Supplies VCC-IO, so needs to be always on. */ ++ reg_dldo1: dldo1 { ++ regulator-always-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc3v3"; ++ }; ++ ++ reg_dcdc1: dcdc1 { ++ regulator-always-on; ++ regulator-min-microvolt = <810000>; ++ regulator-max-microvolt = <990000>; ++ regulator-name = "vdd-gpu-sys"; ++ }; ++ ++ reg_dcdc2: dcdc2 { ++ regulator-always-on; ++ regulator-min-microvolt = <810000>; ++ regulator-max-microvolt = <1100000>; ++ regulator-name = "vdd-cpu"; ++ }; ++ ++ reg_dcdc3: dcdc3 { ++ regulator-always-on; ++ regulator-min-microvolt = <1100000>; ++ regulator-max-microvolt = <1100000>; ++ regulator-name = "vdd-dram"; ++ }; ++ }; ++ }; ++}; ++ ++&pio { ++ vcc-pc-supply = <®_dldo1>; ++ vcc-pf-supply = <®_dldo1>; ++ vcc-pg-supply = <®_aldo1>; ++ vcc-ph-supply = <®_dldo1>; ++ vcc-pi-supply = <®_dldo1>; ++}; diff --git a/patch/u-boot/u-boot-sunxi/board_mellowflyc5/0002-add-defconfig.patch b/patch/u-boot/u-boot-sunxi/board_mellowflyc5/0002-add-defconfig.patch new file mode 100644 index 000000000000..dab84e908430 --- /dev/null +++ b/patch/u-boot/u-boot-sunxi/board_mellowflyc5/0002-add-defconfig.patch @@ -0,0 +1,38 @@ +diff --git a/configs/mellow_fly_c5_defconfig b/configs/mellow_fly_c5_defconfig +new file mode 100644 +index 00000000000..224d9283f03 +--- /dev/null ++++ b/configs/mellow_fly_c5_defconfig +@@ -0,0 +1,32 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_SUNXI=y ++CONFIG_DEFAULT_DEVICE_TREE="sun50i-h618-mellow-fly-c5" ++CONFIG_SPL=y ++CONFIG_DRAM_SUN50I_H616_DX_ODT=0x07070707 ++CONFIG_DRAM_SUN50I_H616_DX_DRI=0x0e0e0e0e ++CONFIG_DRAM_SUN50I_H616_CA_DRI=0x0e0e ++CONFIG_DRAM_SUN50I_H616_ODT_EN=0xaaaaeeee ++CONFIG_DRAM_SUN50I_H616_TPR6=0x44000000 ++CONFIG_DRAM_SUN50I_H616_TPR10=0x402f6663 ++CONFIG_DRAM_SUN50I_H616_TPR11=0x24242624 ++CONFIG_DRAM_SUN50I_H616_TPR12=0x0f0f100f ++CONFIG_MACH_SUN50I_H616=y ++CONFIG_SUNXI_DRAM_H616_LPDDR4=y ++CONFIG_DRAM_CLK=792 ++CONFIG_USB1_VBUS_PIN="PC16" ++CONFIG_R_I2C_ENABLE=y ++CONFIG_SPL_SPI_SUNXI=y ++# CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set ++CONFIG_SPL_I2C=y ++CONFIG_SPL_SYS_I2C_LEGACY=y ++CONFIG_SYS_I2C_MVTWSI=y ++CONFIG_SYS_I2C_SLAVE=0x7f ++CONFIG_SYS_I2C_SPEED=400000 ++CONFIG_SPI_FLASH_ZBIT=y ++CONFIG_PHY_MOTORCOMM=y ++CONFIG_SUN8I_EMAC=y ++CONFIG_AXP313_POWER=y ++CONFIG_SPI=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_OHCI_HCD=y ++CONFIG_USB_MUSB_GADGET=y diff --git a/patch/u-boot/u-boot-sunxi/board_mellowflyc5/0003-update-makefile.patch b/patch/u-boot/u-boot-sunxi/board_mellowflyc5/0003-update-makefile.patch new file mode 100644 index 000000000000..3e9b899e1aa6 --- /dev/null +++ b/patch/u-boot/u-boot-sunxi/board_mellowflyc5/0003-update-makefile.patch @@ -0,0 +1,12 @@ +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index 9d28a485bec..1eb8deb2ecd 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -836,6 +836,7 @@ dtb-$(CONFIG_MACH_SUN50I_H6) += \ + dtb-$(CONFIG_MACH_SUN50I_H616) += \ + sun50i-h616-orangepi-zero2.dtb \ + sun50i-h618-orangepi-zero3.dtb \ ++ sun50i-h618-mellow-fly-c5.dtb \ + sun50i-h616-x96-mate.dtb + dtb-$(CONFIG_MACH_SUN50I) += \ + sun50i-a64-amarula-relic.dtb \