kiddin9 1 anno fa
parent
commit
8b91717fab
32 ha cambiato i file con 1991 aggiunte e 4418 eliminazioni
  1. 1 1
      .github/workflows/Openwrt-AutoBuild.yml
  2. 1 1
      .github/workflows/repo-dispatcher.yml
  3. 1 14
      devices/armsr_armv8/patches/rootfs.patch
  4. 1 3
      devices/common/diy.sh
  5. 0 45
      devices/ipq40xx_generic/patches/ACRH17.patch
  6. 0 15
      devices/ipq807x_generic/.config
  7. 0 8
      devices/ipq807x_generic/diy.sh
  8. 0 600
      devices/ipq807x_generic/patches/01-zte_mf269.bin.patch
  9. 1 1
      devices/mediatek_filogic/.config
  10. 0 6
      devices/mediatek_filogic/diy.sh
  11. 1 1
      devices/mediatek_filogic/diy/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand.dts
  12. 48 49
      devices/mediatek_filogic/patches/08-cmcc_rax3000m.patch
  13. 2 2
      devices/mediatek_filogic/patches/11-gl-mt2500.patch
  14. 0 14
      devices/mediatek_filogic/patches/15-cmcc-a10.patch
  15. 2 1
      devices/qualcommax_ipq60xx/diy.sh
  16. BIN
      devices/qualcommax_ipq60xx/diy/package/firmware/ipq-wifi/src/board-jdc_ax1800-pro.ipq6018
  17. 11 0
      devices/qualcommax_ipq60xx/patches/01-zn-m2.patch
  18. 1799 0
      devices/qualcommax_ipq60xx/patches/02-jdc_ax1800-pro.patch
  19. 15 0
      devices/qualcommax_ipq807x/.config
  20. 10 0
      devices/qualcommax_ipq807x/diy.sh
  21. 1 5
      devices/qualcommax_ipq807x/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dts
  22. 1 5
      devices/qualcommax_ipq807x/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax6.dts
  23. 1 5
      devices/qualcommax_ipq807x/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts
  24. 10 46
      devices/qualcommax_ipq807x/patches/04-stock.patch
  25. 30 0
      devices/qualcommax_ipq807x/patches/kernel_version.patch
  26. 2 0
      devices/qualcommax_ipq807x/settings.ini
  27. 1 1
      devices/ramips_mt7621/patches/02-cr660x.patch
  28. 0 22
      devices/rockchip_armv8/patches/97-xgp.patch
  29. 0 20
      devices/rockchip_armv8/patches/98-r2c-plus.patch
  30. 52 21
      devices/rockchip_armv8/patches/99-more.patch
  31. 0 175
      devices/rockchip_armv8/patches/fan.patch
  32. 0 3357
      devices/sunxi_cortexa53/patches/OrangePi_zero2.patch.b

+ 1 - 1
.github/workflows/Openwrt-AutoBuild.yml

@@ -183,7 +183,6 @@ jobs:
         cp -rf devices/${{matrix.target}}/. openwrt/
         cp -rf devices openwrt/
         cd openwrt
-        cp -Rf ./diy/* ./ || true
         chmod +x devices/common/$DIY_SH
         /bin/bash "devices/common/$DIY_SH"
         cp -f devices/common/$CONFIG_FILE .config
@@ -196,6 +195,7 @@ jobs:
           echo "/bin/bash devices/${{matrix.target}}/$DIY_SH"
           /bin/bash "devices/${{matrix.target}}/$DIY_SH"
         fi
+        cp -Rf ./diy/* ./ || true
 
     - name: Apply patches
       run: |

+ 1 - 1
.github/workflows/repo-dispatcher.yml

@@ -147,7 +147,7 @@ jobs:
           -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
           -H "Accept: application/vnd.github.everest-preview+json" \
           -H "Authorization: token ${{ secrets.TOKEN_KIDDIN9 }}" \
-          -d '{"event_type": "ipq807x_generic ${{ github.event.inputs.param }}", "client_payload": {"target": "ipq807x_generic"}}'
+          -d '{"event_type": "qualcommax_ipq807x ${{ github.event.inputs.param }}", "client_payload": {"target": "qualcommax_ipq807x"}}'
           curl \
           -X POST https://api.github.com/repos/${{ github.repository }}/dispatches \
           -H "Accept: application/vnd.github.everest-preview+json" \

+ 1 - 14
devices/armsr_armv8/patches/rootfs.patch

@@ -36,7 +36,7 @@
      IMAGES-y += combined.img
    endif
    ifeq ($(CONFIG_VMDK_IMAGES),y)
-@@ -116,4 +114,34 @@ define Device/generic
+@@ -116,4 +114,21 @@ define Device/generic
  endef
  TARGET_DEVICES += generic
  
@@ -46,12 +46,6 @@
 +endef
 +TARGET_DEVICES += box
 +
-+define Device/h28k
-+  DEVICE_TITLE := HinLink H28K
-+  DEVICE_PACKAGES := perlbase-base perlbase-utf8 perlbase-time perlbase-xsloader perlbase-file btrfs-progs luci-app-amlogic kmod-brcmfmac wpad-basic-mbedtls iw fdisk lsblk automount
-+endef
-+TARGET_DEVICES += h28k
-+
 +define Image/Build
 +  if [ "$(PROFILE_SANITIZED)" == "box" ]; then \
 +  	export BIN_DIR=$(BIN_DIR); \
@@ -60,13 +54,6 @@
 +	export ROOTFS_PARTSIZE=$(shell echo $$(($(ROOTFS_PARTSIZE)/1024/1024))); \
 +  	cd /data/packit/amlogic-s9xxx-openwrt; \
 +  	. ~/packit/packit_amlogic.sh; \
-+  elif [ "$(PROFILE_SANITIZED)" == "h28k" ]; then \
-+  	export BIN_DIR=$(BIN_DIR); \
-+  	export DATE=$(DATE); \
-+  	export PACKAGE_SOC=$(PROFILE_SANITIZED); \
-+	export ROOTFS_MB=$(shell echo $$(($(ROOTFS_PARTSIZE)/1024/1024))); \
-+  	cd /data/packit/flippy-openwrt-actions; \
-+  	. ~/packit/packit_flippy.sh; \
 +  fi
 +endef
 +

+ 1 - 3
devices/common/diy.sh

@@ -57,7 +57,7 @@ grep -q 'PKG_RELEASE:=9' package/libs/openssl/Makefile && {
 sh -c "curl -sfL https://github.com/openwrt/openwrt/commit/a48d0bdb77eb93f7fba6e055dace125c72755b6a.patch | patch -d './' -p1 --forward"
 }
 
-sed -i "/wireless.\${name}.disabled/d" package/kernel/mac80211/files/lib/wifi/mac80211.sh
+sed -i "/wireless.\${name}.disabled/d" package/kernel/mac80211/files/lib/wifi/mac80211.sh || sed -i "/wireless.\${name}.disabled/d" package/network/config/wifi-scripts/files/lib/wifi/mac80211.sh
 
 sed -i "/BuildPackage,miniupnpd-iptables/d" feeds/packages/net/miniupnpd/Makefile
 sed -i 's/Os/O2/g' include/target.mk
@@ -69,8 +69,6 @@ sed -i 's/max_requests 3/max_requests 20/g' package/network/services/uhttpd/file
 #rm -rf ./feeds/packages/lang/{golang,node}
 sed -i "s/tty\(0\|1\)::askfirst/tty\1::respawn/g" target/linux/*/base-files/etc/inittab
 
-sed -i '/echo "radio_config_id=${radio_md5sum}" >> $hostapd_conf_file/d' package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
-
 date=`date +%m.%d.%Y`
 sed -i -e "/\(# \)\?REVISION:=/c\REVISION:=$date" -e '/VERSION_CODE:=/c\VERSION_CODE:=$(REVISION)' include/version.mk
 

+ 0 - 45
devices/ipq40xx_generic/patches/ACRH17.patch

@@ -1,45 +0,0 @@
---- a/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rt-ac42u.dts
-+++ b/target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4019-rt-ac42u.dts
-@@ -225,38 +225,13 @@
- 			#size-cells = <1>;
- 
- 			partition@0 {
--				label = "SBL1";
--				reg = <0x00000000 0x00080000>;
--				read-only;
--			};
--			partition@80000 {
--				label = "MIBIB";
--				reg = <0x00080000 0x00080000>;
--				read-only;
--			};
--			partition@100000 {
--				label = "QSEE";
--				reg = <0x00100000 0x00100000>;
--				read-only;
--			};
--			partition@200000 {
--				label = "CDT";
--				reg = <0x00200000 0x00080000>;
--				read-only;
--			};
--			partition@280000 {
--				label = "APPSBL";
--				reg = <0x00280000 0x00140000>;
--				read-only;
--			};
--			partition@3C0000 {
--				label = "APPSBLENV";
--				reg = <0x003C0000 0x00040000>;
-+				label = "Bootloader";
-+				reg = <0x000000000000 0x000000400000>;
- 				read-only;
- 			};
- 			partition@400000 {
--				label = "ubi";
--				reg = <0x00400000 0x07C00000>;
-+				label = "UBI_DEV";
-+				reg = <0x000000400000 0x000007C00000>;
- 			};
- 		};
- 	};

+ 0 - 15
devices/ipq807x_generic/.config

@@ -1,15 +0,0 @@
-
-CONFIG_TARGET_ipq807x=y
-CONFIG_TARGET_ipq807x_generic=y
-CONFIG_TARGET_MULTI_PROFILE=y
-CONFIG_TARGET_DEVICE_ipq807x_generic_DEVICE_redmi_ax6=y
-CONFIG_TARGET_DEVICE_ipq807x_generic_DEVICE_xiaomi_ax3600=y
-CONFIG_TARGET_DEVICE_ipq807x_generic_DEVICE_xiaomi_ax9000=y
-CONFIG_TARGET_DEVICE_ipq807x_generic_DEVICE_qnap_301w=y
-CONFIG_TARGET_DEVICE_ipq807x_generic_DEVICE_zte_mf269=y
-CONFIG_TARGET_DEVICE_ipq807x_generic_DEVICE_zyxel_nbg7815=y
-CONFIG_TARGET_DEVICE_ipq807x_generic_DEVICE_buffalo_wxr-5950ax12=y
-CONFIG_TARGET_DEVICE_ipq807x_generic_DEVICE_cmcc_rm2-6=y
-CONFIG_PACKAGE_kmod-rtl8812au-ct=n
-CONFIG_PACKAGE_luci-ssl=y # uhttpd服务
-

+ 0 - 8
devices/ipq807x_generic/diy.sh

@@ -1,8 +0,0 @@
-#!/bin/bash
-shopt -s extglob
-
-SHELL_FOLDER=$(dirname $(readlink -f "$0"))
-
-sed -i '/rm -rf $(KDIR)\/tmp/d' include/image.mk
-
-rm -rf feeds/kiddin9/{rtl8821cu,rtl88x2bu} package/kernel/mt76 devices/common/patches/mt7922.patch

+ 0 - 600
devices/ipq807x_generic/patches/01-zte_mf269.bin.patch

@@ -1,600 +0,0 @@
-From c8b8a6adca5bfb49a9312eb3ba17a68f53ffd63e Mon Sep 17 00:00:00 2001
-From: Hugo Yuan <[email protected]>
-Date: Thu, 8 Sep 2022 20:27:05 +0800
-Subject: [PATCH] ipq807x: add support for ZTE MF269
-
-Co-authored-by: AmadeusGhost <[email protected]>
-Signed-off-by: Tianling Shen <[email protected]>
----
- package/boot/uboot-envtools/files/ipq807x     |   3 +-
- package/firmware/ipq-wifi/Makefile            |   2 +
- .../firmware/ipq-wifi/board-zte_mf269.ipq8074 | Bin 0 -> 131172 bytes
- .../ipq807x/base-files/etc/board.d/02_network |  24 +-
- .../etc/hotplug.d/firmware/11-ath11k-caldata  |   3 +-
- .../etc/hotplug.d/ieee80211/11_fix_wifi_mac   |  18 ++
- .../base-files/lib/upgrade/platform.sh        |   4 +
- .../arm64/boot/dts/qcom/ipq8071-mf269.dts     | 212 ++++++++++++++++++
- target/linux/ipq807x/image/generic.mk         |  13 ++
- 9 files changed, 276 insertions(+), 3 deletions(-)
- create mode 100644 package/firmware/ipq-wifi/board-zte_mf269.ipq8074
- create mode 100644 target/linux/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
- create mode 100644 target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts
-
-diff --git a/package/boot/uboot-envtools/files/ipq807x b/package/boot/uboot-envtools/files/ipq807x
-index 5c5b77089ac..4444021defe 100644
---- a/package/boot/uboot-envtools/files/ipq807x
-+++ b/package/boot/uboot-envtools/files/ipq807x
-@@ -27,7 +27,8 @@ edimax,cax1800)
- 	;;
- redmi,ax6|\
- xiaomi,ax3600|\
--xiaomi,ax9000)
-+xiaomi,ax9000|\
-+zte,mf269)
- 	idx="$(find_mtd_index 0:appsblenv)"
- 	[ -n "$idx" ] && \
- 		ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x10000" "0x20000"
-diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
-index 32988910c0a..763eeb3a137 100644
---- a/package/firmware/ipq-wifi/Makefile
-+++ b/package/firmware/ipq-wifi/Makefile
-@@ -40,6 +40,7 @@ ALLWIFIBOARDS:= \
- 	wallys_dr40x9 \
- 	xiaomi_ax3600 \
- 	xiaomi_ax9000 \
-+	zte_mf269 \
- 	zte_mf289f \
- 	zte_mf287plus \
- 	zyxel_nbg7815
-@@ -128,6 +129,7 @@ $(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6))
- $(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9))
- $(eval $(call generate-ipq-wifi-package,xiaomi_ax3600,Xiaomi AX3600))
- $(eval $(call generate-ipq-wifi-package,xiaomi_ax9000,Xiaomi AX9000))
-+$(eval $(call generate-ipq-wifi-package,zte_mf269,ZTE MF269))
- $(eval $(call generate-ipq-wifi-package,zte_mf289f,ZTE MF289F))
- $(eval $(call generate-ipq-wifi-package,zte_mf287plus,ZTE MF287Plus))
- $(eval $(call generate-ipq-wifi-package,zyxel_nbg7815,Zyxel NBG7815))
-diff --git a/package/firmware/ipq-wifi/board-zte_mf269.ipq8074 b/package/firmware/ipq-wifi/board-zte_mf269.ipq8074
-new file mode 100644
-index 0000000000000000000000000000000000000000..473fceabc4e532a3099c0210562a31188e0c1988
-GIT binary patch
-literal 131172
-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
-E|I0XP%>V!Z
-
-literal 0
-HcmV?d00001
-
-diff --git a/target/linux/ipq807x/base-files/etc/board.d/02_network b/target/linux/ipq807x/base-files/etc/board.d/02_network
-index 004ab4fdc62..a597aee68f2 100644
---- a/target/linux/ipq807x/base-files/etc/board.d/02_network
-+++ b/target/linux/ipq807x/base-files/etc/board.d/02_network
-@@ -16,7 +16,8 @@ ipq807x_setup_interfaces()
- 	xiaomi,ax9000)
- 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
- 		;;
--	edgecore,eap102)
-+	edgecore,eap102|\
-+	zte,mf269)
- 		ucidef_set_interfaces_lan_wan "lan" "wan"
- 		;;
- 	edimax,cax1800)
-@@ -38,9 +39,31 @@ ipq807x_setup_interfaces()
- 	esac
- }
- 
-+ipq807x_setup_macs()
-+{
-+	local board="$1"
-+	local lan_mac=""
-+	local wan_mac=""
-+	local label_mac=""
-+
-+	case "$board" in
-+	zte,mf269)
-+		wan_mac="$(mtd_get_mac_binary mac 0x0)"
-+		[ "$wan_mac" != "00:00:00:00:00:00" ] || wan_mac="$(get_mac_binary "$(find_mtd_chardev mac)" 0x20000)"
-+		lan_mac="$(macaddr_add "$wan_mac" 1)"
-+		label_mac="$wan_mac"
-+		;;
-+	esac
-+
-+	[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
-+	[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
-+	[ -n "$label_mac" ] && ucidef_set_label_macaddr "$label_mac"
-+}
-+
- board_config_update
- board=$(board_name)
- ipq807x_setup_interfaces $board
-+ipq807x_setup_macs $board
- board_config_flush
- 
- exit 0
-diff --git a/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
-index 524211ef43e..61ea555247e 100644
---- a/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
-+++ b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
-@@ -18,6 +18,7 @@ case "$FIRMWARE" in
- 	redmi,ax6|\
- 	xiaomi,ax3600|\
- 	xiaomi,ax9000|\
-+	zte,mf269|\
- 	zyxel,nbg7815)
- 		caldata_extract "0:art" 0x1000 0x20000
- 		;;
-diff --git a/target/linux/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
-new file mode 100644
-index 00000000000..c8a8c6ad2b9
---- /dev/null
-+++ b/target/linux/ipq807x/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
-@@ -0,0 +1,19 @@
-+[ "$ACTION" == "add" ] || exit 0
-+
-+PHYNBR=${DEVPATH##*/phy}
-+
-+[ -n $PHYNBR ] || exit 0
-+
-+. /lib/functions.sh
-+. /lib/functions/system.sh
-+
-+board=$(board_name)
-+
-+case "$board" in
-+	zte,mf269)
-+		mac_addr="$(mtd_get_mac_binary mac 0x0)"
-+		[ "$mac_addr" != "00:00:00:00:00:00" ] || mac_addr="$(get_mac_binary "$(find_mtd_chardev mac)" 0x20000)"
-+		[ "$PHYNBR" = "0" ] && macaddr_add "$mac_addr" 2 > "/sys${DEVPATH}/macaddress"
-+		[ "$PHYNBR" = "1" ] && macaddr_add "$mac_addr" 3 > "/sys${DEVPATH}/macaddress"
-+	;;
-+esac
-diff --git a/target/linux/ipq807x/base-files/lib/upgrade/platform.sh b/target/linux/ipq807x/base-files/lib/upgrade/platform.sh
-index 346cc390f3124..d9a81e1e22d2b 100644
---- a/target/linux/ipq807x/base-files/lib/upgrade/platform.sh
-+++ b/target/linux/ipq807x/base-files/lib/upgrade/platform.sh
-@@ -109,6 +109,10 @@ platform_do_upgrade() {
- 		CI_ROOT_UBIPART="rootfs"
- 		nand_do_upgrade "$1"
- 		;;
-+	zte,mf269)
-+		CI_UBIPART="rootfs"
-+		nand_do_upgrade "$1"
-+		;;
- 	*)
- 		default_do_upgrade "$1"
- 		;;
-diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts
-new file mode 100644
-index 00000000000..be76ddf12e4
---- /dev/null
-+++ b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-mf269.dts
-@@ -0,0 +1,212 @@
-+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
-+
-+/dts-v1/;
-+
-+#include "ipq8074-512m.dtsi"
-+#include "ipq8074-ac-cpu.dtsi"
-+#include "ipq8074-ess.dtsi"
-+#include <dt-bindings/gpio/gpio.h>
-+#include <dt-bindings/input/input.h>
-+
-+/ {
-+	model = "ZTE MF269";
-+	compatible = "zte,mf269", "qcom,ipq8074";
-+
-+	aliases {
-+		serial0 = &blsp1_uart5;
-+		led-boot = &led_system_white;
-+		led-failsafe = &led_system_white;
-+		led-running = &led_system_white;
-+		led-upgrade = &led_system_white;
-+	};
-+
-+	chosen {
-+		stdout-path = "serial0:115200n8";
-+		bootargs-append = " root=/dev/ubiblock0_1";
-+	};
-+
-+	keys {
-+		compatible = "gpio-keys";
-+
-+		reset {
-+			label = "reset";
-+			gpios = <&tlmm 46 GPIO_ACTIVE_LOW>;
-+			linux,code = <KEY_RESTART>;
-+		};
-+
-+		wps {
-+			label = "wps";
-+			gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
-+			linux,code = <KEY_WPS_BUTTON>;
-+		};
-+	};
-+
-+	leds {
-+		compatible = "gpio-leds";
-+
-+		led_system_white: system-white {
-+			label = "white:system";
-+			gpio = <&tlmm 56 GPIO_ACTIVE_HIGH>;
-+		};
-+	};
-+};
-+
-+&tlmm {
-+	mdio_pins: mdio-pins {
-+		mdc {
-+			pins = "gpio68";
-+			function = "mdc";
-+			drive-strength = <8>;
-+			bias-pull-up;
-+		};
-+
-+		mido {
-+			pins = "gpio69";
-+			function = "mdio";
-+			drive-strength = <8>;
-+			bias-pull-up;
-+		};
-+	};
-+
-+	usb_vbus_pins: usb-vbus-pins {
-+		usb-pins {
-+			pins = "gpio29";
-+			function = "gpio";
-+			drive-strength = <8>;
-+			bias-disable;
-+			output-high;
-+		};
-+	};
-+};
-+
-+&blsp1_spi1 {
-+	pinctrl-0 = <&spi_0_pins>;
-+	pinctrl-names = "default";
-+	cs-select = <0>;
-+	status = "okay";
-+
-+	flash@0 {
-+		compatible = "jedec,spi-nor";
-+		#address-cells = <1>;
-+		#size-cells = <1>;
-+		reg = <0>;
-+		spi-max-frequency = <50000000>;
-+	};
-+};
-+
-+&blsp1_uart5 {
-+	status = "okay";
-+};
-+
-+&prng {
-+	status = "okay";
-+};
-+
-+&cryptobam {
-+	status = "okay";
-+};
-+
-+&crypto {
-+	status = "okay";
-+};
-+
-+&qpic_bam {
-+	status = "okay";
-+};
-+
-+&qpic_nand {
-+	status = "okay";
-+
-+	nand@0 {
-+		reg = <0>;
-+		nand-ecc-strength = <4>;
-+		nand-ecc-step-size = <512>;
-+		nand-bus-width = <8>;
-+
-+		partitions {
-+			compatible = "qcom,smem-part";
-+		};
-+	};
-+};
-+
-+&qusb_phy_0 {
-+	status = "okay";
-+};
-+
-+&ssphy_0 {
-+	status = "okay";
-+};
-+
-+&usb_0 {
-+	pinctrl-0 = <&usb_vbus_pins>;
-+	pinctrl-names = "default";
-+	status = "okay";
-+};
-+
-+&mdio {
-+	status = "okay";
-+
-+	pinctrl-0 = <&mdio_pins>;
-+	pinctrl-names = "default";
-+
-+	qca8075_24: ethernet-phy@24 {
-+		compatible = "ethernet-phy-ieee802.3-c22";
-+		reg = <24>;
-+		reset-gpios = <&tlmm 25 GPIO_ACTIVE_LOW>;
-+	};
-+
-+	qca8075_28: ethernet-phy@28 {
-+		compatible = "ethernet-phy-ieee802.3-c22";
-+		reg = <28>;
-+		reset-gpios = <&tlmm 44 GPIO_ACTIVE_LOW>;
-+	};
-+};
-+
-+&switch {
-+	status = "okay";
-+
-+	switch_cpu_bmp = <0x1>;  /* cpu port bitmap */
-+	switch_lan_bmp = <0x3e>; /* lan port bitmap */
-+	switch_wan_bmp = <0x40>; /* wan port bitmap */
-+	switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/
-+	switch_mac_mode1 = <0xf>; /* mac mode for uniphy instance1*/
-+	switch_mac_mode2 = <0xf>; /* mac mode for uniphy instance2*/
-+	bm_tick_mode = <0>; /* bm tick mode */
-+	tm_tick_mode = <0>; /* tm tick mode */
-+
-+	qcom,port_phyinfo {
-+		port@4 {
-+			port_id = <5>;
-+			phy_address = <24>;
-+			port_mac_sel = "QGMAC_PORT";
-+		};
-+		port@5 {
-+			port_id = <6>;
-+			phy_address = <28>;
-+			port_mac_sel = "QGMAC_PORT";
-+		};
-+	};
-+};
-+
-+&edma {
-+	status = "okay";
-+};
-+
-+&dp5_syn {
-+	status = "okay";
-+	phy-handle = <&qca8075_24>;
-+	label = "lan";
-+};
-+
-+&dp6_syn {
-+	status = "okay";
-+	phy-handle = <&qca8075_28>;
-+	label = "wan";
-+};
-+
-+&wifi {
-+	status = "okay";
-+
-+	qcom,ath11k-calibration-variant = "ZTE-MF269";
-+	qcom,ath11k-fw-memory-mode = <1>;
-+};
-
---- a/target/linux/ipq807x/image/generic.mk
-+++ b/target/linux/ipq807x/image/generic.mk
-@@ -162,6 +162,19 @@ endif
- endef
- TARGET_DEVICES += xiaomi_ax9000
- 
-+define Device/zte_mf269
-+	$(call Device/FitImage)
-+	$(call Device/UbiFit)
-+	DEVICE_VENDOR := ZTE
-+	DEVICE_MODEL := MF269
-+	BLOCKSIZE := 128k
-+	PAGESIZE := 2048
-+	DEVICE_DTS_CONFIG := config@ac04
-+	SOC := ipq8071
-+	DEVICE_PACKAGES := ipq-wifi-zte_mf269
-+endef
-+TARGET_DEVICES += zte_mf269
-+
- define Device/zyxel_nbg7815
- 	$(call Device/FitImage)
- 	$(call Device/EmmcImage)

+ 1 - 1
devices/mediatek_filogic/.config

@@ -19,7 +19,7 @@ CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_jcg_q30-pro=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cetron_ct3003=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_glinet_gl-mt6000=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_glinet_gl-mt2500=y
-CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cmcc_rax3000m=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cmcc_rax3000m-nand=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cmcc_rax3000m-emmc=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_jdcloud_re-cp-03=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_abt_asr3000=y

+ 0 - 6
devices/mediatek_filogic/diy.sh

@@ -1,9 +1,3 @@
 #!/bin/bash
 
 shopt -s extglob
-
-sed -i "/mt7986_xiaomi_redmi-router-ax6000 /d" package/boot/uboot-mediatek/Makefile
-sed -i "/mt7981_h3c_magic-nx30-pro /d" package/boot/uboot-mediatek/Makefile
-sed -i "/mt7981_qihoo_360t7 /d" package/boot/uboot-mediatek/Makefile
-sed -i "/cmcc_rax3000m.* /d" package/boot/uboot-mediatek/Makefile
-sed -i "/mt7981_jcg_q30-pro /d" package/boot/uboot-mediatek/Makefile

+ 1 - 1
devices/mediatek_filogic/diy/target/linux/mediatek/dts/mt7981b-cmcc-rax3000m-nand.dts

@@ -5,7 +5,7 @@
 
 / {
 	model = "CMCC RAX3000M (NAND version)";
-	compatible = "cmcc,rax3000m", "mediatek,mt7981";
+	compatible = "cmcc,rax3000m-nand", "mediatek,mt7981";
 
 	aliases {
 		label-mac-device = &gmac1;

+ 48 - 49
devices/mediatek_filogic/patches/08-cmcc_rax3000m.patch

@@ -12,66 +12,47 @@
 
 --- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
 +++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
-@@ -46,9 +46,9 @@ case "$board" in
- 		[ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
- 		[ "$PHYNBR" = "1" ] && macaddr_setbit_la $(macaddr_add $addr 2) > /sys${DEVPATH}/macaddress
+@@ -57,6 +57,13 @@ case "$board" in
+ 		esac
+ 		[ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress
  		;;
--	cmcc,rax3000m)
--		case "$(cmdline_get_var root)" in
--		/dev/mmc*)
-+	cmcc,rax3000m*)
-+		case "$board" in
-+		cmcc,rax3000m-emmc)
- 			addr=$(mmc_get_mac_binary factory 0xa)
- 			;;
- 		*)
++	cmcc,rax3000m-emmc)
++		[ "$PHYNBR" = "1" ] && mmc_get_mac_binary factory 0xa > /sys${DEVPATH}/macaddress
++		;;
++	cmcc,a10|\
++	cmcc,rax3000m-nand)
++		[ "$PHYNBR" = "1" ] && mtd_get_mac_binary Factory 0xa > /sys${DEVPATH}/macaddress
++		;;
+ 	cudy,wr3000-v1)
+ 		addr=$(mtd_get_mac_binary bdinfo 0xde00)
+ 		# Originally, phy0 is phy1 mac with LA bit set. However, this would conflict
 
 --- a/target/linux/mediatek/image/filogic.mk
 +++ b/target/linux/mediatek/image/filogic.mk
-@@ -251,37 +251,36 @@ TARGET_DEVICES += cetron_ct3003
- 
- define Device/cmcc_rax3000m
-   DEVICE_VENDOR := CMCC
--  DEVICE_MODEL := RAX3000M
--  DEVICE_DTS := mt7981b-cmcc-rax3000m
--  DEVICE_DTS_OVERLAY := mt7981b-cmcc-rax3000m-emmc mt7981b-cmcc-rax3000m-nand
+@@ -280,7 +280,38 @@ define Device/cmcc_rax3000m
+   ARTIFACT/nand-preloader.bin := mt7981-bl2 spim-nand-ddr4
+   ARTIFACT/nand-bl31-uboot.fip := mt7981-bl31-uboot cmcc_rax3000m-nand
+ endef
+-TARGET_DEVICES += cmcc_rax3000m
++
++define Device/cmcc_rax3000m-nand
++  DEVICE_VENDOR := CMCC
 +  DEVICE_MODEL := RAX3000M NAND
 +  DEVICE_DTS := mt7981b-cmcc-rax3000m-nand
-   DEVICE_DTS_DIR := ../dts
--  DEVICE_DTC_FLAGS := --pad 4096
--  DEVICE_DTS_LOADADDR := 0x43f00000
-   DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 \
- 	e2fsprogs f2fsck mkf2fs
--  KERNEL_LOADADDR := 0x44000000
--  KERNEL := kernel-bin | gzip
--  KERNEL_INITRAMFS := kernel-bin | lzma | \
--	fit lzma $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb with-initrd | pad-to 64k
--  KERNEL_INITRAMFS_SUFFIX := -recovery.itb
++  DEVICE_DTS_DIR := ../dts
++  DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware kmod-usb3 \
++	e2fsprogs f2fsck mkf2fs
 +  UBINIZE_OPTS := -E 5
 +  BLOCKSIZE := 128k
 +  PAGESIZE := 2048
 +  IMAGE_SIZE := 116736k
-   KERNEL_IN_UBI := 1
--  UBOOTENV_IN_UBI := 1
--  IMAGES := sysupgrade.itb
--  IMAGE_SIZE := $$(shell expr 64 + $$(CONFIG_TARGET_ROOTFS_PARTSIZE))m
--  IMAGE/sysupgrade.itb := append-kernel | \
--	 fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb external-static-with-rootfs | \
--	 pad-rootfs | append-metadata
--  ARTIFACTS := \
--	emmc-gpt.bin emmc-preloader.bin emmc-bl31-uboot.fip \
--	nand-preloader.bin nand-bl31-uboot.fip
--  ARTIFACT/emmc-gpt.bin := mt798x-gpt emmc
--  ARTIFACT/emmc-preloader.bin := mt7981-bl2 emmc-ddr4
--  ARTIFACT/emmc-bl31-uboot.fip := mt7981-bl31-uboot cmcc_rax3000m-emmc
--  ARTIFACT/nand-preloader.bin := mt7981-bl2 spim-nand-ddr4
--  ARTIFACT/nand-bl31-uboot.fip := mt7981-bl31-uboot cmcc_rax3000m-nand
++  KERNEL_IN_UBI := 1
 +  IMAGES += factory.bin
 +  IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
 +  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
- endef
- TARGET_DEVICES += cmcc_rax3000m
- 
++endef
++TARGET_DEVICES += cmcc_rax3000m-nand
++
 +define Device/cmcc_rax3000m-emmc
 +  DEVICE_VENDOR := CMCC
 +  DEVICE_MODEL := RAX3000M eMMC
@@ -85,7 +66,25 @@
 +  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
 +endef
 +TARGET_DEVICES += cmcc_rax3000m-emmc
-+
+ 
  define Device/confiabits_mt7981
    DEVICE_VENDOR := Confiabits
-   DEVICE_MODEL := MT7981
+
+--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
++++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+@@ -109,6 +109,7 @@ platform_do_upgrade() {
+ 	cudy,wr3000-v1)
+ 		default_do_upgrade "$1"
+ 		;;
++	cmcc,rax3000m-emmc|\
+ 	glinet,gl-mt6000)
+ 		CI_KERNPART="kernel"
+ 		CI_ROOTPART="rootfs"
+@@ -184,6 +185,7 @@ platform_copy_config() {
+ 			;;
+ 		esac
+ 		;;
++	cmcc,rax3000m-emmc|\
+ 	glinet,gl-mt6000|\
+ 	ubnt,unifi-6-plus)
+ 		emmc_copy_config

+ 2 - 2
devices/mediatek_filogic/patches/11-gl-mt2500.patch

@@ -238,17 +238,17 @@ index 3c278d5faf2c4..6130768cb4c66 100755
 --- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
 @@ -97,6 +97,7 @@ platform_do_upgrade() {
- 	cudy,wr3000-v1)
  		default_do_upgrade "$1"
  		;;
+ 	cmcc,rax3000m-emmc|\
 +	glinet,gl-mt2500|\
  	glinet,gl-mt6000)
  		CI_KERNPART="kernel"
  		CI_ROOTPART="rootfs"
 @@ -176,6 +177,7 @@ platform_copy_config() {
- 			;;
  		esac
  		;;
+ 	cmcc,rax3000m-emmc|\
 +	glinet,gl-mt2500|\
  	glinet,gl-mt6000|\
  	ubnt,unifi-6-plus)

+ 0 - 14
devices/mediatek_filogic/patches/15-cmcc-a10.patch

@@ -270,20 +270,6 @@ index 53e7b024e40fb..61637e09c7f0e 100644
  	confiabits,mt7981|\
  	cudy,wr3000-v1|\
  	tenbay,wr3000k|\
-diff --git a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
-index cb476d84d9115..125bec12cdb88 100644
---- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
-+++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/ieee80211/11_fix_wifi_mac
-@@ -62,6 +62,9 @@
- 		esac
- 		[ "$PHYNBR" = "1" ] && echo "$addr" > /sys${DEVPATH}/macaddress
- 		;;
-+	cmcc,a10)
-+ 		[ "$PHYNBR" = "1" ] && mtd_get_mac_binary factory 0xa > /sys${DEVPATH}/macaddress
-+ 		;;
- 	cudy,wr3000-v1)
- 		addr=$(mtd_get_mac_binary bdinfo 0xde00)
- 		# Originally, phy0 is phy1 mac with LA bit set. However, this would conflict
 diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
 index 6976a399e86dc..83428f0d981e7 100644
 --- a/target/linux/mediatek/image/filogic.mk

+ 2 - 1
devices/qualcommax_ipq60xx/diy.sh

@@ -6,7 +6,7 @@ SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
 git_clone_path master https://github.com/coolsnowwolf/lede target/linux/generic/hack-6.1
 
-rm -rf target/linux/qualcommax package/kernel/qca-* package/boot/uboot-envtools package/firmware/ipq-wifi
+rm -rf target/linux/qualcommax/!(Makefile) package/kernel/qca-* package/boot/uboot-envtools package/firmware/ipq-wifi
 git_clone_path master https://github.com/coolsnowwolf/lede target/linux/qualcommax
 git_clone_path master https://github.com/coolsnowwolf/lede package/qca
 git_clone_path master https://github.com/coolsnowwolf/lede package/boot/uboot-envtools
@@ -18,3 +18,4 @@ curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/target/linu
 
 
 
+

BIN
devices/qualcommax_ipq60xx/diy/package/firmware/ipq-wifi/src/board-jdc_ax1800-pro.ipq6018


+ 11 - 0
devices/qualcommax_ipq60xx/patches/01-zn-m2.patch

@@ -0,0 +1,11 @@
+--- a/target/linux/qualcommax/image/ipq60xx.mk
++++ b/target/linux/qualcommax/image/ipq60xx.mk
+@@ -28,6 +28,8 @@ define Device/cmiot_ax18
+ 	$(call Device/UbiFit)
+ 	DEVICE_VENDOR := CMIOT
+ 	DEVICE_MODEL := AX18
++	DEVICE_ALT0_VENDOR := ZN
++	DEVICE_ALT0_MODEL := M2
+ 	BLOCKSIZE := 128k
+ 	PAGESIZE := 2048
+ 	DEVICE_DTS_CONFIG := config@cp03-c1

+ 1799 - 0
devices/qualcommax_ipq60xx/patches/02-jdc_ax1800-pro.patch

@@ -0,0 +1,1799 @@
+From 222b0208ae8c9ccbae94ff22ba9370c2e72519e5 Mon Sep 17 00:00:00 2001
+From: JiaY-shi <[email protected]>
+Date: Thu, 21 Sep 2023 18:37:36 +0800
+Subject: [PATCH] QualcommAX: ipq60xx: add support for JD Cloud AX1800 Pro
+
+---
+ .../uboot-envtools/files/qualcommax   |    5 +
+ package/firmware/ipq-wifi/Makefile            |    2 +
+ .../ipq-wifi/src/board-jdc_ax1800-pro.ipq6018 |  Bin 0 -> 65644 bytes
+ .../boot/dts/qcom/ipq6018-jdc-ax1800-pro.dts  |  424 ++++++
+ target/linux/qualcommax/image/ipq60xx.mk      |   24 +-
+ .../ipq60xx/base-files/etc/board.d/01_leds    |    4 +-
+ .../ipq60xx/base-files/etc/board.d/02_network |    3 +
+ .../etc/hotplug.d/firmware/11-ath11k-caldata  |    3 +
+ .../ipq60xx/base-files/lib/upgrade/mmc.sh     |   83 ++
+ .../base-files/lib/upgrade/platform.sh        |    5 +
+ ...ers-pinctrl-qcom-add-ipq6000-support.patch | 1133 +++++++++++++++++
+ 11 files changed, 1684 insertions(+), 2 deletions(-)
+ create mode 100644 package/firmware/ipq-wifi/src/board-jdc_ax1800-pro.ipq6018
+ create mode 100644 target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-jdc-ax1800-pro.dts
+ create mode 100644 target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/mmc.sh
+ create mode 100644 target/linux/qualcommax/patches-6.1/2000-drivers-pinctrl-qcom-add-ipq6000-support.patch
+
+diff --git a/package/boot/uboot-envtools/files/qualcommax b/package/boot/uboot-envtools/files/qualcommax
+index 783073696615c..186c56c152f75 100644
+--- a/package/boot/uboot-envtools/files/qualcommax
++++ b/package/boot/uboot-envtools/files/qualcommax
+@@ -20,6 +20,11 @@ glinet,gl-axt1800)
+     [ -n "$idx" ] && \
+         ubootenv_add_uci_config "/dev/mtd$idx" "0x0" "0x40000" "0x20000" "2"
+ 	;;
++    jdc,ax1800-pro)
++        mmcpart="$(find_mmc_part 0:APPSBLENV)"
++        [ -n "$mmcpart" ] && \
++            ubootenv_add_uci_config "$mmcpart" "0x0" "0x40000" "0x20000" "2"
++	;;
+ esac
+ 
+ config_load ubootenv
+diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile
+index 4474977494e4d..4b88911c0e102 100644
+--- a/package/firmware/ipq-wifi/Makefile
++++ b/package/firmware/ipq-wifi/Makefile
+@@ -36,6 +36,7 @@ ALLWIFIBOARDS:= \
+ 	edimax_cax1800 \
+ 	glinet_gl-ax1800 \
+ 	glinet_gl-axt1800 \
++	jdc_ax1800-pro \
+ 	linksys_mr7350 \
+ 	linksys_mx4200 \
+ 	netgear_rax120v2 \
+@@ -141,6 +142,7 @@ $(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102))
+ $(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800))
+ $(eval $(call generate-ipq-wifi-package,glinet_gl-ax1800,GL.iNet GL-AX1800))
+ $(eval $(call generate-ipq-wifi-package,glinet_gl-axt1800,GL.iNet GL-AXT1800))
++$(eval $(call generate-ipq-wifi-package,jdc_ax1800-pro,JD Cloud AX1800 Pro))
+ $(eval $(call generate-ipq-wifi-package,linksys_mr7350,Linksys MR7350))
+ $(eval $(call generate-ipq-wifi-package,linksys_mx4200,Linksys MX4200))
+ $(eval $(call generate-ipq-wifi-package,netgear_rax120v2,Netgear RAX120v2))
+diff --git a/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-jdc-ax1800-pro.dts b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-jdc-ax1800-pro.dts
+new file mode 100644
+index 0000000000000..85032240a7a83
+--- /dev/null
++++ b/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-jdc-ax1800-pro.dts
+@@ -0,0 +1,424 @@
++/dts-v1/;
++/*
++ * Copyright (c) 2019, The Linux Foundation. All rights reserved.
++ *
++ * Permission to use, copy, modify, and/or distribute this software for any
++ * purpose with or without fee is hereby granted, provided that the above
++ * copyright notice and this permission notice appear in all copies.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
++ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
++ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
++ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ */
++
++#include "ipq6018.dtsi"
++#include "ipq6018-512m.dtsi"
++#include "ipq6018-ess.dtsi"
++
++
++#include <dt-bindings/input/input.h>
++#include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/leds/common.h>
++
++/ {
++    model = "JDCloud AX1800 Pro";
++	compatible = "jdc,ax1800-pro", "qcom,ipq6018-cp03", "qcom,ipq6018";
++
++	aliases {
++		sdhc1 = &sdhc;
++		serial0 = &blsp1_uart3;
++		led-boot = &led_red_1;
++		led-failsafe = &led_red_1;
++		led-running = &led_green_1;
++		led-upgrade = &led_green_1;
++		ethernet1 = &dp2;
++		ethernet2 = &dp3;
++		ethernet3 = &dp4;
++		ethernet4 = &dp5;
++	};
++
++	chosen {
++		bootargs = "console=ttyMSM0,115200,n8";
++		bootargs-append = " rootfstype=squashfs,ext4 swiotlb=1 coherent_pool=2M";
++	};
++
++    gpio_keys {
++        compatible = "gpio-keys";
++        status = "okay";
++
++        joylink {
++            label = "joylink";
++            linux,code = <0x211>;
++            gpios = <&tlmm 0x08 GPIO_ACTIVE_LOW>;
++            linux,input-type = <0x01>;
++            debounce-interval = <0x3c>;
++        };
++
++        reset {
++            label = "reset";
++            linux,code = <0x198>;
++            gpios = <&tlmm 0x09 GPIO_ACTIVE_LOW>;
++            linux,input-type = <0x01>;
++            debounce-interval = <0x3c>;
++        };
++    };
++    
++    leds {
++        compatible = "gpio-leds";
++
++        led_blue_1: led@35 {
++            label = "led_b1";
++            gpio = <&tlmm 0x23 GPIO_ACTIVE_HIGH>;
++        };
++
++       led_red_1: led@37 {
++            label = "led_r1";
++            gpio = <&tlmm 0x25 GPIO_ACTIVE_HIGH>;
++        };
++
++        led_green_1: led@50 {
++            label = "led_g1";
++            gpio = <&tlmm 0x32 GPIO_ACTIVE_HIGH>;
++        };
++
++        led_blue_2: led@30 {
++            label = "led_b2";
++            gpio = <&tlmm 0x1e GPIO_ACTIVE_HIGH>;
++        };
++
++        led_red_2: led@32 {
++            label = "led_r2";
++            gpio = <&tlmm 0x20 GPIO_ACTIVE_HIGH>;
++        };
++
++        led_green_2: led@33 {
++            label = "led_g2";
++            gpio = <&tlmm 0x21 GPIO_ACTIVE_HIGH>;
++        };
++
++        led_blue_3:led@31 {
++            label = "led_b3";
++            gpio = <&tlmm 0x1f GPIO_ACTIVE_HIGH>;
++        };
++
++        led_red_3: led@29 {
++            label = "led_r3";
++            gpio = <&tlmm 0x1d GPIO_ACTIVE_HIGH>;
++        };
++
++        led_green_3: led@34 {
++            label = "led_g3";
++            gpio = <&tlmm 0x22 GPIO_ACTIVE_HIGH>;
++        };
++    };
++};
++
++&tlmm {
++    compatible = "qcom,ipq6000-pinctrl";
++
++    spi_1_pins: spi_1_pins {
++        mux {
++            pins = "gpio38","gpio39","gpio40","gpio41";
++            function = "blsp0_spi";
++            drive-strength = <0x08>;
++            bias-pull-down;
++        };
++    };
++
++    button_pins: button_pins {
++        joylink_button {
++            pins = "gpio8";
++            function = "gpio";
++            drive-strength = <0x08>;
++            bias-pull-up;
++        };
++
++        reset_button {
++            pins = "gpio9";
++            function = "gpio";
++            drive-strength = <0x08>;
++            bias-pull-up;
++        };
++    };
++
++    mdio_pinmux: mdio_pinmux {
++        mux_0 {
++            pins = "gpio64";
++            function = "mdc";
++            drive-strength = <0x08>;
++            bias-pull-up;
++        };
++
++        mux_1 {
++            pins = "gpio65";
++            function = "mdio";
++            drive-strength = <0x08>;
++            bias-pull-up;
++        };
++
++        mux_2 {
++            pins = "gpio75";
++            function = "gpio";
++            bias-pull-up;
++        };
++    };
++
++    leds_pins: leds_pins {
++        led_b1 {
++            pins = "gpio35";
++            function = "gpio";
++            drive-strength = <0x08>;
++            bias-pull-down;
++        };
++
++        led_r1 {
++            pins = "gpio37";
++            function = "gpio";
++            drive-strength = <0x08>;
++            bias-pull-down;
++        };
++
++        led_g1 {
++            pins = "gpio50";
++            function = "gpio";
++            drive-strength = <0x08>;
++            bias-pull-down;
++        };
++
++        led_b2 {
++            pins = "gpio30";
++            function = "gpio";
++            drive-strength = <0x08>;
++            bias-pull-down;
++        };
++
++        led_r2 {
++            pins = "gpio32";
++            function = "gpio";
++            drive-strength = <0x08>;
++            bias-pull-down;
++        };
++
++        led_g2 {
++            pins = "gpio33";
++            function = "gpio";
++            drive-strength = <0x08>;
++            bias-pull-down;
++        };
++
++        led_b3 {
++            pins = "gpio31";
++            function = "gpio";
++            drive-strength = <0x08>;
++            bias-pull-down;
++        };
++
++        led_r3 {
++            pins = "gpio29";
++            function = "gpio";
++            drive-strength = <0x08>;
++            bias-pull-down;
++        };
++
++        led_g3 {
++            pins = "gpio34";
++            function = "gpio";
++            drive-strength = <0x08>;
++            bias-pull-down;
++        };
++    };
++};
++
++
++&blsp1_uart3 {
++	pinctrl-0 = <&serial_3_pins>;
++	pinctrl-names = "default";
++	status = "okay";
++};
++
++&blsp1_spi1 {
++	pinctrl-0 = <&spi_1_pins>;
++	pinctrl-names = "default";
++	cs-select = <0>;
++	status = "okay";
++
++	m25p80@0 {
++		#address-cells = <1>;
++		#size-cells = <1>;
++		reg = <0>;
++		compatible = "n25q128a11";
++		linux,modalias = "m25p80", "n25q128a11";
++		spi-max-frequency = <50000000>;
++		use-default-sizes;
++	};
++};
++
++&prng {
++	status = "okay";
++};
++
++&cryptobam {
++	status = "okay";
++};
++
++&crypto {
++	status = "okay";
++};
++
++&qpic_bam {
++	status = "okay";
++};
++
++&qusb_phy_0 {
++	status = "okay";
++};
++
++&qusb_phy_1 {
++	status = "okay";
++};
++
++
++&ssphy_0 {
++	status = "okay";
++};
++
++&usb3 {
++	status = "okay";
++};
++
++&usb2 {
++	status = "okay";
++};
++
++&edma {
++	status = "okay";
++};
++
++&rpm {
++	status = "disabled";
++};
++
++&mdio {
++	status = "okay";
++
++	pinctrl-0 = <&mdio_pinmux>;
++	pinctrl-names = "default";
++	reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>;
++
++    ethernet_0: ethernet-phy-package@0 {
++        compatible = "qcom,qca8075-package";
++        #address-cells = <1>;
++        #size-cells = <0>;
++        reg = <0>;
++		qcom,package-mode = "psgmii";
++
++        qca8075_1: ethernet-phy@1 {
++            compatible = "ethernet-phy-ieee802.3-c22";
++            reg = <1>;
++        };
++
++        qca8075_2: ethernet-phy@2 {
++            compatible = "ethernet-phy-ieee802.3-c22";
++            reg = <2>;
++        };
++
++        qca8075_3: ethernet-phy@3 {
++            compatible = "ethernet-phy-ieee802.3-c22";
++            reg = <3>;
++        };
++
++        qca8075_4: ethernet-phy@4 {
++            compatible = "ethernet-phy-ieee802.3-c22";
++            reg = <4>;
++        };
++    };
++};
++
++&switch {
++	status = "okay";
++
++    switch_lan_bmp = <(0x8 | 0x10 | 0x20)>; /* lan port bitmap */
++	switch_wan_bmp = <0x4>; /* wan port bitmap */
++
++	qcom,port_phyinfo {
++        port@1 {
++            port_id = <2>;
++            phy_address = <1>;
++        };
++
++        port@2 {
++            port_id = <3>;
++            phy_address = <2>;
++        };
++
++        port@3 {
++            port_id = <4>;
++            phy_address = <3>;
++        };
++
++        port@4 {
++            port_id = <5>;
++            phy_address = <4>;
++        };
++	};
++};
++
++&qpic_bam {
++	status = "okay";
++};
++
++&wifi {
++	status = "okay";
++    qcom,ath11k-calibration-variant = "JDC-AX1800-Pro";
++	qcom,ath11k-fw-memory-mode = <1>;
++};
++
++
++&dp2 {
++    phy-handle = <&qca8075_1>;
++    status = "okay";
++};
++
++&dp3 {
++    phy-handle = <&qca8075_2>;
++    status = "okay";
++};
++
++&dp4 {
++    phy-handle = <&qca8075_3>;
++    status = "okay";
++};
++
++&dp5 {
++    phy-handle = <&qca8075_4>;
++	phy-mode = "psgmii";
++    status = "okay";
++};
++
++&sdhc {
++	status = "okay";
++
++	/delete-property/ mmc-hs400-1_8v;
++	mmc-hs200-1_8v;
++	mmc-ddr-1_8v;
++};
++
++&CPU0 {
++	/delete-property/ cpu-supply;
++};
++
++&CPU1 {
++	/delete-property/ cpu-supply;
++};
++
++&CPU2 {
++	/delete-property/ cpu-supply;
++};
++
++&CPU3 {
++	/delete-property/ cpu-supply;
++};
+diff --git a/target/linux/qualcommax/image/ipq60xx.mk b/target/linux/qualcommax/image/ipq60xx.mk
+index 17fd54aa4017b..efc9c8802ad0a 100644
+--- a/target/linux/qualcommax/image/ipq60xx.mk
++++ b/target/linux/qualcommax/image/ipq60xx.mk
+@@ -49,6 +49,21 @@ define Device/glinet_gl-axt1800
+ endef
+ TARGET_DEVICES += glinet_gl-axt1800
+ 
++define Device/jdc_ax1800-pro
++	$(call Device/FitImage)
++	DEVICE_VENDOR := JD Cloud
++	DEVICE_MODEL := JDC AX1800 Pro
++	DEVICE_DTS_CONFIG := config@cp03-c2
++	DEVICE_DTS := ipq6018-jdc-ax1800-pro
++	SOC := ipq6018
++	DEVICE_PACKAGES := ipq-wifi-jdc_ax1800-pro kmod-fs-ext4 mkf2fs f2fsck kmod-fs-f2fs
++	BLOCKSIZE := 64k
++	KERNEL_SIZE := 6144k
++	IMAGES += factory.bin
++	IMAGE/factory.bin := append-kernel | pad-to 6144k |  append-rootfs | append-metadata
++endef
++TARGET_DEVICES += jdc_ax1800-pro
++
+ define Device/linksys_mr7350
+ 	$(call Device/FitImage)
+ 	DEVICE_VENDOR := Linksys
+diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/01_leds b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/01_leds
+index a75a2f071308a..6976dbabb6411 100644
+--- a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/01_leds
++++ b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/01_leds
+@@ -11,6 +11,9 @@ cmiot,ax18)
+ 	ucidef_set_led_netdev "wlan2g" "WLAN2G" "blue:wlan2g" "wlan1"
+ 	ucidef_set_led_netdev "wlan5g" "WLAN5G" "blue:wlan5g" "wlan0"
+ 	;;
++jdc,ax1800-pro)
++        ucidef_set_led_netdev "wan" "WAN" "net_blue" "eth3"
++        ;;
+ redmi,ax5-*|\
+ xiaomi,rm1800)
+ 	ucidef_set_led_netdev "internet" "Internet" "blue:network" "wan"
+diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network
+index ead1fb8f0fa57..cb743fa38c199 100644
+--- a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network
++++ b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network
+@@ -24,6 +24,9 @@ ipq60xx_setup_interfaces()
+ 	glinet,gl-axt1800)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2" "wan"
+ 		;;
++	jdc,ax1800-pro)
++		ucidef_set_interfaces_lan_wan "eth0 eth1 eth2" "eth3"
++		;;
+ 	*)
+ 		echo "Unsupported hardware. Network interfaces not initialized"
+ 		;;
+diff --git a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
+index f148438b3335d..bc30e8cc423db 100644
+--- a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
++++ b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
+@@ -15,6 +15,7 @@ case "$FIRMWARE" in
+ 	zn,m2)
+ 		caldata_extract "0:art" 0x1000 0x10000
+ 		;;
++	jdc,ax1800-pro|\
+ 	redmi,ax5-jdcloud)
+ 		caldata_extract_mmc "0:ART" 0x1000 0x10000
+ 		;;
+diff --git a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/mmc.sh b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/mmc.sh
+new file mode 100644
+index 0000000000000..dac9ddd568654
+--- /dev/null
++++ b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/mmc.sh
+@@ -0,0 +1,83 @@
++#
++# Copyright (C) 2016 lede-project.org
++#
++
++# this can be used as a generic mmc upgrade script
++# just add a device entry in platform.sh, 
++# define "kernelname" and "rootfsname" and call mmc_do_upgrade
++# after the kernel and rootfs flash a loopdev (as overlay) is 
++# setup on top of the rootfs partition
++# for the proper function a padded rootfs image is needed, basically 
++# append "pad-to 64k" to the image definition
++# this is based on the ipq806x zyxel.sh mmc upgrade
++
++. /lib/functions.sh
++
++mmc_do_upgrade() {
++	local tar_file="$1"
++	local rootfs=
++	local kernel=
++
++			[ -z "$kernel" ] && kernel=$(find_mmc_part ${kernelname})
++			[ -z "$rootfs" ] && rootfs=$(find_mmc_part ${rootfsname})
++
++			[ -z "$kernel" ] && echo "Upgrade failed: kernel partition not found! Rebooting..." && reboot -f
++			[ -z "$rootfs" ] && echo "Upgrade failed: rootfs partition not found! Rebooting..." && reboot -f
++
++	mmc_do_flash $tar_file $kernel $rootfs
++
++	return 0
++}
++
++mmc_do_flash() {
++	local tar_file=$1
++	local kernel=$2
++	local rootfs=$3
++	
++	# keep sure its unbound
++	losetup --detach-all || {
++		echo Failed to detach all loop devices. Skip this try.
++		reboot -f
++	}
++
++	# use the first found directory in the tar archive
++	local board_dir=$(tar tf $tar_file | grep -m 1 '^sysupgrade-.*/$')
++	board_dir=${board_dir%/}
++
++	echo "flashing kernel to $kernel"
++	tar xf $tar_file ${board_dir}/kernel -O >$kernel
++
++	echo "flashing rootfs to ${rootfs}"
++	tar xf $tar_file ${board_dir}/root -O >"${rootfs}"
++
++	# a padded rootfs is needed for overlay fs creation
++	local offset=$(tar xf $tar_file ${board_dir}/root -O | wc -c)
++	[ $offset -lt 65536 ] && {
++		echo Wrong size for rootfs: $offset
++		sleep 10
++		reboot -f
++	}
++
++	# Mount loop for rootfs_data
++	local loopdev="$(losetup -f)"
++	losetup -o $offset $loopdev $rootfs || {
++		echo "Failed to mount looped rootfs_data."
++		sleep 10
++		reboot -f
++	}
++
++	echo "Format new rootfs_data at position ${offset}."
++	mkfs.ext4 -F -L rootfs_data $loopdev
++	mkdir /tmp/new_root
++	mount -t ext4 $loopdev /tmp/new_root && {
++		echo "Saving config to rootfs_data at position ${offset}."
++		cp -v "$UPGRADE_BACKUP" "/tmp/new_root/$BACKUP_FILE"
++		umount /tmp/new_root
++	}
++
++	# Cleanup
++	losetup -d $loopdev >/dev/null 2>&1
++	sync
++	umount -a
++	reboot -f
++}
+diff --git a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh
+index 3c01d8dd967c4..d4c5072de7b13 100644
+--- a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh
++++ b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh
+@@ -14,6 +14,11 @@ platform_do_upgrade() {
+ 	glinet,gl-ax1800)
+ 		nand_do_upgrade "$1"
+ 		;;
++	jdc,ax1800-pro)
++		kernelname="0:HLOS"
++		rootfsname="rootfs"
++		mmc_do_upgrade "$1"
++		;;
+ 	*)
+ 		default_do_upgrade "$1"
+ 		;;
+diff --git a/target/linux/qualcommax/patches-6.1/2000-drivers-pinctrl-qcom-add-ipq6000-support.patch b/target/linux/qualcommax/patches-6.1/2000-drivers-pinctrl-qcom-add-ipq6000-support.patch
+new file mode 100644
+index 0000000000000..d856e56fbef64
+--- /dev/null
++++ b/target/linux/qualcommax/patches-6.1/2000-drivers-pinctrl-qcom-add-ipq6000-support.patch
+@@ -0,0 +1,1133 @@
++From 192ce4f2a695c1d6ed72ac1a1b69f125ada9d4c3 Mon Sep 17 00:00:00 2001
++From: JiaY-shi <[email protected]>
++Date: Tue, 28 Nov 2023 23:31:57 +0800
++Subject: [PATCH] drivers: pinctrl: qcom: add ipq6000 support
++
++---
++ drivers/pinctrl/qcom/Makefile          |    1 +
++ drivers/pinctrl/qcom/pinctrl-ipq6000.c | 1101 ++++++++++++++++++++++++
++ 2 files changed, 1102 insertions(+)
++ create mode 100644 drivers/pinctrl/qcom/pinctrl-ipq6000.c
++
++diff --git a/drivers/pinctrl/qcom/Makefile b/drivers/pinctrl/qcom/Makefile
++index 8269a1db8794..0db75e183ca0 100644
++--- a/drivers/pinctrl/qcom/Makefile
+++++ b/drivers/pinctrl/qcom/Makefile
++@@ -6,6 +6,7 @@ obj-$(CONFIG_PINCTRL_APQ8084)	+= pinctrl-apq8084.o
++ obj-$(CONFIG_PINCTRL_IPQ4019)	+= pinctrl-ipq4019.o
++ obj-$(CONFIG_PINCTRL_IPQ8064)	+= pinctrl-ipq8064.o
++ obj-$(CONFIG_PINCTRL_IPQ8074)	+= pinctrl-ipq8074.o
+++obj-$(CONFIG_PINCTRL_IPQ6018)	+= pinctrl-ipq6000.o
++ obj-$(CONFIG_PINCTRL_IPQ6018)	+= pinctrl-ipq6018.o
++ obj-$(CONFIG_PINCTRL_MSM8226)	+= pinctrl-msm8226.o
++ obj-$(CONFIG_PINCTRL_MSM8660)	+= pinctrl-msm8660.o
++diff --git a/drivers/pinctrl/qcom/pinctrl-ipq6000.c b/drivers/pinctrl/qcom/pinctrl-ipq6000.c
++new file mode 100644
++index 000000000000..cd7b16ed695d
++--- /dev/null
+++++ b/drivers/pinctrl/qcom/pinctrl-ipq6000.c
++@@ -0,0 +1,1101 @@
+++// SPDX-License-Identifier: GPL-2.0
+++/*
+++ * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
+++ */
+++
+++#include <linux/module.h>
+++#include <linux/of.h>
+++#include <linux/platform_device.h>
+++#include <linux/pinctrl/pinctrl.h>
+++
+++#include "pinctrl-msm.h"
+++
+++#define FUNCTION(fname)			                \
+++	[msm_mux_##fname] = {		                \
+++		.name = #fname,				\
+++		.groups = fname##_groups,               \
+++		.ngroups = ARRAY_SIZE(fname##_groups),	\
+++	}
+++
+++#define REG_SIZE 0x1000
+++#define PINGROUP(id, f1, f2, f3, f4, f5, f6, f7, f8, f9)	\
+++	{					        \
+++		.name = "gpio" #id,			\
+++		.pins = gpio##id##_pins,		\
+++		.npins = (unsigned int)ARRAY_SIZE(gpio##id##_pins),	\
+++		.funcs = (int[]){			\
+++			msm_mux_gpio, /* gpio mode */	\
+++			msm_mux_##f1,			\
+++			msm_mux_##f2,			\
+++			msm_mux_##f3,			\
+++			msm_mux_##f4,			\
+++			msm_mux_##f5,			\
+++			msm_mux_##f6,			\
+++			msm_mux_##f7,			\
+++			msm_mux_##f8,			\
+++			msm_mux_##f9			\
+++		},				        \
+++		.nfuncs = 10,				\
+++		.ctl_reg = REG_SIZE * id,			\
+++		.io_reg = 0x4 + REG_SIZE * id,		\
+++		.intr_cfg_reg = 0x8 + REG_SIZE * id,		\
+++		.intr_status_reg = 0xc + REG_SIZE * id,	\
+++		.intr_target_reg = 0x8 + REG_SIZE * id,	\
+++		.mux_bit = 2,			\
+++		.pull_bit = 0,			\
+++		.drv_bit = 6,			\
+++		.oe_bit = 9,			\
+++		.in_bit = 0,			\
+++		.out_bit = 1,			\
+++		.intr_enable_bit = 0,		\
+++		.intr_status_bit = 0,		\
+++		.intr_target_bit = 5,		\
+++		.intr_target_kpss_val = 3,	\
+++		.intr_raw_status_bit = 4,	\
+++		.intr_polarity_bit = 1,		\
+++		.intr_detection_bit = 2,	\
+++		.intr_detection_width = 2,	\
+++	}
+++
+++static const struct pinctrl_pin_desc ipq6018_pins[] = {
+++	PINCTRL_PIN(0, "GPIO_0"),
+++	PINCTRL_PIN(1, "GPIO_1"),
+++	PINCTRL_PIN(2, "GPIO_2"),
+++	PINCTRL_PIN(3, "GPIO_3"),
+++	PINCTRL_PIN(4, "GPIO_4"),
+++	PINCTRL_PIN(5, "GPIO_5"),
+++	PINCTRL_PIN(6, "GPIO_6"),
+++	PINCTRL_PIN(7, "GPIO_7"),
+++	PINCTRL_PIN(8, "GPIO_8"),
+++	PINCTRL_PIN(9, "GPIO_9"),
+++	PINCTRL_PIN(10, "GPIO_10"),
+++	PINCTRL_PIN(11, "GPIO_11"),
+++	PINCTRL_PIN(12, "GPIO_12"),
+++	PINCTRL_PIN(13, "GPIO_13"),
+++	PINCTRL_PIN(14, "GPIO_14"),
+++	PINCTRL_PIN(15, "GPIO_15"),
+++	PINCTRL_PIN(16, "GPIO_16"),
+++	PINCTRL_PIN(17, "GPIO_17"),
+++	PINCTRL_PIN(18, "GPIO_18"),
+++	PINCTRL_PIN(19, "GPIO_19"),
+++
+++	PINCTRL_PIN(21, "GPIO_21"),
+++	PINCTRL_PIN(22, "GPIO_22"),
+++	PINCTRL_PIN(23, "GPIO_23"),
+++	PINCTRL_PIN(24, "GPIO_24"),
+++	PINCTRL_PIN(25, "GPIO_25"),
+++	PINCTRL_PIN(26, "GPIO_26"),
+++	PINCTRL_PIN(27, "GPIO_27"),
+++	PINCTRL_PIN(28, "GPIO_28"),
+++	PINCTRL_PIN(29, "GPIO_29"),
+++	PINCTRL_PIN(30, "GPIO_30"),
+++	PINCTRL_PIN(31, "GPIO_31"),
+++	PINCTRL_PIN(32, "GPIO_32"),
+++	PINCTRL_PIN(33, "GPIO_33"),
+++	PINCTRL_PIN(34, "GPIO_34"),
+++	PINCTRL_PIN(35, "GPIO_35"),
+++	PINCTRL_PIN(36, "GPIO_36"),
+++	PINCTRL_PIN(37, "GPIO_37"),
+++	PINCTRL_PIN(38, "GPIO_38"),
+++	PINCTRL_PIN(39, "GPIO_39"),
+++	PINCTRL_PIN(40, "GPIO_40"),
+++	PINCTRL_PIN(41, "GPIO_41"),
+++	PINCTRL_PIN(42, "GPIO_42"),
+++	PINCTRL_PIN(43, "GPIO_43"),
+++	PINCTRL_PIN(44, "GPIO_44"),
+++	PINCTRL_PIN(45, "GPIO_45"),
+++	PINCTRL_PIN(46, "GPIO_46"),
+++	PINCTRL_PIN(47, "GPIO_47"),
+++	PINCTRL_PIN(48, "GPIO_48"),
+++	PINCTRL_PIN(49, "GPIO_49"),
+++	PINCTRL_PIN(50, "GPIO_50"),
+++	PINCTRL_PIN(51, "GPIO_51"),
+++	PINCTRL_PIN(52, "GPIO_52"),
+++	PINCTRL_PIN(53, "GPIO_53"),
+++	PINCTRL_PIN(54, "GPIO_54"),
+++	PINCTRL_PIN(55, "GPIO_55"),
+++	PINCTRL_PIN(56, "GPIO_56"),
+++	PINCTRL_PIN(57, "GPIO_57"),
+++	PINCTRL_PIN(58, "GPIO_58"),
+++	PINCTRL_PIN(59, "GPIO_59"),
+++	PINCTRL_PIN(60, "GPIO_60"),
+++	PINCTRL_PIN(61, "GPIO_61"),
+++	PINCTRL_PIN(62, "GPIO_62"),
+++	PINCTRL_PIN(63, "GPIO_63"),
+++	PINCTRL_PIN(64, "GPIO_64"),
+++	PINCTRL_PIN(65, "GPIO_65"),
+++	PINCTRL_PIN(66, "GPIO_66"),
+++	PINCTRL_PIN(67, "GPIO_67"),
+++	PINCTRL_PIN(68, "GPIO_68"),
+++	PINCTRL_PIN(69, "GPIO_69"),
+++	PINCTRL_PIN(70, "GPIO_70"),
+++	PINCTRL_PIN(71, "GPIO_71"),
+++	PINCTRL_PIN(72, "GPIO_72"),
+++	PINCTRL_PIN(73, "GPIO_73"),
+++	PINCTRL_PIN(74, "GPIO_74"),
+++	PINCTRL_PIN(75, "GPIO_75"),
+++	PINCTRL_PIN(76, "GPIO_76"),
+++	PINCTRL_PIN(77, "GPIO_77"),
+++	PINCTRL_PIN(78, "GPIO_78"),
+++	PINCTRL_PIN(79, "GPIO_79"),
+++};
+++
+++#define DECLARE_MSM_GPIO_PINS(pin) \
+++	static const unsigned int gpio##pin##_pins[] = { pin }
+++DECLARE_MSM_GPIO_PINS(0);
+++DECLARE_MSM_GPIO_PINS(1);
+++DECLARE_MSM_GPIO_PINS(2);
+++DECLARE_MSM_GPIO_PINS(3);
+++DECLARE_MSM_GPIO_PINS(4);
+++DECLARE_MSM_GPIO_PINS(5);
+++DECLARE_MSM_GPIO_PINS(6);
+++DECLARE_MSM_GPIO_PINS(7);
+++DECLARE_MSM_GPIO_PINS(8);
+++DECLARE_MSM_GPIO_PINS(9);
+++DECLARE_MSM_GPIO_PINS(10);
+++DECLARE_MSM_GPIO_PINS(11);
+++DECLARE_MSM_GPIO_PINS(12);
+++DECLARE_MSM_GPIO_PINS(13);
+++DECLARE_MSM_GPIO_PINS(14);
+++DECLARE_MSM_GPIO_PINS(15);
+++DECLARE_MSM_GPIO_PINS(16);
+++DECLARE_MSM_GPIO_PINS(17);
+++DECLARE_MSM_GPIO_PINS(18);
+++DECLARE_MSM_GPIO_PINS(19);
+++
+++DECLARE_MSM_GPIO_PINS(21);
+++DECLARE_MSM_GPIO_PINS(22);
+++DECLARE_MSM_GPIO_PINS(23);
+++DECLARE_MSM_GPIO_PINS(24);
+++DECLARE_MSM_GPIO_PINS(25);
+++DECLARE_MSM_GPIO_PINS(26);
+++DECLARE_MSM_GPIO_PINS(27);
+++DECLARE_MSM_GPIO_PINS(28);
+++DECLARE_MSM_GPIO_PINS(29);
+++DECLARE_MSM_GPIO_PINS(30);
+++DECLARE_MSM_GPIO_PINS(31);
+++DECLARE_MSM_GPIO_PINS(32);
+++DECLARE_MSM_GPIO_PINS(33);
+++DECLARE_MSM_GPIO_PINS(34);
+++DECLARE_MSM_GPIO_PINS(35);
+++DECLARE_MSM_GPIO_PINS(36);
+++DECLARE_MSM_GPIO_PINS(37);
+++DECLARE_MSM_GPIO_PINS(38);
+++DECLARE_MSM_GPIO_PINS(39);
+++DECLARE_MSM_GPIO_PINS(40);
+++DECLARE_MSM_GPIO_PINS(41);
+++DECLARE_MSM_GPIO_PINS(42);
+++DECLARE_MSM_GPIO_PINS(43);
+++DECLARE_MSM_GPIO_PINS(44);
+++DECLARE_MSM_GPIO_PINS(45);
+++DECLARE_MSM_GPIO_PINS(46);
+++DECLARE_MSM_GPIO_PINS(47);
+++DECLARE_MSM_GPIO_PINS(48);
+++DECLARE_MSM_GPIO_PINS(49);
+++DECLARE_MSM_GPIO_PINS(50);
+++DECLARE_MSM_GPIO_PINS(51);
+++DECLARE_MSM_GPIO_PINS(52);
+++DECLARE_MSM_GPIO_PINS(53);
+++DECLARE_MSM_GPIO_PINS(54);
+++DECLARE_MSM_GPIO_PINS(55);
+++DECLARE_MSM_GPIO_PINS(56);
+++DECLARE_MSM_GPIO_PINS(57);
+++DECLARE_MSM_GPIO_PINS(58);
+++DECLARE_MSM_GPIO_PINS(59);
+++DECLARE_MSM_GPIO_PINS(60);
+++DECLARE_MSM_GPIO_PINS(61);
+++DECLARE_MSM_GPIO_PINS(62);
+++DECLARE_MSM_GPIO_PINS(63);
+++DECLARE_MSM_GPIO_PINS(64);
+++DECLARE_MSM_GPIO_PINS(65);
+++DECLARE_MSM_GPIO_PINS(66);
+++DECLARE_MSM_GPIO_PINS(67);
+++DECLARE_MSM_GPIO_PINS(68);
+++DECLARE_MSM_GPIO_PINS(69);
+++DECLARE_MSM_GPIO_PINS(70);
+++DECLARE_MSM_GPIO_PINS(71);
+++DECLARE_MSM_GPIO_PINS(72);
+++DECLARE_MSM_GPIO_PINS(73);
+++DECLARE_MSM_GPIO_PINS(74);
+++DECLARE_MSM_GPIO_PINS(75);
+++DECLARE_MSM_GPIO_PINS(76);
+++DECLARE_MSM_GPIO_PINS(77);
+++DECLARE_MSM_GPIO_PINS(78);
+++DECLARE_MSM_GPIO_PINS(79);
+++
+++enum ipq6018_functions {
+++	msm_mux_atest_char,
+++	msm_mux_atest_char0,
+++	msm_mux_atest_char1,
+++
+++	msm_mux_atest_char3,
+++	msm_mux_audio0,
+++	msm_mux_audio1,
+++	msm_mux_audio2,
+++	msm_mux_audio3,
+++	msm_mux_audio_rxbclk,
+++	msm_mux_audio_rxfsync,
+++	msm_mux_audio_rxmclk,
+++	msm_mux_audio_rxmclkin,
+++	msm_mux_audio_txbclk,
+++	msm_mux_audio_txfsync,
+++	msm_mux_audio_txmclk,
+++	msm_mux_audio_txmclkin,
+++	msm_mux_blsp0_i2c,
+++	msm_mux_blsp0_spi,
+++	msm_mux_blsp0_uart,
+++	msm_mux_blsp1_i2c,
+++	msm_mux_blsp1_spi,
+++	msm_mux_blsp1_uart,
+++	msm_mux_blsp2_i2c,
+++	msm_mux_blsp2_spi,
+++	msm_mux_blsp2_uart,
+++	msm_mux_blsp3_i2c,
+++	msm_mux_blsp3_spi,
+++	msm_mux_blsp3_uart,
+++	msm_mux_blsp4_i2c,
+++	msm_mux_blsp4_spi,
+++	msm_mux_blsp4_uart,
+++	msm_mux_blsp5_i2c,
+++	msm_mux_blsp5_uart,
+++	msm_mux_burn0,
+++	msm_mux_burn1,
+++	msm_mux_cri_trng,
+++	msm_mux_cri_trng0,
+++	msm_mux_cri_trng1,
+++	msm_mux_cxc0,
+++	msm_mux_cxc1,
+++	msm_mux_dbg_out,
+++	msm_mux_gcc_plltest,
+++	msm_mux_gcc_tlmm,
+++	msm_mux_gpio,
+++	msm_mux_lpass_aud,
+++	msm_mux_lpass_aud0,
+++	msm_mux_lpass_aud1,
+++	msm_mux_lpass_aud2,
+++	msm_mux_lpass_pcm,
+++	msm_mux_lpass_pdm,
+++	msm_mux_mac00,
+++	msm_mux_mac01,
+++	msm_mux_mac10,
+++	msm_mux_mac11,
+++	msm_mux_mac12,
+++	msm_mux_mac13,
+++	msm_mux_mac20,
+++	msm_mux_mac21,
+++	msm_mux_mdc,
+++	msm_mux_mdio,
+++	msm_mux_pcie0_clk,
+++	msm_mux_pcie0_rst,
+++	msm_mux_pcie0_wake,
+++	msm_mux_prng_rosc,
+++	msm_mux_pta1_0,
+++	msm_mux_pta1_1,
+++	msm_mux_pta1_2,
+++	msm_mux_pta2_0,
+++	msm_mux_pta2_1,
+++	msm_mux_pta2_2,
+++	msm_mux_pwm00,
+++	msm_mux_pwm01,
+++	msm_mux_pwm02,
+++	msm_mux_pwm03,
+++	msm_mux_pwm04,
+++	msm_mux_pwm10,
+++	msm_mux_pwm11,
+++	msm_mux_pwm12,
+++	msm_mux_pwm13,
+++	msm_mux_pwm14,
+++
+++	msm_mux_pwm21,
+++	msm_mux_pwm22,
+++	msm_mux_pwm23,
+++	msm_mux_pwm24,
+++	msm_mux_pwm30,
+++	msm_mux_pwm31,
+++	msm_mux_pwm32,
+++	msm_mux_pwm33,
+++	msm_mux_qdss_cti_trig_in_a0,
+++	msm_mux_qdss_cti_trig_in_a1,
+++	msm_mux_qdss_cti_trig_out_a0,
+++	msm_mux_qdss_cti_trig_out_a1,
+++	msm_mux_qdss_cti_trig_in_b0,
+++	msm_mux_qdss_cti_trig_in_b1,
+++	msm_mux_qdss_cti_trig_out_b0,
+++	msm_mux_qdss_cti_trig_out_b1,
+++	msm_mux_qdss_traceclk_a,
+++	msm_mux_qdss_tracectl_a,
+++	msm_mux_qdss_tracedata_a,
+++	msm_mux_qdss_traceclk_b,
+++	msm_mux_qdss_tracectl_b,
+++	msm_mux_qdss_tracedata_b,
+++	msm_mux_qpic_pad,
+++	msm_mux_rx0,
+++	msm_mux_rx1,
+++	msm_mux_rx_swrm,
+++	msm_mux_rx_swrm0,
+++	msm_mux_rx_swrm1,
+++	msm_mux_sd_card,
+++	msm_mux_sd_write,
+++	msm_mux_tsens_max,
+++	msm_mux_tx_swrm,
+++	msm_mux_tx_swrm0,
+++	msm_mux_tx_swrm1,
+++	msm_mux_tx_swrm2,
+++	msm_mux_wci20,
+++	msm_mux_wci21,
+++	msm_mux_wci22,
+++	msm_mux_wci23,
+++	msm_mux_wsa_swrm,
+++	msm_mux__,
+++};
+++
+++static const char * const blsp3_uart_groups[] = {
+++	"gpio73", "gpio74", "gpio75", "gpio76",
+++};
+++
+++static const char * const blsp3_i2c_groups[] = {
+++	"gpio73", "gpio74",
+++};
+++
+++static const char * const blsp3_spi_groups[] = {
+++	"gpio73", "gpio74", "gpio75", "gpio76", "gpio77", "gpio78", "gpio79",
+++};
+++
+++static const char * const wci20_groups[] = {
+++	"gpio0", "gpio2",
+++};
+++
+++static const char * const qpic_pad_groups[] = {
+++	"gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio9", "gpio10",
+++	"gpio11", "gpio17", "gpio15", "gpio12", "gpio13", "gpio14", "gpio5",
+++	"gpio6", "gpio7", "gpio8",
+++};
+++
+++static const char * const burn0_groups[] = {
+++	"gpio0",
+++};
+++
+++static const char * const mac12_groups[] = {
+++	"gpio1", "gpio11",
+++};
+++
+++static const char * const qdss_tracectl_b_groups[] = {
+++	"gpio1",
+++};
+++
+++static const char * const burn1_groups[] = {
+++	"gpio1",
+++};
+++
+++static const char * const qdss_traceclk_b_groups[] = {
+++	"gpio0",
+++};
+++
+++static const char * const qdss_tracedata_b_groups[] = {
+++	"gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7", "gpio8", "gpio9",
+++	"gpio10", "gpio11", "gpio12", "gpio13", "gpio14", "gpio15", "gpio16",
+++	"gpio17",
+++};
+++
+++static const char * const mac01_groups[] = {
+++	"gpio3", "gpio4",
+++};
+++
+++static const char * const mac21_groups[] = {
+++	"gpio5", "gpio6",
+++};
+++
+++static const char * const atest_char_groups[] = {
+++	"gpio9",
+++};
+++
+++static const char * const cxc0_groups[] = {
+++	"gpio9", "gpio16",
+++};
+++
+++static const char * const mac13_groups[] = {
+++	"gpio9", "gpio16",
+++};
+++
+++static const char * const dbg_out_groups[] = {
+++	"gpio9",
+++};
+++
+++static const char * const wci22_groups[] = {
+++	"gpio11", "gpio17",
+++};
+++
+++static const char * const pwm00_groups[] = {
+++	"gpio18",
+++};
+++
+++static const char * const atest_char0_groups[] = {
+++	"gpio18",
+++};
+++
+++static const char * const wci23_groups[] = {
+++	"gpio18", "gpio19",
+++};
+++
+++static const char * const mac11_groups[] = {
+++	"gpio18", "gpio19",
+++};
+++
+++static const char * const pwm10_groups[] = {
+++	"gpio19",
+++};
+++
+++static const char * const atest_char1_groups[] = {
+++	"gpio19",
+++};
+++
+++
+++static const char * const pwm30_groups[] = {
+++	"gpio21",
+++};
+++
+++static const char * const atest_char3_groups[] = {
+++	"gpio21",
+++};
+++
+++static const char * const audio_txmclk_groups[] = {
+++	"gpio22",
+++};
+++
+++static const char * const audio_txmclkin_groups[] = {
+++	"gpio22",
+++};
+++
+++static const char * const pwm02_groups[] = {
+++	"gpio22",
+++};
+++
+++static const char * const tx_swrm0_groups[] = {
+++	"gpio22",
+++};
+++
+++static const char * const qdss_cti_trig_out_b0_groups[] = {
+++	"gpio22",
+++};
+++
+++static const char * const audio_txbclk_groups[] = {
+++	"gpio23",
+++};
+++
+++static const char * const pwm12_groups[] = {
+++	"gpio23",
+++};
+++
+++static const char * const wsa_swrm_groups[] = {
+++	"gpio23", "gpio24",
+++};
+++
+++static const char * const tx_swrm1_groups[] = {
+++	"gpio23",
+++};
+++
+++static const char * const qdss_cti_trig_in_b0_groups[] = {
+++	"gpio23",
+++};
+++
+++static const char * const audio_txfsync_groups[] = {
+++	"gpio24",
+++};
+++
+++static const char * const pwm22_groups[] = {
+++	"gpio24",
+++};
+++
+++static const char * const tx_swrm2_groups[] = {
+++	"gpio24",
+++};
+++
+++static const char * const qdss_cti_trig_out_b1_groups[] = {
+++	"gpio24",
+++};
+++
+++static const char * const audio0_groups[] = {
+++	"gpio25", "gpio32",
+++};
+++
+++static const char * const pwm32_groups[] = {
+++	"gpio25",
+++};
+++
+++static const char * const tx_swrm_groups[] = {
+++	"gpio25",
+++};
+++
+++static const char * const qdss_cti_trig_in_b1_groups[] = {
+++	"gpio25",
+++};
+++
+++static const char * const audio1_groups[] = {
+++	"gpio26", "gpio33",
+++};
+++
+++static const char * const pwm04_groups[] = {
+++	"gpio26",
+++};
+++
+++static const char * const audio2_groups[] = {
+++	"gpio27",
+++};
+++
+++static const char * const pwm14_groups[] = {
+++	"gpio27",
+++};
+++
+++static const char * const audio3_groups[] = {
+++	"gpio28",
+++};
+++
+++static const char * const pwm24_groups[] = {
+++	"gpio28",
+++};
+++
+++static const char * const audio_rxmclk_groups[] = {
+++	"gpio29",
+++};
+++
+++static const char * const audio_rxmclkin_groups[] = {
+++	"gpio29",
+++};
+++
+++static const char * const pwm03_groups[] = {
+++	"gpio29",
+++};
+++
+++static const char * const lpass_pdm_groups[] = {
+++	"gpio29", "gpio30", "gpio31", "gpio32",
+++};
+++
+++static const char * const lpass_aud_groups[] = {
+++	"gpio29",
+++};
+++
+++static const char * const qdss_cti_trig_in_a1_groups[] = {
+++	"gpio29",
+++};
+++
+++static const char * const audio_rxbclk_groups[] = {
+++	"gpio30",
+++};
+++
+++static const char * const pwm13_groups[] = {
+++	"gpio30",
+++};
+++
+++static const char * const lpass_aud0_groups[] = {
+++	"gpio30",
+++};
+++
+++static const char * const rx_swrm_groups[] = {
+++	"gpio30",
+++};
+++
+++static const char * const qdss_cti_trig_out_a1_groups[] = {
+++	"gpio30",
+++};
+++
+++static const char * const audio_rxfsync_groups[] = {
+++	"gpio31",
+++};
+++
+++static const char * const pwm23_groups[] = {
+++	"gpio31",
+++};
+++
+++static const char * const lpass_aud1_groups[] = {
+++	"gpio31",
+++};
+++
+++static const char * const rx_swrm0_groups[] = {
+++	"gpio31",
+++};
+++
+++static const char * const qdss_cti_trig_in_a0_groups[] = {
+++	"gpio31",
+++};
+++
+++static const char * const pwm33_groups[] = {
+++	"gpio32",
+++};
+++
+++static const char * const lpass_aud2_groups[] = {
+++	"gpio32",
+++};
+++
+++static const char * const rx_swrm1_groups[] = {
+++	"gpio32",
+++};
+++
+++static const char * const qdss_cti_trig_out_a0_groups[] = {
+++	"gpio32",
+++};
+++
+++static const char * const lpass_pcm_groups[] = {
+++	"gpio34", "gpio35", "gpio36", "gpio37",
+++};
+++
+++static const char * const mac10_groups[] = {
+++	"gpio34", "gpio35",
+++};
+++
+++static const char * const mac00_groups[] = {
+++	"gpio34", "gpio35",
+++};
+++
+++static const char * const mac20_groups[] = {
+++	"gpio36", "gpio37",
+++};
+++
+++static const char * const blsp0_uart_groups[] = {
+++	"gpio38", "gpio39", "gpio40", "gpio41",
+++};
+++
+++static const char * const blsp0_i2c_groups[] = {
+++	"gpio38", "gpio39",
+++};
+++
+++static const char * const blsp0_spi_groups[] = {
+++	"gpio38", "gpio39", "gpio40", "gpio41",
+++};
+++
+++static const char * const blsp2_uart_groups[] = {
+++	"gpio42", "gpio43", "gpio44", "gpio45",
+++};
+++
+++static const char * const blsp2_i2c_groups[] = {
+++	"gpio42", "gpio43",
+++};
+++
+++static const char * const blsp2_spi_groups[] = {
+++	"gpio42", "gpio43", "gpio44", "gpio45",
+++};
+++
+++static const char * const blsp5_i2c_groups[] = {
+++	"gpio46", "gpio47",
+++};
+++
+++static const char * const blsp5_uart_groups[] = {
+++	"gpio48", "gpio49",
+++};
+++
+++static const char * const qdss_traceclk_a_groups[] = {
+++	"gpio48",
+++};
+++
+++static const char * const qdss_tracectl_a_groups[] = {
+++	"gpio49",
+++};
+++
+++static const char * const pwm01_groups[] = {
+++	"gpio50",
+++};
+++
+++static const char * const pta1_1_groups[] = {
+++	"gpio51",
+++};
+++
+++static const char * const pwm11_groups[] = {
+++	"gpio51",
+++};
+++
+++static const char * const rx1_groups[] = {
+++	"gpio51",
+++};
+++
+++static const char * const pta1_2_groups[] = {
+++	"gpio52",
+++};
+++
+++static const char * const pwm21_groups[] = {
+++	"gpio52",
+++};
+++
+++static const char * const pta1_0_groups[] = {
+++	"gpio53",
+++};
+++
+++static const char * const pwm31_groups[] = {
+++	"gpio53",
+++};
+++
+++static const char * const prng_rosc_groups[] = {
+++	"gpio53",
+++};
+++
+++static const char * const blsp4_uart_groups[] = {
+++	"gpio55", "gpio56", "gpio57", "gpio58",
+++};
+++
+++static const char * const blsp4_i2c_groups[] = {
+++	"gpio55", "gpio56",
+++};
+++
+++static const char * const blsp4_spi_groups[] = {
+++	"gpio55", "gpio56", "gpio57", "gpio58",
+++};
+++
+++static const char * const pcie0_clk_groups[] = {
+++	"gpio59",
+++};
+++
+++static const char * const cri_trng0_groups[] = {
+++	"gpio59",
+++};
+++
+++static const char * const pcie0_rst_groups[] = {
+++	"gpio60",
+++};
+++
+++static const char * const cri_trng1_groups[] = {
+++	"gpio60",
+++};
+++
+++static const char * const pcie0_wake_groups[] = {
+++	"gpio61",
+++};
+++
+++static const char * const cri_trng_groups[] = {
+++	"gpio61",
+++};
+++
+++static const char * const sd_card_groups[] = {
+++	"gpio62",
+++};
+++
+++static const char * const sd_write_groups[] = {
+++	"gpio63",
+++};
+++
+++static const char * const rx0_groups[] = {
+++	"gpio63",
+++};
+++
+++static const char * const tsens_max_groups[] = {
+++	"gpio63",
+++};
+++
+++static const char * const mdc_groups[] = {
+++	"gpio64",
+++};
+++
+++static const char * const qdss_tracedata_a_groups[] = {
+++	"gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70",
+++	"gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77",
+++	"gpio78", "gpio79",
+++};
+++
+++static const char * const mdio_groups[] = {
+++	"gpio65",
+++};
+++
+++static const char * const pta2_0_groups[] = {
+++	"gpio66",
+++};
+++
+++static const char * const wci21_groups[] = {
+++	"gpio66", "gpio68",
+++};
+++
+++static const char * const cxc1_groups[] = {
+++	"gpio66", "gpio68",
+++};
+++
+++static const char * const pta2_1_groups[] = {
+++	"gpio67",
+++};
+++
+++static const char * const pta2_2_groups[] = {
+++	"gpio68",
+++};
+++
+++static const char * const blsp1_uart_groups[] = {
+++	"gpio69", "gpio70", "gpio71", "gpio72",
+++};
+++
+++static const char * const blsp1_i2c_groups[] = {
+++	"gpio69", "gpio70",
+++};
+++
+++static const char * const blsp1_spi_groups[] = {
+++	"gpio69", "gpio70", "gpio71", "gpio72",
+++};
+++
+++static const char * const gcc_plltest_groups[] = {
+++	"gpio69", "gpio71",
+++};
+++
+++static const char * const gcc_tlmm_groups[] = {
+++	"gpio70",
+++};
+++
+++static const char * const gpio_groups[] = {
+++	"gpio0", "gpio1", "gpio2", "gpio3", "gpio4", "gpio5", "gpio6", "gpio7",
+++	"gpio8", "gpio9", "gpio10", "gpio11", "gpio12", "gpio13", "gpio14",
+++	"gpio15", "gpio16", "gpio17", "gpio18", "gpio19", "gpio20", "gpio21",
+++	"gpio22", "gpio23", "gpio24", "gpio25", "gpio26", "gpio27", "gpio28",
+++	"gpio29", "gpio30", "gpio31", "gpio32", "gpio33", "gpio34", "gpio35",
+++	"gpio36", "gpio37", "gpio38", "gpio39", "gpio40", "gpio41", "gpio42",
+++	"gpio43", "gpio44", "gpio45", "gpio46", "gpio47", "gpio48", "gpio49",
+++	"gpio50", "gpio51", "gpio52", "gpio53", "gpio54", "gpio55", "gpio56",
+++	"gpio57", "gpio58", "gpio59", "gpio60", "gpio61", "gpio62", "gpio63",
+++	"gpio64", "gpio65", "gpio66", "gpio67", "gpio68", "gpio69", "gpio70",
+++	"gpio71", "gpio72", "gpio73", "gpio74", "gpio75", "gpio76", "gpio77",
+++	"gpio78", "gpio79",
+++};
+++
+++static const struct msm_function ipq6018_functions[] = {
+++	FUNCTION(atest_char),
+++	FUNCTION(atest_char0),
+++	FUNCTION(atest_char1),
+++
+++	FUNCTION(atest_char3),
+++	FUNCTION(audio0),
+++	FUNCTION(audio1),
+++	FUNCTION(audio2),
+++	FUNCTION(audio3),
+++	FUNCTION(audio_rxbclk),
+++	FUNCTION(audio_rxfsync),
+++	FUNCTION(audio_rxmclk),
+++	FUNCTION(audio_rxmclkin),
+++	FUNCTION(audio_txbclk),
+++	FUNCTION(audio_txfsync),
+++	FUNCTION(audio_txmclk),
+++	FUNCTION(audio_txmclkin),
+++	FUNCTION(blsp0_i2c),
+++	FUNCTION(blsp0_spi),
+++	FUNCTION(blsp0_uart),
+++	FUNCTION(blsp1_i2c),
+++	FUNCTION(blsp1_spi),
+++	FUNCTION(blsp1_uart),
+++	FUNCTION(blsp2_i2c),
+++	FUNCTION(blsp2_spi),
+++	FUNCTION(blsp2_uart),
+++	FUNCTION(blsp3_i2c),
+++	FUNCTION(blsp3_spi),
+++	FUNCTION(blsp3_uart),
+++	FUNCTION(blsp4_i2c),
+++	FUNCTION(blsp4_spi),
+++	FUNCTION(blsp4_uart),
+++	FUNCTION(blsp5_i2c),
+++	FUNCTION(blsp5_uart),
+++	FUNCTION(burn0),
+++	FUNCTION(burn1),
+++	FUNCTION(cri_trng),
+++	FUNCTION(cri_trng0),
+++	FUNCTION(cri_trng1),
+++	FUNCTION(cxc0),
+++	FUNCTION(cxc1),
+++	FUNCTION(dbg_out),
+++	FUNCTION(gcc_plltest),
+++	FUNCTION(gcc_tlmm),
+++	FUNCTION(gpio),
+++	FUNCTION(lpass_aud),
+++	FUNCTION(lpass_aud0),
+++	FUNCTION(lpass_aud1),
+++	FUNCTION(lpass_aud2),
+++	FUNCTION(lpass_pcm),
+++	FUNCTION(lpass_pdm),
+++	FUNCTION(mac00),
+++	FUNCTION(mac01),
+++	FUNCTION(mac10),
+++	FUNCTION(mac11),
+++	FUNCTION(mac12),
+++	FUNCTION(mac13),
+++	FUNCTION(mac20),
+++	FUNCTION(mac21),
+++	FUNCTION(mdc),
+++	FUNCTION(mdio),
+++	FUNCTION(pcie0_clk),
+++	FUNCTION(pcie0_rst),
+++	FUNCTION(pcie0_wake),
+++	FUNCTION(prng_rosc),
+++	FUNCTION(pta1_0),
+++	FUNCTION(pta1_1),
+++	FUNCTION(pta1_2),
+++	FUNCTION(pta2_0),
+++	FUNCTION(pta2_1),
+++	FUNCTION(pta2_2),
+++	FUNCTION(pwm00),
+++	FUNCTION(pwm01),
+++	FUNCTION(pwm02),
+++	FUNCTION(pwm03),
+++	FUNCTION(pwm04),
+++	FUNCTION(pwm10),
+++	FUNCTION(pwm11),
+++	FUNCTION(pwm12),
+++	FUNCTION(pwm13),
+++	FUNCTION(pwm14),
+++
+++	FUNCTION(pwm21),
+++	FUNCTION(pwm22),
+++	FUNCTION(pwm23),
+++	FUNCTION(pwm24),
+++	FUNCTION(pwm30),
+++	FUNCTION(pwm31),
+++	FUNCTION(pwm32),
+++	FUNCTION(pwm33),
+++	FUNCTION(qdss_cti_trig_in_a0),
+++	FUNCTION(qdss_cti_trig_in_a1),
+++	FUNCTION(qdss_cti_trig_out_a0),
+++	FUNCTION(qdss_cti_trig_out_a1),
+++	FUNCTION(qdss_cti_trig_in_b0),
+++	FUNCTION(qdss_cti_trig_in_b1),
+++	FUNCTION(qdss_cti_trig_out_b0),
+++	FUNCTION(qdss_cti_trig_out_b1),
+++	FUNCTION(qdss_traceclk_a),
+++	FUNCTION(qdss_tracectl_a),
+++	FUNCTION(qdss_tracedata_a),
+++	FUNCTION(qdss_traceclk_b),
+++	FUNCTION(qdss_tracectl_b),
+++	FUNCTION(qdss_tracedata_b),
+++	FUNCTION(qpic_pad),
+++	FUNCTION(rx0),
+++	FUNCTION(rx1),
+++	FUNCTION(rx_swrm),
+++	FUNCTION(rx_swrm0),
+++	FUNCTION(rx_swrm1),
+++	FUNCTION(sd_card),
+++	FUNCTION(sd_write),
+++	FUNCTION(tsens_max),
+++	FUNCTION(tx_swrm),
+++	FUNCTION(tx_swrm0),
+++	FUNCTION(tx_swrm1),
+++	FUNCTION(tx_swrm2),
+++	FUNCTION(wci20),
+++	FUNCTION(wci21),
+++	FUNCTION(wci22),
+++	FUNCTION(wci23),
+++	FUNCTION(wsa_swrm),
+++};
+++
+++static const struct msm_pingroup ipq6018_groups[] = {
+++	PINGROUP(0, qpic_pad, wci20, qdss_traceclk_b, _, burn0, _, _, _, _),
+++	PINGROUP(1, qpic_pad, mac12, qdss_tracectl_b, _, burn1, _, _, _, _),
+++	PINGROUP(2, qpic_pad, wci20, qdss_tracedata_b, _, _, _, _, _, _),
+++	PINGROUP(3, qpic_pad, mac01, qdss_tracedata_b, _, _, _, _, _, _),
+++	PINGROUP(4, qpic_pad, mac01, qdss_tracedata_b, _, _, _, _, _, _),
+++	PINGROUP(5, qpic_pad, mac21, qdss_tracedata_b, _, _, _, _, _, _),
+++	PINGROUP(6, qpic_pad, mac21, qdss_tracedata_b, _, _, _, _, _, _),
+++	PINGROUP(7, qpic_pad, qdss_tracedata_b, _, _, _, _, _, _, _),
+++	PINGROUP(8, qpic_pad, qdss_tracedata_b, _, _, _, _, _, _, _),
+++	PINGROUP(9, qpic_pad, atest_char, cxc0, mac13, dbg_out, qdss_tracedata_b, _, _, _),
+++	PINGROUP(10, qpic_pad, qdss_tracedata_b, _, _, _, _, _, _, _),
+++	PINGROUP(11, qpic_pad, wci22, mac12, qdss_tracedata_b, _, _, _, _, _),
+++	PINGROUP(12, qpic_pad, qdss_tracedata_b, _, _, _, _, _, _, _),
+++	PINGROUP(13, qpic_pad, qdss_tracedata_b, _, _, _, _, _, _, _),
+++	PINGROUP(14, qpic_pad, qdss_tracedata_b, _, _, _, _, _, _, _),
+++	PINGROUP(15, qpic_pad, qdss_tracedata_b, _, _, _, _, _, _, _),
+++	PINGROUP(16, qpic_pad, cxc0, mac13, qdss_tracedata_b, _, _, _, _, _),
+++	PINGROUP(17, qpic_pad, qdss_tracedata_b, wci22, _, _, _, _, _, _),
+++	PINGROUP(18, pwm00, atest_char0, wci23, mac11, _, _, _, _, _),
+++	PINGROUP(19, pwm10, atest_char1, wci23, mac11, _, _, _, _, _),
+++
+++	PINGROUP(21, pwm30, atest_char3, _, _, _, _, _, _, _),
+++	PINGROUP(22, audio_txmclk, audio_txmclkin, pwm02, tx_swrm0, _, qdss_cti_trig_out_b0, _, _, _),
+++	PINGROUP(23, audio_txbclk, pwm12, wsa_swrm, tx_swrm1, _, qdss_cti_trig_in_b0, _, _, _),
+++	PINGROUP(24, audio_txfsync, pwm22, wsa_swrm, tx_swrm2, _, qdss_cti_trig_out_b1, _, _, _),
+++	PINGROUP(25, audio0, pwm32, tx_swrm, _, qdss_cti_trig_in_b1, _, _, _, _),
+++	PINGROUP(26, audio1, pwm04, _, _, _, _, _, _, _),
+++	PINGROUP(27, audio2, pwm14, _, _, _, _, _, _, _),
+++	PINGROUP(28, audio3, pwm24, _, _, _, _, _, _, _),
+++	PINGROUP(29, audio_rxmclk, audio_rxmclkin, pwm03, lpass_pdm, lpass_aud, qdss_cti_trig_in_a1, _, _, _),
+++	PINGROUP(30, audio_rxbclk, pwm13, lpass_pdm, lpass_aud0, rx_swrm, _, qdss_cti_trig_out_a1, _, _),
+++	PINGROUP(31, audio_rxfsync, pwm23, lpass_pdm, lpass_aud1, rx_swrm0, _, qdss_cti_trig_in_a0, _, _),
+++	PINGROUP(32, audio0, pwm33, lpass_pdm, lpass_aud2, rx_swrm1, _, qdss_cti_trig_out_a0, _, _),
+++	PINGROUP(33, audio1, _, _, _, _, _, _, _, _),
+++	PINGROUP(34, lpass_pcm, mac10, mac00, _, _, _, _, _, _),
+++	PINGROUP(35, lpass_pcm, mac10, mac00, _, _, _, _, _, _),
+++	PINGROUP(36, lpass_pcm, mac20, _, _, _, _, _, _, _),
+++	PINGROUP(37, lpass_pcm, mac20, _, _, _, _, _, _, _),
+++	PINGROUP(38, blsp0_uart, blsp0_i2c, blsp0_spi, _, _, _, _, _, _),
+++	PINGROUP(39, blsp0_uart, blsp0_i2c, blsp0_spi, _, _, _, _, _, _),
+++	PINGROUP(40, blsp0_uart, blsp0_spi, _, _, _, _, _, _, _),
+++	PINGROUP(41, blsp0_uart, blsp0_spi, _, _, _, _, _, _, _),
+++	PINGROUP(42, blsp2_uart, blsp2_i2c, blsp2_spi, _, _, _, _, _, _),
+++	PINGROUP(43, blsp2_uart, blsp2_i2c, blsp2_spi, _, _, _, _, _, _),
+++	PINGROUP(44, blsp2_uart, blsp2_spi, _, _, _, _, _, _, _),
+++	PINGROUP(45, blsp2_uart, blsp2_spi, _, _, _, _, _, _, _),
+++	PINGROUP(46, blsp5_i2c, _, _, _, _, _, _, _, _),
+++	PINGROUP(47, blsp5_i2c, _, _, _, _, _, _, _, _),
+++	PINGROUP(48, blsp5_uart, _, qdss_traceclk_a, _, _, _, _, _, _),
+++	PINGROUP(49, blsp5_uart, _, qdss_tracectl_a, _, _, _, _, _, _),
+++	PINGROUP(50, pwm01, _, _, _, _, _, _, _, _),
+++	PINGROUP(51, pta1_1, pwm11, _, rx1, _, _, _, _, _),
+++	PINGROUP(52, pta1_2, pwm21, _, _, _, _, _, _, _),
+++	PINGROUP(53, pta1_0, pwm31, prng_rosc, _, _, _, _, _, _),
+++	PINGROUP(54, _, _, _, _, _, _, _, _, _),
+++	PINGROUP(55, blsp4_uart, blsp4_i2c, blsp4_spi, _, _, _, _, _, _),
+++	PINGROUP(56, blsp4_uart, blsp4_i2c, blsp4_spi, _, _, _, _, _, _),
+++	PINGROUP(57, blsp4_uart, blsp4_spi, _, _, _, _, _, _, _),
+++	PINGROUP(58, blsp4_uart, blsp4_spi, _, _, _, _, _, _, _),
+++	PINGROUP(59, pcie0_clk, _, _, cri_trng0, _, _, _, _, _),
+++	PINGROUP(60, pcie0_rst, _, _, cri_trng1, _, _, _, _, _),
+++	PINGROUP(61, pcie0_wake, _, _, cri_trng, _, _, _, _, _),
+++	PINGROUP(62, sd_card, _, _, _, _, _, _, _, _),
+++	PINGROUP(63, sd_write, rx0, _, tsens_max, _, _, _, _, _),
+++	PINGROUP(64, mdc, _, qdss_tracedata_a, _, _, _, _, _, _),
+++	PINGROUP(65, mdio, _, qdss_tracedata_a, _, _, _, _, _, _),
+++	PINGROUP(66, pta2_0, wci21, cxc1, qdss_tracedata_a, _, _, _, _, _),
+++	PINGROUP(67, pta2_1, qdss_tracedata_a, _, _, _, _, _, _, _),
+++	PINGROUP(68, pta2_2, wci21, cxc1, qdss_tracedata_a, _, _, _, _, _),
+++	PINGROUP(69, blsp1_uart, blsp1_i2c, blsp1_spi, gcc_plltest, qdss_tracedata_a, _, _, _, _),
+++	PINGROUP(70, blsp1_uart, blsp1_i2c, blsp1_spi, gcc_tlmm, qdss_tracedata_a, _, _, _, _),
+++	PINGROUP(71, blsp1_uart, blsp1_spi, gcc_plltest, qdss_tracedata_a, _, _, _, _, _),
+++	PINGROUP(72, blsp1_uart, blsp1_spi, qdss_tracedata_a, _, _, _, _, _, _),
+++	PINGROUP(73, blsp3_uart, blsp3_i2c, blsp3_spi, _, qdss_tracedata_a, _, _, _, _),
+++	PINGROUP(74, blsp3_uart, blsp3_i2c, blsp3_spi, _, qdss_tracedata_a, _, _, _, _),
+++	PINGROUP(75, blsp3_uart, blsp3_spi, _, qdss_tracedata_a, _, _, _, _, _),
+++	PINGROUP(76, blsp3_uart, blsp3_spi, _, qdss_tracedata_a, _, _, _, _, _),
+++	PINGROUP(77, blsp3_spi, _, qdss_tracedata_a, _, _, _, _, _, _),
+++	PINGROUP(78, blsp3_spi, _, qdss_tracedata_a, _, _, _, _, _, _),
+++	PINGROUP(79, blsp3_spi, _, qdss_tracedata_a, _, _, _, _, _, _),
+++};
+++
+++static const struct msm_pinctrl_soc_data ipq6018_pinctrl = {
+++	.pins = ipq6018_pins,
+++	.npins = ARRAY_SIZE(ipq6018_pins),
+++	.functions = ipq6018_functions,
+++	.nfunctions = ARRAY_SIZE(ipq6018_functions),
+++	.groups = ipq6018_groups,
+++	.ngroups = ARRAY_SIZE(ipq6018_groups),
+++	.ngpios = 79,
+++};
+++
+++static int ipq6018_pinctrl_probe(struct platform_device *pdev)
+++{
+++	return msm_pinctrl_probe(pdev, &ipq6018_pinctrl);
+++}
+++
+++static const struct of_device_id ipq6018_pinctrl_of_match[] = {
+++	{ .compatible = "qcom,ipq6000-pinctrl", },
+++	{ },
+++};
+++
+++static struct platform_driver ipq6018_pinctrl_driver = {
+++	.driver = {
+++		.name = "ipq6000-pinctrl",
+++		.of_match_table = ipq6018_pinctrl_of_match,
+++	},
+++	.probe = ipq6018_pinctrl_probe,
+++	.remove = msm_pinctrl_remove,
+++};
+++
+++static int __init ipq6018_pinctrl_init(void)
+++{
+++	return platform_driver_register(&ipq6018_pinctrl_driver);
+++}
+++arch_initcall(ipq6018_pinctrl_init);
+++
+++static void __exit ipq6018_pinctrl_exit(void)
+++{
+++	platform_driver_unregister(&ipq6018_pinctrl_driver);
+++}
+++module_exit(ipq6018_pinctrl_exit);
+++
+++MODULE_DESCRIPTION("QTI ipq6000 pinctrl driver");
+++MODULE_LICENSE("GPL v2");
+++MODULE_DEVICE_TABLE(of, ipq6018_pinctrl_of_match);
++-- 
++2.25.1
++

+ 15 - 0
devices/qualcommax_ipq807x/.config

@@ -0,0 +1,15 @@
+
+CONFIG_TARGET_qualcommax=y
+CONFIG_TARGET_qualcommax_ipq807x=y
+CONFIG_TARGET_MULTI_PROFILE=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq807x_DEVICE_buffalo_wxr-5950ax12=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq807x_DEVICE_cmcc_rm2-6=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq807x_DEVICE_qnap_301w=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq807x_DEVICE_redmi_ax6=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq807x_DEVICE_xiaomi_ax3600=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq807x_DEVICE_xiaomi_ax9000=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq807x_DEVICE_zte_mf269=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq807x_DEVICE_zyxel_nbg7815=y
+
+CONFIG_PACKAGE_luci-ssl=y uhttpd服务
+

+ 10 - 0
devices/qualcommax_ipq807x/diy.sh

@@ -0,0 +1,10 @@
+#!/bin/bash
+shopt -s extglob
+
+SHELL_FOLDER=$(dirname $(readlink -f "$0"))
+
+git_clone_path master https://github.com/coolsnowwolf/lede target/linux/generic/hack-6.1
+
+rm -rf package/feeds/kiddin9/quectel_Gobinet devices/common/patches/kernel_version.patch devices/common/patches/rootfstargz.patch target/linux/generic/hack-6.1/{410-block-fit-partition-parser.patch,724-net-phy-aquantia*,720-net-phy-add-aqr-phys.patch}
+
+curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/target/linux/generic/pending-6.1/613-netfilter_optional_tcp_window_check.patch -o target/linux/generic/pending-6.1/613-netfilter_optional_tcp_window_check.patch

+ 1 - 5
devices/ipq807x_generic/diy/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dts → devices/qualcommax_ipq807x/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax3600.dts

@@ -86,13 +86,9 @@
 
 &qpic_nand {
 	/delete-node/ partitions;
-	/delete-node/ nand@0;
 
 	nand@0 {
-		reg = <0>;
-		nand-ecc-strength = <4>;
-		nand-ecc-step-size = <512>;
-		nand-bus-width = <8>;
+		/delete-node/ partitions;
 
 		partitions {
 			compatible = "qcom,smem-part";

+ 1 - 5
devices/ipq807x_generic/diy/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8071-ax6.dts → devices/qualcommax_ipq807x/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8071-ax6.dts

@@ -59,13 +59,9 @@
 
 &qpic_nand {
 	/delete-node/ partitions;
-	/delete-node/ nand@0;
 
 	nand@0 {
-		reg = <0>;
-		nand-ecc-strength = <4>;
-		nand-ecc-step-size = <512>;
-		nand-bus-width = <8>;
+		/delete-node/ partitions;
 
 		partitions {
 			compatible = "qcom,smem-part";

+ 1 - 5
devices/ipq807x_generic/diy/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts → devices/qualcommax_ipq807x/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq8072-ax9000.dts

@@ -527,13 +527,9 @@
 
 &qpic_nand {
 	/delete-node/ partitions;
-	/delete-node/ nand@0;
 
 	nand@0 {
-		reg = <0>;
-		nand-ecc-strength = <4>;
-		nand-ecc-step-size = <512>;
-		nand-bus-width = <8>;
+		/delete-node/ partitions;
 
 		partitions {
 			compatible = "qcom,smem-part";

+ 10 - 46
devices/ipq807x_generic/patches/04-stock.patch → devices/qualcommax_ipq807x/patches/04-stock.patch

@@ -1,26 +1,25 @@
---- a/target/linux/ipq807x/image/generic.mk
-+++ b/target/linux/ipq807x/image/generic.mk
-@@ -134,12 +134,7 @@ define Device/xiaomi_ax3600
+--- a/target/linux/qualcommax/image/ipq807x.mk
++++ b/target/linux/qualcommax/image/ipq807x.mk
+@@ -256,12 +256,7 @@ define Device/xiaomi_ax3600
  	PAGESIZE := 2048
  	DEVICE_DTS_CONFIG := config@ac04
  	SOC := ipq8071
 -	KERNEL_SIZE := 36608k
--	DEVICE_PACKAGES := ipq-wifi-xiaomi_ax3600 kmod-ath10k-ct-smallbuffers ath10k-firmware-qca9887-ct
+ 	DEVICE_PACKAGES := ipq-wifi-xiaomi_ax3600 kmod-ath10k-ct-smallbuffers ath10k-firmware-qca9887-ct
 -ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
 -	ARTIFACTS := initramfs-factory.ubi
 -	ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-uImage.itb | ubinize-kernel
 -endif
-+	DEVICE_PACKAGES := ipq-wifi-xiaomi_ax3600 kmod-ath10k-ct-smallbuffers ath10k-firmware-qca9887-ct -kmod-usb3 -kmod-usb-dwc3 -kmod-usb-dwc3-qcom
  endef
  TARGET_DEVICES += xiaomi_ax3600
  
-@@ -152,13 +147,8 @@ define Device/xiaomi_ax9000
+@@ -274,13 +269,8 @@ define Device/xiaomi_ax9000
  	PAGESIZE := 2048
  	DEVICE_DTS_CONFIG := config@hk14
  	SOC := ipq8072
 -	KERNEL_SIZE := 57344k
  	DEVICE_PACKAGES := ipq-wifi-xiaomi_ax9000 kmod-ath11k-pci ath11k-firmware-qcn9074 \
- 	kmod-ath10k-ct ath10k-firmware-qca9887-ct
+ 		kmod-ath10k-ct ath10k-firmware-qca9887-ct
 -ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
 -	ARTIFACTS := initramfs-factory.ubi
 -	ARTIFACT/initramfs-factory.ubi := append-image-stage initramfs-uImage.itb | ubinize-kernel
@@ -29,8 +28,8 @@
  TARGET_DEVICES += xiaomi_ax9000
  
 
---- a/target/linux/ipq807x/base-files/etc/init.d/bootcount
-+++ b/target/linux/ipq807x/base-files/etc/init.d/bootcount
+--- a/target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount
++++ b/target/linux/qualcommax/ipq807x/base-files/etc/init.d/bootcount
 @@ -9,5 +9,13 @@ boot() {
  		# Unset changed flag after sysupgrade complete
  		fw_setenv changed
@@ -47,8 +46,8 @@
  }
  
 
---- a/target/linux/ipq807x/base-files/lib/upgrade/platform.sh
-+++ b/target/linux/ipq807x/base-files/lib/upgrade/platform.sh
+--- a/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
++++ b/target/linux/qualcommax/ipq807x/base-files/lib/upgrade/platform.sh
 @@ -83,20 +83,29 @@ platform_do_upgrade() {
  	redmi,ax6|\
  	xiaomi,ax3600|\
@@ -92,38 +91,3 @@
  		;;
  	*)
 
---- /dev/null
-+++ b/target/linux/ipq807x/base-files/etc/hotplug.d/firmware/11-ath10k-caldata
-@@ -0,0 +1,20 @@
-+#!/bin/sh
-+
-+[ -e /lib/firmware/$FIRMWARE ] && exit 0
-+
-+. /lib/functions/caldata.sh
-+
-+board=$(board_name)
-+
-+case "$FIRMWARE" in
-+"ath10k/cal-pci-0000:01:00.0.bin")
-+	case "$board" in
-+	xiaomi,ax3600)
-+		caldata_extract "0:art" 0x33000 0x844
-+		;;
-+	esac
-+	;;
-+*)
-+	exit 1
-+	;;
-+esac
-
---- a/target/linux/ipq807x/patches-5.15/0102-arm64-dts-ipq8074-add-reserved-memory-nodes.patch
-+++ b/target/linux/ipq807x/patches-5.15/0102-arm64-dts-ipq8074-add-reserved-memory-nodes.patch
-@@ -23,7 +23,7 @@ Signed-off-by: Robert Marko <[email protected]>
-  		#size-cells = <2>;
-  		ranges;
-  
--+		nss@40000000 {
-++		nss_region: nss@40000000 {
- +			no-map;
- +			reg = <0x0 0x40000000 0x0 0x01000000>;
- +		};

+ 30 - 0
devices/qualcommax_ipq807x/patches/kernel_version.patch

@@ -0,0 +1,30 @@
+--- a/scripts/json_overview_image_info.py
++++ b/scripts/json_overview_image_info.py
+@@ -47,7 +47,7 @@ def get_initial_output(image_info):
+ 
+ 
+ if output:
+-    default_packages, output["arch_packages"] = run(
++    default_packages, output["arch_packages"], output["kernel_version"] = run(
+         [
+             "make",
+             "--no-print-directory",
+@@ -55,6 +55,7 @@ def get_initial_output(image_info):
+             "target/linux/",
+             "val.DEFAULT_PACKAGES",
+             "val.ARCH_PACKAGES",
++            "val.LINUX_VERSION",
+             "V=s",
+         ],
+         stdout=PIPE,
+
+--- a/scripts/json_add_image_info.py
++++ b/scripts/json_add_image_info.py
+@@ -55,6 +55,7 @@ def get_titles():
+     "profiles": {
+         device_id: {
+             "image_prefix": getenv("DEVICE_IMG_PREFIX"),
++            "image_initramfs": getenv("KERNEL_INITRAMFS_IMAGE"),
+             "images": [
+                 {
+                     "type": getenv("FILE_TYPE"),

+ 2 - 0
devices/qualcommax_ipq807x/settings.ini

@@ -0,0 +1,2 @@
+REPO_URL="https://github.com/openwrt/openwrt"
+REPO_BRANCH="main"

+ 1 - 1
devices/ramips_mt7621/patches/02-cr660x.patch

@@ -30,7 +30,7 @@
 +  IMAGE_SIZE := 15808k
 +  DEVICE_VENDOR := JDCloud
 +  DEVICE_MODEL := Luban 鲁班
-+  DEVICE_PACKAGES += kmod-mt7915e uboot-envtools  kmod-mmc kmod-sdhci kmod-sdhci-mt7620 kmod-fs-ext4 wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
++  DEVICE_PACKAGES += kmod-mt7915e kmod-mt7915-firmware uboot-envtools kmod-mmc kmod-sdhci kmod-sdhci-mt7620 kmod-fs-ext4 wpad-mini -wpad-basic-mbedtls -coremark -htop -bash -openssh-sftp-server
 +endef
 +TARGET_DEVICES += jdcloud_luban
 +

+ 0 - 22
devices/rockchip_armv8/patches/97-xgp.patch

@@ -48,28 +48,6 @@ index 8fed56a0027b9..95410bca3a518 100755
  	rocktech,mpc1903|\
  	sharevdi,h3399pc)
  		wan_mac=$(macaddr_generate_from_mmc_cid mmcblk0)
-diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk
-index 88f40f98f45db..c8fe96f74d37e 100644
---- a/target/linux/rockchip/image/armv8.mk
-+++ b/target/linux/rockchip/image/armv8.mk
-@@ -81,6 +80,17 @@ $(call Device/fastrhino_common)
- endef
- TARGET_DEVICES += fastrhino_r68s
- 
-+define Device/nlnet_xgp
-+  DEVICE_VENDOR := NLnet
-+  DEVICE_MODEL := XiGuaPi
-+  SOC := rk3568
-+  UBOOT_DEVICE_NAME := nlnet-xgp-rk3568
-+  IMAGE/sysupgrade.img.gz := boot-combined | boot-script nlnet-xgp | pine64-img | gzip | append-metadata
-+  DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-mt7921e wpad-openssl
-+  DEVICE_DTS = rockchip/rk3568-xgp rockchip/rk3568-xgp-v3
-+endef
-+TARGET_DEVICES += nlnet_xgp
-+
- define Device/friendlyarm_nanopi-neo3
-   DEVICE_VENDOR := FriendlyARM
-   DEVICE_MODEL := NanoPi NEO3
 diff --git a/target/linux/rockchip/patches-5.15/210-rockchip-rk356x-add-support-for-new-boards.patch b/target/linux/rockchip/patches-5.15/210-rockchip-rk356x-add-support-for-new-boards.patch
 index 2f9a26979dc4b..f66423793c78d 100644
 --- a/target/linux/rockchip/patches-5.15/210-rockchip-rk356x-add-support-for-new-boards.patch

+ 0 - 20
devices/rockchip_armv8/patches/98-r2c-plus.patch

@@ -1,23 +1,3 @@
---- a/target/linux/rockchip/image/armv8.mk
-+++ b/target/linux/rockchip/image/armv8.mk
-@@ -91,6 +91,16 @@
- endef
- TARGET_DEVICES += friendlyarm_nanopi-r2c
- 
-+define Device/friendlyarm_nanopi-r2c-plus
-+  DEVICE_VENDOR := FriendlyARM
-+  DEVICE_MODEL := NanoPi R2C Plus
-+  SOC := rk3328
-+  UBOOT_DEVICE_NAME := nanopi-r2c-plus-rk3328
-+  IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-bin | gzip | append-metadata
-+  DEVICE_PACKAGES := kmod-usb-net-rtl8152
-+endef
-+TARGET_DEVICES += friendlyarm_nanopi-r2c-plus
-+
- define Device/friendlyarm_nanopi-r2s
-   DEVICE_VENDOR := FriendlyARM
-   DEVICE_MODEL := NanoPi R2S
-
 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
 +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
 @@ -14,6 +14,7 @@

+ 52 - 21
devices/rockchip_armv8/patches/99-more.patch

@@ -1,6 +1,55 @@
 --- a/target/linux/rockchip/image/armv8.mk
 +++ b/target/linux/rockchip/image/armv8.mk
-@@ -141,6 +141,47 @@ define Device/friendlyarm_nanopi-r5s
+@@ -3,7 +3,7 @@
+ # Copyright (C) 2020 Tobias Maedel
+ 
+ define Device/ariaboard_photonicat
+-  DEVICE_VENDOR := Ariaboard
++  DEVICE_VENDOR := 光影猫
+   DEVICE_MODEL := Photonicat
+   SOC := rk3568
+   UBOOT_DEVICE_NAME := photonicat-rk3568
+ 
+@@ -72,6 +72,17 @@ $(call Device/fastrhino_common)
+ endef
+ TARGET_DEVICES += fastrhino_r68s
+ 
++define Device/nlnet_xgp
++  DEVICE_VENDOR := NLnet
++  DEVICE_MODEL := XiGuaPi
++  SOC := rk3568
++  UBOOT_DEVICE_NAME := nlnet-xgp-rk3568
++  IMAGE/sysupgrade.img.gz := boot-combined | boot-script nlnet-xgp | pine64-img | gzip | append-metadata
++  DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-mt7921e wpad-openssl
++  DEVICE_DTS = rockchip/rk3568-xgp rockchip/rk3568-xgp-v3
++endef
++TARGET_DEVICES += nlnet_xgp
++
+ define Device/friendlyarm_nanopi-neo3
+   DEVICE_VENDOR := FriendlyARM
+   DEVICE_MODEL := NanoPi NEO3
+@@ -91,9 +102,19 @@ define Device/friendlyarm_nanopi-r2c
+ endef
+ TARGET_DEVICES += friendlyarm_nanopi-r2c
+ 
++define Device/friendlyarm_nanopi-r2c-plus
++  DEVICE_VENDOR := FriendlyARM
++  DEVICE_MODEL := NanoPi R2C Plus
++  SOC := rk3328
++  UBOOT_DEVICE_NAME := nanopi-r2c-plus-rk3328
++  IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-bin | gzip | append-metadata
++  DEVICE_PACKAGES := kmod-usb-net-rtl8152
++endef
++TARGET_DEVICES += friendlyarm_nanopi-r2c-plus
++
+ define Device/friendlyarm_nanopi-r2s
+   DEVICE_VENDOR := FriendlyARM
+-  DEVICE_MODEL := NanoPi R2S
++  DEVICE_MODEL := NanoPi R2S / R2S Plus
+   SOC := rk3328
+   UBOOT_DEVICE_NAME := nanopi-r2s-rk3328
+   IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-bin | gzip | append-metadata
+@@ -141,6 +162,38 @@ define Device/friendlyarm_nanopi-r5s
  endef
  TARGET_DEVICES += friendlyarm_nanopi-r5s
  
@@ -35,15 +84,6 @@
 +  DEVICE_DTS = rockchip/rk3328-nanopi-r2s
 +endef
 +TARGET_DEVICES += friendlyarm_nanopc-t6
-+
-+define Device/friendlyarm_nanopi-r2s-plus
-+  DEVICE_VENDOR := FriendlyARM
-+  DEVICE_MODEL := NanoPi R2S Plus
-+  SOC := rk3328
-+  DEVICE_DTS = rockchip/rk3328-nanopi-r2s
-+  DEVICE_PACKAGES := kmod-usb-net-rtl8152
-+endef
-+TARGET_DEVICES += friendlyarm_nanopi-r2s-plus
 +
  define Device/firefly_station-p2
    DEVICE_VENDOR := Firefly
@@ -51,13 +91,12 @@
 
 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
 +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
-@@ -23,8 +23,16 @@
+@@ -23,8 +23,15 @@
  	sharevdi,h3399pc|\
  	sharevdi,guangmiao-g4c|\
  	xunlong,orangepi-r1-plus|\
 -	xunlong,orangepi-r1-plus-lts)
 +	xunlong,orangepi-r1-plus-lts|\
-+	friendlyarm,orangepi-r2s-plus|\
 +	friendlyarm,nanopc-t6)
  		ucidef_set_interfaces_lan_wan 'eth1' 'eth0'
 +		;;
@@ -173,7 +212,7 @@
 
 --- a/target/linux/rockchip/image/Makefile
 +++ b/target/linux/rockchip/image/Makefile
-@@ -79,4 +79,31 @@ endif
+@@ -79,4 +79,23 @@ endif
  
  include $(SUBTARGET).mk
  
@@ -194,14 +233,6 @@
 +		cd /data/packit/friendlywrt23-rk3399; \
 +		. ~/packit/packit_nanopi.sh; \
 +	fi
-+	if [[ "$(PROFILE_SANITIZED)" == "friendlyarm_nanopi-r2s-plus" ]]; then \
-+		export IMG_PREFIX="$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))"; \
-+		export BIN_DIR=$(BIN_DIR); \
-+		export TOPDIR=$(TOPDIR); \
-+		export MORE=$(MORE); \
-+		cd /data/packit/friendlywrt23-rk3328; \
-+		. ~/packit/packit_nanopi.sh; \
-+	fi
 +endef
 +
  $(eval $(call BuildImage))

+ 0 - 175
devices/rockchip_armv8/patches/fan.patch

@@ -1,175 +0,0 @@
-From 6bd64bbc79b7a86224dea328dee07fa27f2cc06b Mon Sep 17 00:00:00 2001
-From: Lawrence-Tang <[email protected]>
-Date: Wed, 20 Oct 2021 15:00:23 +0800
-Subject: [PATCH] rockchip: add fan control for r2s/r4s
-
----
- .../armv8/base-files/etc/init.d/fa-fancontrol | 16 ++++
- .../armv8/base-files/usr/bin/cputemp.sh       | 14 ++++
- .../usr/bin/fa-fancontrol-direct.sh           | 69 +++++++++++++++++++
- .../armv8/base-files/usr/bin/fa-fancontrol.sh | 36 ++++++++++
- 4 files changed, 127 insertions(+)
- create mode 100755 target/linux/rockchip/armv8/base-files/etc/init.d/fa-fancontrol
- create mode 100755 target/linux/rockchip/armv8/base-files/usr/bin/cputemp.sh
- create mode 100755 target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol-direct.sh
- create mode 100755 target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol.sh
-
-diff --git a/target/linux/rockchip/armv8/base-files/etc/init.d/fa-fancontrol b/target/linux/rockchip/armv8/base-files/etc/init.d/fa-fancontrol
-new file mode 100755
-index 0000000000000..dd848927101b0
---- /dev/null
-+++ b/target/linux/rockchip/armv8/base-files/etc/init.d/fa-fancontrol
-@@ -0,0 +1,16 @@
-+#!/bin/sh /etc/rc.common
-+
-+START=21
-+start() {
-+    /usr/bin/fa-fancontrol.sh &
-+}
-+
-+stop() {
-+kill -9 $(ps -w | grep fa-fancontrol | grep -v grep | awk '{print$1}') 2>/dev/null
-+}
-+
-+restart() {
-+stop
-+start
-+}
-+
-diff --git a/target/linux/rockchip/armv8/base-files/usr/bin/cputemp.sh b/target/linux/rockchip/armv8/base-files/usr/bin/cputemp.sh
-new file mode 100755
-index 0000000000000..e497269bccdcd
---- /dev/null
-+++ b/target/linux/rockchip/armv8/base-files/usr/bin/cputemp.sh
-@@ -0,0 +1,14 @@
-+#!/bin/bash
-+
-+while true
-+do
-+echo "-----------------"
-+echo "Curr freq: `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq`,`cat /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_cur_freq`"
-+echo "Temp: `cat /sys/class/thermal/thermal_zone0/temp`"
-+if [ -d /sys/devices/platform/pwm-fan ]; then
-+    CUR=`cat /sys/devices/virtual/thermal/cooling_device0/cur_state`
-+    MAX=`cat /sys/devices/virtual/thermal/cooling_device0/max_state`
-+    echo "Fan Level: ${CUR}/${MAX}"
-+fi
-+sleep 5
-+done
-diff --git a/target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol-direct.sh b/target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol-direct.sh
-new file mode 100755
-index 0000000000000..b16c994d66955
---- /dev/null
-+++ b/target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol-direct.sh
-@@ -0,0 +1,69 @@
-+#!/bin/bash
-+
-+# determine fan controller
-+if [ -d /sys/devices/platform/pwm-fan ]; then
-+    echo "pls use /usr/bin/fa-fancontrol.sh."
-+    exit 1
-+fi
-+
-+if [ ! -d /sys/class/pwm/pwmchip1 ]; then
-+    echo "this model does not support pwm."
-+    exit 1
-+fi
-+if [ ! -d /sys/class/pwm/pwmchip1/pwm0 ]; then
-+    echo 0 > /sys/class/pwm/pwmchip1/export
-+fi
-+sleep 1
-+while [ ! -d /sys/class/pwm/pwmchip1/pwm0 ];
-+do
-+    sleep 1
-+done
-+ISENABLE=`cat /sys/class/pwm/pwmchip1/pwm0/enable`
-+if [ $ISENABLE -eq 1 ]; then
-+    echo 0 > /sys/class/pwm/pwmchip1/pwm0/enable
-+fi
-+echo 50000 > /sys/class/pwm/pwmchip1/pwm0/period
-+echo 1 > /sys/class/pwm/pwmchip1/pwm0/enable
-+
-+# max speed run 5s
-+echo 46990 > /sys/class/pwm/pwmchip1/pwm0/duty_cycle
-+sleep 5
-+echo 25000 > /sys/class/pwm/pwmchip1/pwm0/duty_cycle
-+
-+# declare -a CpuTemps=(55000 43000 38000 32000)
-+# declare -a PwmDutyCycles=(1000 20000 30000 45000)
-+
-+declare -a CpuTemps=(75000 63000 58000 52000)
-+declare -a PwmDutyCycles=(25000 35000 45000 46990)
-+
-+declare -a Percents=(100 75 50 25)
-+DefaultDuty=49990
-+DefaultPercents=0
-+
-+while true
-+do
-+	temp=$(cat /sys/class/thermal/thermal_zone0/temp)
-+	INDEX=0
-+	FOUNDTEMP=0
-+	DUTY=$DefaultDuty
-+	PERCENT=$DefaultPercents
-+	
-+	for i in 0 1 2 3; do
-+		if [ $temp -gt ${CpuTemps[$i]} ]; then
-+			INDEX=$i
-+			FOUNDTEMP=1
-+			break
-+		fi	
-+	done
-+	if [ ${FOUNDTEMP} == 1 ]; then
-+		DUTY=${PwmDutyCycles[$i]}
-+		PERCENT=${Percents[$i]}
-+	fi
-+
-+	echo $DUTY > /sys/class/pwm/pwmchip1/pwm0/duty_cycle;
-+
-+        # echo "temp: $temp, duty: $DUTY, ${PERCENT}%"
-+        # cat /sys/devices/system/cpu/cpu*/cpufreq/cpuinfo_cur_freq
-+
-+	sleep 2s;
-+done
-diff --git a/target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol.sh b/target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol.sh
-new file mode 100755
-index 0000000000000..e7c14054c80e9
---- /dev/null
-+++ b/target/linux/rockchip/armv8/base-files/usr/bin/fa-fancontrol.sh
-@@ -0,0 +1,36 @@
-+#!/bin/bash
-+
-+# determine fan controller
-+if [ -d /sys/devices/platform/pwm-fan ]; then
-+    (cd /sys/devices/virtual/thermal/thermal_zone0 && {        
-+        logger -p user.info -t "pwmfan" "set the conditions for fan"
-+        [ -f trip_point_3_temp ] && {
-+            # select fan level 1
-+            echo 50000 > trip_point_3_temp
-+        }
-+        [ -f trip_point_4_temp ] && {
-+            # select fan level 2-4
-+            echo 55000 > trip_point_4_temp
-+        }
-+    })
-+
-+    (cd /sys/devices/virtual/thermal/cooling_device0 && {
-+        TYPE=`cat type`
-+        if [ $TYPE = 'pwm-fan' ]; then
-+            # run 5s
-+            for i in `seq 1 5`; do
-+                logger -p user.info -t "pwmfan" "start to spin ${i}/5"
-+                echo 3 > cur_state
-+                sleep 1
-+            done
-+            logger -p user.info -t "pwmfan" "set to auto"
-+            echo 0 > cur_state
-+        fi
-+    })
-+else
-+    logger -p user.info -t "pwmfan" "not found cooling device"
-+    if [ -d /sys/class/pwm ]; then
-+        nohup /usr/bin/fa-fancontrol-direct.sh&
-+    fi
-+fi
-+

+ 0 - 3357
devices/sunxi_cortexa53/patches/OrangePi_zero2.patch.b

@@ -1,3357 +0,0 @@
-diff --git a/package/boot/arm-trusted-firmware-sunxi/Makefile b/package/boot/arm-trusted-firmware-sunxi/Makefile
-index 0abfbae750142..9608ce39a1d2a 100644
---- a/package/boot/arm-trusted-firmware-sunxi/Makefile
-+++ b/package/boot/arm-trusted-firmware-sunxi/Makefile
-@@ -12,9 +12,9 @@ PKG_RELEASE:=1
- 
- PKG_SOURCE_PROTO:=git
- PKG_SOURCE_URL=https://github.com/ARM-software/arm-trusted-firmware
--PKG_SOURCE_DATE:=2020-11-17
--PKG_SOURCE_VERSION:=e2c509a39c6cc4dda8734e6509cdbe6e3603cdfc
--PKG_MIRROR_HASH:=b212d369a5286ebbf6a5616486efa05fa54d4294fd6e9ba2e54fdfae9eda918d
-+PKG_SOURCE_DATE:=2022-06-01
-+PKG_SOURCE_VERSION:=35f4c7295bafeb32c8bcbdfb6a3f2e74a57e732b
-+PKG_MIRROR_HASH:=88a282242ca5c921ce43eb913112e964ae87ddf85a87f2d4d6d192d1fe943370
- 
- PKG_LICENSE:=BSD-3-Clause
- PKG_LICENSE_FILES:=license.md
-@@ -42,6 +42,11 @@ define Package/arm-trusted-firmware-sunxi-h6
-     VARIANT:=sun50i_h6
- endef
- 
-+define Package/arm-trusted-firmware-sunxi-h616
-+    $(call Package/arm-trusted-firmware-sunxi/Default)
-+    VARIANT:=sun50i_h616
-+endef
-+
- export GCC_HONOUR_COPTS=s
- 
- MAKE_VARS = \
-@@ -61,3 +66,4 @@ endef
- 
- $(eval $(call BuildPackage,arm-trusted-firmware-sunxi-a64))
- $(eval $(call BuildPackage,arm-trusted-firmware-sunxi-h6))
-+$(eval $(call BuildPackage,arm-trusted-firmware-sunxi-h616))
-diff --git a/package/boot/uboot-sunxi/Makefile b/package/boot/uboot-sunxi/Makefile
-index 5c27407d15511..1e3c8ea4da0e4 100644
---- a/package/boot/uboot-sunxi/Makefile
-+++ b/package/boot/uboot-sunxi/Makefile
-@@ -322,6 +322,15 @@ define U-Boot/orangepi_pc2
-   ATF:=a64
- endef
- 
-+define U-Boot/orangepi_zero2
-+  BUILD_SUBTARGET:=cortexa53
-+  NAME:=Xunlong Orange Pi Zero2
-+  BUILD_DEVICES:=xunlong_orangepi-zero2
-+  DEPENDS:=+PACKAGE_u-boot-orangepi_zero2:arm-trusted-firmware-sunxi-h616
-+  UENV:=h616
-+  ATF:=h616
-+endef
-+
- define U-Boot/Bananapi_M2_Ultra
-   BUILD_SUBTARGET:=cortexa7
-   NAME:=Bananapi M2 Ultra
-@@ -376,6 +385,7 @@ UBOOT_TARGETS := \
- 	orangepi_plus \
- 	orangepi_2 \
- 	orangepi_pc2 \
-+	orangepi_zero2 \
- 	pangolin \
- 	pine64_plus \
- 	sopine_baseboard \
-diff --git a/package/boot/uboot-sunxi/uEnv-h616.txt b/package/boot/uboot-sunxi/uEnv-h616.txt
-new file mode 100644
-index 0000000000000..78810ff223cce
---- /dev/null
-+++ b/package/boot/uboot-sunxi/uEnv-h616.txt
-@@ -0,0 +1,7 @@
-+setenv mmc_rootpart 2
-+part uuid mmc ${mmc_bootdev}:${mmc_rootpart} uuid
-+setenv loadkernel fatload mmc \$mmc_bootdev \$kernel_addr_r uImage
-+setenv loaddtb fatload mmc \$mmc_bootdev \$fdt_addr_r dtb
-+setenv bootargs console=ttyS0,115200 earlyprintk root=PARTUUID=${uuid} rootwait
-+setenv uenvcmd run loadkernel \&\& run loaddtb \&\& booti \$kernel_addr_r - \$fdt_addr_r
-+run uenvcmd
-
-diff --git a/target/linux/sunxi/image/cortexa53.mk b/target/linux/sunxi/image/cortexa53.mk
-index a00bac2c81c76..ba36f75533b99 100644
---- a/target/linux/sunxi/image/cortexa53.mk
-+++ b/target/linux/sunxi/image/cortexa53.mk
-@@ -24,6 +24,11 @@ define Device/sun50i-h6
-   $(Device/sun50i)
- endef
- 
-+define Device/sun50i-h616
-+  SOC := sun50i-h616
-+  $(Device/sun50i)
-+endef
-+
- define Device/friendlyarm_nanopi-neo-plus2
-   DEVICE_VENDOR := FriendlyARM
-   DEVICE_MODEL := NanoPi NEO Plus2
-@@ -101,6 +106,14 @@ define Device/xunlong_orangepi-one-plus
- endef
- TARGET_DEVICES += xunlong_orangepi-one-plus
- 
-+define Device/xunlong_orangepi-zero2
-+  $(Device/sun50i-h616)
-+  DEVICE_VENDOR := Xunlong
-+  DEVICE_MODEL := Orange Pi Zero2
-+  SUNXI_DTS_DIR := allwinner/
-+endef
-+TARGET_DEVICES += xunlong_orangepi-zero2
-+
- define Device/xunlong_orangepi-pc2
-   DEVICE_VENDOR := Xunlong
-   DEVICE_MODEL := Orange Pi PC 2
-diff --git a/target/linux/sunxi/patches-5.10/502-Add-support-for-the-Allwinner-H616-pin-controller.patch b/target/linux/sunxi/patches-5.10/502-Add-support-for-the-Allwinner-H616-pin-controller.patch
-new file mode 100644
-index 0000000000000..1759077ff33fd
---- /dev/null
-+++ b/target/linux/sunxi/patches-5.10/502-Add-support-for-the-Allwinner-H616-pin-controller.patch
-@@ -0,0 +1,580 @@
-+diff --git a/drivers/pinctrl/sunxi/Kconfig b/drivers/pinctrl/sunxi/Kconfig
-+index 593293584ecc..73e88ce71a48 100644
-+--- a/drivers/pinctrl/sunxi/Kconfig
-++++ b/drivers/pinctrl/sunxi/Kconfig
-+@@ -119,4 +119,9 @@  config PINCTRL_SUN50I_H6_R
-+ 	default ARM64 && ARCH_SUNXI
-+ 	select PINCTRL_SUNXI
-+ 
-++config PINCTRL_SUN50I_H616
-++	bool "Support for the Allwinner H616 PIO"
-++	default ARM64 && ARCH_SUNXI
-++	select PINCTRL_SUNXI
-++
-+ endif
-+diff --git a/drivers/pinctrl/sunxi/Makefile b/drivers/pinctrl/sunxi/Makefile
-+index 8b7ff0dc3bdf..5359327a3c8f 100644
-+--- a/drivers/pinctrl/sunxi/Makefile
-++++ b/drivers/pinctrl/sunxi/Makefile
-+@@ -23,5 +23,6 @@  obj-$(CONFIG_PINCTRL_SUN8I_V3S)		+= pinctrl-sun8i-v3s.o
-+ obj-$(CONFIG_PINCTRL_SUN50I_H5)		+= pinctrl-sun50i-h5.o
-+ obj-$(CONFIG_PINCTRL_SUN50I_H6)		+= pinctrl-sun50i-h6.o
-+ obj-$(CONFIG_PINCTRL_SUN50I_H6_R)	+= pinctrl-sun50i-h6-r.o
-++obj-$(CONFIG_PINCTRL_SUN50I_H616)	+= pinctrl-sun50i-h616.o
-+ obj-$(CONFIG_PINCTRL_SUN9I_A80)		+= pinctrl-sun9i-a80.o
-+ obj-$(CONFIG_PINCTRL_SUN9I_A80_R)	+= pinctrl-sun9i-a80-r.o
-+diff --git a/drivers/pinctrl/sunxi/pinctrl-sun50i-h616.c b/drivers/pinctrl/sunxi/pinctrl-sun50i-h616.c
-+new file mode 100644
-+index 000000000000..734f63eb08dd
-+--- /dev/null
-++++ b/drivers/pinctrl/sunxi/pinctrl-sun50i-h616.c
-+@@ -0,0 +1,549 @@ 
-++// SPDX-License-Identifier: GPL-2.0
-++/*
-++ * Allwinner H616 SoC pinctrl driver.
-++ *
-++ * Copyright (C) 2020 Arm Ltd.
-++ * based on the H6 pinctrl driver
-++ *   Copyright (C) 2017 Icenowy Zheng <[email protected]>
-++ */
-++
-++#include <linux/module.h>
-++#include <linux/platform_device.h>
-++#include <linux/of.h>
-++#include <linux/of_device.h>
-++#include <linux/pinctrl/pinctrl.h>
-++
-++#include "pinctrl-sunxi.h"
-++
-++static const struct sunxi_desc_pin h616_pins[] = {
-++	/* Internal connection to the AC200 part */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 0),
-++		SUNXI_FUNCTION(0x2, "emac1")),		/* ERXD1 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1),
-++		SUNXI_FUNCTION(0x2, "emac1")),		/* ERXD0 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2),
-++		SUNXI_FUNCTION(0x2, "emac1")),		/* ECRS_DV */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3),
-++		SUNXI_FUNCTION(0x2, "emac1")),		/* ERXERR */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4),
-++		SUNXI_FUNCTION(0x2, "emac1")),		/* ETXD1 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5),
-++		SUNXI_FUNCTION(0x2, "emac1")),		/* ETXD0 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6),
-++		SUNXI_FUNCTION(0x2, "emac1")),		/* ETXCK */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7),
-++		SUNXI_FUNCTION(0x2, "emac1")),		/* ETXEN */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 8),
-++		SUNXI_FUNCTION(0x2, "emac1")),		/* EMDC */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 9),
-++		SUNXI_FUNCTION(0x2, "emac1")),		/* EMDIO */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 10),
-++		SUNXI_FUNCTION(0x2, "i2c3")),		/* SCK */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 11),
-++		SUNXI_FUNCTION(0x2, "i2c3")),		/* SDA */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 12),
-++		SUNXI_FUNCTION(0x2, "pwm5")),
-++	/* Hole */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* WE */
-++		  SUNXI_FUNCTION(0x3, "mmc2"),		/* DS */
-++		  SUNXI_FUNCTION(0x4, "spi0"),		/* CLK */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)),	/* PC_EINT0 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* ALE */
-++		  SUNXI_FUNCTION(0x3, "mmc2"),		/* RST */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)),	/* PC_EINT1 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* CLE */
-++		  SUNXI_FUNCTION(0x4, "spi0"),		/* MOSI */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)),	/* PC_EINT2 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* CE1 */
-++		  SUNXI_FUNCTION(0x4, "spi0"),		/* CS0 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)),	/* PC_EINT3 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* CE0 */
-++		  SUNXI_FUNCTION(0x4, "spi0"),		/* MISO */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)),	/* PC_EINT4 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* RE */
-++		  SUNXI_FUNCTION(0x3, "mmc2"),		/* CLK */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)),	/* PC_EINT5 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* RB0 */
-++		  SUNXI_FUNCTION(0x3, "mmc2"),		/* CMD */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)),	/* PC_EINT6 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* RB1 */
-++		  SUNXI_FUNCTION(0x4, "spi0"),		/* CS1 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)),	/* PC_EINT7 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ7 */
-++		  SUNXI_FUNCTION(0x3, "mmc2"),		/* D3 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)),	/* PC_EINT8 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ6 */
-++		  SUNXI_FUNCTION(0x3, "mmc2"),		/* D4 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)),	/* PC_EINT9 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ5 */
-++		  SUNXI_FUNCTION(0x3, "mmc2"),		/* D0 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)),	/* PC_EINT10 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ4 */
-++		  SUNXI_FUNCTION(0x3, "mmc2"),		/* D5 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)),	/* PC_EINT11 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQS */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)),	/* PC_EINT12 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ3 */
-++		  SUNXI_FUNCTION(0x3, "mmc2"),		/* D1 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)),	/* PC_EINT13 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ2 */
-++		  SUNXI_FUNCTION(0x3, "mmc2"),		/* D6 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)),	/* PC_EINT14 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ1 */
-++		  SUNXI_FUNCTION(0x3, "mmc2"),		/* D2 */
-++		  SUNXI_FUNCTION(0x4, "spi0"),		/* WP */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 15)),	/* PC_EINT15 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "nand0"),		/* DQ0 */
-++		  SUNXI_FUNCTION(0x3, "mmc2"),		/* D7 */
-++		  SUNXI_FUNCTION(0x4, "spi0"),		/* HOLD */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 16)),	/* PC_EINT16 */
-++	/* Hole */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D1 */
-++		  SUNXI_FUNCTION(0x3, "jtag"),		/* MS */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)),	/* PF_EINT0 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D0 */
-++		  SUNXI_FUNCTION(0x3, "jtag"),		/* DI */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)),	/* PF_EINT1 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "mmc0"),		/* CLK */
-++		  SUNXI_FUNCTION(0x3, "uart0"),		/* TX */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)),	/* PF_EINT2 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "mmc0"),		/* CMD */
-++		  SUNXI_FUNCTION(0x3, "jtag"),		/* DO */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)),	/* PF_EINT3 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D3 */
-++		  SUNXI_FUNCTION(0x3, "uart0"),		/* RX */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)),	/* PF_EINT4 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "mmc0"),		/* D2 */
-++		  SUNXI_FUNCTION(0x3, "jtag"),		/* CK */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)),	/* PF_EINT5 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 6),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 6)),	/* PF_EINT6 */
-++	/* Hole */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "mmc1"),		/* CLK */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 0)),	/* PG_EINT0 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "mmc1"),		/* CMD */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 1)),	/* PG_EINT1 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D0 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 2)),	/* PG_EINT2 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D1 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 3)),	/* PG_EINT3 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D2 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 4)),	/* PG_EINT4 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "mmc1"),		/* D3 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 5)),	/* PG_EINT5 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart1"),		/* TX */
-++		  SUNXI_FUNCTION(0x4, "jtag"),		/* MS */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 6)),	/* PG_EINT6 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart1"),		/* RX */
-++		  SUNXI_FUNCTION(0x4, "jtag"),		/* CK */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 7)),	/* PG_EINT7 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart1"),		/* RTS */
-++		  SUNXI_FUNCTION(0x3, "clock"),		/* PLL_LOCK_DEBUG */
-++		  SUNXI_FUNCTION(0x4, "jtag"),		/* DO */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 8)),	/* PG_EINT8 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart1"),		/* CTS */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 9)),	/* PG_EINT9 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "h_i2s2"),	/* MCLK */
-++		  SUNXI_FUNCTION(0x3, "clock"),		/* X32KFOUT */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 10)),	/* PG_EINT10 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "h_i2s2"),	/* BCLK */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 11)),	/* PG_EINT11 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "h_i2s2"),	/* SYNC */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 12)),	/* PG_EINT12 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 13),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "h_i2s2"),	/* DOUT */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 13)),	/* PG_EINT13 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 14),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "h_i2s2"),	/* DIN */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 14)),	/* PG_EINT14 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 15),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart2"),		/* TX */
-++		  SUNXI_FUNCTION(0x5, "i2c4"),		/* SCK */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 15)),	/* PG_EINT15 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 16),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart2"),		/* TX */
-++		  SUNXI_FUNCTION(0x5, "i2c4"),		/* SDA */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 16)),	/* PG_EINT16 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 17),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart2"),		/* RTS */
-++		  SUNXI_FUNCTION(0x5, "i2c3"),		/* SCK */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 17)),	/* PG_EINT17 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 18),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart2"),		/* CTS */
-++		  SUNXI_FUNCTION(0x5, "i2c3"),		/* SDA */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 18)),	/* PG_EINT18 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 19),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x4, "pwm1"),
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 19)),	/* PG_EINT19 */
-++	/* Hole */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 0),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart0"),		/* TX */
-++		  SUNXI_FUNCTION(0x4, "pwm3"),
-++		  SUNXI_FUNCTION(0x5, "i2c1"),		/* SCK */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 0)),	/* PH_EINT0 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 1),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart0"),		/* RX */
-++		  SUNXI_FUNCTION(0x4, "pwm4"),
-++		  SUNXI_FUNCTION(0x5, "i2c1"),		/* SDA */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 1)),	/* PH_EINT1 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 2),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart5"),		/* TX */
-++		  SUNXI_FUNCTION(0x3, "spdif"),		/* MCLK */
-++		  SUNXI_FUNCTION(0x4, "pwm2"),
-++		  SUNXI_FUNCTION(0x5, "i2c2"),		/* SCK */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 2)),	/* PH_EINT2 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 3),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart5"),		/* RX */
-++		  SUNXI_FUNCTION(0x4, "pwm1"),
-++		  SUNXI_FUNCTION(0x5, "i2c2"),		/* SDA */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 3)),	/* PH_EINT3 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 4),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x3, "spdif"),		/* OUT */
-++		  SUNXI_FUNCTION(0x5, "i2c3"),		/* SCK */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 4)),	/* PH_EINT4 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 5),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart2"),		/* TX */
-++		  SUNXI_FUNCTION(0x3, "h_i2s3"),	/* MCLK */
-++		  SUNXI_FUNCTION(0x4, "spi1"),		/* CS0 */
-++		  SUNXI_FUNCTION(0x5, "i2c3"),		/* SDA */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 5)),	/* PH_EINT5 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 6),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart2"),		/* RX */
-++		  SUNXI_FUNCTION(0x3, "h_i2s3"),	/* BCLK */
-++		  SUNXI_FUNCTION(0x4, "spi1"),		/* CLK */
-++		  SUNXI_FUNCTION(0x5, "i2c4"),		/* SCK */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 6)),	/* PH_EINT6 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 7),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart2"),		/* RTS */
-++		  SUNXI_FUNCTION(0x3, "h_i2s3"),	/* SYNC */
-++		  SUNXI_FUNCTION(0x4, "spi1"),		/* MOSI */
-++		  SUNXI_FUNCTION(0x5, "i2c4"),		/* SDA */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 7)),	/* PH_EINT7 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 8),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "uart2"),		/* CTS */
-++		  SUNXI_FUNCTION(0x3, "h_i2s3"),	/* DO0 */
-++		  SUNXI_FUNCTION(0x4, "spi1"),		/* MISO */
-++		  SUNXI_FUNCTION(0x5, "h_i2s3"),	/* DI1 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 8)),	/* PH_EINT8 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 9),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x3, "h_i2s3"),	/* DI0 */
-++		  SUNXI_FUNCTION(0x4, "spi1"),		/* CS1 */
-++		  SUNXI_FUNCTION(0x3, "h_i2s3"),	/* DO1 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 9)),	/* PH_EINT9 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(H, 10),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x3, "ir_rx"),
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 3, 10)),	/* PH_EINT10 */
-++	/* Hole */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 0),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* ERXD3 */
-++		  SUNXI_FUNCTION(0x3, "dmic"),		/* CLK */
-++		  SUNXI_FUNCTION(0x4, "h_i2s0"),	/* MCLK */
-++		  SUNXI_FUNCTION(0x5, "hdmi"),		/* HSCL */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 0)),	/* PI_EINT0 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 1),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* ERXD2 */
-++		  SUNXI_FUNCTION(0x3, "dmic"),		/* DATA0 */
-++		  SUNXI_FUNCTION(0x4, "h_i2s0"),	/* BCLK */
-++		  SUNXI_FUNCTION(0x5, "hdmi"),		/* HSDA */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 1)),	/* PI_EINT1 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 2),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* ERXD1 */
-++		  SUNXI_FUNCTION(0x3, "dmic"),		/* DATA1 */
-++		  SUNXI_FUNCTION(0x4, "h_i2s0"),	/* SYNC */
-++		  SUNXI_FUNCTION(0x5, "hdmi"),		/* HCEC */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 2)),	/* PI_EINT2 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 3),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* ERXD0 */
-++		  SUNXI_FUNCTION(0x3, "dmic"),		/* DATA2 */
-++		  SUNXI_FUNCTION(0x4, "h_i2s0"),	/* DO0 */
-++		  SUNXI_FUNCTION(0x5, "h_i2s0"),	/* DI1 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 3)),	/* PI_EINT3 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 4),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* ERXCK */
-++		  SUNXI_FUNCTION(0x3, "dmic"),		/* DATA3 */
-++		  SUNXI_FUNCTION(0x4, "h_i2s0"),	/* DI0 */
-++		  SUNXI_FUNCTION(0x5, "h_i2s0"),	/* DO1 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 4)),	/* PI_EINT4 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 5),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* ERXCTL */
-++		  SUNXI_FUNCTION(0x3, "uart2"),		/* TX */
-++		  SUNXI_FUNCTION(0x4, "ts0"),		/* CLK */
-++		  SUNXI_FUNCTION(0x5, "i2c0"),		/* SCK */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 5)),	/* PI_EINT5 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 6),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* ENULL */
-++		  SUNXI_FUNCTION(0x3, "uart2"),		/* RX */
-++		  SUNXI_FUNCTION(0x4, "ts0"),		/* ERR */
-++		  SUNXI_FUNCTION(0x5, "i2c0"),		/* SDA */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 6)),	/* PI_EINT6 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 7),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* ETXD3 */
-++		  SUNXI_FUNCTION(0x3, "uart2"),		/* RTS */
-++		  SUNXI_FUNCTION(0x4, "ts0"),		/* SYNC */
-++		  SUNXI_FUNCTION(0x5, "i2c1"),		/* SCK */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 7)),	/* PI_EINT7 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 8),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* ETXD2 */
-++		  SUNXI_FUNCTION(0x3, "uart2"),		/* CTS */
-++		  SUNXI_FUNCTION(0x4, "ts0"),		/* DVLD */
-++		  SUNXI_FUNCTION(0x5, "i2c1"),		/* SDA */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 8)),	/* PI_EINT8 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 9),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* ETXD1 */
-++		  SUNXI_FUNCTION(0x3, "uart3"),		/* TX */
-++		  SUNXI_FUNCTION(0x4, "ts0"),		/* D0 */
-++		  SUNXI_FUNCTION(0x5, "i2c2"),		/* SCK */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 9)),	/* PI_EINT9 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 10),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* ETXD0 */
-++		  SUNXI_FUNCTION(0x3, "uart3"),		/* RX */
-++		  SUNXI_FUNCTION(0x4, "ts0"),		/* D1 */
-++		  SUNXI_FUNCTION(0x5, "i2c2"),		/* SDA */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 10)),	/* PI_EINT10 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 11),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* ETXCK */
-++		  SUNXI_FUNCTION(0x3, "uart3"),		/* RTS */
-++		  SUNXI_FUNCTION(0x4, "ts0"),		/* D2 */
-++		  SUNXI_FUNCTION(0x5, "pwm1"),
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 11)),	/* PI_EINT11 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 12),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* ETXCTL */
-++		  SUNXI_FUNCTION(0x3, "uart3"),		/* CTS */
-++		  SUNXI_FUNCTION(0x4, "ts0"),		/* D3 */
-++		  SUNXI_FUNCTION(0x5, "pwm2"),
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 12)),	/* PI_EINT12 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 13),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* ECLKIN */
-++		  SUNXI_FUNCTION(0x3, "uart4"),		/* TX */
-++		  SUNXI_FUNCTION(0x4, "ts0"),		/* D4 */
-++		  SUNXI_FUNCTION(0x5, "pwm3"),
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 13)),	/* PI_EINT13 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 14),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* MDC */
-++		  SUNXI_FUNCTION(0x3, "uart4"),		/* RX */
-++		  SUNXI_FUNCTION(0x4, "ts0"),		/* D5 */
-++		  SUNXI_FUNCTION(0x5, "pwm4"),
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 14)),	/* PI_EINT14 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 15),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* MDIO */
-++		  SUNXI_FUNCTION(0x3, "uart4"),		/* RTS */
-++		  SUNXI_FUNCTION(0x4, "ts0"),		/* D6 */
-++		  SUNXI_FUNCTION(0x5, "clock"),		/* CLK_FANOUT0 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 15)),	/* PI_EINT15 */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(I, 16),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x2, "emac0"),		/* EPHY_CLK */
-++		  SUNXI_FUNCTION(0x3, "uart4"),		/* CTS */
-++		  SUNXI_FUNCTION(0x4, "ts0"),		/* D7 */
-++		  SUNXI_FUNCTION(0x5, "clock"),		/* CLK_FANOUT1 */
-++		  SUNXI_FUNCTION_IRQ_BANK(0x6, 4, 16)),	/* PI_EINT16 */
-++};
-++static const unsigned int h616_irq_bank_map[] = { 2, 5, 6, 7, 8 };
-++
-++static const struct sunxi_pinctrl_desc h616_pinctrl_data = {
-++	.pins = h616_pins,
-++	.npins = ARRAY_SIZE(h616_pins),
-++	.irq_banks = 5,
-++	.irq_bank_map = h616_irq_bank_map,
-++	.irq_read_needs_mux = true,
-++	.io_bias_cfg_variant = BIAS_VOLTAGE_PIO_POW_MODE_SEL,
-++};
-++
-++static int h616_pinctrl_probe(struct platform_device *pdev)
-++{
-++	return sunxi_pinctrl_init(pdev,
-++				  &h616_pinctrl_data);
-++}
-++
-++static const struct of_device_id h616_pinctrl_match[] = {
-++	{ .compatible = "allwinner,sun50i-h616-pinctrl", },
-++	{}
-++};
-++
-++static struct platform_driver h616_pinctrl_driver = {
-++	.probe	= h616_pinctrl_probe,
-++	.driver	= {
-++		.name		= "sun50i-h616-pinctrl",
-++		.of_match_table	= h616_pinctrl_match,
-++	},
-++};
-++builtin_platform_driver(h616_pinctrl_driver);
-diff --git a/target/linux/sunxi/patches-5.10/503-Add-support-for-the-Allwinner-H616-R-pin-controller.patch b/target/linux/sunxi/patches-5.10/503-Add-support-for-the-Allwinner-H616-R-pin-controller.patch
-new file mode 100644
-index 0000000000000..b876452508a27
---- /dev/null
-+++ b/target/linux/sunxi/patches-5.10/503-Add-support-for-the-Allwinner-H616-R-pin-controller.patch
-@@ -0,0 +1,89 @@
-+diff --git a/drivers/pinctrl/sunxi/Kconfig b/drivers/pinctrl/sunxi/Kconfig
-+index 73e88ce71a48..33751a6a0757 100644
-+--- a/drivers/pinctrl/sunxi/Kconfig
-++++ b/drivers/pinctrl/sunxi/Kconfig
-+@@ -124,4 +124,9 @@  config PINCTRL_SUN50I_H616
-+ 	default ARM64 && ARCH_SUNXI
-+ 	select PINCTRL_SUNXI
-+ 
-++config PINCTRL_SUN50I_H616_R
-++	bool "Support for the Allwinner H616 R-PIO"
-++	default ARM64 && ARCH_SUNXI
-++	select PINCTRL_SUNXI
-++
-+ endif
-+diff --git a/drivers/pinctrl/sunxi/Makefile b/drivers/pinctrl/sunxi/Makefile
-+index 5359327a3c8f..d3440c42b9d6 100644
-+--- a/drivers/pinctrl/sunxi/Makefile
-++++ b/drivers/pinctrl/sunxi/Makefile
-+@@ -24,5 +24,6 @@  obj-$(CONFIG_PINCTRL_SUN50I_H5)		+= pinctrl-sun50i-h5.o
-+ obj-$(CONFIG_PINCTRL_SUN50I_H6)		+= pinctrl-sun50i-h6.o
-+ obj-$(CONFIG_PINCTRL_SUN50I_H6_R)	+= pinctrl-sun50i-h6-r.o
-+ obj-$(CONFIG_PINCTRL_SUN50I_H616)	+= pinctrl-sun50i-h616.o
-++obj-$(CONFIG_PINCTRL_SUN50I_H616_R)	+= pinctrl-sun50i-h616-r.o
-+ obj-$(CONFIG_PINCTRL_SUN9I_A80)		+= pinctrl-sun9i-a80.o
-+ obj-$(CONFIG_PINCTRL_SUN9I_A80_R)	+= pinctrl-sun9i-a80-r.o
-+diff --git a/drivers/pinctrl/sunxi/pinctrl-sun50i-h616-r.c b/drivers/pinctrl/sunxi/pinctrl-sun50i-h616-r.c
-+new file mode 100644
-+index 000000000000..eb76c009bf24
-+--- /dev/null
-++++ b/drivers/pinctrl/sunxi/pinctrl-sun50i-h616-r.c
-+@@ -0,0 +1,58 @@ 
-++// SPDX-License-Identifier: GPL-2.0
-++/*
-++ * Allwinner H616 R_PIO pin controller driver
-++ *
-++ * Copyright (C) 2020 Arm Ltd.
-++ * Based on former work, which is:
-++ *   Copyright (C) 2017 Icenowy Zheng <[email protected]>
-++ *   Copyright (C) 2014 Boris Brezillon
-++ *   Boris Brezillon <[email protected]>
-++ *   Copyright (C) 2014 Maxime Ripard
-++ *   Maxime Ripard <[email protected]>
-++ */
-++
-++#include <linux/init.h>
-++#include <linux/platform_device.h>
-++#include <linux/of.h>
-++#include <linux/of_device.h>
-++#include <linux/pinctrl/pinctrl.h>
-++#include <linux/reset.h>
-++
-++#include "pinctrl-sunxi.h"
-++
-++static const struct sunxi_desc_pin sun50i_h616_r_pins[] = {
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 0),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x3, "s_i2c")),	/* SCK */
-++	SUNXI_PIN(SUNXI_PINCTRL_PIN(L, 1),
-++		  SUNXI_FUNCTION(0x0, "gpio_in"),
-++		  SUNXI_FUNCTION(0x1, "gpio_out"),
-++		  SUNXI_FUNCTION(0x3, "s_i2c")),	/* SDA */
-++};
-++
-++static const struct sunxi_pinctrl_desc sun50i_h616_r_pinctrl_data = {
-++	.pins = sun50i_h616_r_pins,
-++	.npins = ARRAY_SIZE(sun50i_h616_r_pins),
-++	.pin_base = PL_BASE,
-++};
-++
-++static int sun50i_h616_r_pinctrl_probe(struct platform_device *pdev)
-++{
-++	return sunxi_pinctrl_init(pdev,
-++				  &sun50i_h616_r_pinctrl_data);
-++}
-++
-++static const struct of_device_id sun50i_h616_r_pinctrl_match[] = {
-++	{ .compatible = "allwinner,sun50i-h616-r-pinctrl", },
-++	{}
-++};
-++
-++static struct platform_driver sun50i_h616_r_pinctrl_driver = {
-++	.probe	= sun50i_h616_r_pinctrl_probe,
-++	.driver	= {
-++		.name		= "sun50i-h616-r-pinctrl",
-++		.of_match_table	= sun50i_h616_r_pinctrl_match,
-++	},
-++};
-++builtin_platform_driver(sun50i_h616_r_pinctrl_driver);
-diff --git a/target/linux/sunxi/patches-5.10/504-Add-support-for-the-Allwinner-H616-R-CCU.patch b/target/linux/sunxi/patches-5.10/504-Add-support-for-the-Allwinner-H616-R-CCU.patch
-new file mode 100644
-index 0000000000000..f7bfe45706a90
---- /dev/null
-+++ b/target/linux/sunxi/patches-5.10/504-Add-support-for-the-Allwinner-H616-R-CCU.patch
-@@ -0,0 +1,96 @@
-+diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c b/drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c
-+index 50f8d1bc7046..119d1797f501 100644
-+--- a/drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c
-++++ b/drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c
-+@@ -136,6 +136,15 @@  static struct ccu_common *sun50i_h6_r_ccu_clks[] = {
-+ 	&w1_clk.common,
-+ };
-+ 
-++static struct ccu_common *sun50i_h616_r_ccu_clks[] = {
-++	&r_apb1_clk.common,
-++	&r_apb2_clk.common,
-++	&r_apb1_twd_clk.common,
-++	&r_apb2_i2c_clk.common,
-++	&r_apb1_ir_clk.common,
-++	&ir_clk.common,
-++};
-++
-+ static struct clk_hw_onecell_data sun50i_h6_r_hw_clks = {
-+ 	.hws	= {
-+ 		[CLK_AR100]		= &ar100_clk.common.hw,
-+@@ -152,7 +161,20 @@  static struct clk_hw_onecell_data sun50i_h6_r_hw_clks = {
-+ 		[CLK_IR]		= &ir_clk.common.hw,
-+ 		[CLK_W1]		= &w1_clk.common.hw,
-+ 	},
-+-	.num	= CLK_NUMBER,
-++	.num	= CLK_NUMBER_H616,
-++};
-++
-++static struct clk_hw_onecell_data sun50i_h616_r_hw_clks = {
-++	.hws	= {
-++		[CLK_R_AHB]		= &r_ahb_clk.hw,
-++		[CLK_R_APB1]		= &r_apb1_clk.common.hw,
-++		[CLK_R_APB2]		= &r_apb2_clk.common.hw,
-++		[CLK_R_APB1_TWD]	= &r_apb1_twd_clk.common.hw,
-++		[CLK_R_APB2_I2C]	= &r_apb2_i2c_clk.common.hw,
-++		[CLK_R_APB1_IR]		= &r_apb1_ir_clk.common.hw,
-++		[CLK_IR]		= &ir_clk.common.hw,
-++	},
-++	.num	= CLK_NUMBER_H616,
-+ };
-+ 
-+ static struct ccu_reset_map sun50i_h6_r_ccu_resets[] = {
-+@@ -165,6 +187,12 @@  static struct ccu_reset_map sun50i_h6_r_ccu_resets[] = {
-+ 	[RST_R_APB1_W1]		=  { 0x1ec, BIT(16) },
-+ };
-+ 
-++static struct ccu_reset_map sun50i_h616_r_ccu_resets[] = {
-++	[RST_R_APB1_TWD]	=  { 0x12c, BIT(16) },
-++	[RST_R_APB2_I2C]	=  { 0x19c, BIT(16) },
-++	[RST_R_APB1_IR]		=  { 0x1cc, BIT(16) },
-++};
-++
-+ static const struct sunxi_ccu_desc sun50i_h6_r_ccu_desc = {
-+ 	.ccu_clks	= sun50i_h6_r_ccu_clks,
-+ 	.num_ccu_clks	= ARRAY_SIZE(sun50i_h6_r_ccu_clks),
-+@@ -175,6 +203,16 @@  static const struct sunxi_ccu_desc sun50i_h6_r_ccu_desc = {
-+ 	.num_resets	= ARRAY_SIZE(sun50i_h6_r_ccu_resets),
-+ };
-+ 
-++static const struct sunxi_ccu_desc sun50i_h616_r_ccu_desc = {
-++	.ccu_clks	= sun50i_h616_r_ccu_clks,
-++	.num_ccu_clks	= ARRAY_SIZE(sun50i_h616_r_ccu_clks),
-++
-++	.hw_clks	= &sun50i_h616_r_hw_clks,
-++
-++	.resets		= sun50i_h616_r_ccu_resets,
-++	.num_resets	= ARRAY_SIZE(sun50i_h616_r_ccu_resets),
-++};
-++
-+ static void __init sunxi_r_ccu_init(struct device_node *node,
-+ 				    const struct sunxi_ccu_desc *desc)
-+ {
-+@@ -195,3 +233,10 @@  static void __init sun50i_h6_r_ccu_setup(struct device_node *node)
-+ }
-+ CLK_OF_DECLARE(sun50i_h6_r_ccu, "allwinner,sun50i-h6-r-ccu",
-+ 	       sun50i_h6_r_ccu_setup);
-++
-++static void __init sun50i_h616_r_ccu_setup(struct device_node *node)
-++{
-++	sunxi_r_ccu_init(node, &sun50i_h616_r_ccu_desc);
-++}
-++CLK_OF_DECLARE(sun50i_h616_r_ccu, "allwinner,sun50i-h616-r-ccu",
-++	       sun50i_h616_r_ccu_setup);
-+diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h6-r.h b/drivers/clk/sunxi-ng/ccu-sun50i-h6-r.h
-+index 782117dc0b28..128302696ca1 100644
-+--- a/drivers/clk/sunxi-ng/ccu-sun50i-h6-r.h
-++++ b/drivers/clk/sunxi-ng/ccu-sun50i-h6-r.h
-+@@ -14,6 +14,7 @@ 
-+ 
-+ #define CLK_R_APB2	3
-+ 
-+-#define CLK_NUMBER	(CLK_W1 + 1)
-++#define CLK_NUMBER_H6	(CLK_W1 + 1)
-++#define CLK_NUMBER_H616	(CLK_IR + 1)
-+ 
-+ #endif /* _CCU_SUN50I_H6_R_H */
-diff --git a/target/linux/sunxi/patches-5.10/505-Add-support-for-the-Allwinner-H616-CCU.patch b/target/linux/sunxi/patches-5.10/505-Add-support-for-the-Allwinner-H616-CCU.patch
-new file mode 100644
-index 0000000000000..488d3cee3e02a
---- /dev/null
-+++ b/target/linux/sunxi/patches-5.10/505-Add-support-for-the-Allwinner-H616-CCU.patch
-@@ -0,0 +1,1424 @@
-+diff --git a/drivers/clk/sunxi-ng/Kconfig b/drivers/clk/sunxi-ng/Kconfig
-+index ce5f5847d5d3..cd46d8853876 100644
-+--- a/drivers/clk/sunxi-ng/Kconfig
-++++ b/drivers/clk/sunxi-ng/Kconfig
-+@@ -32,8 +32,13 @@  config SUN50I_H6_CCU
-+ 	default ARM64 && ARCH_SUNXI
-+ 	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST
-+ 
-++config SUN50I_H616_CCU
-++	bool "Support for the Allwinner H616 CCU"
-++	default ARM64 && ARCH_SUNXI
-++	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST
-++
-+ config SUN50I_H6_R_CCU
-+-	bool "Support for the Allwinner H6 PRCM CCU"
-++	bool "Support for the Allwinner H6 and H616 PRCM CCU"
-+ 	default ARM64 && ARCH_SUNXI
-+ 	depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST
-+ 
-+diff --git a/drivers/clk/sunxi-ng/Makefile b/drivers/clk/sunxi-ng/Makefile
-+index 3eb5cff40eac..96c324306d97 100644
-+--- a/drivers/clk/sunxi-ng/Makefile
-++++ b/drivers/clk/sunxi-ng/Makefile
-+@@ -26,6 +26,7 @@  obj-$(CONFIG_SUN50I_A64_CCU)	+= ccu-sun50i-a64.o
-+ obj-$(CONFIG_SUN50I_A100_CCU)	+= ccu-sun50i-a100.o
-+ obj-$(CONFIG_SUN50I_A100_R_CCU)	+= ccu-sun50i-a100-r.o
-+ obj-$(CONFIG_SUN50I_H6_CCU)	+= ccu-sun50i-h6.o
-++obj-$(CONFIG_SUN50I_H616_CCU)	+= ccu-sun50i-h616.o
-+ obj-$(CONFIG_SUN50I_H6_R_CCU)	+= ccu-sun50i-h6-r.o
-+ obj-$(CONFIG_SUN4I_A10_CCU)	+= ccu-sun4i-a10.o
-+ obj-$(CONFIG_SUN5I_CCU)		+= ccu-sun5i.o
-+diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h616.c b/drivers/clk/sunxi-ng/ccu-sun50i-h616.c
-+new file mode 100644
-+index 000000000000..3fbb258f0354
-+--- /dev/null
-++++ b/drivers/clk/sunxi-ng/ccu-sun50i-h616.c
-+@@ -0,0 +1,1134 @@ 
-++// SPDX-License-Identifier: GPL-2.0
-++/*
-++ * Copyright (c) 2020 Arm Ltd.
-++ * Based on the H6 CCU driver, which is:
-++ *   Copyright (c) 2017 Icenowy Zheng <[email protected]>
-++ */
-++
-++#include <linux/clk-provider.h>
-++#include <linux/io.h>
-++#include <linux/of_address.h>
-++#include <linux/platform_device.h>
-++
-++#include "ccu_common.h"
-++#include "ccu_reset.h"
-++
-++#include "ccu_div.h"
-++#include "ccu_gate.h"
-++#include "ccu_mp.h"
-++#include "ccu_mult.h"
-++#include "ccu_nk.h"
-++#include "ccu_nkm.h"
-++#include "ccu_nkmp.h"
-++#include "ccu_nm.h"
-++
-++#include "ccu-sun50i-h616.h"
-++
-++/*
-++ * The CPU PLL is actually NP clock, with P being /1, /2 or /4. However
-++ * P should only be used for output frequencies lower than 288 MHz.
-++ *
-++ * For now we can just model it as a multiplier clock, and force P to /1.
-++ *
-++ * The M factor is present in the register's description, but not in the
-++ * frequency formula, and it's documented as "M is only used for backdoor
-++ * testing", so it's not modelled and then force to 0.
-++ */
-++#define SUN50I_H616_PLL_CPUX_REG	0x000
-++static struct ccu_mult pll_cpux_clk = {
-++	.enable		= BIT(31),
-++	.lock		= BIT(28),
-++	.mult		= _SUNXI_CCU_MULT_MIN(8, 8, 12),
-++	.common		= {
-++		.reg		= 0x000,
-++		.hw.init	= CLK_HW_INIT("pll-cpux", "osc24M",
-++					      &ccu_mult_ops,
-++					      CLK_SET_RATE_UNGATE),
-++	},
-++};
-++
-++/* Some PLLs are input * N / div1 / P. Model them as NKMP with no K */
-++#define SUN50I_H616_PLL_DDR0_REG	0x010
-++static struct ccu_nkmp pll_ddr0_clk = {
-++	.enable		= BIT(31),
-++	.lock		= BIT(28),
-++	.n		= _SUNXI_CCU_MULT_MIN(8, 8, 12),
-++	.m		= _SUNXI_CCU_DIV(1, 1), /* input divider */
-++	.p		= _SUNXI_CCU_DIV(0, 1), /* output divider */
-++	.common		= {
-++		.reg		= 0x010,
-++		.hw.init	= CLK_HW_INIT("pll-ddr0", "osc24M",
-++					      &ccu_nkmp_ops,
-++					      CLK_SET_RATE_UNGATE),
-++	},
-++};
-++
-++#define SUN50I_H616_PLL_DDR1_REG	0x018
-++static struct ccu_nkmp pll_ddr1_clk = {
-++	.enable		= BIT(31),
-++	.lock		= BIT(28),
-++	.n		= _SUNXI_CCU_MULT_MIN(8, 8, 12),
-++	.m		= _SUNXI_CCU_DIV(1, 1), /* input divider */
-++	.p		= _SUNXI_CCU_DIV(0, 1), /* output divider */
-++	.common		= {
-++		.reg		= 0x018,
-++		.hw.init	= CLK_HW_INIT("pll-ddr1", "osc24M",
-++					      &ccu_nkmp_ops,
-++					      CLK_SET_RATE_UNGATE),
-++	},
-++};
-++
-++#define SUN50I_H616_PLL_PERIPH0_REG	0x020
-++static struct ccu_nkmp pll_periph0_clk = {
-++	.enable		= BIT(31),
-++	.lock		= BIT(28),
-++	.n		= _SUNXI_CCU_MULT_MIN(8, 8, 12),
-++	.m		= _SUNXI_CCU_DIV(1, 1), /* input divider */
-++	.p		= _SUNXI_CCU_DIV(0, 1), /* output divider */
-++	.fixed_post_div	= 4,
-++	.common		= {
-++		.reg		= 0x020,
-++		.features	= CCU_FEATURE_FIXED_POSTDIV,
-++		.hw.init	= CLK_HW_INIT("pll-periph0", "osc24M",
-++					      &ccu_nkmp_ops,
-++					      CLK_SET_RATE_UNGATE),
-++	},
-++};
-++
-++#define SUN50I_H616_PLL_PERIPH1_REG	0x028
-++static struct ccu_nkmp pll_periph1_clk = {
-++	.enable		= BIT(31),
-++	.lock		= BIT(28),
-++	.n		= _SUNXI_CCU_MULT_MIN(8, 8, 12),
-++	.m		= _SUNXI_CCU_DIV(1, 1), /* input divider */
-++	.p		= _SUNXI_CCU_DIV(0, 1), /* output divider */
-++	.fixed_post_div	= 4,
-++	.common		= {
-++		.reg		= 0x028,
-++		.features	= CCU_FEATURE_FIXED_POSTDIV,
-++		.hw.init	= CLK_HW_INIT("pll-periph1", "osc24M",
-++					      &ccu_nkmp_ops,
-++					      CLK_SET_RATE_UNGATE),
-++	},
-++};
-++
-++#define SUN50I_H616_PLL_GPU_REG		0x030
-++static struct ccu_nkmp pll_gpu_clk = {
-++	.enable		= BIT(31),
-++	.lock		= BIT(28),
-++	.n		= _SUNXI_CCU_MULT_MIN(8, 8, 12),
-++	.m		= _SUNXI_CCU_DIV(1, 1), /* input divider */
-++	.p		= _SUNXI_CCU_DIV(0, 1), /* output divider */
-++	.common		= {
-++		.reg		= 0x030,
-++		.hw.init	= CLK_HW_INIT("pll-gpu", "osc24M",
-++					      &ccu_nkmp_ops,
-++					      CLK_SET_RATE_UNGATE),
-++	},
-++};
-++
-++/*
-++ * For Video PLLs, the output divider is described as "used for testing"
-++ * in the user manual. So it's not modelled and forced to 0.
-++ */
-++#define SUN50I_H616_PLL_VIDEO0_REG	0x040
-++static struct ccu_nm pll_video0_clk = {
-++	.enable		= BIT(31),
-++	.lock		= BIT(28),
-++	.n		= _SUNXI_CCU_MULT_MIN(8, 8, 12),
-++	.m		= _SUNXI_CCU_DIV(1, 1), /* input divider */
-++	.fixed_post_div	= 4,
-++	.min_rate	= 288000000,
-++	.max_rate	= 2400000000UL,
-++	.common		= {
-++		.reg		= 0x040,
-++		.features	= CCU_FEATURE_FIXED_POSTDIV,
-++		.hw.init	= CLK_HW_INIT("pll-video0", "osc24M",
-++					      &ccu_nm_ops,
-++					      CLK_SET_RATE_UNGATE),
-++	},
-++};
-++
-++#define SUN50I_H616_PLL_VIDEO1_REG	0x048
-++static struct ccu_nm pll_video1_clk = {
-++	.enable		= BIT(31),
-++	.lock		= BIT(28),
-++	.n		= _SUNXI_CCU_MULT_MIN(8, 8, 12),
-++	.m		= _SUNXI_CCU_DIV(1, 1), /* input divider */
-++	.fixed_post_div	= 4,
-++	.min_rate	= 288000000,
-++	.max_rate	= 2400000000UL,
-++	.common		= {
-++		.reg		= 0x048,
-++		.features	= CCU_FEATURE_FIXED_POSTDIV,
-++		.hw.init	= CLK_HW_INIT("pll-video1", "osc24M",
-++					      &ccu_nm_ops,
-++					      CLK_SET_RATE_UNGATE),
-++	},
-++};
-++
-++#define SUN50I_H616_PLL_VIDEO2_REG	0x050
-++static struct ccu_nm pll_video2_clk = {
-++	.enable		= BIT(31),
-++	.lock		= BIT(28),
-++	.n		= _SUNXI_CCU_MULT_MIN(8, 8, 12),
-++	.m		= _SUNXI_CCU_DIV(1, 1), /* input divider */
-++	.fixed_post_div	= 4,
-++	.min_rate	= 288000000,
-++	.max_rate	= 2400000000UL,
-++	.common		= {
-++		.reg		= 0x050,
-++		.features	= CCU_FEATURE_FIXED_POSTDIV,
-++		.hw.init	= CLK_HW_INIT("pll-video2", "osc24M",
-++					      &ccu_nm_ops,
-++					      CLK_SET_RATE_UNGATE),
-++	},
-++};
-++
-++#define SUN50I_H616_PLL_VE_REG		0x058
-++static struct ccu_nkmp pll_ve_clk = {
-++	.enable		= BIT(31),
-++	.lock		= BIT(28),
-++	.n		= _SUNXI_CCU_MULT_MIN(8, 8, 12),
-++	.m		= _SUNXI_CCU_DIV(1, 1), /* input divider */
-++	.p		= _SUNXI_CCU_DIV(0, 1), /* output divider */
-++	.common		= {
-++		.reg		= 0x058,
-++		.hw.init	= CLK_HW_INIT("pll-ve", "osc24M",
-++					      &ccu_nkmp_ops,
-++					      CLK_SET_RATE_UNGATE),
-++	},
-++};
-++
-++#define SUN50I_H616_PLL_DE_REG		0x060
-++static struct ccu_nkmp pll_de_clk = {
-++	.enable		= BIT(31),
-++	.lock		= BIT(28),
-++	.n		= _SUNXI_CCU_MULT_MIN(8, 8, 12),
-++	.m		= _SUNXI_CCU_DIV(1, 1), /* input divider */
-++	.p		= _SUNXI_CCU_DIV(0, 1), /* output divider */
-++	.common		= {
-++		.reg		= 0x060,
-++		.hw.init	= CLK_HW_INIT("pll-de", "osc24M",
-++					      &ccu_nkmp_ops,
-++					      CLK_SET_RATE_UNGATE),
-++	},
-++};
-++
-++/*
-++ * TODO: Determine SDM settings for the audio PLL. The manual suggests
-++ * PLL_FACTOR_N=16, PLL_POST_DIV_P=2, OUTPUT_DIV=2, pattern=0xe000c49b
-++ * for 24.576 MHz, and PLL_FACTOR_N=22, PLL_POST_DIV_P=3, OUTPUT_DIV=2,
-++ * pattern=0xe001288c for 22.5792 MHz.
-++ * This clashes with our fixed PLL_POST_DIV_P.
-++ */
-++#define SUN50I_H616_PLL_AUDIO_REG	0x078
-++static struct ccu_nm pll_audio_hs_clk = {
-++	.enable		= BIT(31),
-++	.lock		= BIT(28),
-++	.n		= _SUNXI_CCU_MULT_MIN(8, 8, 12),
-++	.m		= _SUNXI_CCU_DIV(1, 1), /* input divider */
-++	.common		= {
-++		.reg		= 0x078,
-++		.hw.init	= CLK_HW_INIT("pll-audio-hs", "osc24M",
-++					      &ccu_nm_ops,
-++					      CLK_SET_RATE_UNGATE),
-++	},
-++};
-++
-++static const char * const cpux_parents[] = { "osc24M", "osc32k",
-++					"iosc", "pll-cpux", "pll-periph0" };
-++static SUNXI_CCU_MUX(cpux_clk, "cpux", cpux_parents,
-++		     0x500, 24, 3, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL);
-++static SUNXI_CCU_M(axi_clk, "axi", "cpux", 0x500, 0, 2, 0);
-++static SUNXI_CCU_M(cpux_apb_clk, "cpux-apb", "cpux", 0x500, 8, 2, 0);
-++
-++static const char * const psi_ahb1_ahb2_parents[] = { "osc24M", "osc32k",
-++						      "iosc", "pll-periph0" };
-++static SUNXI_CCU_MP_WITH_MUX(psi_ahb1_ahb2_clk, "psi-ahb1-ahb2",
-++			     psi_ahb1_ahb2_parents,
-++			     0x510,
-++			     0, 2,	/* M */
-++			     8, 2,	/* P */
-++			     24, 2,	/* mux */
-++			     0);
-++
-++static const char * const ahb3_apb1_apb2_parents[] = { "osc24M", "osc32k",
-++						       "psi-ahb1-ahb2",
-++						       "pll-periph0" };
-++static SUNXI_CCU_MP_WITH_MUX(ahb3_clk, "ahb3", ahb3_apb1_apb2_parents, 0x51c,
-++			     0, 2,	/* M */
-++			     8, 2,	/* P */
-++			     24, 2,	/* mux */
-++			     0);
-++
-++static SUNXI_CCU_MP_WITH_MUX(apb1_clk, "apb1", ahb3_apb1_apb2_parents, 0x520,
-++			     0, 2,	/* M */
-++			     8, 2,	/* P */
-++			     24, 2,	/* mux */
-++			     0);
-++
-++static SUNXI_CCU_MP_WITH_MUX(apb2_clk, "apb2", ahb3_apb1_apb2_parents, 0x524,
-++			     0, 2,	/* M */
-++			     8, 2,	/* P */
-++			     24, 2,	/* mux */
-++			     0);
-++
-++static const char * const mbus_parents[] = { "osc24M", "pll-periph0-2x",
-++					     "pll-ddr0", "pll-ddr1" };
-++static SUNXI_CCU_M_WITH_MUX_GATE(mbus_clk, "mbus", mbus_parents, 0x540,
-++					0, 3,	/* M */
-++					24, 2,	/* mux */
-++					BIT(31),	/* gate */
-++					CLK_IS_CRITICAL);
-++
-++static const char * const de_parents[] = { "pll-de", "pll-periph0-2x" };
-++static SUNXI_CCU_M_WITH_MUX_GATE(de_clk, "de", de_parents, 0x600,
-++				       0, 4,	/* M */
-++				       24, 1,	/* mux */
-++				       BIT(31),	/* gate */
-++				       CLK_SET_RATE_PARENT);
-++
-++static SUNXI_CCU_GATE(bus_de_clk, "bus-de", "psi-ahb1-ahb2",
-++		      0x60c, BIT(0), 0);
-++
-++static SUNXI_CCU_M_WITH_MUX_GATE(deinterlace_clk, "deinterlace",
-++				       de_parents,
-++				       0x620,
-++				       0, 4,	/* M */
-++				       24, 1,	/* mux */
-++				       BIT(31),	/* gate */
-++				       0);
-++
-++static SUNXI_CCU_GATE(bus_deinterlace_clk, "bus-deinterlace", "psi-ahb1-ahb2",
-++		      0x62c, BIT(0), 0);
-++
-++static SUNXI_CCU_M_WITH_MUX_GATE(g2d_clk, "g2d", de_parents, 0x630,
-++				       0, 4,	/* M */
-++				       24, 1,	/* mux */
-++				       BIT(31),	/* gate */
-++				       0);
-++
-++static SUNXI_CCU_GATE(bus_g2d_clk, "bus-g2d", "psi-ahb1-ahb2",
-++		      0x63c, BIT(0), 0);
-++
-++static const char * const gpu0_parents[] = { "pll-gpu", "gpu1" };
-++static SUNXI_CCU_M_WITH_MUX_GATE(gpu0_clk, "gpu0", gpu0_parents, 0x670,
-++				       0, 2,	/* M */
-++				       24, 1,	/* mux */
-++				       BIT(31),	/* gate */
-++				       CLK_SET_RATE_PARENT);
-++static SUNXI_CCU_M_WITH_GATE(gpu1_clk, "gpu1", "pll-periph0-2x", 0x674,
-++					0, 3,	/* M */
-++					BIT(31),/* gate */
-++					0);
-++
-++static SUNXI_CCU_GATE(bus_gpu_clk, "bus-gpu", "psi-ahb1-ahb2",
-++		      0x67c, BIT(0), 0);
-++
-++static const char * const ce_parents[] = { "osc24M", "pll-periph0-2x" };
-++static SUNXI_CCU_MP_WITH_MUX_GATE(ce_clk, "ce", ce_parents, 0x680,
-++					0, 4,	/* M */
-++					8, 2,	/* N */
-++					24, 1,	/* mux */
-++					BIT(31),/* gate */
-++					0);
-++
-++static SUNXI_CCU_GATE(bus_ce_clk, "bus-ce", "psi-ahb1-ahb2",
-++		      0x68c, BIT(0), 0);
-++
-++static const char * const ve_parents[] = { "pll-ve" };
-++static SUNXI_CCU_M_WITH_MUX_GATE(ve_clk, "ve", ve_parents, 0x690,
-++				       0, 3,	/* M */
-++				       24, 1,	/* mux */
-++				       BIT(31),	/* gate */
-++				       CLK_SET_RATE_PARENT);
-++
-++static SUNXI_CCU_GATE(bus_ve_clk, "bus-ve", "psi-ahb1-ahb2",
-++		      0x69c, BIT(0), 0);
-++
-++static SUNXI_CCU_GATE(bus_dma_clk, "bus-dma", "psi-ahb1-ahb2",
-++		      0x70c, BIT(0), 0);
-++
-++static SUNXI_CCU_GATE(bus_hstimer_clk, "bus-hstimer", "psi-ahb1-ahb2",
-++		      0x73c, BIT(0), 0);
-++
-++static SUNXI_CCU_GATE(avs_clk, "avs", "osc24M", 0x740, BIT(31), 0);
-++
-++static SUNXI_CCU_GATE(bus_dbg_clk, "bus-dbg", "psi-ahb1-ahb2",
-++		      0x78c, BIT(0), 0);
-++
-++static SUNXI_CCU_GATE(bus_psi_clk, "bus-psi", "psi-ahb1-ahb2",
-++		      0x79c, BIT(0), 0);
-++
-++static SUNXI_CCU_GATE(bus_pwm_clk, "bus-pwm", "apb1", 0x7ac, BIT(0), 0);
-++
-++static SUNXI_CCU_GATE(bus_iommu_clk, "bus-iommu", "apb1", 0x7bc, BIT(0), 0);
-++
-++static const char * const dram_parents[] = { "pll-ddr0", "pll-ddr1" };
-++static struct ccu_div dram_clk = {
-++	.div		= _SUNXI_CCU_DIV(0, 2),
-++	.mux		= _SUNXI_CCU_MUX(24, 2),
-++	.common	= {
-++		.reg		= 0x800,
-++		.hw.init	= CLK_HW_INIT_PARENTS("dram",
-++						      dram_parents,
-++						      &ccu_div_ops,
-++						      CLK_IS_CRITICAL),
-++	},
-++};
-++
-++static SUNXI_CCU_GATE(mbus_dma_clk, "mbus-dma", "mbus",
-++		      0x804, BIT(0), 0);
-++static SUNXI_CCU_GATE(mbus_ve_clk, "mbus-ve", "mbus",
-++		      0x804, BIT(1), 0);
-++static SUNXI_CCU_GATE(mbus_ce_clk, "mbus-ce", "mbus",
-++		      0x804, BIT(2), 0);
-++static SUNXI_CCU_GATE(mbus_ts_clk, "mbus-ts", "mbus",
-++		      0x804, BIT(3), 0);
-++static SUNXI_CCU_GATE(mbus_nand_clk, "mbus-nand", "mbus",
-++		      0x804, BIT(5), 0);
-++static SUNXI_CCU_GATE(mbus_g2d_clk, "mbus-g2d", "mbus",
-++		      0x804, BIT(10), 0);
-++
-++static SUNXI_CCU_GATE(bus_dram_clk, "bus-dram", "psi-ahb1-ahb2",
-++		      0x80c, BIT(0), CLK_IS_CRITICAL);
-++
-++static const char * const nand_spi_parents[] = { "osc24M", "pll-periph0",
-++					     "pll-periph1", "pll-periph0-2x",
-++					     "pll-periph1-2x" };
-++static SUNXI_CCU_MP_WITH_MUX_GATE(nand0_clk, "nand0", nand_spi_parents, 0x810,
-++					0, 4,	/* M */
-++					8, 2,	/* N */
-++					24, 3,	/* mux */
-++					BIT(31),/* gate */
-++					0);
-++
-++static SUNXI_CCU_MP_WITH_MUX_GATE(nand1_clk, "nand1", nand_spi_parents, 0x814,
-++					0, 4,	/* M */
-++					8, 2,	/* N */
-++					24, 3,	/* mux */
-++					BIT(31),/* gate */
-++					0);
-++
-++static SUNXI_CCU_GATE(bus_nand_clk, "bus-nand", "ahb3", 0x82c, BIT(0), 0);
-++
-++static const char * const mmc_parents[] = { "osc24M", "pll-periph0-2x",
-++					    "pll-periph1-2x" };
-++static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc0_clk, "mmc0", mmc_parents, 0x830,
-++					  0, 4,		/* M */
-++					  8, 2,		/* N */
-++					  24, 2,	/* mux */
-++					  BIT(31),	/* gate */
-++					  2,		/* post-div */
-++					  0);
-++
-++static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc1_clk, "mmc1", mmc_parents, 0x834,
-++					  0, 4,		/* M */
-++					  8, 2,		/* N */
-++					  24, 2,	/* mux */
-++					  BIT(31),	/* gate */
-++					  2,		/* post-div */
-++					  0);
-++
-++static SUNXI_CCU_MP_WITH_MUX_GATE_POSTDIV(mmc2_clk, "mmc2", mmc_parents, 0x838,
-++					  0, 4,		/* M */
-++					  8, 2,		/* N */
-++					  24, 2,	/* mux */
-++					  BIT(31),	/* gate */
-++					  2,		/* post-div */
-++					  0);
-++
-++static SUNXI_CCU_GATE(bus_mmc0_clk, "bus-mmc0", "ahb3", 0x84c, BIT(0), 0);
-++static SUNXI_CCU_GATE(bus_mmc1_clk, "bus-mmc1", "ahb3", 0x84c, BIT(1), 0);
-++static SUNXI_CCU_GATE(bus_mmc2_clk, "bus-mmc2", "ahb3", 0x84c, BIT(2), 0);
-++
-++static SUNXI_CCU_GATE(bus_uart0_clk, "bus-uart0", "apb2", 0x90c, BIT(0), 0);
-++static SUNXI_CCU_GATE(bus_uart1_clk, "bus-uart1", "apb2", 0x90c, BIT(1), 0);
-++static SUNXI_CCU_GATE(bus_uart2_clk, "bus-uart2", "apb2", 0x90c, BIT(2), 0);
-++static SUNXI_CCU_GATE(bus_uart3_clk, "bus-uart3", "apb2", 0x90c, BIT(3), 0);
-++static SUNXI_CCU_GATE(bus_uart4_clk, "bus-uart4", "apb2", 0x90c, BIT(4), 0);
-++static SUNXI_CCU_GATE(bus_uart5_clk, "bus-uart5", "apb2", 0x90c, BIT(5), 0);
-++
-++static SUNXI_CCU_GATE(bus_i2c0_clk, "bus-i2c0", "apb2", 0x91c, BIT(0), 0);
-++static SUNXI_CCU_GATE(bus_i2c1_clk, "bus-i2c1", "apb2", 0x91c, BIT(1), 0);
-++static SUNXI_CCU_GATE(bus_i2c2_clk, "bus-i2c2", "apb2", 0x91c, BIT(2), 0);
-++static SUNXI_CCU_GATE(bus_i2c3_clk, "bus-i2c3", "apb2", 0x91c, BIT(3), 0);
-++static SUNXI_CCU_GATE(bus_i2c4_clk, "bus-i2c4", "apb2", 0x91c, BIT(4), 0);
-++
-++static SUNXI_CCU_MP_WITH_MUX_GATE(spi0_clk, "spi0", nand_spi_parents, 0x940,
-++					0, 4,	/* M */
-++					8, 2,	/* N */
-++					24, 3,	/* mux */
-++					BIT(31),/* gate */
-++					0);
-++
-++static SUNXI_CCU_MP_WITH_MUX_GATE(spi1_clk, "spi1", nand_spi_parents, 0x944,
-++					0, 4,	/* M */
-++					8, 2,	/* N */
-++					24, 3,	/* mux */
-++					BIT(31),/* gate */
-++					0);
-++
-++static SUNXI_CCU_GATE(bus_spi0_clk, "bus-spi0", "ahb3", 0x96c, BIT(0), 0);
-++static SUNXI_CCU_GATE(bus_spi1_clk, "bus-spi1", "ahb3", 0x96c, BIT(1), 0);
-++
-++static SUNXI_CCU_GATE(emac_25m_clk, "emac-25m", "ahb3", 0x970,
-++		      BIT(31) | BIT(30), 0);
-++
-++static SUNXI_CCU_GATE(bus_emac0_clk, "bus-emac0", "ahb3", 0x97c, BIT(0), 0);
-++static SUNXI_CCU_GATE(bus_emac1_clk, "bus-emac1", "ahb3", 0x97c, BIT(1), 0);
-++
-++static const char * const ts_parents[] = { "osc24M", "pll-periph0" };
-++static SUNXI_CCU_MP_WITH_MUX_GATE(ts_clk, "ts", ts_parents, 0x9b0,
-++					0, 4,	/* M */
-++					8, 2,	/* N */
-++					24, 1,	/* mux */
-++					BIT(31),/* gate */
-++					0);
-++
-++static SUNXI_CCU_GATE(bus_ts_clk, "bus-ts", "ahb3", 0x9bc, BIT(0), 0);
-++
-++static SUNXI_CCU_GATE(bus_ths_clk, "bus-ths", "apb1", 0x9fc, BIT(0), 0);
-++
-++static const char * const audio_parents[] = { "pll-audio-1x", "pll-audio-2x",
-++					      "pll-audio-4x", "pll-audio-hs" };
-++static struct ccu_div spdif_clk = {
-++	.enable		= BIT(31),
-++	.div		= _SUNXI_CCU_DIV_FLAGS(8, 2, CLK_DIVIDER_POWER_OF_TWO),
-++	.mux		= _SUNXI_CCU_MUX(24, 2),
-++	.common		= {
-++		.reg		= 0xa20,
-++		.hw.init	= CLK_HW_INIT_PARENTS("spdif",
-++						      audio_parents,
-++						      &ccu_div_ops,
-++						      0),
-++	},
-++};
-++
-++static SUNXI_CCU_GATE(bus_spdif_clk, "bus-spdif", "apb1", 0xa2c, BIT(0), 0);
-++
-++static struct ccu_div dmic_clk = {
-++	.enable		= BIT(31),
-++	.div		= _SUNXI_CCU_DIV_FLAGS(8, 2, CLK_DIVIDER_POWER_OF_TWO),
-++	.mux		= _SUNXI_CCU_MUX(24, 2),
-++	.common		= {
-++		.reg		= 0xa40,
-++		.hw.init	= CLK_HW_INIT_PARENTS("dmic",
-++						      audio_parents,
-++						      &ccu_div_ops,
-++						      0),
-++	},
-++};
-++
-++static SUNXI_CCU_GATE(bus_dmic_clk, "bus-dmic", "apb1", 0xa4c, BIT(0), 0);
-++
-++static SUNXI_CCU_M_WITH_MUX_GATE(audio_codec_1x_clk, "audio-codec-1x",
-++				 audio_parents, 0xa50,
-++				 0, 4,	/* M */
-++				 24, 2,	/* mux */
-++				 BIT(31),	/* gate */
-++				 CLK_SET_RATE_PARENT);
-++static SUNXI_CCU_M_WITH_MUX_GATE(audio_codec_4x_clk, "audio-codec-4x",
-++				 audio_parents, 0xa54,
-++				 0, 4,	/* M */
-++				 24, 2,	/* mux */
-++				 BIT(31),	/* gate */
-++				 CLK_SET_RATE_PARENT);
-++
-++static SUNXI_CCU_GATE(bus_audio_codec_clk, "bus-audio-codec", "apb1", 0xa5c,
-++		BIT(0), 0);
-++
-++static struct ccu_div audio_hub_clk = {
-++	.enable		= BIT(31),
-++	.div		= _SUNXI_CCU_DIV_FLAGS(8, 2, CLK_DIVIDER_POWER_OF_TWO),
-++	.mux		= _SUNXI_CCU_MUX(24, 2),
-++	.common		= {
-++		.reg		= 0xa60,
-++		.hw.init	= CLK_HW_INIT_PARENTS("audio-hub",
-++						      audio_parents,
-++						      &ccu_div_ops,
-++						      0),
-++	},
-++};
-++
-++static SUNXI_CCU_GATE(bus_audio_hub_clk, "bus-audio-hub", "apb1", 0xa6c, BIT(0), 0);
-++
-++/*
-++ * There are OHCI 12M clock source selection bits for 2 USB 2.0 ports.
-++ * We will force them to 0 (12M divided from 48M).
-++ */
-++#define SUN50I_H616_USB0_CLK_REG		0xa70
-++#define SUN50I_H616_USB1_CLK_REG		0xa74
-++#define SUN50I_H616_USB2_CLK_REG		0xa78
-++#define SUN50I_H616_USB3_CLK_REG		0xa7c
-++
-++static SUNXI_CCU_GATE(usb_ohci0_clk, "usb-ohci0", "osc12M", 0xa70, BIT(31), 0);
-++static SUNXI_CCU_GATE(usb_phy0_clk, "usb-phy0", "osc24M", 0xa70, BIT(29), 0);
-++
-++static SUNXI_CCU_GATE(usb_ohci1_clk, "usb-ohci1", "osc12M", 0xa74, BIT(31), 0);
-++static SUNXI_CCU_GATE(usb_phy1_clk, "usb-phy1", "osc24M", 0xa74, BIT(29), 0);
-++
-++static SUNXI_CCU_GATE(usb_ohci2_clk, "usb-ohci2", "osc12M", 0xa78, BIT(31), 0);
-++static SUNXI_CCU_GATE(usb_phy2_clk, "usb-phy2", "osc24M", 0xa78, BIT(29), 0);
-++
-++static SUNXI_CCU_GATE(usb_ohci3_clk, "usb-ohci3", "osc12M", 0xa7c, BIT(31), 0);
-++static SUNXI_CCU_GATE(usb_phy3_clk, "usb-phy3", "osc12M", 0xa7c, BIT(29), 0);
-++
-++static SUNXI_CCU_GATE(bus_ohci0_clk, "bus-ohci0", "ahb3", 0xa8c, BIT(0), 0);
-++static SUNXI_CCU_GATE(bus_ohci1_clk, "bus-ohci1", "ahb3", 0xa8c, BIT(1), 0);
-++static SUNXI_CCU_GATE(bus_ohci2_clk, "bus-ohci2", "ahb3", 0xa8c, BIT(2), 0);
-++static SUNXI_CCU_GATE(bus_ohci3_clk, "bus-ohci3", "ahb3", 0xa8c, BIT(3), 0);
-++static SUNXI_CCU_GATE(bus_ehci0_clk, "bus-ehci0", "ahb3", 0xa8c, BIT(4), 0);
-++static SUNXI_CCU_GATE(bus_ehci1_clk, "bus-ehci1", "ahb3", 0xa8c, BIT(5), 0);
-++static SUNXI_CCU_GATE(bus_ehci2_clk, "bus-ehci2", "ahb3", 0xa8c, BIT(6), 0);
-++static SUNXI_CCU_GATE(bus_ehci3_clk, "bus-ehci3", "ahb3", 0xa8c, BIT(7), 0);
-++static SUNXI_CCU_GATE(bus_otg_clk, "bus-otg", "ahb3", 0xa8c, BIT(8), 0);
-++
-++static SUNXI_CCU_GATE(bus_keyadc_clk, "bus-keyadc", "apb1", 0xa9c, BIT(0), 0);
-++
-++static struct clk_fixed_factor pll_periph0_4x_clk;
-++
-++static const char * const hdmi_parents[] = { "pll-video0", "pll-video0-4x",
-++					     "pll-video2", "pll-video2-4x" };
-++static SUNXI_CCU_M_WITH_MUX_GATE(hdmi_clk, "hdmi", hdmi_parents, 0xb00,
-++				 0, 4,		/* M */
-++				 24, 2,		/* mux */
-++				 BIT(31),	/* gate */
-++				 0);
-++
-++static SUNXI_CCU_GATE(hdmi_slow_clk, "hdmi-slow", "osc24M", 0xb04, BIT(31), 0);
-++
-++static const char * const hdmi_cec_parents[] = { "osc32k", "pll-periph0-2x" };
-++static const struct ccu_mux_fixed_prediv hdmi_cec_predivs[] = {
-++	{ .index = 1, .div = 36621 },
-++};
-++
-++#define SUN50I_H616_HDMI_CEC_CLK_REG		0xb10
-++static struct ccu_mux hdmi_cec_clk = {
-++	.enable		= BIT(31),
-++
-++	.mux		= {
-++		.shift	= 24,
-++		.width	= 2,
-++
-++		.fixed_predivs	= hdmi_cec_predivs,
-++		.n_predivs	= ARRAY_SIZE(hdmi_cec_predivs),
-++	},
-++
-++	.common		= {
-++		.reg		= 0xb10,
-++		.features	= CCU_FEATURE_VARIABLE_PREDIV,
-++		.hw.init	= CLK_HW_INIT_PARENTS("hdmi-cec",
-++						      hdmi_cec_parents,
-++						      &ccu_mux_ops,
-++						      0),
-++	},
-++};
-++
-++static SUNXI_CCU_GATE(bus_hdmi_clk, "bus-hdmi", "ahb3", 0xb1c, BIT(0), 0);
-++
-++static SUNXI_CCU_GATE(bus_tcon_top_clk, "bus-tcon-top", "ahb3",
-++		      0xb5c, BIT(0), 0);
-++
-++static const char * const tcon_tv0_parents[] = { "pll-video0",
-++						 "pll-video0-4x",
-++						 "pll-video1",
-++						 "pll-video1-4x" };
-++static SUNXI_CCU_MP_WITH_MUX_GATE(tcon_tv0_clk, "tcon-tv0",
-++				  tcon_tv0_parents, 0xb80,
-++				  0, 4,		/* M */
-++				  8, 2,		/* P */
-++				  24, 3,	/* mux */
-++				  BIT(31),	/* gate */
-++				  CLK_SET_RATE_PARENT);
-++
-++static SUNXI_CCU_GATE(bus_tcon_tv0_clk, "bus-tcon-tv0", "ahb3",
-++		      0xb9c, BIT(0), 0);
-++
-++static const char * const hdcp_parents[] = { "pll-periph0", "pll-periph1" };
-++static SUNXI_CCU_M_WITH_MUX_GATE(hdcp_clk, "hdcp", hdcp_parents, 0xc40,
-++				 0, 4,		/* M */
-++				 24, 2,		/* mux */
-++				 BIT(31),	/* gate */
-++				 0);
-++
-++static SUNXI_CCU_GATE(bus_hdcp_clk, "bus-hdcp", "ahb3", 0xc4c, BIT(0), 0);
-++
-++/* Fixed factor clocks */
-++static CLK_FIXED_FACTOR_FW_NAME(osc12M_clk, "osc12M", "hosc", 2, 1, 0);
-++
-++static const struct clk_hw *clk_parent_pll_audio[] = {
-++	&pll_audio_hs_clk.common.hw
-++};
-++
-++/*
-++ * The divider of pll-audio is fixed to 24 for now, so 24576000 and 22579200
-++ * rates can be set exactly in conjunction with sigma-delta modulation.
-++ */
-++static CLK_FIXED_FACTOR_HWS(pll_audio_1x_clk, "pll-audio-1x",
-++			    clk_parent_pll_audio,
-++			    96, 1, CLK_SET_RATE_PARENT);
-++static CLK_FIXED_FACTOR_HWS(pll_audio_2x_clk, "pll-audio-2x",
-++			    clk_parent_pll_audio,
-++			    48, 1, CLK_SET_RATE_PARENT);
-++static CLK_FIXED_FACTOR_HWS(pll_audio_4x_clk, "pll-audio-4x",
-++			    clk_parent_pll_audio,
-++			    24, 1, CLK_SET_RATE_PARENT);
-++
-++static const struct clk_hw *pll_periph0_parents[] = {
-++	&pll_periph0_clk.common.hw
-++};
-++static CLK_FIXED_FACTOR_HWS(pll_periph0_4x_clk, "pll-periph0-4x",
-++			    pll_periph0_parents,
-++			    1, 4, 0);
-++static CLK_FIXED_FACTOR_HWS(pll_periph0_2x_clk, "pll-periph0-2x",
-++			    pll_periph0_parents,
-++			    1, 2, 0);
-++
-++static const struct clk_hw *pll_periph1_parents[] = {
-++	&pll_periph1_clk.common.hw
-++};
-++static CLK_FIXED_FACTOR_HWS(pll_periph1_4x_clk, "pll-periph1-4x",
-++			    pll_periph1_parents,
-++			    1, 4, 0);
-++static CLK_FIXED_FACTOR_HWS(pll_periph1_2x_clk, "pll-periph1-2x",
-++			    pll_periph1_parents,
-++			    1, 2, 0);
-++
-++static CLK_FIXED_FACTOR_HW(pll_video0_4x_clk, "pll-video0-4x",
-++			   &pll_video0_clk.common.hw,
-++			   1, 4, CLK_SET_RATE_PARENT);
-++static CLK_FIXED_FACTOR_HW(pll_video1_4x_clk, "pll-video1-4x",
-++			   &pll_video1_clk.common.hw,
-++			   1, 4, CLK_SET_RATE_PARENT);
-++static CLK_FIXED_FACTOR_HW(pll_video2_4x_clk, "pll-video2-4x",
-++			   &pll_video2_clk.common.hw,
-++			   1, 4, CLK_SET_RATE_PARENT);
-++
-++static struct ccu_common *sun50i_h616_ccu_clks[] = {
-++	&pll_cpux_clk.common,
-++	&pll_ddr0_clk.common,
-++	&pll_ddr1_clk.common,
-++	&pll_periph0_clk.common,
-++	&pll_periph1_clk.common,
-++	&pll_gpu_clk.common,
-++	&pll_video0_clk.common,
-++	&pll_video1_clk.common,
-++	&pll_video2_clk.common,
-++	&pll_ve_clk.common,
-++	&pll_de_clk.common,
-++	&pll_audio_hs_clk.common,
-++	&cpux_clk.common,
-++	&axi_clk.common,
-++	&cpux_apb_clk.common,
-++	&psi_ahb1_ahb2_clk.common,
-++	&ahb3_clk.common,
-++	&apb1_clk.common,
-++	&apb2_clk.common,
-++	&mbus_clk.common,
-++	&de_clk.common,
-++	&bus_de_clk.common,
-++	&deinterlace_clk.common,
-++	&bus_deinterlace_clk.common,
-++	&g2d_clk.common,
-++	&bus_g2d_clk.common,
-++	&gpu0_clk.common,
-++	&bus_gpu_clk.common,
-++	&gpu1_clk.common,
-++	&ce_clk.common,
-++	&bus_ce_clk.common,
-++	&ve_clk.common,
-++	&bus_ve_clk.common,
-++	&bus_dma_clk.common,
-++	&bus_hstimer_clk.common,
-++	&avs_clk.common,
-++	&bus_dbg_clk.common,
-++	&bus_psi_clk.common,
-++	&bus_pwm_clk.common,
-++	&bus_iommu_clk.common,
-++	&dram_clk.common,
-++	&mbus_dma_clk.common,
-++	&mbus_ve_clk.common,
-++	&mbus_ce_clk.common,
-++	&mbus_ts_clk.common,
-++	&mbus_nand_clk.common,
-++	&mbus_g2d_clk.common,
-++	&bus_dram_clk.common,
-++	&nand0_clk.common,
-++	&nand1_clk.common,
-++	&bus_nand_clk.common,
-++	&mmc0_clk.common,
-++	&mmc1_clk.common,
-++	&mmc2_clk.common,
-++	&bus_mmc0_clk.common,
-++	&bus_mmc1_clk.common,
-++	&bus_mmc2_clk.common,
-++	&bus_uart0_clk.common,
-++	&bus_uart1_clk.common,
-++	&bus_uart2_clk.common,
-++	&bus_uart3_clk.common,
-++	&bus_uart4_clk.common,
-++	&bus_uart5_clk.common,
-++	&bus_i2c0_clk.common,
-++	&bus_i2c1_clk.common,
-++	&bus_i2c2_clk.common,
-++	&bus_i2c3_clk.common,
-++	&bus_i2c4_clk.common,
-++	&spi0_clk.common,
-++	&spi1_clk.common,
-++	&bus_spi0_clk.common,
-++	&bus_spi1_clk.common,
-++	&emac_25m_clk.common,
-++	&bus_emac0_clk.common,
-++	&bus_emac1_clk.common,
-++	&ts_clk.common,
-++	&bus_ts_clk.common,
-++	&bus_ths_clk.common,
-++	&spdif_clk.common,
-++	&bus_spdif_clk.common,
-++	&dmic_clk.common,
-++	&bus_dmic_clk.common,
-++	&audio_codec_1x_clk.common,
-++	&audio_codec_4x_clk.common,
-++	&bus_audio_codec_clk.common,
-++	&audio_hub_clk.common,
-++	&bus_audio_hub_clk.common,
-++	&usb_ohci0_clk.common,
-++	&usb_phy0_clk.common,
-++	&usb_ohci1_clk.common,
-++	&usb_phy1_clk.common,
-++	&usb_ohci2_clk.common,
-++	&usb_phy2_clk.common,
-++	&usb_ohci3_clk.common,
-++	&usb_phy3_clk.common,
-++	&bus_ohci0_clk.common,
-++	&bus_ohci1_clk.common,
-++	&bus_ohci2_clk.common,
-++	&bus_ohci3_clk.common,
-++	&bus_ehci0_clk.common,
-++	&bus_ehci1_clk.common,
-++	&bus_ehci2_clk.common,
-++	&bus_ehci3_clk.common,
-++	&bus_otg_clk.common,
-++	&bus_keyadc_clk.common,
-++	&hdmi_clk.common,
-++	&hdmi_slow_clk.common,
-++	&hdmi_cec_clk.common,
-++	&bus_hdmi_clk.common,
-++	&bus_tcon_top_clk.common,
-++	&tcon_tv0_clk.common,
-++	&bus_tcon_tv0_clk.common,
-++	&hdcp_clk.common,
-++	&bus_hdcp_clk.common,
-++};
-++
-++static struct clk_hw_onecell_data sun50i_h616_hw_clks = {
-++	.hws	= {
-++		[CLK_OSC12M]		= &osc12M_clk.hw,
-++		[CLK_PLL_CPUX]		= &pll_cpux_clk.common.hw,
-++		[CLK_PLL_DDR0]		= &pll_ddr0_clk.common.hw,
-++		[CLK_PLL_DDR1]		= &pll_ddr1_clk.common.hw,
-++		[CLK_PLL_PERIPH0]	= &pll_periph0_clk.common.hw,
-++		[CLK_PLL_PERIPH0_2X]	= &pll_periph0_2x_clk.hw,
-++		[CLK_PLL_PERIPH0_4X]	= &pll_periph0_4x_clk.hw,
-++		[CLK_PLL_PERIPH1]	= &pll_periph1_clk.common.hw,
-++		[CLK_PLL_PERIPH1_2X]	= &pll_periph1_2x_clk.hw,
-++		[CLK_PLL_PERIPH1_4X]	= &pll_periph1_4x_clk.hw,
-++		[CLK_PLL_GPU]		= &pll_gpu_clk.common.hw,
-++		[CLK_PLL_VIDEO0]	= &pll_video0_clk.common.hw,
-++		[CLK_PLL_VIDEO0_4X]	= &pll_video0_4x_clk.hw,
-++		[CLK_PLL_VIDEO1]	= &pll_video1_clk.common.hw,
-++		[CLK_PLL_VIDEO1_4X]	= &pll_video1_4x_clk.hw,
-++		[CLK_PLL_VIDEO2]	= &pll_video2_clk.common.hw,
-++		[CLK_PLL_VIDEO2_4X]	= &pll_video2_4x_clk.hw,
-++		[CLK_PLL_VE]		= &pll_ve_clk.common.hw,
-++		[CLK_PLL_DE]		= &pll_de_clk.common.hw,
-++		[CLK_PLL_AUDIO_HS]	= &pll_audio_hs_clk.common.hw,
-++		[CLK_PLL_AUDIO_1X]	= &pll_audio_1x_clk.hw,
-++		[CLK_PLL_AUDIO_2X]	= &pll_audio_2x_clk.hw,
-++		[CLK_PLL_AUDIO_4X]	= &pll_audio_4x_clk.hw,
-++		[CLK_CPUX]		= &cpux_clk.common.hw,
-++		[CLK_AXI]		= &axi_clk.common.hw,
-++		[CLK_CPUX_APB]		= &cpux_apb_clk.common.hw,
-++		[CLK_PSI_AHB1_AHB2]	= &psi_ahb1_ahb2_clk.common.hw,
-++		[CLK_AHB3]		= &ahb3_clk.common.hw,
-++		[CLK_APB1]		= &apb1_clk.common.hw,
-++		[CLK_APB2]		= &apb2_clk.common.hw,
-++		[CLK_MBUS]		= &mbus_clk.common.hw,
-++		[CLK_DE]		= &de_clk.common.hw,
-++		[CLK_BUS_DE]		= &bus_de_clk.common.hw,
-++		[CLK_DEINTERLACE]	= &deinterlace_clk.common.hw,
-++		[CLK_BUS_DEINTERLACE]	= &bus_deinterlace_clk.common.hw,
-++		[CLK_G2D]		= &g2d_clk.common.hw,
-++		[CLK_BUS_G2D]		= &bus_g2d_clk.common.hw,
-++		[CLK_GPU0]		= &gpu0_clk.common.hw,
-++		[CLK_BUS_GPU]		= &bus_gpu_clk.common.hw,
-++		[CLK_GPU1]		= &gpu1_clk.common.hw,
-++		[CLK_CE]		= &ce_clk.common.hw,
-++		[CLK_BUS_CE]		= &bus_ce_clk.common.hw,
-++		[CLK_VE]		= &ve_clk.common.hw,
-++		[CLK_BUS_VE]		= &bus_ve_clk.common.hw,
-++		[CLK_BUS_DMA]		= &bus_dma_clk.common.hw,
-++		[CLK_BUS_HSTIMER]	= &bus_hstimer_clk.common.hw,
-++		[CLK_AVS]		= &avs_clk.common.hw,
-++		[CLK_BUS_DBG]		= &bus_dbg_clk.common.hw,
-++		[CLK_BUS_PSI]		= &bus_psi_clk.common.hw,
-++		[CLK_BUS_PWM]		= &bus_pwm_clk.common.hw,
-++		[CLK_BUS_IOMMU]		= &bus_iommu_clk.common.hw,
-++		[CLK_DRAM]		= &dram_clk.common.hw,
-++		[CLK_MBUS_DMA]		= &mbus_dma_clk.common.hw,
-++		[CLK_MBUS_VE]		= &mbus_ve_clk.common.hw,
-++		[CLK_MBUS_CE]		= &mbus_ce_clk.common.hw,
-++		[CLK_MBUS_TS]		= &mbus_ts_clk.common.hw,
-++		[CLK_MBUS_NAND]		= &mbus_nand_clk.common.hw,
-++		[CLK_MBUS_G2D]		= &mbus_g2d_clk.common.hw,
-++		[CLK_BUS_DRAM]		= &bus_dram_clk.common.hw,
-++		[CLK_NAND0]		= &nand0_clk.common.hw,
-++		[CLK_NAND1]		= &nand1_clk.common.hw,
-++		[CLK_BUS_NAND]		= &bus_nand_clk.common.hw,
-++		[CLK_MMC0]		= &mmc0_clk.common.hw,
-++		[CLK_MMC1]		= &mmc1_clk.common.hw,
-++		[CLK_MMC2]		= &mmc2_clk.common.hw,
-++		[CLK_BUS_MMC0]		= &bus_mmc0_clk.common.hw,
-++		[CLK_BUS_MMC1]		= &bus_mmc1_clk.common.hw,
-++		[CLK_BUS_MMC2]		= &bus_mmc2_clk.common.hw,
-++		[CLK_BUS_UART0]		= &bus_uart0_clk.common.hw,
-++		[CLK_BUS_UART1]		= &bus_uart1_clk.common.hw,
-++		[CLK_BUS_UART2]		= &bus_uart2_clk.common.hw,
-++		[CLK_BUS_UART3]		= &bus_uart3_clk.common.hw,
-++		[CLK_BUS_UART4]		= &bus_uart4_clk.common.hw,
-++		[CLK_BUS_UART5]		= &bus_uart5_clk.common.hw,
-++		[CLK_BUS_I2C0]		= &bus_i2c0_clk.common.hw,
-++		[CLK_BUS_I2C1]		= &bus_i2c1_clk.common.hw,
-++		[CLK_BUS_I2C2]		= &bus_i2c2_clk.common.hw,
-++		[CLK_BUS_I2C3]		= &bus_i2c3_clk.common.hw,
-++		[CLK_BUS_I2C4]		= &bus_i2c4_clk.common.hw,
-++		[CLK_SPI0]		= &spi0_clk.common.hw,
-++		[CLK_SPI1]		= &spi1_clk.common.hw,
-++		[CLK_BUS_SPI0]		= &bus_spi0_clk.common.hw,
-++		[CLK_BUS_SPI1]		= &bus_spi1_clk.common.hw,
-++		[CLK_EMAC_25M]		= &emac_25m_clk.common.hw,
-++		[CLK_BUS_EMAC0]		= &bus_emac0_clk.common.hw,
-++		[CLK_BUS_EMAC1]		= &bus_emac1_clk.common.hw,
-++		[CLK_TS]		= &ts_clk.common.hw,
-++		[CLK_BUS_TS]		= &bus_ts_clk.common.hw,
-++		[CLK_BUS_THS]		= &bus_ths_clk.common.hw,
-++		[CLK_SPDIF]		= &spdif_clk.common.hw,
-++		[CLK_BUS_SPDIF]		= &bus_spdif_clk.common.hw,
-++		[CLK_DMIC]		= &dmic_clk.common.hw,
-++		[CLK_BUS_DMIC]		= &bus_dmic_clk.common.hw,
-++		[CLK_AUDIO_CODEC_1X]	= &audio_codec_1x_clk.common.hw,
-++		[CLK_AUDIO_CODEC_4X]	= &audio_codec_4x_clk.common.hw,
-++		[CLK_BUS_AUDIO_CODEC]	= &bus_audio_codec_clk.common.hw,
-++		[CLK_AUDIO_HUB]		= &audio_hub_clk.common.hw,
-++		[CLK_BUS_AUDIO_HUB]	= &bus_audio_hub_clk.common.hw,
-++		[CLK_USB_OHCI0]		= &usb_ohci0_clk.common.hw,
-++		[CLK_USB_PHY0]		= &usb_phy0_clk.common.hw,
-++		[CLK_USB_OHCI1]		= &usb_ohci1_clk.common.hw,
-++		[CLK_USB_PHY1]		= &usb_phy1_clk.common.hw,
-++		[CLK_USB_OHCI2]		= &usb_ohci2_clk.common.hw,
-++		[CLK_USB_PHY2]		= &usb_phy2_clk.common.hw,
-++		[CLK_USB_OHCI3]		= &usb_ohci3_clk.common.hw,
-++		[CLK_USB_PHY3]		= &usb_phy3_clk.common.hw,
-++		[CLK_BUS_OHCI0]		= &bus_ohci0_clk.common.hw,
-++		[CLK_BUS_OHCI1]		= &bus_ohci1_clk.common.hw,
-++		[CLK_BUS_OHCI2]		= &bus_ohci2_clk.common.hw,
-++		[CLK_BUS_OHCI3]		= &bus_ohci3_clk.common.hw,
-++		[CLK_BUS_EHCI0]		= &bus_ehci0_clk.common.hw,
-++		[CLK_BUS_EHCI1]		= &bus_ehci1_clk.common.hw,
-++		[CLK_BUS_EHCI2]		= &bus_ehci2_clk.common.hw,
-++		[CLK_BUS_EHCI3]		= &bus_ehci3_clk.common.hw,
-++		[CLK_BUS_OTG]		= &bus_otg_clk.common.hw,
-++		[CLK_BUS_KEYADC]	= &bus_keyadc_clk.common.hw,
-++		[CLK_HDMI]		= &hdmi_clk.common.hw,
-++		[CLK_HDMI_SLOW]		= &hdmi_slow_clk.common.hw,
-++		[CLK_HDMI_CEC]		= &hdmi_cec_clk.common.hw,
-++		[CLK_BUS_HDMI]		= &bus_hdmi_clk.common.hw,
-++		[CLK_BUS_TCON_TOP]	= &bus_tcon_top_clk.common.hw,
-++		[CLK_TCON_TV0]		= &tcon_tv0_clk.common.hw,
-++		[CLK_BUS_TCON_TV0]	= &bus_tcon_tv0_clk.common.hw,
-++		[CLK_HDCP]		= &hdcp_clk.common.hw,
-++		[CLK_BUS_HDCP]		= &bus_hdcp_clk.common.hw,
-++	},
-++	.num = CLK_NUMBER,
-++};
-++
-++static struct ccu_reset_map sun50i_h616_ccu_resets[] = {
-++	[RST_MBUS]		= { 0x540, BIT(30) },
-++
-++	[RST_BUS_DE]		= { 0x60c, BIT(16) },
-++	[RST_BUS_DEINTERLACE]	= { 0x62c, BIT(16) },
-++	[RST_BUS_GPU]		= { 0x67c, BIT(16) },
-++	[RST_BUS_CE]		= { 0x68c, BIT(16) },
-++	[RST_BUS_VE]		= { 0x69c, BIT(16) },
-++	[RST_BUS_DMA]		= { 0x70c, BIT(16) },
-++	[RST_BUS_HSTIMER]	= { 0x73c, BIT(16) },
-++	[RST_BUS_DBG]		= { 0x78c, BIT(16) },
-++	[RST_BUS_PSI]		= { 0x79c, BIT(16) },
-++	[RST_BUS_PWM]		= { 0x7ac, BIT(16) },
-++	[RST_BUS_IOMMU]		= { 0x7bc, BIT(16) },
-++	[RST_BUS_DRAM]		= { 0x80c, BIT(16) },
-++	[RST_BUS_NAND]		= { 0x82c, BIT(16) },
-++	[RST_BUS_MMC0]		= { 0x84c, BIT(16) },
-++	[RST_BUS_MMC1]		= { 0x84c, BIT(17) },
-++	[RST_BUS_MMC2]		= { 0x84c, BIT(18) },
-++	[RST_BUS_UART0]		= { 0x90c, BIT(16) },
-++	[RST_BUS_UART1]		= { 0x90c, BIT(17) },
-++	[RST_BUS_UART2]		= { 0x90c, BIT(18) },
-++	[RST_BUS_UART3]		= { 0x90c, BIT(19) },
-++	[RST_BUS_UART4]		= { 0x90c, BIT(20) },
-++	[RST_BUS_UART5]		= { 0x90c, BIT(21) },
-++	[RST_BUS_I2C0]		= { 0x91c, BIT(16) },
-++	[RST_BUS_I2C1]		= { 0x91c, BIT(17) },
-++	[RST_BUS_I2C2]		= { 0x91c, BIT(18) },
-++	[RST_BUS_I2C3]		= { 0x91c, BIT(19) },
-++	[RST_BUS_I2C4]		= { 0x91c, BIT(20) },
-++	[RST_BUS_SPI0]		= { 0x96c, BIT(16) },
-++	[RST_BUS_SPI1]		= { 0x96c, BIT(17) },
-++	[RST_BUS_EMAC0]		= { 0x97c, BIT(16) },
-++	[RST_BUS_EMAC1]		= { 0x97c, BIT(17) },
-++	[RST_BUS_TS]		= { 0x9bc, BIT(16) },
-++	[RST_BUS_THS]		= { 0x9fc, BIT(16) },
-++	[RST_BUS_SPDIF]		= { 0xa2c, BIT(16) },
-++	[RST_BUS_DMIC]		= { 0xa4c, BIT(16) },
-++	[RST_BUS_AUDIO_CODEC]	= { 0xa5c, BIT(16) },
-++	[RST_BUS_AUDIO_HUB]	= { 0xa6c, BIT(16) },
-++
-++	[RST_USB_PHY0]		= { 0xa70, BIT(30) },
-++	[RST_USB_PHY1]		= { 0xa74, BIT(30) },
-++	[RST_USB_PHY2]		= { 0xa78, BIT(30) },
-++	[RST_USB_PHY3]		= { 0xa7c, BIT(30) },
-++
-++	[RST_BUS_OHCI0]		= { 0xa8c, BIT(16) },
-++	[RST_BUS_OHCI1]		= { 0xa8c, BIT(17) },
-++	[RST_BUS_OHCI2]		= { 0xa8c, BIT(18) },
-++	[RST_BUS_OHCI3]		= { 0xa8c, BIT(19) },
-++	[RST_BUS_EHCI0]		= { 0xa8c, BIT(20) },
-++	[RST_BUS_EHCI1]		= { 0xa8c, BIT(21) },
-++	[RST_BUS_EHCI2]		= { 0xa8c, BIT(22) },
-++	[RST_BUS_EHCI3]		= { 0xa8c, BIT(23) },
-++	[RST_BUS_OTG]		= { 0xa8c, BIT(24) },
-++	[RST_BUS_KEYADC]	= { 0xa9c, BIT(16) },
-++
-++	[RST_BUS_HDMI]		= { 0xb1c, BIT(16) },
-++	[RST_BUS_HDMI_SUB]	= { 0xb1c, BIT(17) },
-++	[RST_BUS_TCON_TOP]	= { 0xb5c, BIT(16) },
-++	[RST_BUS_TCON_TV0]	= { 0xb9c, BIT(16) },
-++	[RST_BUS_HDCP]		= { 0xc4c, BIT(16) },
-++};
-++
-++static const struct sunxi_ccu_desc sun50i_h616_ccu_desc = {
-++	.ccu_clks	= sun50i_h616_ccu_clks,
-++	.num_ccu_clks	= ARRAY_SIZE(sun50i_h616_ccu_clks),
-++
-++	.hw_clks	= &sun50i_h616_hw_clks,
-++
-++	.resets		= sun50i_h616_ccu_resets,
-++	.num_resets	= ARRAY_SIZE(sun50i_h616_ccu_resets),
-++};
-++
-++static const u32 pll_regs[] = {
-++	SUN50I_H616_PLL_CPUX_REG,
-++	SUN50I_H616_PLL_DDR0_REG,
-++	SUN50I_H616_PLL_DDR1_REG,
-++	SUN50I_H616_PLL_PERIPH0_REG,
-++	SUN50I_H616_PLL_PERIPH1_REG,
-++	SUN50I_H616_PLL_GPU_REG,
-++	SUN50I_H616_PLL_VIDEO0_REG,
-++	SUN50I_H616_PLL_VIDEO1_REG,
-++	SUN50I_H616_PLL_VIDEO2_REG,
-++	SUN50I_H616_PLL_VE_REG,
-++	SUN50I_H616_PLL_DE_REG,
-++	SUN50I_H616_PLL_AUDIO_REG,
-++};
-++
-++static const u32 pll_video_regs[] = {
-++	SUN50I_H616_PLL_VIDEO0_REG,
-++	SUN50I_H616_PLL_VIDEO1_REG,
-++	SUN50I_H616_PLL_VIDEO2_REG,
-++};
-++
-++static const u32 usb2_clk_regs[] = {
-++	SUN50I_H616_USB0_CLK_REG,
-++	SUN50I_H616_USB1_CLK_REG,
-++	SUN50I_H616_USB2_CLK_REG,
-++	SUN50I_H616_USB3_CLK_REG,
-++};
-++
-++static int sun50i_h616_ccu_probe(struct platform_device *pdev)
-++{
-++	struct resource *res;
-++	void __iomem *reg;
-++	u32 val;
-++	int i;
-++
-++	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-++	reg = devm_ioremap_resource(&pdev->dev, res);
-++	if (IS_ERR(reg))
-++		return PTR_ERR(reg);
-++
-++	/* Enable the lock bits on all PLLs */
-++	for (i = 0; i < ARRAY_SIZE(pll_regs); i++) {
-++		val = readl(reg + pll_regs[i]);
-++		val |= BIT(29);
-++		writel(val, reg + pll_regs[i]);
-++	}
-++
-++	/*
-++	 * Force the output divider of video PLLs to 0.
-++	 *
-++	 * See the comment before pll-video0 definition for the reason.
-++	 */
-++	for (i = 0; i < ARRAY_SIZE(pll_video_regs); i++) {
-++		val = readl(reg + pll_video_regs[i]);
-++		val &= ~BIT(0);
-++		writel(val, reg + pll_video_regs[i]);
-++	}
-++
-++	/*
-++	 * Force OHCI 12M clock sources to 00 (12MHz divided from 48MHz)
-++	 *
-++	 * This clock mux is still mysterious, and the code just enforces
-++	 * it to have a valid clock parent.
-++	 */
-++	for (i = 0; i < ARRAY_SIZE(usb2_clk_regs); i++) {
-++		val = readl(reg + usb2_clk_regs[i]);
-++		val &= ~GENMASK(25, 24);
-++		writel (val, reg + usb2_clk_regs[i]);
-++	}
-++
-++	/*
-++	 * Force the post-divider of pll-audio to 12 and the output divider
-++	 * of it to 2, so 24576000 and 22579200 rates can be set exactly.
-++	 */
-++	val = readl(reg + SUN50I_H616_PLL_AUDIO_REG);
-++	val &= ~(GENMASK(21, 16) | BIT(0));
-++	writel(val | (11 << 16) | BIT(0), reg + SUN50I_H616_PLL_AUDIO_REG);
-++
-++	/*
-++	 * First clock parent (osc32K) is unusable for CEC. But since there
-++	 * is no good way to force parent switch (both run with same frequency),
-++	 * just set second clock parent here.
-++	 */
-++	val = readl(reg + SUN50I_H616_HDMI_CEC_CLK_REG);
-++	val |= BIT(24);
-++	writel(val, reg + SUN50I_H616_HDMI_CEC_CLK_REG);
-++
-++	return sunxi_ccu_probe(pdev->dev.of_node, reg, &sun50i_h616_ccu_desc);
-++}
-++
-++static const struct of_device_id sun50i_h616_ccu_ids[] = {
-++	{ .compatible = "allwinner,sun50i-h616-ccu",
-++		.data = &sun50i_h616_ccu_desc },
-++	{ }
-++};
-++
-++static struct platform_driver sun50i_h616_ccu_driver = {
-++	.probe	= sun50i_h616_ccu_probe,
-++	.driver	= {
-++		.name	= "sun50i-h616-ccu",
-++		.of_match_table	= sun50i_h616_ccu_ids,
-++	},
-++};
-++builtin_platform_driver(sun50i_h616_ccu_driver);
-+diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h616.h b/drivers/clk/sunxi-ng/ccu-sun50i-h616.h
-+new file mode 100644
-+index 000000000000..da8f0b1206f9
-+--- /dev/null
-++++ b/drivers/clk/sunxi-ng/ccu-sun50i-h616.h
-+@@ -0,0 +1,58 @@ 
-++/* SPDX-License-Identifier: GPL-2.0 */
-++/*
-++ * Copyright 2020 Arm Ltd.
-++ */
-++
-++#ifndef _CCU_SUN50I_H616_H_
-++#define _CCU_SUN50I_H616_H_
-++
-++#include <dt-bindings/clock/sun50i-h616-ccu.h>
-++#include <dt-bindings/reset/sun50i-h616-ccu.h>
-++
-++#define CLK_OSC12M		0
-++#define CLK_PLL_CPUX		1
-++#define CLK_PLL_DDR0		2
-++#define CLK_PLL_DDR1		3
-++
-++/* PLL_PERIPH0 exported for PRCM */
-++
-++#define CLK_PLL_PERIPH0_2X	5
-++#define CLK_PLL_PERIPH0_4X	6
-++#define CLK_PLL_PERIPH1		7
-++#define CLK_PLL_PERIPH1_2X	8
-++#define CLK_PLL_PERIPH1_4X	9
-++#define CLK_PLL_GPU		10
-++#define CLK_PLL_VIDEO0		11
-++#define CLK_PLL_VIDEO0_4X	12
-++#define CLK_PLL_VIDEO1		13
-++#define CLK_PLL_VIDEO1_4X	14
-++#define CLK_PLL_VIDEO2		15
-++#define CLK_PLL_VIDEO2_4X	16
-++#define CLK_PLL_VE		17
-++#define CLK_PLL_DE		18
-++#define CLK_PLL_AUDIO_HS	19
-++#define CLK_PLL_AUDIO_1X	20
-++#define CLK_PLL_AUDIO_2X	21
-++#define CLK_PLL_AUDIO_4X	22
-++
-++/* CPUX clock exported for DVFS */
-++
-++#define CLK_AXI			24
-++#define CLK_CPUX_APB		25
-++#define CLK_PSI_AHB1_AHB2	26
-++#define CLK_AHB3		27
-++
-++/* APB1 clock exported for PIO */
-++
-++#define CLK_APB2		29
-++#define CLK_MBUS		30
-++
-++/* All module clocks and bus gates are exported except DRAM */
-++
-++#define CLK_DRAM		51
-++
-++#define CLK_BUS_DRAM		58
-++
-++#define CLK_NUMBER		(CLK_BUS_HDCP + 1)
-++
-++#endif /* _CCU_SUN50I_H616_H_ */
-+diff --git a/include/dt-bindings/clock/sun50i-h616-ccu.h b/include/dt-bindings/clock/sun50i-h616-ccu.h
-+new file mode 100644
-+index 000000000000..a9cc8844e3a9
-+--- /dev/null
-++++ b/include/dt-bindings/clock/sun50i-h616-ccu.h
-+@@ -0,0 +1,110 @@ 
-++// SPDX-License-Identifier: (GPL-2.0+ or MIT)
-++/*
-++ * Copyright (C) 2020 Arm Ltd.
-++ */
-++
-++#ifndef _DT_BINDINGS_CLK_SUN50I_H616_H_
-++#define _DT_BINDINGS_CLK_SUN50I_H616_H_
-++
-++#define CLK_PLL_PERIPH0		4
-++
-++#define CLK_CPUX		23
-++
-++#define CLK_APB1		28
-++
-++#define CLK_DE			31
-++#define CLK_BUS_DE		32
-++#define CLK_DEINTERLACE		33
-++#define CLK_BUS_DEINTERLACE	34
-++#define CLK_G2D			35
-++#define CLK_BUS_G2D		36
-++#define CLK_GPU0		37
-++#define CLK_BUS_GPU		38
-++#define CLK_GPU1		39
-++#define CLK_CE			40
-++#define CLK_BUS_CE		41
-++#define CLK_VE			42
-++#define CLK_BUS_VE		43
-++#define CLK_BUS_DMA		44
-++#define CLK_BUS_HSTIMER		45
-++#define CLK_AVS			46
-++#define CLK_BUS_DBG		47
-++#define CLK_BUS_PSI		48
-++#define CLK_BUS_PWM		49
-++#define CLK_BUS_IOMMU		50
-++
-++#define CLK_MBUS_DMA		52
-++#define CLK_MBUS_VE		53
-++#define CLK_MBUS_CE		54
-++#define CLK_MBUS_TS		55
-++#define CLK_MBUS_NAND		56
-++#define CLK_MBUS_G2D		57
-++
-++#define CLK_NAND0		59
-++#define CLK_NAND1		60
-++#define CLK_BUS_NAND		61
-++#define CLK_MMC0		62
-++#define CLK_MMC1		63
-++#define CLK_MMC2		64
-++#define CLK_BUS_MMC0		65
-++#define CLK_BUS_MMC1		66
-++#define CLK_BUS_MMC2		67
-++#define CLK_BUS_UART0		68
-++#define CLK_BUS_UART1		69
-++#define CLK_BUS_UART2		70
-++#define CLK_BUS_UART3		71
-++#define CLK_BUS_UART4		72
-++#define CLK_BUS_UART5		73
-++#define CLK_BUS_I2C0		74
-++#define CLK_BUS_I2C1		75
-++#define CLK_BUS_I2C2		76
-++#define CLK_BUS_I2C3		77
-++#define CLK_BUS_I2C4		78
-++#define CLK_SPI0		79
-++#define CLK_SPI1		80
-++#define CLK_BUS_SPI0		81
-++#define CLK_BUS_SPI1		82
-++#define CLK_EMAC_25M		83
-++#define CLK_BUS_EMAC0		84
-++#define CLK_BUS_EMAC1		85
-++#define CLK_TS			86
-++#define CLK_BUS_TS		87
-++#define CLK_BUS_THS		88
-++#define CLK_SPDIF		89
-++#define CLK_BUS_SPDIF		90
-++#define CLK_DMIC		91
-++#define CLK_BUS_DMIC		92
-++#define CLK_AUDIO_CODEC_1X	93
-++#define CLK_AUDIO_CODEC_4X	94
-++#define CLK_BUS_AUDIO_CODEC	95
-++#define CLK_AUDIO_HUB		96
-++#define CLK_BUS_AUDIO_HUB	97
-++#define CLK_USB_OHCI0		98
-++#define CLK_USB_PHY0		99
-++#define CLK_USB_OHCI1		100
-++#define CLK_USB_PHY1		101
-++#define CLK_USB_OHCI2		102
-++#define CLK_USB_PHY2		103
-++#define CLK_USB_OHCI3		104
-++#define CLK_USB_PHY3		105
-++#define CLK_BUS_OHCI0		106
-++#define CLK_BUS_OHCI1		107
-++#define CLK_BUS_OHCI2		108
-++#define CLK_BUS_OHCI3		109
-++#define CLK_BUS_EHCI0		110
-++#define CLK_BUS_EHCI1		111
-++#define CLK_BUS_EHCI2		112
-++#define CLK_BUS_EHCI3		113
-++#define CLK_BUS_OTG		114
-++#define CLK_BUS_KEYADC		115
-++#define CLK_HDMI		116
-++#define CLK_HDMI_SLOW		117
-++#define CLK_HDMI_CEC		118
-++#define CLK_BUS_HDMI		119
-++#define CLK_BUS_TCON_TOP	120
-++#define CLK_TCON_TV0		121
-++#define CLK_BUS_TCON_TV0	122
-++#define CLK_HDCP		123
-++#define CLK_BUS_HDCP		124
-++
-++#endif /* _DT_BINDINGS_CLK_SUN50I_H616_H_ */
-+diff --git a/include/dt-bindings/reset/sun50i-h616-ccu.h b/include/dt-bindings/reset/sun50i-h616-ccu.h
-+new file mode 100644
-+index 000000000000..1c992cfbbbab
-+--- /dev/null
-++++ b/include/dt-bindings/reset/sun50i-h616-ccu.h
-+@@ -0,0 +1,67 @@ 
-++// SPDX-License-Identifier: (GPL-2.0+ or MIT)
-++/*
-++ * Copyright (C) 2017 Icenowy Zheng <[email protected]>
-++ */
-++
-++#ifndef _DT_BINDINGS_RESET_SUN50I_H616_H_
-++#define _DT_BINDINGS_RESET_SUN50I_H616_H_
-++
-++#define RST_MBUS		0
-++#define RST_BUS_DE		1
-++#define RST_BUS_DEINTERLACE	2
-++#define RST_BUS_GPU		3
-++#define RST_BUS_CE		4
-++#define RST_BUS_VE		5
-++#define RST_BUS_DMA		6
-++#define RST_BUS_HSTIMER		7
-++#define RST_BUS_DBG		8
-++#define RST_BUS_PSI		9
-++#define RST_BUS_PWM		10
-++#define RST_BUS_IOMMU		11
-++#define RST_BUS_DRAM		12
-++#define RST_BUS_NAND		13
-++#define RST_BUS_MMC0		14
-++#define RST_BUS_MMC1		15
-++#define RST_BUS_MMC2		16
-++#define RST_BUS_UART0		17
-++#define RST_BUS_UART1		18
-++#define RST_BUS_UART2		19
-++#define RST_BUS_UART3		20
-++#define RST_BUS_UART4		21
-++#define RST_BUS_UART5		22
-++#define RST_BUS_I2C0		23
-++#define RST_BUS_I2C1		24
-++#define RST_BUS_I2C2		25
-++#define RST_BUS_I2C3		26
-++#define RST_BUS_I2C4		27
-++#define RST_BUS_SPI0		28
-++#define RST_BUS_SPI1		29
-++#define RST_BUS_EMAC0		30
-++#define RST_BUS_EMAC1		31
-++#define RST_BUS_TS		32
-++#define RST_BUS_THS		33
-++#define RST_BUS_SPDIF		34
-++#define RST_BUS_DMIC		35
-++#define RST_BUS_AUDIO_CODEC	36
-++#define RST_BUS_AUDIO_HUB	37
-++#define RST_USB_PHY0		38
-++#define RST_USB_PHY1		39
-++#define RST_USB_PHY2		40
-++#define RST_USB_PHY3		41
-++#define RST_BUS_OHCI0		42
-++#define RST_BUS_OHCI1		43
-++#define RST_BUS_OHCI2		44
-++#define RST_BUS_OHCI3		45
-++#define RST_BUS_EHCI0		46
-++#define RST_BUS_EHCI1		47
-++#define RST_BUS_EHCI2		48
-++#define RST_BUS_EHCI3		49
-++#define RST_BUS_OTG		50
-++#define RST_BUS_HDMI		51
-++#define RST_BUS_HDMI_SUB	52
-++#define RST_BUS_TCON_TOP	53
-++#define RST_BUS_TCON_TV0	54
-++#define RST_BUS_HDCP		55
-++#define RST_BUS_KEYADC		56
-++
-++#endif /* _DT_BINDINGS_RESET_SUN50I_H616_H_ */
-diff --git a/target/linux/sunxi/patches-5.10/506-add-support-for-A100-mmc-controller.patch b/target/linux/sunxi/patches-5.10/506-add-support-for-A100-mmc-controller.patch
-new file mode 100644
-index 0000000000000..fd03037553125
---- /dev/null
-+++ b/target/linux/sunxi/patches-5.10/506-add-support-for-A100-mmc-controller.patch
-@@ -0,0 +1,65 @@
-+diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
-+index fc62773602ec..1518b64112b7 100644
-+@@ -244,6 +244,7 @@
-+ 
-+ struct sunxi_mmc_cfg {
-+ 	u32 idma_des_size_bits;
-++	u32 idma_des_shift;
-+ 	const struct sunxi_mmc_clk_delay *clk_delays;
-+ 
-+ 	/* does the IP block support autocalibration? */
-+@@ -343,7 +344,7 @@
-+ 	/* Enable CEATA support */
-+ 	mmc_writel(host, REG_FUNS, SDXC_CEATA_ON);
-+ 	/* Set DMA descriptor list base address */
-+-	mmc_writel(host, REG_DLBA, host->sg_dma);
-++	mmc_writel(host, REG_DLBA, host->sg_dma >> host->cfg->idma_des_shift);
-+ 
-+ 	rval = mmc_readl(host, REG_GCTRL);
-+ 	rval |= SDXC_INTERRUPT_ENABLE_BIT;
-+@@ -373,8 +374,10 @@
-+ 
-+ 		next_desc += sizeof(struct sunxi_idma_des);
-+ 		pdes[i].buf_addr_ptr1 =
-+-			cpu_to_le32(sg_dma_address(&data->sg[i]));
-+-		pdes[i].buf_addr_ptr2 = cpu_to_le32((u32)next_desc);
-++			cpu_to_le32(sg_dma_address(&data->sg[i]) >>
-++				    host->cfg->idma_des_shift);
-++		pdes[i].buf_addr_ptr2 = cpu_to_le32((u32)next_desc >>
-++						    host->cfg->idma_des_shift);
-+ 	}
-+ 
-+ 	pdes[0].config |= cpu_to_le32(SDXC_IDMAC_DES0_FD);
-+@@ -1178,6 +1181,23 @@
-+ 	.needs_new_timings = true,
-+ };
-+ 
-++static const struct sunxi_mmc_cfg sun50i_a100_cfg = {
-++	.idma_des_size_bits = 16,
-++	.idma_des_shift = 2,
-++	.clk_delays = NULL,
-++	.can_calibrate = true,
-++	.mask_data0 = true,
-++	.needs_new_timings = true,
-++};
-++
-++static const struct sunxi_mmc_cfg sun50i_a100_emmc_cfg = {
-++	.idma_des_size_bits = 13,
-++	.idma_des_shift = 2,
-++	.clk_delays = NULL,
-++	.can_calibrate = true,
-++	.needs_new_timings = true,
-++};
-++
-+ static const struct of_device_id sunxi_mmc_of_match[] = {
-+ 	{ .compatible = "allwinner,sun4i-a10-mmc", .data = &sun4i_a10_cfg },
-+ 	{ .compatible = "allwinner,sun5i-a13-mmc", .data = &sun5i_a13_cfg },
-+@@ -1186,6 +1206,8 @@
-+ 	{ .compatible = "allwinner,sun9i-a80-mmc", .data = &sun9i_a80_cfg },
-+ 	{ .compatible = "allwinner,sun50i-a64-mmc", .data = &sun50i_a64_cfg },
-+ 	{ .compatible = "allwinner,sun50i-a64-emmc", .data = &sun50i_a64_emmc_cfg },
-++	{ .compatible = "allwinner,sun50i-a100-mmc", .data = &sun50i_a100_cfg },
-++	{ .compatible = "allwinner,sun50i-a100-emmc", .data = &sun50i_a100_emmc_cfg },
-+ 	{ /* sentinel */ }
-+ };
-+ MODULE_DEVICE_TABLE(of, sunxi_mmc_of_match);
-diff --git a/target/linux/sunxi/patches-5.10/507-Add-Allwinner-H616-.dtsi-file.patch b/target/linux/sunxi/patches-5.10/507-Add-Allwinner-H616-.dtsi-file.patch
-new file mode 100644
-index 0000000000000..32bf6471606b1
---- /dev/null
-+++ b/target/linux/sunxi/patches-5.10/507-Add-Allwinner-H616-.dtsi-file.patch
-@@ -0,0 +1,710 @@
-+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
-+new file mode 100644
-+index 000000000000..dcffbfdcd26b
-+--- /dev/null
-++++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
-+@@ -0,0 +1,704 @@ 
-++// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
-++// Copyright (C) 2020 Arm Ltd.
-++// based on the H6 dtsi, which is:
-++//   Copyright (C) 2017 Icenowy Zheng <[email protected]>
-++
-++#include <dt-bindings/interrupt-controller/arm-gic.h>
-++#include <dt-bindings/clock/sun50i-h616-ccu.h>
-++#include <dt-bindings/clock/sun50i-h6-r-ccu.h>
-++#include <dt-bindings/reset/sun50i-h616-ccu.h>
-++#include <dt-bindings/reset/sun50i-h6-r-ccu.h>
-++
-++/ {
-++	interrupt-parent = <&gic>;
-++	#address-cells = <2>;
-++	#size-cells = <2>;
-++
-++	cpus {
-++		#address-cells = <1>;
-++		#size-cells = <0>;
-++
-++		cpu0: cpu@0 {
-++			compatible = "arm,cortex-a53";
-++			device_type = "cpu";
-++			reg = <0>;
-++			enable-method = "psci";
-++			clocks = <&ccu CLK_CPUX>;
-++		};
-++
-++		cpu1: cpu@1 {
-++			compatible = "arm,cortex-a53";
-++			device_type = "cpu";
-++			reg = <1>;
-++			enable-method = "psci";
-++			clocks = <&ccu CLK_CPUX>;
-++		};
-++
-++		cpu2: cpu@2 {
-++			compatible = "arm,cortex-a53";
-++			device_type = "cpu";
-++			reg = <2>;
-++			enable-method = "psci";
-++			clocks = <&ccu CLK_CPUX>;
-++		};
-++
-++		cpu3: cpu@3 {
-++			compatible = "arm,cortex-a53";
-++			device_type = "cpu";
-++			reg = <3>;
-++			enable-method = "psci";
-++			clocks = <&ccu CLK_CPUX>;
-++		};
-++	};
-++
-++	reserved-memory {
-++		#address-cells = <2>;
-++		#size-cells = <2>;
-++		ranges;
-++
-++		/* 512KiB reserved for ARM Trusted Firmware (BL31) */
-++		secmon_reserved: secmon@40000000 {
-++			reg = <0x0 0x40000000 0x0 0x80000>;
-++			no-map;
-++		};
-++	};
-++
-++	osc24M: osc24M_clk {
-++		#clock-cells = <0>;
-++		compatible = "fixed-clock";
-++		clock-frequency = <24000000>;
-++		clock-output-names = "osc24M";
-++	};
-++
-++	pmu {
-++		compatible = "arm,cortex-a53-pmu";
-++		interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>,
-++			     <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>,
-++			     <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
-++			     <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
-++		interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>;
-++	};
-++
-++	psci {
-++		compatible = "arm,psci-0.2";
-++		method = "smc";
-++	};
-++
-++	timer {
-++		compatible = "arm,armv8-timer";
-++		arm,no-tick-in-suspend;
-++		interrupts = <GIC_PPI 13
-++			(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
-++			     <GIC_PPI 14
-++			(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
-++			     <GIC_PPI 11
-++			(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>,
-++			     <GIC_PPI 10
-++			(GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
-++	};
-++
-++	soc {
-++		compatible = "simple-bus";
-++		#address-cells = <1>;
-++		#size-cells = <1>;
-++		ranges = <0x0 0x0 0x0 0x40000000>;
-++
-++		syscon: syscon@3000000 {
-++			compatible = "allwinner,sun50i-h616-system-control",
-++				     "allwinner,sun50i-a64-system-control";
-++			reg = <0x03000000 0x1000>;
-++			#address-cells = <1>;
-++			#size-cells = <1>;
-++			ranges;
-++
-++			sram_c: sram@28000 {
-++				compatible = "mmio-sram";
-++				reg = <0x00028000 0x30000>;
-++				#address-cells = <1>;
-++				#size-cells = <1>;
-++				ranges = <0 0x00028000 0x30000>;
-++			};
-++
-++			sram_c1: sram@1a00000 {
-++				compatible = "mmio-sram";
-++				reg = <0x01a00000 0x200000>;
-++				#address-cells = <1>;
-++				#size-cells = <1>;
-++				ranges = <0 0x01a00000 0x200000>;
-++
-++				ve_sram: sram-section@0 {
-++					compatible = "allwinner,sun50i-h616-sram-c1",
-++						     "allwinner,sun4i-a10-sram-c1";
-++					reg = <0x000000 0x200000>;
-++				};
-++			};
-++		};
-++
-++		ccu: clock@3001000 {
-++			compatible = "allwinner,sun50i-h616-ccu";
-++			reg = <0x03001000 0x1000>;
-++			clocks = <&osc24M>, <&rtc 0>, <&rtc 2>;
-++			clock-names = "hosc", "losc", "iosc";
-++			#clock-cells = <1>;
-++			#reset-cells = <1>;
-++		};
-++
-++		watchdog: watchdog@30090a0 {
-++			compatible = "allwinner,sun50i-h616-wdt",
-++				     "allwinner,sun6i-a31-wdt";
-++			reg = <0x030090a0 0x20>;
-++			interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&osc24M>;
-++			status = "disabled";
-++		};
-++
-++		pio: pinctrl@300b000 {
-++			compatible = "allwinner,sun50i-h616-pinctrl";
-++			reg = <0x0300b000 0x400>;
-++			interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>,
-++				     <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>,
-++				     <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>,
-++				     <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>,
-++				     <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_APB1>, <&osc24M>, <&rtc 0>;
-++			clock-names = "apb", "hosc", "losc";
-++			gpio-controller;
-++			#gpio-cells = <3>;
-++			interrupt-controller;
-++			#interrupt-cells = <3>;
-++
-++			ext_rgmii_pins: rgmii-pins {
-++				pins = "PI0", "PI1", "PI2", "PI3", "PI4",
-++				       "PI5", "PI7", "PI8", "PI9", "PI10",
-++				       "PI11", "PI12", "PI13", "PI14", "PI15",
-++				       "PI16";
-++				function = "emac0";
-++				drive-strength = <40>;
-++			};
-++
-++			i2c0_pins: i2c0-pins {
-++				pins = "PI6", "PI7";
-++				function = "i2c0";
-++			};
-++
-++			i2c3_pins_a: i2c1-pins-a {
-++				pins = "PH4", "PH5";
-++				function = "i2c3";
-++			};
-++
-++			ir_rx_pin: ir_rx_pin {
-++				pins = "PH10";
-++				function = "ir_rx";
-++			};
-++
-++			mmc0_pins: mmc0-pins {
-++				pins = "PF0", "PF1", "PF2", "PF3",
-++				       "PF4", "PF5";
-++				function = "mmc0";
-++				drive-strength = <30>;
-++				bias-pull-up;
-++			};
-++
-++			mmc1_pins: mmc1-pins {
-++				pins = "PG0", "PG1", "PG2", "PG3",
-++				       "PG4", "PG5";
-++				function = "mmc1";
-++				drive-strength = <30>;
-++				bias-pull-up;
-++			};
-++
-++			mmc2_pins: mmc2-pins {
-++				pins = "PC0", "PC1", "PC5", "PC6",
-++				       "PC8", "PC9", "PC10", "PC11",
-++				       "PC13", "PC14", "PC15", "PC16";
-++				function = "mmc2";
-++				drive-strength = <30>;
-++				bias-pull-up;
-++			};
-++
-++			spi0_pins: spi0-pins {
-++				pins = "PC0", "PC2", "PC3", "PC4";
-++				function = "spi0";
-++			};
-++
-++			spi1_pins: spi1-pins {
-++				pins = "PH6", "PH7", "PH8";
-++				function = "spi1";
-++			};
-++
-++			spi1_cs_pin: spi1-cs-pin {
-++				pins = "PH5";
-++				function = "spi1";
-++			};
-++
-++			uart0_ph_pins: uart0-ph-pins {
-++				pins = "PH0", "PH1";
-++				function = "uart0";
-++			};
-++
-++			uart1_pins: uart1-pins {
-++				pins = "PG6", "PG7";
-++				function = "uart1";
-++			};
-++
-++			uart1_rts_cts_pins: uart1-rts-cts-pins {
-++				pins = "PG8", "PG9";
-++				function = "uart1";
-++			};
-++		};
-++
-++		gic: interrupt-controller@3021000 {
-++			compatible = "arm,gic-400";
-++			reg = <0x03021000 0x1000>,
-++			      <0x03022000 0x2000>,
-++			      <0x03024000 0x2000>,
-++			      <0x03026000 0x2000>;
-++			interrupts = <GIC_PPI 9 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>;
-++			interrupt-controller;
-++			#interrupt-cells = <3>;
-++		};
-++
-++		mmc0: mmc@4020000 {
-++			compatible = "allwinner,sun50i-h616-mmc",
-++				     "allwinner,sun50i-a100-mmc";
-++			reg = <0x04020000 0x1000>;
-++			clocks = <&ccu CLK_BUS_MMC0>, <&ccu CLK_MMC0>;
-++			clock-names = "ahb", "mmc";
-++			resets = <&ccu RST_BUS_MMC0>;
-++			reset-names = "ahb";
-++			interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>;
-++			pinctrl-names = "default";
-++			pinctrl-0 = <&mmc0_pins>;
-++			status = "disabled";
-++			#address-cells = <1>;
-++			#size-cells = <0>;
-++		};
-++
-++		mmc1: mmc@4021000 {
-++			compatible = "allwinner,sun50i-h616-mmc",
-++				     "allwinner,sun50i-a100-mmc";
-++			reg = <0x04021000 0x1000>;
-++			clocks = <&ccu CLK_BUS_MMC1>, <&ccu CLK_MMC1>;
-++			clock-names = "ahb", "mmc";
-++			resets = <&ccu RST_BUS_MMC1>;
-++			reset-names = "ahb";
-++			interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>;
-++			pinctrl-names = "default";
-++			pinctrl-0 = <&mmc1_pins>;
-++			status = "disabled";
-++			#address-cells = <1>;
-++			#size-cells = <0>;
-++		};
-++
-++		mmc2: mmc@4022000 {
-++			compatible = "allwinner,sun50i-h616-emmc",
-++				     "allwinner,sun50i-a64-emmc";
-++			reg = <0x04022000 0x1000>;
-++			clocks = <&ccu CLK_BUS_MMC2>, <&ccu CLK_MMC2>;
-++			clock-names = "ahb", "mmc";
-++			resets = <&ccu RST_BUS_MMC2>;
-++			reset-names = "ahb";
-++			interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
-++			pinctrl-names = "default";
-++			pinctrl-0 = <&mmc2_pins>;
-++			status = "disabled";
-++			#address-cells = <1>;
-++			#size-cells = <0>;
-++		};
-++
-++		uart0: serial@5000000 {
-++			compatible = "snps,dw-apb-uart";
-++			reg = <0x05000000 0x400>;
-++			interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
-++			reg-shift = <2>;
-++			reg-io-width = <4>;
-++			clocks = <&ccu CLK_BUS_UART0>;
-++			resets = <&ccu RST_BUS_UART0>;
-++			status = "disabled";
-++		};
-++
-++		uart1: serial@5000400 {
-++			compatible = "snps,dw-apb-uart";
-++			reg = <0x05000400 0x400>;
-++			interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
-++			reg-shift = <2>;
-++			reg-io-width = <4>;
-++			clocks = <&ccu CLK_BUS_UART1>;
-++			resets = <&ccu RST_BUS_UART1>;
-++			status = "disabled";
-++		};
-++
-++		uart2: serial@5000800 {
-++			compatible = "snps,dw-apb-uart";
-++			reg = <0x05000800 0x400>;
-++			interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
-++			reg-shift = <2>;
-++			reg-io-width = <4>;
-++			clocks = <&ccu CLK_BUS_UART2>;
-++			resets = <&ccu RST_BUS_UART2>;
-++			status = "disabled";
-++		};
-++
-++		uart3: serial@5000c00 {
-++			compatible = "snps,dw-apb-uart";
-++			reg = <0x05000c00 0x400>;
-++			interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
-++			reg-shift = <2>;
-++			reg-io-width = <4>;
-++			clocks = <&ccu CLK_BUS_UART3>;
-++			resets = <&ccu RST_BUS_UART3>;
-++			status = "disabled";
-++		};
-++
-++		uart4: serial@5001000 {
-++			compatible = "snps,dw-apb-uart";
-++			reg = <0x05001000 0x400>;
-++			interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
-++			reg-shift = <2>;
-++			reg-io-width = <4>;
-++			clocks = <&ccu CLK_BUS_UART4>;
-++			resets = <&ccu RST_BUS_UART4>;
-++			status = "disabled";
-++		};
-++
-++		uart5: serial@5001400 {
-++			compatible = "snps,dw-apb-uart";
-++			reg = <0x05001400 0x400>;
-++			interrupts = <GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>;
-++			reg-shift = <2>;
-++			reg-io-width = <4>;
-++			clocks = <&ccu CLK_BUS_UART5>;
-++			resets = <&ccu RST_BUS_UART5>;
-++			status = "disabled";
-++		};
-++
-++		i2c0: i2c@5002000 {
-++			compatible = "allwinner,sun50i-h616-i2c",
-++				     "allwinner,sun6i-a31-i2c";
-++			reg = <0x05002000 0x400>;
-++			interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_BUS_I2C0>;
-++			resets = <&ccu RST_BUS_I2C0>;
-++			pinctrl-names = "default";
-++			pinctrl-0 = <&i2c0_pins>;
-++			status = "disabled";
-++			#address-cells = <1>;
-++			#size-cells = <0>;
-++		};
-++
-++		i2c1: i2c@5002400 {
-++			compatible = "allwinner,sun50i-h616-i2c",
-++				     "allwinner,sun6i-a31-i2c";
-++			reg = <0x05002400 0x400>;
-++			interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_BUS_I2C1>;
-++			resets = <&ccu RST_BUS_I2C1>;
-++			status = "disabled";
-++			#address-cells = <1>;
-++			#size-cells = <0>;
-++		};
-++
-++		i2c2: i2c@5002800 {
-++			compatible = "allwinner,sun50i-h616-i2c",
-++				     "allwinner,sun6i-a31-i2c";
-++			reg = <0x05002800 0x400>;
-++			interrupts = <GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_BUS_I2C2>;
-++			resets = <&ccu RST_BUS_I2C2>;
-++			status = "disabled";
-++			#address-cells = <1>;
-++			#size-cells = <0>;
-++		};
-++
-++		i2c3: i2c@5002c00 {
-++			compatible = "allwinner,sun50i-h616-i2c",
-++				     "allwinner,sun6i-a31-i2c";
-++			reg = <0x05002c00 0x400>;
-++			interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_BUS_I2C3>;
-++			resets = <&ccu RST_BUS_I2C3>;
-++			status = "disabled";
-++			#address-cells = <1>;
-++			#size-cells = <0>;
-++		};
-++
-++		i2c4: i2c@5003000 {
-++			compatible = "allwinner,sun50i-h616-i2c",
-++				     "allwinner,sun6i-a31-i2c";
-++			reg = <0x05003000 0x400>;
-++			interrupts = <GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_BUS_I2C4>;
-++			resets = <&ccu RST_BUS_I2C4>;
-++			status = "disabled";
-++			#address-cells = <1>;
-++			#size-cells = <0>;
-++		};
-++
-++		spi0: spi@5010000 {
-++			compatible = "allwinner,sun50i-h616-spi",
-++				     "allwinner,sun8i-h3-spi";
-++			reg = <0x05010000 0x1000>;
-++			interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>;
-++			clock-names = "ahb", "mod";
-++			resets = <&ccu RST_BUS_SPI0>;
-++			pinctrl-names = "default";
-++			pinctrl-0 = <&spi0_pins>;
-++			status = "disabled";
-++			#address-cells = <1>;
-++			#size-cells = <0>;
-++		};
-++
-++		spi1: spi@5011000 {
-++			compatible = "allwinner,sun50i-h616-spi",
-++				     "allwinner,sun8i-h3-spi";
-++			reg = <0x05011000 0x1000>;
-++			interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_BUS_SPI1>, <&ccu CLK_SPI1>;
-++			clock-names = "ahb", "mod";
-++			resets = <&ccu RST_BUS_SPI1>;
-++			pinctrl-names = "default";
-++			pinctrl-0 = <&spi1_pins>;
-++			status = "disabled";
-++			#address-cells = <1>;
-++			#size-cells = <0>;
-++		};
-++
-++		emac0: ethernet@5020000 {
-++			compatible = "allwinner,sun50i-h616-emac",
-++				     "allwinner,sun50i-a64-emac";
-++			syscon = <&syscon>;
-++			reg = <0x05020000 0x10000>;
-++			interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
-++			interrupt-names = "macirq";
-++			resets = <&ccu RST_BUS_EMAC0>;
-++			reset-names = "stmmaceth";
-++			clocks = <&ccu CLK_BUS_EMAC0>;
-++			clock-names = "stmmaceth";
-++			status = "disabled";
-++
-++			mdio: mdio {
-++				compatible = "snps,dwmac-mdio";
-++				#address-cells = <1>;
-++				#size-cells = <0>;
-++			};
-++		};
-++
-++		usbotg: usb@5100000 {
-++			compatible = "allwinner,sun50i-h616-musb",
-++				     "allwinner,sun8i-a33-musb";
-++			reg = <0x05100000 0x0400>;
-++			clocks = <&ccu CLK_BUS_OTG>;
-++			resets = <&ccu RST_BUS_OTG>;
-++			interrupts = <GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>;
-++			interrupt-names = "mc";
-++			phys = <&usbphy 0>;
-++			phy-names = "usb";
-++			extcon = <&usbphy 0>;
-++			status = "disabled";
-++		};
-++
-++		usbphy: phy@5100400 {
-++			compatible = "allwinner,sun50i-h616-usb-phy";
-++			reg = <0x05100400 0x24>,
-++			      <0x05101800 0x4>,
-++			      <0x05200800 0x4>,
-++			      <0x05310800 0x4>,
-++			      <0x05311800 0x4>;
-++			reg-names = "phy_ctrl",
-++				    "pmu0",
-++				    "pmu1",
-++				    "pmu2",
-++				    "pmu3";
-++			clocks = <&ccu CLK_USB_PHY0>,
-++				 <&ccu CLK_USB_PHY1>,
-++				 <&ccu CLK_USB_PHY2>,
-++				 <&ccu CLK_USB_PHY3>;
-++			clock-names = "usb0_phy",
-++				      "usb1_phy",
-++				      "usb2_phy",
-++				      "usb3_phy";
-++			resets = <&ccu RST_USB_PHY0>,
-++				 <&ccu RST_USB_PHY1>,
-++				 <&ccu RST_USB_PHY2>,
-++				 <&ccu RST_USB_PHY3>;
-++			reset-names = "usb0_reset",
-++				      "usb1_reset",
-++				      "usb2_reset",
-++				      "usb3_reset";
-++			status = "disabled";
-++			#phy-cells = <1>;
-++		};
-++
-++		ehci0: usb@5101000 {
-++			compatible = "allwinner,sun50i-h616-ehci",
-++				     "generic-ehci";
-++			reg = <0x05101000 0x100>;
-++			interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_BUS_OHCI0>,
-++				 <&ccu CLK_BUS_EHCI0>,
-++				 <&ccu CLK_USB_OHCI0>;
-++			resets = <&ccu RST_BUS_OHCI0>,
-++				 <&ccu RST_BUS_EHCI0>;
-++			status = "disabled";
-++		};
-++
-++		ohci0: usb@5101400 {
-++			compatible = "allwinner,sun50i-h616-ohci",
-++				     "generic-ohci";
-++			reg = <0x05101400 0x100>;
-++			interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_BUS_OHCI0>,
-++				 <&ccu CLK_USB_OHCI0>;
-++			resets = <&ccu RST_BUS_OHCI0>;
-++			status = "disabled";
-++		};
-++
-++		ehci1: usb@5200000 {
-++			compatible = "allwinner,sun50i-h616-ehci",
-++				     "generic-ehci";
-++			reg = <0x05200000 0x100>;
-++			interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_BUS_OHCI1>,
-++				 <&ccu CLK_BUS_EHCI1>,
-++				 <&ccu CLK_USB_OHCI1>;
-++			resets = <&ccu RST_BUS_OHCI1>,
-++				 <&ccu RST_BUS_EHCI1>;
-++			phys = <&usbphy 1>;
-++			phy-names = "usb";
-++			status = "disabled";
-++		};
-++
-++		ohci1: usb@5200400 {
-++			compatible = "allwinner,sun50i-h616-ohci",
-++				     "generic-ohci";
-++			reg = <0x05200400 0x100>;
-++			interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_BUS_OHCI1>,
-++				 <&ccu CLK_USB_OHCI1>;
-++			resets = <&ccu RST_BUS_OHCI1>;
-++			phys = <&usbphy 1>;
-++			phy-names = "usb";
-++			status = "disabled";
-++		};
-++
-++		ehci2: usb@5310000 {
-++			compatible = "allwinner,sun50i-h616-ehci",
-++				     "generic-ehci";
-++			reg = <0x05310000 0x100>;
-++			interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_BUS_OHCI2>,
-++				 <&ccu CLK_BUS_EHCI2>,
-++				 <&ccu CLK_USB_OHCI2>;
-++			resets = <&ccu RST_BUS_OHCI2>,
-++				 <&ccu RST_BUS_EHCI2>;
-++			phys = <&usbphy 2>;
-++			phy-names = "usb";
-++			status = "disabled";
-++		};
-++
-++		ohci2: usb@5310400 {
-++			compatible = "allwinner,sun50i-h616-ohci",
-++				     "generic-ohci";
-++			reg = <0x05310400 0x100>;
-++			interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_BUS_OHCI2>,
-++				 <&ccu CLK_USB_OHCI2>;
-++			resets = <&ccu RST_BUS_OHCI2>;
-++			phys = <&usbphy 2>;
-++			phy-names = "usb";
-++			status = "disabled";
-++		};
-++
-++		ehci3: usb@5311000 {
-++			compatible = "allwinner,sun50i-h616-ehci",
-++				     "generic-ehci";
-++			reg = <0x05311000 0x100>;
-++			interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_BUS_OHCI3>,
-++				 <&ccu CLK_BUS_EHCI3>,
-++				 <&ccu CLK_USB_OHCI3>;
-++			resets = <&ccu RST_BUS_OHCI3>,
-++				 <&ccu RST_BUS_EHCI3>;
-++			phys = <&usbphy 3>;
-++			phy-names = "usb";
-++			status = "disabled";
-++		};
-++
-++		ohci3: usb@5311400 {
-++			compatible = "allwinner,sun50i-h616-ohci",
-++				     "generic-ohci";
-++			reg = <0x05311400 0x100>;
-++			interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&ccu CLK_BUS_OHCI3>,
-++				 <&ccu CLK_USB_OHCI3>;
-++			resets = <&ccu RST_BUS_OHCI3>;
-++			phys = <&usbphy 3>;
-++			phy-names = "usb";
-++			status = "disabled";
-++		};
-++
-++		rtc: rtc@7000000 {
-++			compatible = "allwinner,sun50i-h616-rtc",
-++				     "allwinner,sun50i-h6-rtc";
-++			reg = <0x07000000 0x400>;
-++			interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>,
-++				     <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
-++			clock-output-names = "osc32k", "osc32k-out", "iosc";
-++			#clock-cells = <1>;
-++		};
-++
-++		r_ccu: clock@7010000 {
-++			compatible = "allwinner,sun50i-h616-r-ccu";
-++			reg = <0x07010000 0x400>;
-++			clocks = <&osc24M>, <&rtc 0>, <&rtc 2>,
-++				 <&ccu CLK_PLL_PERIPH0>;
-++			clock-names = "hosc", "losc", "iosc", "pll-periph";
-++			#clock-cells = <1>;
-++			#reset-cells = <1>;
-++		};
-++
-++		r_pio: pinctrl@7022000 {
-++			compatible = "allwinner,sun50i-h616-r-pinctrl";
-++			reg = <0x07022000 0x400>;
-++			interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&r_ccu CLK_R_APB1>, <&osc24M>, <&rtc 0>;
-++			clock-names = "apb", "hosc", "losc";
-++			gpio-controller;
-++			#gpio-cells = <3>;
-++			interrupt-controller;
-++			#interrupt-cells = <3>;
-++
-++			r_i2c_pins: r-i2c-pins {
-++				pins = "PL0", "PL1";
-++				function = "s_i2c";
-++			};
-++		};
-++
-++		ir: ir@7040000 {
-++				compatible = "allwinner,sun50i-h616-ir",
-++					     "allwinner,sun6i-a31-ir";
-++				reg = <0x07040000 0x400>;
-++				interrupts = <GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
-++				clocks = <&ccu CLK_R_APB1_IR>,
-++					 <&ccu CLK_IR>;
-++				clock-names = "apb", "ir";
-++				resets = <&ccu RST_R_APB1_IR>;
-++				pinctrl-names = "default";
-++				pinctrl-0 = <&ir_rx_pin>;
-++				status = "disabled";
-++		};
-++
-++		r_i2c: i2c@7081400 {
-++			compatible = "allwinner,sun50i-h616-i2c",
-++				     "allwinner,sun6i-a31-i2c";
-++			reg = <0x07081400 0x400>;
-++			interrupts = <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
-++			clocks = <&r_ccu CLK_R_APB2_I2C>;
-++			resets = <&r_ccu RST_R_APB2_I2C>;
-++			status = "disabled";
-++			#address-cells = <1>;
-++			#size-cells = <0>;
-++		};
-++	};
-++};
-diff --git a/target/linux/sunxi/patches-5.10/508-Add-OrangePi-Zero-2-.dts.patch b/target/linux/sunxi/patches-5.10/508-Add-OrangePi-Zero-2-.dts.patch
-new file mode 100644
-index 0000000000000..870c00efe3d14
---- /dev/null
-+++ b/target/linux/sunxi/patches-5.10/508-Add-OrangePi-Zero-2-.dts.patch
-@@ -0,0 +1,244 @@
-+diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
-+index 211d1e9d4701..0cf8299b1ce7 100644
-+--- a/arch/arm64/boot/dts/allwinner/Makefile
-++++ b/arch/arm64/boot/dts/allwinner/Makefile
-+@@ -36,3 +36,4 @@  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-orangepi-one-plus.dtb
-+ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64.dtb
-+ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-pine-h64-model-b.dtb
-+ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h6-tanix-tx6.dtb
-++dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb
-+
-+diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
-+new file mode 100644
-+index 000000000000..814f5b4fec7c
-+--- /dev/null
-++++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts
-+@@ -0,0 +1,228 @@ 
-++// SPDX-License-Identifier: (GPL-2.0+ or MIT)
-++/*
-++ * Copyright (C) 2020 Arm Ltd.
-++ */
-++
-++/dts-v1/;
-++
-++#include "sun50i-h616.dtsi"
-++
-++#include <dt-bindings/gpio/gpio.h>
-++#include <dt-bindings/interrupt-controller/arm-gic.h>
-++
-++/ {
-++	model = "OrangePi Zero2";
-++	compatible = "xunlong,orangepi-zero2", "allwinner,sun50i-h616";
-++
-++	aliases {
-++		ethernet0 = &emac0;
-++		serial0 = &uart0;
-++	};
-++
-++	chosen {
-++		stdout-path = "serial0:115200n8";
-++	};
-++
-++	leds {
-++		compatible = "gpio-leds";
-++
-++		power {
-++			label = "orangepi:red:power";
-++			gpios = <&pio 2 13 GPIO_ACTIVE_HIGH>; /* PC13 */
-++			default-state = "on";
-++		};
-++
-++		status {
-++			label = "orangepi:green:status";
-++			gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */
-++		};
-++	};
-++
-++	reg_vcc5v: vcc5v {
-++		/* board wide 5V supply directly from the USB-C socket */
-++		compatible = "regulator-fixed";
-++		regulator-name = "vcc-5v";
-++		regulator-min-microvolt = <5000000>;
-++		regulator-max-microvolt = <5000000>;
-++		regulator-always-on;
-++	};
-++
-++	reg_usb1_vbus: usb1-vbus {
-++		compatible = "regulator-fixed";
-++		regulator-name = "usb1-vbus";
-++		regulator-min-microvolt = <5000000>;
-++		regulator-max-microvolt = <5000000>;
-++		enable-active-high;
-++		gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */
-++		status = "okay";
-++	};
-++};
-++
-++&ehci0 {
-++	status = "okay";
-++};
-++
-++&ehci1 {
-++	status = "okay";
-++};
-++
-++/* USB 2 & 3 are on headers only. */
-++
-++&emac0 {
-++	pinctrl-names = "default";
-++	pinctrl-0 = <&ext_rgmii_pins>;
-++	phy-mode = "rgmii-id";
-++	phy-handle = <&ext_rgmii_phy>;
-++	phy-supply = <&reg_dcdce>;
-++	allwinner,rx-delay-ps = <3100>;
-++	allwinner,tx-delay-ps = <700>;
-++	status = "okay";
-++};
-++
-++&mdio {
-++	ext_rgmii_phy: ethernet-phy@1 {
-++		compatible = "ethernet-phy-ieee802.3-c22";
-++		reg = <1>;
-++	};
-++};
-++
-++&mmc0 {
-++	vmmc-supply = <&reg_dcdce>;
-++	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;	/* PF6 */
-++	bus-width = <4>;
-++	status = "okay";
-++};
-++
-++&ohci0 {
-++	status = "okay";
-++};
-++
-++&ohci1 {
-++	status = "okay";
-++};
-++
-++&r_i2c {
-++	status = "okay";
-++
-++	axp305: pmic@36 {
-++		compatible = "x-powers,axp305", "x-powers,axp805",
-++			     "x-powers,axp806";
-++		reg = <0x36>;
-++
-++		/* dummy interrupt to appease the driver for now */
-++		interrupts = <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>;
-++		interrupt-controller;
-++		#interrupt-cells = <1>;
-++
-++		x-powers,self-working-mode;
-++		vina-supply = <&reg_vcc5v>;
-++		vinb-supply = <&reg_vcc5v>;
-++		vinc-supply = <&reg_vcc5v>;
-++		vind-supply = <&reg_vcc5v>;
-++		vine-supply = <&reg_vcc5v>;
-++		aldoin-supply = <&reg_vcc5v>;
-++		bldoin-supply = <&reg_vcc5v>;
-++		cldoin-supply = <&reg_vcc5v>;
-++
-++		regulators {
-++			reg_aldo1: aldo1 {
-++				regulator-always-on;
-++				regulator-min-microvolt = <3300000>;
-++				regulator-max-microvolt = <3300000>;
-++				regulator-name = "vcc-sys";
-++			};
-++
-++			reg_aldo2: aldo2 {
-++				regulator-min-microvolt = <3300000>;
-++				regulator-max-microvolt = <3300000>;
-++				regulator-name = "vcc3v3-ext";
-++			};
-++
-++			reg_aldo3: aldo3 {
-++				regulator-min-microvolt = <3300000>;
-++				regulator-max-microvolt = <3300000>;
-++				regulator-name = "vcc3v3-ext2";
-++			};
-++
-++			reg_bldo1: bldo1 {
-++				regulator-always-on;
-++				regulator-min-microvolt = <1800000>;
-++				regulator-max-microvolt = <1800000>;
-++				regulator-name = "vcc1v8";
-++			};
-++
-++			bldo2 {
-++				/* unused */
-++			};
-++
-++			bldo3 {
-++				/* unused */
-++			};
-++
-++			bldo4 {
-++				/* unused */
-++			};
-++
-++			cldo1 {
-++				/* reserved */
-++			};
-++
-++			cldo2 {
-++				/* unused */
-++			};
-++
-++			cldo3 {
-++				/* unused */
-++			};
-++
-++			reg_dcdca: dcdca {
-++				regulator-always-on;
-++				regulator-min-microvolt = <810000>;
-++				regulator-max-microvolt = <1080000>;
-++				regulator-name = "vdd-cpu";
-++			};
-++
-++			reg_dcdcc: dcdcc {
-++				regulator-always-on;
-++				regulator-min-microvolt = <810000>;
-++				regulator-max-microvolt = <1080000>;
-++				regulator-name = "vdd-gpu-sys";
-++			};
-++
-++			reg_dcdcd: dcdcd {
-++				regulator-always-on;
-++				regulator-min-microvolt = <1500000>;
-++				regulator-max-microvolt = <1500000>;
-++				regulator-name = "vdd-dram";
-++			};
-++
-++			reg_dcdce: dcdce {
-++				regulator-boot-on;
-++				regulator-min-microvolt = <3300000>;
-++				regulator-max-microvolt = <3300000>;
-++				regulator-name = "vcc-eth-mmc";
-++			};
-++
-++			sw {
-++				/* unused */
-++			};
-++		};
-++	};
-++};
-++
-++&uart0 {
-++	pinctrl-names = "default";
-++	pinctrl-0 = <&uart0_ph_pins>;
-++	status = "okay";
-++};
-++
-++&usbotg {
-++	dr_mode = "otg";
-++	status = "okay";
-++};
-++
-++&usbphy {
-++	usb0_vbus-supply = <&reg_vcc5v>;
-++	usb1_vbus-supply = <&reg_usb1_vbus>;
-++	status = "okay";
-++};