kiddin9 1 år sedan
förälder
incheckning
7edf61c5bb
47 ändrade filer med 2957 tillägg och 125 borttagningar
  1. 5 4
      .github/workflows/Openwrt-AutoBuild.yml
  2. 0 1
      devices/bcm27xx_bcm2708/diy.sh
  3. 2 0
      devices/bcm27xx_bcm2709/.config
  4. 1 0
      devices/bcm27xx_bcm2710/.config
  5. 0 2
      devices/bcm27xx_bcm2710/diy.sh
  6. 2 0
      devices/bcm27xx_bcm2711/.config
  7. 1 1
      devices/bcm27xx_bcm2711/diy.sh
  8. 2 0
      devices/bcm27xx_bcm2712/.config
  9. 0 2
      devices/bcm27xx_bcm2712/diy.sh
  10. 4 0
      devices/common/.config
  11. 4 5
      devices/common/diy.sh
  12. 8 7
      devices/common/kernel_6.1.sh
  13. 12 0
      devices/common/kernel_6.6.sh
  14. 1 1
      devices/common/patches/imagebuilder.patch
  15. 21 0
      devices/common/patches/kernel6.1.patch.b
  16. 1 1
      devices/common/patches/usb-audio.patch
  17. 5 0
      devices/mediatek_filogic/.config
  18. 1 1
      devices/mediatek_filogic/diy.sh
  19. 287 0
      devices/mediatek_filogic/diy/target/linux/mediatek/dts/mt7981b-nokia-ea0326gmp.dts
  20. 0 11
      devices/mediatek_filogic/patches/02-ax6000.patch
  21. 12 1
      devices/mediatek_filogic/patches/08-cmcc_rax3000m.patch
  22. 4 5
      devices/mediatek_filogic/patches/15-cmcc-a10.patch
  23. 22 0
      devices/mediatek_filogic/patches/19-ct3003.patch
  24. 119 0
      devices/mediatek_filogic/patches/20-ea0326gmp.patch
  25. 1 4
      devices/mediatek_mt7981/diy.sh
  26. 1 0
      devices/meson_meson8b/diy.sh
  27. 2 5
      devices/qualcommax_ipq60xx/diy.sh
  28. 708 0
      devices/qualcommax_ipq60xx/patches/mi-router-hd.patch
  29. 4 0
      devices/qualcommax_ipq807x/.config
  30. 1 9
      devices/qualcommax_ipq807x/diy.sh
  31. 3 0
      devices/rockchip_armv8/.config
  32. 11 11
      devices/rockchip_armv8/diy.sh
  33. 462 0
      devices/rockchip_armv8/diy/package/boot/uboot-rockchip/patches/316-rockchip-rk3568-Add-support-for-nlnet-xgp.patch
  34. 732 0
      devices/rockchip_armv8/diy/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-nlnet-xgz68.dtsi
  35. 86 0
      devices/rockchip_armv8/diy/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-xgp-v3.dts
  36. 286 0
      devices/rockchip_armv8/diy/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-xgp.dts
  37. 0 0
      devices/rockchip_armv8/diy/target/linux/rockchip/patches-6.6/205-rockchip-rk3328-add-support-for-FriendlyARM-NanoPi-Neo3.patch
  38. 13 12
      devices/rockchip_armv8/patches/01-hinlink.patch
  39. 11 9
      devices/rockchip_armv8/patches/22-H3399PC.patch
  40. 42 17
      devices/rockchip_armv8/patches/33-rk3568.patch
  41. 6 6
      devices/rockchip_armv8/patches/44-m68s-plus.patch
  42. 70 0
      devices/rockchip_armv8/patches/55-xgp.patch
  43. 0 2
      devices/sunxi_cortexa53/.config
  44. 0 2
      devices/sunxi_cortexa7/.config
  45. 1 3
      devices/x86_64/diy.sh
  46. 2 0
      devices/x86_generic/.config
  47. 1 3
      devices/x86_generic/diy.sh

+ 5 - 4
.github/workflows/Openwrt-AutoBuild.yml

@@ -117,7 +117,7 @@ jobs:
         sudo -E apt-get -qq install build-essential clang llvm flex g++ gawk gcc-multilib gettext \
         git libncurses5-dev libssl-dev python3-distutils python3-pyelftools python3-setuptools \
         libpython3-dev rsync unzip zlib1g-dev swig aria2 jq subversion qemu-utils ccache rename \
-        libelf-dev device-tree-compiler libgnutls28-dev coccinelle libgmp3-dev libmpc-dev
+        libelf-dev device-tree-compiler libgnutls28-dev coccinelle libgmp3-dev libmpc-dev libfuse-dev
         sudo -E apt-get -qq purge azure-cli ghc* zulu* firefox powershell openjdk* dotnet* google* mysql* php* android*
         sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc
         sudo -E apt-get -qq autoremove --purge
@@ -139,7 +139,7 @@ jobs:
         REPO_BRANCH="$((curl -gs -H 'Content-Type: application/json' \
            -H "Authorization: Bearer ${{ secrets.TOKEN_KIDDIN9 }}" \
            -X POST -d '{ "query": "query {repository(owner: \"openwrt\", name: \"openwrt\") {refs(refPrefix: \"refs/tags/\", last: 4, orderBy: {field: TAG_COMMIT_DATE, direction: ASC}) {edges {node {name}}}}}"}' https://api.github.com/graphql) | jq -r '.data.repository.refs.edges[].node.name' | grep v23 | tail -n 1)"
-        #REPO_BRANCH="openwrt-23.05"
+        REPO_BRANCH="openwrt-23.05"
         #echo "CONFIG_VERSION_REPO=\"https://dl.openwrt.ai/`echo $REPO_BRANCH  | cut -d . -f 1,2 | sed -e 's/^v//'`\"">>devices/common/.config
         echo "CONFIG_VERSION_REPO=\"https://dl.openwrt.ai/23.05\"">>devices/common/.config
         if [[ ! "${{ env.REPO_BRANCH }}" && "$REPO_URL" == "https://github.com/openwrt/openwrt" ]]; then
@@ -163,7 +163,8 @@ jobs:
     - name: Load custom configuration
       run: |
         function git_clone_path() {
-          branch="$1" rurl="$2" localdir="gitemp" && shift 2
+          branch="$1" rurl="$2" localdir="gitemp" mv="$3"
+          [[ "$mv" != "mv" ]] && shift 2 || shift 3
           git clone -b $branch --depth 1 --filter=blob:none --sparse $rurl $localdir
           if [ "$?" != 0 ]; then
             echo "error on $rurl"
@@ -172,7 +173,7 @@ jobs:
           cd $localdir
           git sparse-checkout init --cone
           git sparse-checkout set $@
-          cp -rn $@ ../$(dirname "$@")/
+          [[ "$mv" != "mv" ]] && cp -rn ./* ../ || mv -n $@/* ../$@/
           cd ..
           rm -rf gitemp
           }

+ 0 - 1
devices/bcm27xx_bcm2708/diy.sh

@@ -6,6 +6,5 @@ SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
 sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += fdisk lsblk kmod-usb-net-asix-ax88179 kmod-usb-net-rtl8152/' target/linux/bcm27xx/Makefile
 
-sed -i 's/ factory.img.gz / /' target/linux/bcm27xx/image/Makefile
 
 

+ 2 - 0
devices/bcm27xx_bcm2709/.config

@@ -6,5 +6,7 @@ CONFIG_TARGET_bcm27xx_bcm2709_DEVICE_rpi-2=y
 CONFIG_PACKAGE_luci-ssl=n # uhttpd服务
 CONFIG_PACKAGE_luci-ssl-nginx=y # nginx
 
+CONFIG_PACKAGE_kmod-pcie_mhi=m
+
 
 

+ 1 - 0
devices/bcm27xx_bcm2710/.config

@@ -6,5 +6,6 @@ CONFIG_TARGET_bcm27xx_bcm2710_DEVICE_rpi-3=y
 CONFIG_PACKAGE_luci-ssl=n # uhttpd服务
 CONFIG_PACKAGE_luci-ssl-nginx=y # nginx
 
+CONFIG_PACKAGE_kmod-pcie_mhi=m
 
 

+ 0 - 2
devices/bcm27xx_bcm2710/diy.sh

@@ -4,8 +4,6 @@ SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
 #bash $SHELL_FOLDER/../common/kernel_6.1.sh
 
-sed -i 's/ factory.img.gz / /' target/linux/bcm27xx/image/Makefile
-
 sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += fdisk lsblk kmod-usb-net-asix-ax88179 kmod-usb-net-rtl8152/' target/linux/bcm27xx/Makefile
 
 mkdir -p files/lib/firmware/brcm

+ 2 - 0
devices/bcm27xx_bcm2711/.config

@@ -8,3 +8,5 @@ CONFIG_PACKAGE_luci-ssl-nginx=y # nginx
 
 CONFIG_PACKAGE_kmod-of-mdio=n
 
+CONFIG_PACKAGE_kmod-pcie_mhi=m
+

+ 1 - 1
devices/bcm27xx_bcm2711/diy.sh

@@ -5,5 +5,5 @@ SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 #bash $SHELL_FOLDER/../common/kernel_6.1.sh
 
 sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += fdisk lsblk kmod-usb-net-asix-ax88179 kmod-usb-net-rtl8152/' target/linux/bcm27xx/Makefile
-sed -i 's/ factory.img.gz / /' target/linux/bcm27xx/image/Makefile
+
 

+ 2 - 0
devices/bcm27xx_bcm2712/.config

@@ -8,3 +8,5 @@ CONFIG_PACKAGE_luci-ssl-nginx=y # nginx
 
 CONFIG_PACKAGE_kmod-of-mdio=n
 
+CONFIG_PACKAGE_kmod-pcie_mhi=m
+

+ 0 - 2
devices/bcm27xx_bcm2712/diy.sh

@@ -5,5 +5,3 @@ SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 bash $SHELL_FOLDER/../common/kernel_6.1.sh
 
 sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += fdisk lsblk kmod-usb-net-asix-ax88179 kmod-usb-net-rtl8152/' target/linux/bcm27xx/Makefile
-sed -i 's/ factory.img.gz / /' target/linux/bcm27xx/image/Makefile
-

+ 4 - 0
devices/common/.config

@@ -95,6 +95,10 @@ CONFIG_KERNEL_BTRFS_FS_POSIX_ACL=y
 CONFIG_PACKAGE_kmod-sprd_pcie=n
 CONFIG_PACKAGE_kmod-drm-nouveau=n
 
+CONFIG_PACKAGE_kmod-pcie_mhi=n
+
+CONFIG_PACKAGE_kmod-rtl8189es=n
+
 CONFIG_IMAGEOPT=y
 CONFIG_VERSIONOPT=y
 

+ 4 - 5
devices/common/diy.sh

@@ -18,7 +18,7 @@ sed -i '/$(curdir)\/compile:/c\$(curdir)/compile: package/opkg/host/compile' pac
 sed -i 's/$(TARGET_DIR)) install/$(TARGET_DIR)) install --force-overwrite --force-depends/' package/Makefile
 sed -i "s/DEFAULT_PACKAGES:=/DEFAULT_PACKAGES:=luci-app-advancedplus luci-app-firewall luci-app-opkg luci-app-upnp luci-app-autoreboot \
 luci-app-wizard luci-base luci-compat luci-lib-ipkg luci-lib-fs \
-coremark wget-ssl curl autocore htop nano zram-swap kmod-lib-zstd kmod-tcp-bbr bash openssh-sftp-server block-mount resolveip ds-lite swconfig luci-app-fan /" include/target.mk
+coremark wget-ssl curl autocore htop nano zram-swap kmod-lib-zstd kmod-tcp-bbr bash openssh-sftp-server block-mount resolveip ds-lite swconfig luci-app-fan luci-app-filebrowser /" include/target.mk
 sed -i "s/procd-ujail//" include/target.mk
 
 sed -i "s/^.*vermagic$/\techo '1' > \$(LINUX_DIR)\/.vermagic/" include/kernel-defaults.mk
@@ -32,7 +32,7 @@ while [[ "$status" == "in_progress" || "$status" == "queued" ]];do
 done
 
 
-mv -f feeds/kiddin9/{r81*} tmp/
+mv -f feeds/kiddin9/r81* tmp/
 
 sed -i "s/192.168.1/10.0.0/" package/feeds/kiddin9/base-files/files/bin/config_generate
 sed -i "s/192.168.1/10.0.0/" package/base-files/files/bin/config_generate
@@ -54,11 +54,11 @@ curl -sfL https://raw.githubusercontent.com/immortalwrt/immortalwrt/master/packa
 }
 
 cd feeds/packages
-rm -rf libs/libpfring 
+rm -rf libs/libpfring
 git_clone_path master https://github.com/openwrt/packages libs/libpfring
 cd ../../
 
-rm -rf package/network/utils/xdp-tools package/feeds/kiddin9/quectel_MHI package/feeds/packages/v4l2loopback
+rm -rf package/network/utils/xdp-tools package/feeds/kiddin9/fibocom_MHI package/feeds/packages/v4l2loopback
 
 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"
@@ -66,7 +66,6 @@ sh -c "curl -sfL https://github.com/openwrt/openwrt/commit/a48d0bdb77eb93f7fba6e
 
 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
 sed -i "/mediaurlbase/d" package/feeds/*/luci-theme*/root/etc/uci-defaults/*
 sed -i 's/=bbr/=cubic/' package/kernel/linux/files/sysctl-tcp-bbr.conf

+ 8 - 7
devices/common/kernel_6.1.sh

@@ -1,12 +1,14 @@
 #!/bin/bash
 
+shopt -s extglob
+
 rm -rf target/linux package/kernel package/boot package/firmware package/network/config/wifi-scripts
 
 mkdir new; cp -rf .git new/.git
 cd new
 git reset --hard origin/master
 
-cp -rf --parents target/linux package/kernel package/boot package/firmware include/kernel* package/network/config/wifi-scripts config/Config-images.in include/image*.mk scripts/ubinize-image.sh package/utils/bcm27xx-utils ../
+cp -rf --parents target/linux package/kernel package/boot package/firmware include/kernel* package/network/config/wifi-scripts config/Config-images.in include/image*.mk include/trusted-firmware-a.mk scripts/ubinize-image.sh package/utils/bcm27xx-utils package/devel/perf ../
 cd -
 
 sed -i "s/^.*vermagic$/\techo '1' > \$(LINUX_DIR)\/.vermagic/" include/kernel-defaults.mk
@@ -14,6 +16,7 @@ sed -i "s/^.*vermagic$/\techo '1' > \$(LINUX_DIR)\/.vermagic/" include/kernel-de
 #sed -i "s/\$(PKG_VERSION)-\$(PKG_RELEASE)/\$(PKG_VERSION)-r\$(PKG_RELEASE)/" include/package-defaults.mk
 
 cp -rf devices/common/patches/rootfstargz.patch.b devices/common/patches/rootfstargz.patch
+cp -rf devices/common/patches/kernel6.1.patch.b devices/common/patches/kernel6.1.patch
 
 git_clone_path master https://github.com/coolsnowwolf/lede target/linux/generic/hack-6.1
 
@@ -28,15 +31,13 @@ curl -sfL https://raw.githubusercontent.com/openwrt/openwrt/main/include/u-boot.
 mkdir package/kernel/mt76/patches
 curl -sfL https://raw.githubusercontent.com/immortalwrt/immortalwrt/master/package/kernel/mt76/patches/0001-mt76-allow-VHT-rate-on-2.4GHz.patch -o package/kernel/mt76/patches/0001-mt76-allow-VHT-rate-on-2.4GHz.patch
 
-rm -rf package/feeds/kiddin9/quectel_Gobinet
-
 cd feeds/packages
-rm -rf libs/xr_usb_serial_common net/coova-chilli net/xtables-addons
-git_clone_path master https://github.com/openwrt/packages libs/xr_usb_serial_common
-git_clone_path master https://github.com/openwrt/packages net/coova-chilli
-git_clone_path master https://github.com/openwrt/packages net/xtables-addons
+rm -rf libs/!(pcre) net/coova-chilli net/xtables-addons net/jool kernel
+git_clone_path master https://github.com/openwrt/packages libs net/coova-chilli net/xtables-addons net/jool kernel
 cd ../../
 
+rm -rf package/feeds/kiddin9/quectel_Gobinet package/feeds/kiddin9/fibocom_MHI package/feeds/packages/libpfring
+
 sed -i 's/=bbr/=cubic/' package/kernel/linux/files/sysctl-tcp-bbr.conf
 
 sed -i "s/tty\(0\|1\)::askfirst/tty\1::respawn/g" target/linux/*/base-files/etc/inittab

+ 12 - 0
devices/common/kernel_6.6.sh

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

+ 1 - 1
devices/common/patches/imagebuilder.patch

@@ -39,7 +39,7 @@
  	echo
  	rm -rf $(TARGET_DIR) $(TARGET_DIR_ORIG)
  	mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(DL_DIR)
-+	if [[ "$(USER_PROFILE)" =~ (DEVICE_phicomm_k2p|DEVICE_asus_rt-n56u-b1|DEVICE_thunder_timecloud|DEVICE_youku_yk-l2|DEVICE_youhua_wr1200js|DEVICE_oraybox_x3a|DEVICE_netgear_wndr3700-v5|DEVICE_xiaomi_mi-router-4a-gigabit|DEVICE_xiaomi_mi-router-4a-gigabit-v2|DEVICE_xiaomi_mi-router-3g-v2|DEVICE_jcg_y2|DEVICE_glinet_gl-mt300a|DEVICE_glinet_gl-mt750|DEVICE_hiwifi_hc5661|DEVICE_hiwifi_hc5761|DEVICE_hiwifi_hc5861|DEVICE_lenovo_newifi-y1|DEVICE_lenovo_newifi-y1s|DEVICE_xiaomi_miwifi-mini|DEVICE_youku_yk-l1c|DEVICE_jdcloud_luban|DEVICE_zte_e8820v2) || "$(TARGETID)" == "ramips/mt76x8" ]]; then \
++	if [[ "$(USER_PROFILE)" =~ (DEVICE_phicomm_k2p|DEVICE_asus_rt-n56u-b1|DEVICE_thunder_timecloud|DEVICE_youku_yk-l2|DEVICE_youhua_wr1200js|DEVICE_oraybox_x3a|DEVICE_netgear_wndr3700-v5|DEVICE_xiaomi_mi-router-4a-gigabit|DEVICE_xiaomi_mi-router-4a-gigabit-v2|DEVICE_xiaomi_mi-router-3g-v2|DEVICE_jcg_y2|DEVICE_glinet_gl-mt300a|DEVICE_glinet_gl-mt750|DEVICE_hiwifi_hc5661|DEVICE_hiwifi_hc5761|DEVICE_hiwifi_hc5861|DEVICE_lenovo_newifi-y1|DEVICE_lenovo_newifi-y1s|DEVICE_xiaomi_miwifi-mini|DEVICE_youku_yk-l1c|DEVICE_ht-jsh_0211|DEVICE_jdcloud_luban|DEVICE_zte_e8820v2) || "$(TARGETID)" == "ramips/mt76x8" ]]; then \
 +		echo "src/gz openwrt_smflash https://dl.openwrt.ai/packages/small_flash" >>$(TOPDIR)/repositories.conf; \
 +	else \
 +		sed -i "/smflash/d" $(TOPDIR)/repositories.conf; \

+ 21 - 0
devices/common/patches/kernel6.1.patch.b

@@ -0,0 +1,21 @@
+--- a/package/kernel/qca-ssdk/Makefile
++++ b/package/kernel/qca-ssdk/Makefile
+@@ -32,11 +32,17 @@ endef
+ 
+ GCC_VERSION=$(shell echo "$(CONFIG_GCC_VERSION)" | sed 's/[^0-9.]*\([0-9.]*\).*/\1/')
+ 
++ifdef CONFIG_TOOLCHAIN_BIN_PATH
++TOOLCHAIN_BIN_PATH=$(CONFIG_TOOLCHAIN_BIN_PATH)
++else
++TOOLCHAIN_BIN_PATH=$(TOOLCHAIN_DIR)/bin
++endif
++
+ LNX_CONFIG_OPTS = LNX_MAKEOPTS='$(KERNEL_MAKEOPTS)' PRJ_PATH=$(PKG_BUILD_DIR) MODULE_TYPE=KSLIB modules
+ 
+ MAKE_FLAGS+= \
+ 	TARGET_NAME=$(CONFIG_TARGET_NAME) \
+-	TOOL_PATH=$(firstword $(TOOLCHAIN_BIN_DIRS)) \
++	TOOL_PATH=$(TOOLCHAIN_BIN_PATH) \
+ 	SYS_PATH=$(LINUX_DIR) \
+ 	TOOLPREFIX=$(TARGET_CROSS) \
+ 	KVER=$(LINUX_VERSION) \

+ 1 - 1
devices/common/patches/usb-audio.patch

@@ -4,7 +4,7 @@
  	CONFIG_SND_USB_AUDIO
    $(call AddDepends/usb)
    $(call AddDepends/sound)
-+  DEPENDS += +LINUX_6_1:kmod-media-core
++  DEPENDS += +LINUX_6_1:kmod-media-core +LINUX_6_6:kmod-media-core
    FILES:= \
  	$(LINUX_DIR)/sound/usb/snd-usbmidi-lib.ko \
  	$(LINUX_DIR)/sound/usb/snd-usb-audio.ko

+ 5 - 0
devices/mediatek_filogic/.config

@@ -32,5 +32,10 @@ CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_bananapi_bpi-r3-mini=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_bananapi_bpi-r4=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_glinet_gl-x3000=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_glinet_gl-xe3000=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_comfast_cf-e393ax=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_nokia_ea0326gmp=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_openembed_som7981=y
 CONFIG_PACKAGE_luci-ssl=y # uhttpd服务
 
+CONFIG_PACKAGE_kmod-pcie_mhi=m
+

+ 1 - 1
devices/mediatek_filogic/diy.sh

@@ -3,7 +3,7 @@
 shopt -s extglob
 SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
-bash $SHELL_FOLDER/../common/kernel_6.1.sh
+bash $SHELL_FOLDER/../common/kernel_6.6.sh
 
 sed -i "s/mi-router-wr30u-stock/mi-router-wr30u/" package/boot/uboot-envtools/files/mediatek_filogic
 sed -i "s/mi-router-wr30u-stock/mi-router-wr30u/" target/linux/mediatek/filogic/base-files/etc/board.d/01_leds

+ 287 - 0
devices/mediatek_filogic/diy/target/linux/mediatek/dts/mt7981b-nokia-ea0326gmp.dts

@@ -0,0 +1,287 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+
+/dts-v1/;
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include "mt7981.dtsi"
+
+/ {
+	model = "Nokia EA0326GMP";
+	compatible = "nokia,ea0326gmp", "mediatek,mt7981";
+
+	aliases {
+		led-boot = &power_led;
+		led-running = &power_led;
+		led-failsafe = &power_led;
+		led-upgrade = &power_led;
+		label-mac-device = &gmac1;
+		serial0 = &uart0;
+	};
+
+	chosen {
+		rootdisk = <&ubi_rootdisk>;
+		stdout-path = "serial0:115200n8";
+	};
+
+	memory@40000000 {
+		reg = <0 0x40000000 0 0x10000000>;
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		button-reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+		};
+
+		button-wps {
+			label = "wps";
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		power_led: led-0 {
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_POWER;
+			gpios = <&pio 4 GPIO_ACTIVE_LOW>;
+		};
+
+		led-1 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_WAN;
+			gpios = <&pio 5 GPIO_ACTIVE_LOW>;
+		};
+
+		led-2 {
+			color = <LED_COLOR_ID_RED>;
+			function = LED_FUNCTION_WAN;
+			gpios = <&pio 6 GPIO_ACTIVE_LOW>;
+		};
+
+		led-3 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_LAN;
+			gpios = <&pio 7 GPIO_ACTIVE_LOW>;
+		};
+
+		led-4 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_WLAN;
+			gpios = <&pio 8 GPIO_ACTIVE_LOW>;
+		};
+
+		led-5 {
+			color = <LED_COLOR_ID_GREEN>;
+			function = LED_FUNCTION_WPS;
+			gpios = <&pio 9 GPIO_ACTIVE_LOW>;
+		};
+	};
+};
+
+&eth {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mdio_pins>;
+	status = "okay";
+
+	gmac0: mac@0 {
+		compatible = "mediatek,eth-mac";
+		reg = <0>;
+		phy-mode = "2500base-x";
+
+		nvmem-cells = <&macaddr_factory_28 0>;
+		nvmem-cell-names = "mac-address";
+
+		fixed-link {
+			speed = <2500>;
+			full-duplex;
+			pause;
+		};
+	};
+
+	gmac1: mac@1 {
+		compatible = "mediatek,eth-mac";
+		reg = <1>;
+		phy-mode = "gmii";
+		phy-handle = <&int_gbe_phy>;
+
+		nvmem-cells = <&macaddr_factory_28 3>;
+		nvmem-cell-names = "mac-address";
+	};
+};
+
+&mdio_bus {
+	switch: switch@1f {
+		compatible = "mediatek,mt7531";
+		reg = <31>;
+		reset-gpios = <&pio 39 GPIO_ACTIVE_HIGH>;
+		interrupt-controller;
+		#interrupt-cells = <1>;
+		interrupt-parent = <&pio>;
+		interrupts = <38 IRQ_TYPE_LEVEL_HIGH>;
+	};
+};
+
+&pio {
+	spi0_flash_pins: spi0-pins {
+		mux {
+			function = "spi";
+			groups = "spi0", "spi0_wp_hold";
+		};
+
+		conf-pu {
+			pins = "SPI0_CS", "SPI0_HOLD", "SPI0_WP";
+			drive-strength = <8>;
+			mediatek,pull-up-adv = <0>; /* bias-disable */
+		};
+
+		conf-pd {
+			pins = "SPI0_CLK", "SPI0_MOSI", "SPI0_MISO";
+			drive-strength = <8>;
+			mediatek,pull-up-adv = <0>; /* bias-disable */
+		};
+	};
+};
+
+&spi0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi0_flash_pins>;
+	status = "okay";
+
+	spi_nand: flash@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "spi-nand";
+		reg = <0>;
+
+		spi-max-frequency = <52000000>;
+		spi-tx-bus-width = <4>;
+		spi-rx-bus-width = <4>;
+
+		mediatek,nmbm;
+		mediatek,bmt-max-ratio = <1>;
+		mediatek,bmt-max-reserved-blocks = <64>;
+
+		partitions {
+			compatible = "fixed-partitions";
+			#address-cells = <1>;
+			#size-cells = <1>;
+
+			partition@0 {
+				label = "bl2";
+				reg = <0x00000 0x0100000>;
+				read-only;
+			};
+
+			partition@100000 {
+				label = "u-boot-env";
+				reg = <0x100000 0x80000>;
+			};
+
+			partition@180000 {
+				label = "factory";
+				reg = <0x180000 0x200000>;
+				read-only;
+
+				nvmem-layout {
+					compatible = "fixed-layout";
+					#address-cells = <1>;
+					#size-cells = <1>;
+
+					eeprom_factory_0: eeprom@0 {
+						reg = <0x0 0x1000>;
+					};
+
+					macaddr_factory_28: macaddr@28 {
+						compatible = "mac-base";
+						reg = <0x28 0x6>;
+						#nvmem-cell-cells = <1>;
+					};
+				};
+			};
+
+			partition@380000 {
+				label = "fip";
+				reg = <0x380000 0x200000>;
+				read-only;
+			};
+
+			partition@580000 {
+				label = "config";
+				reg = <0x580000 0x200000>;
+				read-only;
+			};
+
+			partition@780000 {
+				label = "config2";
+				reg = <0x780000 0x200000>;
+				read-only;
+			};
+
+			partition@980000 {
+				label = "ubi";
+				reg = <0x980000 0x6e00000>;
+
+				volumes {
+					ubi_rootdisk: ubi-volume-fit {
+						volname = "fit";
+					};
+				};
+			};
+		};
+	};
+};
+
+&switch {
+	ports {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		port@1 {
+			reg = <1>;
+			label = "lan1";
+		};
+
+		port@2 {
+			reg = <2>;
+			label = "lan2";
+		};
+
+		port@3 {
+			reg = <3>;
+			label = "lan3";
+		};
+
+		port@6 {
+			reg = <6>;
+			ethernet = <&gmac0>;
+			phy-mode = "2500base-x";
+
+			fixed-link {
+				speed = <2500>;
+				full-duplex;
+				pause;
+			};
+		};
+	};
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&watchdog {
+	status = "okay";
+};
+
+&wifi {
+	nvmem-cells = <&eeprom_factory_0>;
+	nvmem-cell-names = "eeprom";
+	status = "okay";
+};

+ 0 - 11
devices/mediatek_filogic/patches/02-ax6000.patch

@@ -64,17 +64,6 @@ index 0000000000000..759baae3aeb18
 +			};
 +};
 
---- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
-+++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
-@@ -134,6 +134,7 @@ platform_do_upgrade() {
- 	tplink,tl-xdr4288|\
- 	tplink,tl-xdr6086|\
- 	tplink,tl-xdr6088|\
-+ 	xiaomi,redmi-router-ax6000|\
- 	xiaomi,mi-router-ax3000t-ubootmod|\
- 	xiaomi,mi-router-wr30u-ubootmod)
- 		CI_KERNPART="fit"
-
 --- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
 +++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
 @@ -26,6 +26,7 @@ xiaomi,mi-router-wr30u-ubootmod)

+ 12 - 1
devices/mediatek_filogic/patches/08-cmcc_rax3000m.patch

@@ -70,4 +70,15 @@
 +  	cmcc,rax3000m-emmc|\
  	acer,predator-w6|\
  	glinet,gl-mt2500|\
- 	glinet,gl-mt6000|\
+ 	glinet,gl-mt6000|\
+
+--- a/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
++++ b/target/linux/mediatek/filogic/base-files/etc/hotplug.d/firmware/11-mt76-caldata
+@@ -31,6 +31,7 @@ case "$FIRMWARE" in
+ 			;;
+ 		esac
+ 		;;
++	cmcc,rax3000m-emmc|\
+ 	ubnt,unifi-6-plus)
+ 		caldata_extract_mmc "factory" 0x0 0x1000
+ 		;;

+ 4 - 5
devices/mediatek_filogic/patches/15-cmcc-a10.patch

@@ -273,17 +273,16 @@ index 53e7b024e40fb..61637e09c7f0e 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
-@@ -57,6 +57,9 @@ case "$board" in
+@@ -65,6 +65,9 @@ case "$board" in
  		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
-
+ 	comfast,cf-e393ax)
+ 		addr=$(mtd_get_mac_binary "Factory" 0x8000)
+ 		[ "$PHYNBR" = "1" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
 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

+ 22 - 0
devices/mediatek_filogic/patches/19-ct3003.patch

@@ -0,0 +1,22 @@
+--- a/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dts
++++ b/target/linux/mediatek/dts/mt7981b-cetron-ct3003.dts
+@@ -159,18 +159,9 @@
+ 
+ 			partition@580000 {
+ 				label = "ubi";
+-				reg = <0x0580000 0x2000000>;
++				reg = <0x0580000 0x7000000>;
+ 			};
+ 
+-			partition@2580000 {
+-				label = "ubi_backup";
+-				reg = <0x2580000 0x2000000>;
+-			};
+-
+-			partition@4580000 {
+-				label = "Config_backup";
+-				reg = <0x4580000 0x0400000>;
+-			};
+ 		};
+ 	};
+ };

+ 119 - 0
devices/mediatek_filogic/patches/20-ea0326gmp.patch

@@ -0,0 +1,119 @@
+diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
+index 7f75de8b3b961c..38aa621ea23867 100644
+--- a/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/01_leds
+@@ -54,6 +54,11 @@ netgear,wax220)
+ 	ucidef_set_led_netdev "wlan2g" "WLAN2G" "blue:wlan2g" "phy0-ap0"
+ 	ucidef_set_led_netdev "wlan5g" "WLAN5G" "blue:wlan5g" "phy1-ap0"
+ 	;;
++nokia,ea0326gmp)
++	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1" "link"
++	ucidef_set_led_netdev "lan" "LAN" "green:lan" "br-lan" "link"
++	ucidef_set_led_netdev "wlan" "WLAN" "green:wlan" "phy1-ap0" "link"
++	;;
+ openembed,som7981)
+ 	ucidef_set_led_netdev "lanact" "LANACT" "green:lan" "eth1" "rx tx"
+ 	ucidef_set_led_netdev "lanlink" "LANLINK" "amber:lan" "eth1" "link"
+diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+index c9fd8d96e69a1f..051db89275e2f0 100644
+--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
++++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+@@ -46,6 +46,7 @@ mediatek_setup_interfaces()
+ 		;;
+ 	cmcc,rax3000m|\
+ 	h3c,magic-nx30-pro|\
++	nokia,ea0326gmp|\
+ 	zbtlink,zbt-z8103ax)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" eth1
+ 		;;
+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 62860390ebb2e6..928750e6473fc4 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
+@@ -116,6 +116,11 @@ case "$board" in
+ 		[ "$PHYNBR" = "0" ] && macaddr_add $hw_mac_addr 2 > /sys${DEVPATH}/macaddress
+ 		[ "$PHYNBR" = "1" ] && macaddr_add $hw_mac_addr 3 > /sys${DEVPATH}/macaddress
+ 		;;
++	nokia,ea0326gmp)
++		addr=$(cat /sys/class/net/eth0/address)
++		[ "$PHYNBR" = "0" ] && macaddr_add $addr 1 > /sys${DEVPATH}/macaddress
++		[ "$PHYNBR" = "1" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress
++		;;
+ 	openembed,som7981)
+ 		[ "$PHYNBR" = "1" ] && cat /sys/class/net/eth0/address > /sys${DEVPATH}/macaddress
+ 		;;
+diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+index ee0e8b62d752db..62b7a209ed4059 100755
+--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
++++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+@@ -145,6 +145,12 @@ platform_do_upgrade() {
+ 		CI_UBIPART="ubi0"
+ 		nand_do_upgrade "$1"
+ 		;;
++	nokia,ea0326gmp)
++		[ -e /dev/fit0 ] && fitblk /dev/fit0
++		[ -e /dev/fitrw ] && fitblk /dev/fitrw
++		CI_KERNPART="fit"
++		nand_do_upgrade "$1"
++		;;
+ 	ubnt,unifi-6-plus)
+ 		CI_KERNPART="kernel0"
+ 		EMMC_ROOT_DEV="$(cmdline_get_var root)"
+diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
+index f99a73ac74c887..e8abed768fd97f 100644
+--- a/target/linux/mediatek/image/filogic.mk
++++ b/target/linux/mediatek/image/filogic.mk
+@@ -881,6 +881,23 @@ define Device/netgear_wax220
+ endef
+ TARGET_DEVICES += netgear_wax220
+ 
++define Device/nokia_ea0326gmp
++  DEVICE_VENDOR := Nokia
++  DEVICE_MODEL := EA0326GMP
++  DEVICE_DTS := mt7981b-nokia-ea0326gmp
++  DEVICE_DTS_DIR := ../dts
++  DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
++  UBINIZE_OPTS := -E 5
++  BLOCKSIZE := 128k
++  PAGESIZE := 2048
++  KERNEL_IN_UBI := 1
++  IMAGE_SIZE := 112640k
++  IMAGES += factory.bin
++  IMAGE/factory.bin := append-ubi | check-size $$$$(IMAGE_SIZE)
++  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
++endef
++TARGET_DEVICES += nokia_ea0326gmp
++
+ define Device/openembed_som7981
+   DEVICE_VENDOR := OpenEmbed
+   DEVICE_MODEL := SOM7981
+diff --git a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+index 62b7a209ed4059..cefe2ac853899c 100755
+--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
++++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+@@ -83,11 +83,7 @@ platform_do_upgrade() {
+ 	bananapi,bpi-r3-mini|\
+ 	bananapi,bpi-r4|\
+ 	bananapi,bpi-r4-poe|\
+-	jdcloud,re-cp-03|\
+-	tplink,tl-xdr4288|\
+-	tplink,tl-xdr6086|\
+-	tplink,tl-xdr6088|\
+-	xiaomi,redmi-router-ax6000-ubootmod)
++	jdcloud,re-cp-03)
+ 		[ -e /dev/fit0 ] && fitblk /dev/fit0
+ 		[ -e /dev/fitrw ] && fitblk /dev/fitrw
+ 		bootdev="$(fitblk_get_bootdev)"
+@@ -145,7 +141,11 @@ platform_do_upgrade() {
+ 		CI_UBIPART="ubi0"
+ 		nand_do_upgrade "$1"
+ 		;;
+-	nokia,ea0326gmp)
++	nokia,ea0326gmp|\
++	tplink,tl-xdr4288|\
++	tplink,tl-xdr6086|\
++	tplink,tl-xdr6088|\
++	xiaomi,redmi-router-ax6000-ubootmod)
+ 		[ -e /dev/fit0 ] && fitblk /dev/fit0
+ 		[ -e /dev/fitrw ] && fitblk /dev/fitrw
+ 		CI_KERNPART="fit"

+ 1 - 4
devices/mediatek_mt7981/diy.sh

@@ -11,10 +11,7 @@ rm -rf devices/common/patches/{rootfstargz.patch,kernel_version.patch,seccomp.pa
 #sed -i "/KernelPackage,sound-soc-core/d" package/kernel/linux/modules/sound.mk
 #sed -i "/KernelPackage,multimedia-input/d" package/kernel/linux/modules/video.mk
 
-git_clone_path openwrt-23.05 https://github.com/openwrt/openwrt toolchain/musl
-git_clone_path openwrt-23.05 https://github.com/openwrt/openwrt package/utils/e2fsprogs
-git_clone_path openwrt-23.05 https://github.com/openwrt/openwrt package/utils/ucode
-git_clone_path openwrt-23.05 https://github.com/openwrt/openwrt package/libs/libselinux
+git_clone_path openwrt-23.05 https://github.com/openwrt/openwrt toolchain/musl package/utils/e2fsprogs package/utils/ucode package/libs/libselinux
 #ln -sf $(pwd)/feeds/luci/modules/luci-base package/feeds/kiddin9/
 
 sed -i "s/PKG_SOURCE_DATE:=.*/PKG_SOURCE_DATE:=2099-12-06/" package/network/config/netifd/Makefile

+ 1 - 0
devices/meson_meson8b/diy.sh

@@ -9,3 +9,4 @@ bash $SHELL_FOLDER/../common/kernel_6.1.sh
 git_clone_path master https://github.com/coolsnowwolf/lede target/linux/meson
 
 
+

+ 2 - 5
devices/qualcommax_ipq60xx/diy.sh

@@ -6,11 +6,8 @@ SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
 bash $SHELL_FOLDER/../common/kernel_6.1.sh
 
-rm -rf target/linux/qualcommax 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
-git_clone_path master https://github.com/coolsnowwolf/lede package/firmware/ipq-wifi
+rm -rf target/linux/qualcommax package/kernel/qca- package/boot/uboot-envtools package/firmware/ipq-wifi
+git_clone_path master https://github.com/coolsnowwolf/lede target/linux/qualcommax package/firmware/ipq-wifi package/boot/uboot-envtools package/qca
 
 sed -i "s/wpad-openssl/wpad-basic-mbedtls/" target/linux/qualcommax/Makefile
 

+ 708 - 0
devices/qualcommax_ipq60xx/patches/mi-router-hd.patch

@@ -0,0 +1,708 @@
+diff --git a/package/boot/uboot-envtools/files/ipq806x b/package/boot/uboot-envtools/files/ipq806x
+index 443a0e13d40de..d43c6d32e909b 100644
+--- a/package/boot/uboot-envtools/files/ipq806x
++++ b/package/boot/uboot-envtools/files/ipq806x
+@@ -56,6 +56,10 @@ qcom,ipq8064-ap148|\
+ qcom,ipq8064-db149)
+ 	ubootenv_add_uci_config $(ubootenv_mtdinfo)
+ 	;;
++xiaomi,mi-router-hd)
++	ubootenv_add_uci_config "/dev/mtd9" "0x0" "0x10000" "0x20000"
++	ubootenv_add_uci_sys_config "/dev/mtd12" "0x0" "0x10000" "0x20000"
++	;;
+ ubnt,unifi-ac-hd|\
+ zyxel,nbg6817)
+ 	ubootenv_add_uci_config "/dev/mtdblock9" "0x0" "0x10000" "0x10000"
+@@ -63,6 +67,6 @@ zyxel,nbg6817)
+ esac
+ 
+ config_load ubootenv
+-config_foreach ubootenv_add_app_config ubootenv
++config_foreach ubootenv_add_app_config
+ 
+ exit 0
+diff --git a/target/linux/ipq806x/base-files/etc/board.d/02_network b/target/linux/ipq806x/base-files/etc/board.d/02_network
+index a408fc14ac133..4993321296463 100644
+--- a/target/linux/ipq806x/base-files/etc/board.d/02_network
++++ b/target/linux/ipq806x/base-files/etc/board.d/02_network
+@@ -66,6 +66,13 @@ ipq806x_setup_interfaces()
+ 	meraki,mr52)
+ 		ucidef_set_interfaces_lan_wan "eth0" "eth1"
+ 		;;
++	xiaomi,mi-router-hd)
++		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" "wan"
++		ucidef_set_network_device_conduit "lan1" "eth1"
++		ucidef_set_network_device_conduit "lan2" "eth1"
++		ucidef_set_network_device_conduit "lan3" "eth1"
++		ucidef_set_network_device_conduit "wan" "eth0"
++	;;
+ 	*)
+ 		echo "Unsupported hardware. Network interfaces not intialized"
+ 		;;
+diff --git a/target/linux/ipq806x/base-files/etc/board.d/05_compat-version b/target/linux/ipq806x/base-files/etc/board.d/05_compat-version
+index caf65b96d20cf..f6ab9b882eee1 100644
+--- a/target/linux/ipq806x/base-files/etc/board.d/05_compat-version
++++ b/target/linux/ipq806x/base-files/etc/board.d/05_compat-version
+@@ -32,7 +32,8 @@ case "$(board_name)" in
+ 	tplink,vr2600v |\
+ 	zyxel,nbg6817 |\
+ 	asus,onhub |\
+-	tplink,onhub)
++	tplink,onhub|\
++	xiaomi,mi-router-hd)
+ 		ucidef_set_compat_version "1.1"
+ 		;;
+ 	linksys,ea7500-v1 |\
+diff --git a/target/linux/ipq806x/base-files/etc/init.d/bootcount b/target/linux/ipq806x/base-files/etc/init.d/bootcount
+index ef3c6894e44ad..e07b8eae8ce34 100755
+--- a/target/linux/ipq806x/base-files/etc/init.d/bootcount
++++ b/target/linux/ipq806x/base-files/etc/init.d/bootcount
+@@ -19,5 +19,13 @@ boot() {
+ 	linksys,ea8500)
+ 		mtd resetbc s_env || true
+ 		;;
++	xiaomi,mi-router-hd)
++		local boot_wait=$( fw_printenv boot_wait | cut -d = -f 2 )
++		[ "$boot_wait" != "on" ] && fw_setenv boot_wait on
++		local bootdelay=$( fw_printenv bootdelay | cut -d = -f 2 )
++		[ "$bootdelay" != "3" ] && fw_setenv bootdelay 3
++		local uart_en=$( fw_printenv uart_en | cut -d = -f 2 )
++		[ "$uart_en" != "1" ] && fw_setenv uart_en 1
++		;;
+ 	esac
+ }
+diff --git a/target/linux/ipq806x/base-files/etc/init.d/hwmon_fancontrol b/target/linux/ipq806x/base-files/etc/init.d/hwmon_fancontrol
+new file mode 100644
+index 0000000000000..9b5017888aa1a
+--- /dev/null
++++ b/target/linux/ipq806x/base-files/etc/init.d/hwmon_fancontrol
+@@ -0,0 +1,20 @@
++#!/bin/sh /etc/rc.common
++
++START=98
++
++boot() {
++	local path_to_hwmon
++	# configuring onboard temp/fan controller to run the fan on its own
++	# for more information, please read https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface
++
++	case $(board_name) in
++	xiaomi,mi-router-hd)
++		path_to_hwmon="$( grep -l emc230 /sys/class/hwmon/hwmon*/name )"
++		if [ -n "$path_to_hwmon" ]; then
++			path_to_hwmon=$( dirname "$path_to_hwmon" 2>/dev/null )
++			# Set FAN speed to 80%
++			echo "204" > "$path_to_hwmon/pwm1"
++		fi
++		;;
++	esac
++}
+diff --git a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+index b3a615a511b6b..e13b2fa2212af 100644
+--- a/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
++++ b/target/linux/ipq806x/base-files/lib/upgrade/platform.sh
+@@ -22,7 +22,8 @@ platform_do_upgrade() {
+ 	netgear,xr500 |\
+ 	nokia,ac400i |\
+ 	qcom,ipq8064-ap148 |\
+-	qcom,ipq8064-ap161)
++	qcom,ipq8064-ap161 |\
++	xiaomi,mi-router-hd)
+ 		nand_do_upgrade "$1"
+ 		;;
+ 	asrock,g10)
+diff --git a/target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-mi-router-hd.dts b/target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-mi-router-hd.dts
+new file mode 100644
+index 0000000000000..dbddabea49792
+--- /dev/null
++++ b/target/linux/ipq806x/files-6.6/arch/arm/boot/dts/qcom/qcom-ipq8064-mi-router-hd.dts
+@@ -0,0 +1,555 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++
++#include "qcom-ipq8064-v2.0-smb208.dtsi"
++
++#include <dt-bindings/input/input.h>
++#include <dt-bindings/leds/common.h>
++
++/ {
++	model = "Xiaomi Mi Router HD (R3D)";
++	compatible = "xiaomi,mi-router-hd", "qcom,ipq8064";
++
++	memory@0 {
++		device_type = "memory";
++		reg = <0x42000000 0x1e000000>;
++	};
++
++	reserved-memory {
++		ramoops@42100000 {
++			compatible = "ramoops";
++			reg = <0x42100000 0x40000>;
++			record-size = <0x4000>;
++			console-size = <0x4000>;
++			ftrace-size = <0x4000>;
++			pmsg-size = <0x4000>;
++		};
++	};
++
++	aliases {
++		label-mac-device = &gmac1;
++
++		mdio-gpio0 = &mdio0;
++
++		led-boot = &led_status_yellow;
++		led-failsafe = &led_status_red;
++		led-running = &led_status_blue;
++		led-upgrade = &led_status_yellow;
++	};
++
++	chosen {
++		bootargs = "rootfstype=squashfs noinitrd";
++	};
++
++	keys {
++		compatible = "gpio-keys";
++		pinctrl-0 = <&button_pins>;
++		pinctrl-names = "default";
++
++		reset {
++			label = "reset";
++			gpios = <&qcom_pinmux 16 GPIO_ACTIVE_LOW>;
++			linux,code = <KEY_RESTART>;
++			debounce-interval = <60>;
++			wakeup-source;
++		};
++
++		power {
++			label = "power";
++			gpios = <&qcom_pinmux 68 GPIO_ACTIVE_LOW>;
++			linux,code = <KEY_POWER>;
++			debounce-interval = <60>;
++			wakeup-source;
++		};
++	};
++
++	leds {
++		compatible = "gpio-leds";
++		pinctrl-0 = <&led_pins>;
++		pinctrl-names = "default";
++
++		led_status_red: led_status_red {
++			function = LED_FUNCTION_STATUS;
++			color = <LED_COLOR_ID_RED>;
++			gpios = <&qcom_pinmux 7 GPIO_ACTIVE_HIGH>;
++		};
++
++		led_status_blue: led_status_blue {
++			function = LED_FUNCTION_STATUS;
++			color = <LED_COLOR_ID_BLUE>;
++			gpios = <&qcom_pinmux 8 GPIO_ACTIVE_HIGH>;
++		};
++
++		led_status_yellow: led_status_yellow {
++			function = LED_FUNCTION_STATUS;
++			color = <LED_COLOR_ID_YELLOW>;
++			gpios = <&qcom_pinmux 9 GPIO_ACTIVE_HIGH>;
++		};
++	};
++
++	i2c_gpio_0 {  /* GSBI1 */
++		compatible = "i2c-gpio";
++		#address-cells = <1>;
++		#size-cells = <0>;
++		pinctrl-0 = <&i2c1_pins>;
++		pinctrl-names = "default";
++		sda-gpios = <&qcom_pinmux 53 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
++		scl-gpios = <&qcom_pinmux 54 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
++		i2c-gpio,delay-us = <5>;
++
++		fan@2f {
++			compatible = "microchip,emc2305";
++			reg = <0x2f>;
++			emc2305,pwm-channel = <0>;
++			emc2305,pwm-min = <0>;
++			emc2305,pwm-max = <255>;
++		};
++	};
++
++	i2c_gpio_1 {  /* GSBI2 */
++		compatible = "i2c-gpio";
++		#address-cells = <1>;
++		#size-cells = <0>;
++		pinctrl-0 = <&i2c2_pins>;
++		pinctrl-names = "default";
++		sda-gpios = <&qcom_pinmux 24 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
++		scl-gpios = <&qcom_pinmux 25 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
++		i2c-gpio,delay-us = <5>;
++
++		temp-sensor@48 {
++			compatible = "ti,tmp75";
++			reg = <0x48>;
++			#thermal-sensor-cells = <0>;
++			status = "okay";
++		};
++	};
++};
++
++&CPU_SPC {
++	status = "disabled";
++};
++
++&adm_dma {
++	status = "okay";
++};
++
++&qcom_pinmux {
++	i2c1_pins: i2c1_pins {  /* GSBI1 - EMC2301 */
++		mux {
++			pins = "gpio53", "gpio54";
++			function = "gsbi1";
++			drive-strength = <12>;
++			bias-none;
++			input;
++		};
++	};
++
++	i2c2_pins: i2c2_pins {  /* GSBI2 - TMP75 */
++		mux {
++			pins = "gpio24", "gpio25";
++			function = "gsbi2";
++			drive-strength = <12>;
++			bias-none;
++			input;
++		};
++	};
++
++	button_pins: button_pins {
++		mux {
++			pins = "gpio16", "gpio68";
++			function = "gpio";
++			drive-strength = <2>;
++			bias-pull-up;
++		};
++	};
++
++	led_pins: led_pins {
++		mux {
++			pins = "gpio7", "gpio8", "gpio9";
++			function = "gpio";
++			drive-strength = <2>;
++			bias-pull-up;
++		};
++	};
++
++	usb_pwr_en_pins: usb_pwr_en_pins {
++		mux {
++			pins = "gpio56";
++			function = "gpio";
++			drive-strength = <12>;
++			bias-pull-up;
++			output-high;
++		};
++	};
++};
++
++&sata_phy {
++	status = "okay";
++};
++
++&sata {
++	status = "okay";
++};
++
++&hs_phy_0 {
++	status = "okay";
++};
++
++&ss_phy_0 {
++	status = "okay";
++};
++
++&usb3_0 {
++	status = "okay";
++};
++
++&hs_phy_1 {
++	status = "okay";
++};
++
++&ss_phy_1 {
++	status = "okay";
++};
++
++&usb3_1 {
++	status = "okay";
++	pinctrl-0 = <&usb_pwr_en_pins>;
++	pinctrl-names = "default";
++};
++
++&pcie0 {
++	status = "okay";
++	reset-gpios = <&qcom_pinmux 3 GPIO_ACTIVE_LOW>;
++	pinctrl-0 = <&pcie0_pins>;
++	pinctrl-names = "default";
++
++	bridge@0,0 {
++		reg = <0x00000000 0 0 0 0>;
++		#address-cells = <3>;
++		#size-cells = <2>;
++		ranges;
++
++		wifi@1,0 {
++			compatible = "pci168c,0046";
++			reg = <0x00010000 0 0 0 0>;
++
++			nvmem-cells = <&precal_art_1000>, <&macaddr_art_1006>;
++			nvmem-cell-names = "pre-calibration", "mac-address";
++		};
++	};
++};
++
++&pcie1 {
++	status = "okay";
++	reset-gpios = <&qcom_pinmux 48 GPIO_ACTIVE_LOW>;
++	pinctrl-0 = <&pcie1_pins>;
++	pinctrl-names = "default";
++	max-link-speed = <1>;
++
++	bridge@0,0 {
++		reg = <0x00000000 0 0 0 0>;
++		#address-cells = <3>;
++		#size-cells = <2>;
++		ranges;
++
++		wifi@1,0 {
++			compatible = "pci168c,0040";
++			reg = <0x00010000 0 0 0 0>;
++
++			nvmem-cells = <&precal_art_5000>, <&macaddr_art_5006>;
++			nvmem-cell-names = "pre-calibration", "mac-address";
++		};
++	};  
++};
++
++&nand {
++	status = "okay";
++
++	nand@0 {
++		reg = <0>;
++		compatible = "qcom,nandcs";
++
++		nand-bus-width = <8>;
++		nand-ecc-strength = <4>;
++		nand-ecc-step-size = <512>;
++
++		nand-is-boot-medium;
++		qcom,boot-partitions = <0 0xf0000000>;
++
++		partitions {
++			compatible = "fixed-partitions";
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			partition@0 {
++				label = "SBL1";
++				reg = <0x0 0x40000>;
++				read-only;
++			};
++
++			partition@40000 {
++				label = "MIBIB";
++				reg = <0x40000 0x80000>;
++				read-only;
++			};
++
++			partition@c0000 {
++				label = "SBL2";
++				reg = <0xc0000 0x80000>;
++				read-only;
++			};
++
++			partition@140000 {
++				label = "SBL3";
++				reg = <0x140000 0x80000>;
++				read-only;
++			};
++
++			partition@1c0000 {
++				label = "DDRCONFIG";
++				reg = <0x1c0000 0x80000>;
++				read-only;
++			};
++
++			partition@240000 {
++				label = "SSD";
++				reg = <0x240000 0x80000>;
++				read-only;
++			};
++
++			partition@2c0000 {
++				label = "TZ";
++				reg = <0x2c0000 0x80000>;
++				read-only;
++			};
++
++			partition@340000 {
++				label = "RPM";
++				reg = <0x340000 0x80000>;
++				read-only;
++			};
++
++			partition@3c0000 {
++				label = "APPSBL";
++				reg = <0x3c0000 0x100000>;
++				read-only;
++			};
++
++			partition@4c0000 {
++				label = "APPSBLENV";
++				reg = <0x4c0000 0x80000>;
++			};
++
++			art: partition@540000 {
++				label = "ART";
++				reg = <0x540000 0x80000>;
++				read-only;
++
++				nvmem-layout {
++					compatible = "fixed-layout";
++					#address-cells = <1>;
++					#size-cells = <1>;
++
++					macaddr_art_0: macaddr@0 {  /* WAN (label) */
++						compatible = "mac-base";
++						reg = <0x0 0x6>;
++						#nvmem-cell-cells = <1>;
++					};
++
++					macaddr_art_6: macaddr@6 {  /* LAN */
++						reg = <0x6 0x6>;
++					};
++
++					macaddr_art_1006: macaddr@1006 {  /* WiFi 2g */
++						reg = <0x1006 0x6>;
++					};
++
++					macaddr_art_5006: macaddr@5006 {  /* WiFi 5g */
++						reg = <0x5006 0x6>;
++					};
++
++					precal_art_1000: precal@1000 {
++						reg = <0x1000 0x2f20>;
++					};
++
++					precal_art_5000: precal@5000 {
++						reg = <0x5000 0x2f20>;
++					};
++				};
++			};
++
++			partition@5c0000 {
++				label = "BOOTCONFIG";
++				reg = <0x5c0000 0x40000>;
++				read-only;
++			};
++
++			partition@600000 {
++				label = "bdata";
++				reg = <0x600000 0x80000>;
++			};
++
++			partition@680000 {
++				label = "crash";
++				reg = <0x680000 0x80000>;
++				read-only;
++			};
++
++			partition@700000 {
++				label = "crash_syslog";
++				reg = <0x700000 0x80000>;
++				read-only;
++			};
++
++			partition@780000 {
++				label = "rsvd";
++				reg = <0x780000 0x80000>;
++				read-only;
++			};
++
++			partition@800000 {
++				label = "kernel_dup";
++				reg = <0x800000 0x400000>;
++			};
++
++			partition@c00000 {
++				label = "kernel";
++				reg = <0xc00000 0x400000>;
++			};
++
++			partition@1000000 {
++				label = "ubi";
++				reg = <0x1000000 0xf000000>;
++			};
++		};
++	};
++};
++
++&mdio0 {
++	status = "okay";
++
++	pinctrl-0 = <&mdio0_pins>;
++	pinctrl-names = "default";
++
++	switch@10 {
++		compatible = "qca,qca8337";
++		#address-cells = <1>;
++		#size-cells = <0>;
++		reg = <0x10>;
++
++		ports {
++			#address-cells = <1>;
++			#size-cells = <0>;
++
++			port@0 {
++				reg = <0>;
++				label = "cpu";
++				ethernet = <&gmac1>;
++				phy-mode = "rgmii";
++				tx-internal-delay-ps = <1000>;
++				rx-internal-delay-ps = <1000>;
++
++				fixed-link {
++					speed = <1000>;
++					full-duplex;
++				};
++			};
++
++			port@1 {
++				reg = <1>;
++				label = "lan3";
++				phy-mode = "internal";
++				phy-handle = <&phy_port1>;
++			};
++
++			port@2 {
++				reg = <2>;
++				label = "lan2";
++				phy-mode = "internal";
++				phy-handle = <&phy_port2>;
++			};
++
++			port@3 {
++				reg = <3>;
++				label = "lan1";
++				phy-mode = "internal";
++				phy-handle = <&phy_port3>;
++			};
++
++			port@5 {
++				reg = <5>;
++				label = "wan";
++				phy-mode = "internal";
++				phy-handle = <&phy_port5>;
++			};
++
++			port@6 {
++				reg = <6>;
++				label = "cpu";
++				ethernet = <&gmac2>;
++				phy-mode = "sgmii";
++				qca,sgmii-enable-pll;
++
++				fixed-link {
++					speed = <1000>;
++					full-duplex;
++				};
++			};
++		};
++
++		mdio {
++			#address-cells = <1>;
++			#size-cells = <0>;
++
++			phy_port1: phy@0 {
++				reg = <0>;
++			};
++
++			phy_port2: phy@1 {
++				reg = <1>;
++			};
++
++			phy_port3: phy@2 {
++				reg = <2>;
++			};
++
++			phy_port4: phy@3 {
++				reg = <3>;
++			};
++
++			phy_port5: phy@4 {
++				reg = <4>;
++			};
++		};
++	};
++};
++
++&gmac1 {
++	status = "okay";
++	phy-mode = "rgmii";
++	qcom,id = <1>;
++
++	pinctrl-0 = <&rgmii2_pins>;
++	pinctrl-names = "default";
++
++	nvmem-cells = <&macaddr_art_0 0>;
++	nvmem-cell-names = "mac-address";
++
++	fixed-link {
++		speed = <1000>;
++		full-duplex;
++	};
++};
++
++&gmac2 {
++	status = "okay";
++	phy-mode = "sgmii";
++	qcom,id = <2>;
++
++	nvmem-cells = <&macaddr_art_6 0>;
++	nvmem-cell-names = "mac-address";
++
++	fixed-link {
++		speed = <1000>;
++		full-duplex;
++	};
++};
+diff --git a/target/linux/ipq806x/image/generic.mk b/target/linux/ipq806x/image/generic.mk
+index 98e74e5b114c2..8f4ef5b7baec6 100644
+--- a/target/linux/ipq806x/image/generic.mk
++++ b/target/linux/ipq806x/image/generic.mk
+@@ -547,6 +547,29 @@ define Device/ubnt_unifi-ac-hd
+ endef
+ TARGET_DEVICES += ubnt_unifi-ac-hd
+ 
++define Device/xiaomi_mi-router-hd
++	$(call Device/LegacyImage)
++	$(Device/dsa-migration)
++	DEVICE_VENDOR := Xiaomi
++	DEVICE_MODEL := Mi Router HD (R3D)
++	SOC := qcom-ipq8064
++	BLOCKSIZE := 128k
++	PAGESIZE := 2048
++	KERNEL_SIZE := 4096k
++	IMAGE_SIZE := 86016k
++	BOARD_NAME := mi-router-hd
++	SUPPORTED_DEVICES += xiaomi,r3d
++	UBINIZE_OPTS := -E 5
++	IMAGES += factory.bin
++	IMAGE/factory.bin := append-kernel | pad-to $$$$(KERNEL_SIZE) | \
++		append-ubi | pad-to $$$$(BLOCKSIZE) | check-size
++	DEVICE_PACKAGES := kmod-i2c-gpio kmod-thermal kmod-hwmon-lm75 \
++		kmod-hwmon-emc2305 hwmon-drivetemp kmod-usb-storage-uas \
++		kmod-ramoops \
++		ath10k-firmware-qca9984-ct ath10k-firmware-qca99x0-ct
++endef
++TARGET_DEVICES += xiaomi_mi-router-hd
++
+ define Device/zyxel_nbg6817
+ 	$(Device/dsa-migration)
+ 	DEVICE_VENDOR := ZyXEL

+ 4 - 0
devices/qualcommax_ipq807x/.config

@@ -10,6 +10,10 @@ 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_TARGET_DEVICE_qualcommax_ipq807x_DEVICE_zbtlink_zbt-z800ax=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq807x_DEVICE_linksys_mx5300=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq807x_DEVICE_linksys_mx4200v1=y
+CONFIG_TARGET_DEVICE_qualcommax_ipq807x_DEVICE_linksys_mx4200v2=y
 
 CONFIG_PACKAGE_luci-ssl=y uhttpd服务
 

+ 1 - 9
devices/qualcommax_ipq807x/diy.sh

@@ -3,12 +3,4 @@ shopt -s extglob
 
 SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
-bash $SHELL_FOLDER/../common/kernel_6.1.sh
-
-rm -rf package/kernel/qca-nss-dp package/kernel/qca-ssdk
-
-git_clone_path master https://github.com/openwrt/openwrt target/linux/qualcommax
-
-git_clone_path master https://github.com/coolsnowwolf/lede package/qca
-
-sed -i "s/KERNEL_PATCHVER:=6.6/KERNEL_PATCHVER:=6.1/" target/linux/qualcommax/Makefile
+bash $SHELL_FOLDER/../common/kernel_6.6.sh

+ 3 - 0
devices/rockchip_armv8/.config

@@ -4,6 +4,9 @@ CONFIG_TARGET_rockchip_armv8=y
 CONFIG_TARGET_MULTI_PROFILE=y
 CONFIG_TARGET_ALL_PROFILES=y
 
+CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_radxa_rock-pi-4a=n
+CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_nlnet_xgp=n
+
 CONFIG_TARGET_KERNEL_PARTSIZE=32
 
 # daed

+ 11 - 11
devices/rockchip_armv8/diy.sh

@@ -3,22 +3,20 @@
 shopt -s extglob
 SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
-bash $SHELL_FOLDER/../common/kernel_6.1.sh
+bash $SHELL_FOLDER/../common/kernel_6.6.sh
 
-rm -rf package/boot
+rm -rf package/boot package/devel/kselftests-bpf package/devel/perf
 
-git_clone_path master https://github.com/immortalwrt/immortalwrt package/boot
+rm -rf target/linux/generic/!(*-5.15) target/linux/rockchip
 
-rm -rf target/linux/generic target/linux/rockchip/!(Makefile)
+git_clone_path master https://github.com/immortalwrt/immortalwrt package/boot target/linux/rockchip
+git_clone_path master https://github.com/immortalwrt/immortalwrt mv target/linux/generic
 
-git_clone_path master https://github.com/immortalwrt/immortalwrt target/linux/generic
-git_clone_path master https://github.com/immortalwrt/immortalwrt target/linux/rockchip
+git_clone_path master https://github.com/coolsnowwolf/lede target/linux/generic/hack-6.6
 
-git_clone_path master https://github.com/coolsnowwolf/lede target/linux/generic/hack-6.1
+curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/target/linux/generic/pending-6.6/613-netfilter_optional_tcp_window_check.patch -o target/linux/generic/pending-6.6/613-netfilter_optional_tcp_window_check.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
-
-rm -rf target/linux/generic/hack-6.1/{410-block-fit-partition-parser.patch,724-net-phy-aquantia*,720-net-phy-add-aqr-phys.patch}
+rm -rf target/linux/generic/hack-6.6/{410-block-fit-partition-parser.patch,724-net-phy-aquantia*,720-net-phy-add-aqr-phys.patch}
 
 sed -i "/KernelPackage,ptp/d" package/kernel/linux/modules/other.mk
 
@@ -29,6 +27,8 @@ rm -rf target/linux/rockchip/armv8/base-files/etc/uci-defaults/13_opkg_update
 sed -i -e 's,kmod-r8168,kmod-r8169,g' target/linux/rockchip/image/armv8.mk
 sed -i -e 's,wpad-openssl,wpad-basic-mbedtls,g' target/linux/rockchip/image/armv8.mk
 
+curl -sfL https://raw.githubusercontent.com/immortalwrt/immortalwrt/master/package/kernel/linux/modules/video.mk -o package/kernel/linux/modules/video.mk
+
 sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += fdisk lsblk kmod-drm-rockchip/' target/linux/rockchip/Makefile
 
 cp -Rf $SHELL_FOLDER/diy/* ./
@@ -38,4 +38,4 @@ sed -i 's,NanoPi R2S$,NanoPi R2S / R2S Plus,' target/linux/rockchip/image/armv8.
 
 echo '
 CONFIG_SENSORS_PWM_FAN=y
-' >> ./target/linux/rockchip/armv8/config-6.1
+' >> ./target/linux/rockchip/armv8/config-6.6

+ 462 - 0
devices/rockchip_armv8/diy/package/boot/uboot-rockchip/patches/316-rockchip-rk3568-Add-support-for-nlnet-xgp.patch

@@ -0,0 +1,462 @@
+--- /dev/null
++++ b/arch/arm/dts/rk3568-xgp-u-boot.dtsi
+@@ -0,0 +1,21 @@
++// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
++
++#include "rk356x-u-boot.dtsi"
++
++/ {
++	chosen {
++		stdout-path = &uart2;
++		u-boot,spl-boot-order = "same-as-spl", &sdmmc0, &sdhci;
++	};
++};
++
++&sdmmc0 {
++	bus-width = <4>;
++	u-boot,spl-fifo-mode;
++};
++
++&uart2 {
++	u-boot,dm-spl;
++	clock-frequency = <24000000>;
++	status = "okay";
++};
+--- /dev/null
++++ b/arch/arm/dts/rk3568-xgp.dts
+@@ -0,0 +1,327 @@
++// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
++
++#include "rk3568-evb.dts"
++
++/ {
++	model = "NLnet XiGuaPi Board";
++	compatible = "nlnet,xgp", "rockchip,rk3568";
++
++	aliases {
++		mmc0 = &sdmmc0;
++		mmc1 = &sdhci;
++	};
++    /delete-node/ vcc3v3-sys;
++
++	vcc_sysin_b: vcc_sysin_b {
++		compatible = "regulator-fixed";
++		regulator-name = "vcc_sysin_b";
++		regulator-always-on;
++		regulator-boot-on;
++		regulator-min-microvolt = <4000000>;
++		regulator-max-microvolt = <4000000>;
++	};
++};
++
++&cpu0 {
++	cpu-supply = <&vdd_cpu>;
++};
++
++&cpu1 {
++	cpu-supply = <&vdd_cpu>;
++};
++
++&cpu2 {
++	cpu-supply = <&vdd_cpu>;
++};
++
++&cpu3 {
++	cpu-supply = <&vdd_cpu>;
++};
++
++&i2c0 {
++	status = "okay";
++
++	vdd_cpu: regulator@1c {
++		compatible = "tcs,tcs4525";
++		reg = <0x1c>;
++		fcs,suspend-voltage-selector = <1>;
++		regulator-name = "vdd_cpu";
++		regulator-always-on;
++		regulator-boot-on;
++		regulator-min-microvolt = <800000>;
++		regulator-max-microvolt = <1150000>;
++		regulator-ramp-delay = <2300>;
++		vin-supply = <&vcc5v0_sys>;
++
++		regulator-state-mem {
++			regulator-off-in-suspend;
++		};
++	};
++
++	rk817: pmic@20 {
++		compatible = "rockchip,rk817";
++		reg = <0x20>;
++		interrupt-parent = <&gpio0>;
++		interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
++
++		pinctrl-names = "default", "pmic-sleep",
++				"pmic-power-off", "pmic-reset";
++		pinctrl-0 = <&pmic_int>;
++		rockchip,system-power-controller;
++		wakeup-source;
++		#clock-cells = <1>;
++		clock-output-names = "rk808-clkout1", "rk808-clkout2";
++		//fb-inner-reg-idxs = <2>;
++		/* 1: rst regs (default in codes), 0: rst the pmic */
++		pmic-reset-func = <0>;
++
++		vcc1-supply = <&vcc_sysin_b>;
++		vcc2-supply = <&vcc_sysin_b>;
++		vcc3-supply = <&vcc_sysin_b>;
++		vcc4-supply = <&vcc_sysin_b>;
++		vcc5-supply = <&vcc_sysin_b>;
++		vcc6-supply = <&vcc_sysin_b>;
++		vcc7-supply = <&vcc_sysin_b>;
++		vcc8-supply = <&vcc_sysin_b>;
++		vcc9-supply = <&dcdc_boost>;
++
++		pwrkey {
++			status = "okay";
++		};
++
++		regulators {
++			vdd_logic: DCDC_REG1 {
++				regulator-always-on;
++				regulator-boot-on;
++				regulator-init-microvolt = <900000>;
++				regulator-initial-mode = <0x2>;
++				regulator-min-microvolt = <500000>;
++				regulator-max-microvolt = <1350000>;
++				regulator-name = "vdd_logic";
++				regulator-ramp-delay = <6001>;
++
++				regulator-state-mem {
++					regulator-off-in-suspend;
++				};
++			};
++
++			vdd_gpu: DCDC_REG2 {
++				regulator-always-on;
++				regulator-init-microvolt = <900000>;
++				regulator-initial-mode = <0x2>;
++				regulator-min-microvolt = <500000>;
++				regulator-max-microvolt = <1350000>;
++				regulator-name = "vdd_gpu";
++				regulator-ramp-delay = <6001>;
++
++				regulator-state-mem {
++					regulator-off-in-suspend;
++				};
++			};
++
++			vcc_ddr: DCDC_REG3 {
++				regulator-always-on;
++				regulator-boot-on;
++				regulator-initial-mode = <0x2>;
++				regulator-name = "vcc_ddr";
++
++				regulator-state-mem {
++					regulator-on-in-suspend;
++				};
++			};
++
++			vcc3v3_sys: DCDC_REG4 {
++				regulator-always-on;
++				regulator-boot-on;
++				regulator-min-microvolt = <3300000>;
++				regulator-max-microvolt = <3300000>;
++				regulator-initial-mode = <0x2>;
++				regulator-name = "vcc3v3_sys";
++				regulator-state-mem {
++					regulator-off-in-suspend;
++				};
++			};
++
++			vdda_0v9: LDO_REG2 {
++				regulator-always-on;
++				regulator-boot-on;
++				regulator-min-microvolt = <900000>;
++				regulator-max-microvolt = <900000>;
++				regulator-name = "vdda_0v9";
++
++				regulator-state-mem {
++					regulator-off-in-suspend;
++				};
++			};
++
++			vdda0v9_pmu: LDO_REG3 {
++				regulator-always-on;
++				regulator-boot-on;
++				regulator-min-microvolt = <900000>;
++				regulator-max-microvolt = <900000>;
++				regulator-name = "vdda0v9_pmu";
++
++				regulator-state-mem {
++					regulator-on-in-suspend;
++					regulator-suspend-microvolt = <900000>;
++				};
++			};
++
++			vccio_acodec: LDO_REG4 {
++				regulator-always-on;
++				regulator-min-microvolt = <3300000>;
++				regulator-max-microvolt = <3300000>;
++				regulator-name = "vccio_acodec";
++
++				regulator-state-mem {
++					regulator-off-in-suspend;
++				};
++			};
++
++			vccio_sd: LDO_REG5 {
++				regulator-min-microvolt = <1800000>;
++				regulator-max-microvolt = <3300000>;
++				regulator-name = "vccio_sd";
++
++				regulator-state-mem {
++					regulator-off-in-suspend;
++				};
++			};
++
++			vcc3v3_pmu: LDO_REG6 {
++				regulator-always-on;
++				regulator-boot-on;
++				regulator-min-microvolt = <3300000>;
++				regulator-max-microvolt = <3300000>;
++				regulator-name = "vcc3v3_pmu";
++
++				regulator-state-mem {
++					regulator-on-in-suspend;
++					regulator-suspend-microvolt = <3300000>;
++				};
++			};
++
++			vcca_1v8_en: LDO_REG7 {
++				regulator-always-on;
++				regulator-boot-on;
++				regulator-min-microvolt = <1800000>;
++				regulator-max-microvolt = <1800000>;
++				regulator-name = "vcca_1v8_en";
++
++				regulator-state-mem {
++					regulator-off-in-suspend;
++				};
++			};
++
++			vdda0v9_image_p: LDO_REG8 {
++				regulator-boot-on;
++				regulator-always-on;
++				regulator-min-microvolt = <900000>;
++				regulator-max-microvolt = <900000>;
++				regulator-name = "vdda0v9_image_p";
++				regulator-state-mem {
++					regulator-off-in-suspend;
++				};
++			};
++
++			vcca1v8_image_p: LDO_REG9 {
++				regulator-always-on;
++				regulator-boot-on;
++				regulator-min-microvolt = <1800000>;
++				regulator-max-microvolt = <1800000>;
++				regulator-name = "vcca1v8_image_p";
++				regulator-state-mem {
++					regulator-off-in-suspend;
++				};
++			};
++
++			dcdc_boost: BOOST {
++				regulator-always-on;
++				regulator-boot-on;
++				regulator-min-microvolt = <4700000>;
++				regulator-max-microvolt = <5400000>;
++				regulator-name = "boost";
++				regulator-state-mem {
++					regulator-off-in-suspend;
++				};
++			};
++
++			otg_switch: OTG_SWITCH {
++				regulator-name = "otg_switch";
++				regulator-state-mem {
++					regulator-off-in-suspend;
++				};
++			};
++		};
++	};
++};
++
++&pinctrl {
++	pmic {
++		pmic_int: pmic_int {
++			rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
++		};
++	};
++};
++
++&saradc {
++   vref-supply = <&vcca_1v8_en>;
++	status = "okay";
++};
++
++&gmac0 {
++	assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
++	assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>;
++	assigned-clock-rates = <0>, <125000000>;
++	clock_in_out = "output";
++	phy-mode = "rgmii-id";
++	pinctrl-names = "default";
++	pinctrl-0 = <&gmac0_miim
++		     &gmac0_tx_bus2
++		     &gmac0_rx_bus2
++		     &gmac0_rgmii_clk
++		     &gmac0_rgmii_bus>;
++	snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
++	snps,reset-active-low;
++	snps,reset-delays-us = <0 20000 100000>;
++	tx_delay = <0x3c>;
++	rx_delay = <0x2f>;
++	phy-handle = <&rgmii_phy0>;
++	status = "okay";
++};
++
++&gmac1 {
++	assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
++	assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>;
++	assigned-clock-rates = <0>, <125000000>;
++	clock_in_out = "output";
++	phy-mode = "rgmii";
++	pinctrl-names = "default";
++	pinctrl-0 = <&gmac1m1_miim
++		     &gmac1m1_tx_bus2
++		     &gmac1m1_rx_bus2
++		     &gmac1m1_rgmii_clk
++		     &gmac1m1_rgmii_bus>;
++	snps,reset-gpio = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>;
++	snps,reset-active-low;
++	snps,reset-delays-us = <0 20000 100000>;
++	tx_delay = <0x3c>;
++	rx_delay = <0x2f>;
++	phy-handle = <&rgmii_phy1>;
++	phy-supply = <&vcca1v8_image_p>;
++	status = "okay";
++};
++
++&mdio0 {
++	rgmii_phy0: ethernet-phy@0 {
++		compatible = "ethernet-phy-ieee802.3-c22";
++		reg = <0x1>;
++	};
++};
++
++&mdio1 {
++	rgmii_phy1: ethernet-phy@0 {
++		compatible = "ethernet-phy-ieee802.3-c22";
++		reg = <0x1>;
++	};
++};
+--- /dev/null
++++ b/configs/nlnet-xgp-rk3568_defconfig
+@@ -0,0 +1,101 @@
++CONFIG_ARM=y
++CONFIG_SKIP_LOWLEVEL_INIT=y
++CONFIG_ARCH_ROCKCHIP=y
++CONFIG_SYS_TEXT_BASE=0x00a00000
++CONFIG_SPL_LIBCOMMON_SUPPORT=y
++CONFIG_SPL_LIBGENERIC_SUPPORT=y
++CONFIG_NR_DRAM_BANKS=2
++CONFIG_DEFAULT_DEVICE_TREE="rk3568-xgp"
++CONFIG_ROCKCHIP_RK3568=y
++CONFIG_TEXT_BASE=0x00a00000
++CONFIG_SPL_BSS_MAX_SIZE=0x4000
++CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
++CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
++CONFIG_SPL_ROCKCHIP_BACK_TO_BROM=y
++CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
++CONFIG_SPL_MMC=y
++CONFIG_SPL_SERIAL=y
++CONFIG_SPL_STACK_R_ADDR=0x600000
++CONFIG_TARGET_EVB_RK3568=y
++CONFIG_DEBUG_UART_BASE=0xFE660000
++CONFIG_DEBUG_UART_CLOCK=24000000
++CONFIG_DEBUG_UART=y
++CONFIG_SYS_LOAD_ADDR=0xc00800
++CONFIG_API=y
++CONFIG_FIT=y
++CONFIG_FIT_VERBOSE=y
++CONFIG_SPL_LOAD_FIT=y
++CONFIG_OF_SYSTEM_SETUP=y
++CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-xgp.dtb"
++# CONFIG_SYS_DEVICE_NULLDEV is not set
++CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS=2
++# CONFIG_DISPLAY_CPUINFO is not set
++CONFIG_DISPLAY_BOARDINFO_LATE=y
++# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
++CONFIG_SPL_STACK_R=y
++CONFIG_SPL_SEPARATE_BSS=y
++CONFIG_SPL_ADC=y
++CONFIG_SPL_ATF=y
++CONFIG_SPL_ATF_LOAD_IMAGE_V2=y
++CONFIG_SPL_BOARD_INIT=y
++CONFIG_CMD_ADC=y
++CONFIG_CMD_BIND=y
++CONFIG_CMD_CLK=y
++CONFIG_CMD_GPIO=y
++CONFIG_CMD_GPT=y
++CONFIG_CMD_I2C=y
++CONFIG_CMD_MMC=y
++CONFIG_CMD_USB=y
++# CONFIG_CMD_SETEXPR is not set
++CONFIG_CMD_PMIC=y
++CONFIG_CMD_REGULATOR=y
++# CONFIG_SPL_DOS_PARTITION is not set
++CONFIG_SPL_OF_CONTROL=y
++CONFIG_OF_LIVE=y
++CONFIG_NET_RANDOM_ETHADDR=y
++CONFIG_SPL_DM_WARN=y
++CONFIG_SPL_REGMAP=y
++CONFIG_SPL_SYSCON=y
++CONFIG_SPL_CLK=y
++CONFIG_ROCKCHIP_GPIO=y
++CONFIG_ROCKCHIP_GPIO_V2=y
++CONFIG_SYS_I2C_ROCKCHIP=y
++CONFIG_MISC=y
++CONFIG_MMC_HS200_SUPPORT=y
++CONFIG_SPL_MMC_HS200_SUPPORT=y
++CONFIG_MMC_DW=y
++CONFIG_MMC_DW_ROCKCHIP=y
++CONFIG_MMC_SDHCI=y
++CONFIG_MMC_SDHCI_SDMA=y
++CONFIG_MMC_SDHCI_ROCKCHIP=y
++CONFIG_DM_ETH=y
++CONFIG_ETH_DESIGNWARE=y
++CONFIG_GMAC_ROCKCHIP=y
++CONFIG_POWER_DOMAIN=y
++CONFIG_DM_PMIC=y
++CONFIG_PMIC_RK8XX=y
++CONFIG_SPL_PMIC_RK8XX=y
++CONFIG_REGULATOR_PWM=y
++CONFIG_DM_REGULATOR_FIXED=y
++CONFIG_SPL_DM_REGULATOR_FIXED=y
++CONFIG_DM_REGULATOR_GPIO=y
++CONFIG_REGULATOR_RK8XX=y
++CONFIG_PWM_ROCKCHIP=y
++CONFIG_SPL_RAM=y
++CONFIG_DM_RESET=y
++CONFIG_BAUDRATE=1500000
++CONFIG_DEBUG_UART_SHIFT=2
++CONFIG_SYSRESET=y
++CONFIG_SYSRESET_PSCI=y
++CONFIG_USB=y
++CONFIG_USB_XHCI_HCD=y
++CONFIG_USB_XHCI_DWC3=y
++CONFIG_USB_EHCI_HCD=y
++CONFIG_USB_EHCI_GENERIC=y
++CONFIG_USB_OHCI_HCD=y
++CONFIG_USB_OHCI_GENERIC=y
++CONFIG_USB_DWC3=y
++CONFIG_USB_DWC3_GENERIC=y
++CONFIG_ROCKCHIP_USB2_PHY=y
++CONFIG_USB_KEYBOARD=y
++CONFIG_USB_HOST_ETHER=y
++CONFIG_USB_ETHER_LAN75XX=y
++CONFIG_USB_ETHER_LAN78XX=y
++CONFIG_USB_ETHER_SMSC95XX=y
++CONFIG_ERRNO_STR=y

+ 732 - 0
devices/rockchip_armv8/diy/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-nlnet-xgz68.dtsi

@@ -0,0 +1,732 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/soc/rockchip,vop2.h>
+#include "rk3568.dtsi"
+
+/ {
+	aliases {
+		mmc0 = &sdmmc0;
+		mmc1 = &sdhci;
+	};
+
+	chosen {
+		stdout-path = "serial2:1500000n8";
+	};
+
+	adc-keys {
+		compatible = "adc-keys";
+		io-channels = <&saradc 0>;
+		io-channel-names = "buttons";
+		keyup-threshold-microvolt = <1750000>;
+
+		button-reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			press-threshold-microvolt = <0>;
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-0 = <&sys_led_pin>;
+		pinctrl-names = "default";
+		sys_led: sys-led {
+			gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>;
+			label = "blue:sys";
+		};
+	};
+
+	vbus_typec: vbus_typec {
+		compatible = "regulator-fixed";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-name = "vbus_typec";
+	};
+
+	vcc_sysin_b: vcc_sysin_b {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_sysin_b";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <4000000>;
+		regulator-max-microvolt = <4000000>;
+	};
+
+	vcc_3v3: vcc_3v3 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vcc3v3_sys>;
+	};
+
+	vcc_1v8: vcc_1v8 {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_1v8";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_sysin_b>;
+	};
+
+	vcc_1v8_image: vcc_1v8_image {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_1v8_image";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		vin-supply = <&vcc_1v8>;
+	};
+
+	vcc_0v6_ddr: vcc_0v6_ddr {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_0v6_ddr";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <600000>;
+		regulator-max-microvolt = <600000>;
+		vin-supply = <&vcc_sysin_b>;
+	};
+
+	vcc_3v3_mainboard: vcc_3v3_mainboard {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_3v3_mainboard";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vbus_typec>;
+	};
+
+	vcc5v_mainboard: vcc5v_mainboard {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc5v_mainboard";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		vin-supply = <&vbus_typec>;
+	};
+
+	vcc5v0_usb_otg0: vcc5v0_usb_otg0 {
+		compatible = "regulator-fixed";
+		enable-active-high;
+		gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&vcc5v0_usb_otg0_en>;
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-name = "vcc5v0_usb_otg0";
+		vin-supply = <&vcc5v_mainboard>;
+	};
+
+	battery_mainboard: battery_mainboard {
+		compatible = "regulator-fixed";
+		regulator-name = "battery_mainboard";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <4000000>;
+		regulator-max-microvolt = <4000000>;
+		vin-supply = <&vbus_typec>;
+	};
+
+	vcc3v3_sd: vcc3v3_sd {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc3v3_sd";
+		regulator-always-on;
+		gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&sdmmc0_pwren>;
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vcc_3v3_mainboard>;
+	};
+
+	pcie_pi6c_oe: pcie-pi6c-oe {
+		compatible = "regulator-fixed";
+		regulator-name = "pcie_pi6c_oe_en";
+		regulator-always-on;
+		regulator-boot-on;
+		enable-active-high;
+		gpio = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pcie_all_power_en_pin>;
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vcc5v_mainboard>;
+	};
+
+	vcc_3v3_wifi: vcc-3v3-wifi {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_3v3_wifi";
+		regulator-always-on;
+		enable-active-high;
+		//gpio = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>;
+		//pinctrl-names = "default";
+		//pinctrl-0 = <&pcie_all_power_en_pin>;
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		vin-supply = <&vcc_3v3_mainboard>;
+	};
+
+	vcc_4v0_5g: vcc-4v0-5g {
+		compatible = "regulator-fixed";
+		regulator-name = "vcc_4v0_5g";
+		regulator-always-on;
+		enable-active-high;
+		//gpio = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>;
+		//pinctrl-names = "default";
+		//pinctrl-0 = <&pcie_all_power_en_pin>;
+		regulator-min-microvolt = <4000000>;
+		regulator-max-microvolt = <4000000>;
+		vin-supply = <&battery_mainboard>;
+	};
+
+#ifdef DTS_NO_LEGACY
+	hdmi-con {
+		compatible = "hdmi-connector";
+		type = "a";
+
+		port {
+			hdmi_con_in: endpoint {
+				remote-endpoint = <&hdmi_out_con>;
+			};
+		};
+	};
+#endif
+};
+
+
+
+&cpu0 {
+	cpu-supply = <&vdd_cpu>;
+};
+
+&cpu1 {
+	cpu-supply = <&vdd_cpu>;
+};
+
+&cpu2 {
+	cpu-supply = <&vdd_cpu>;
+};
+
+&cpu3 {
+	cpu-supply = <&vdd_cpu>;
+};
+
+&tsadc {
+	rockchip,hw-tshut-mode = <1>;
+	rockchip,hw-tshut-polarity = <0>;
+	status = "okay";
+};
+
+&i2c0 {
+	status = "okay";
+
+	fusb0: usb-typec@22 {
+		compatible = "fcs,fusb302";
+		reg = <0x22>;
+		interrupt-parent = <&gpio0>;
+		interrupts = <RK_PC5 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&fusb0_int>;
+		vbus-supply = <&vbus_typec>;
+		status = "disabled";
+	};
+
+	vdd_cpu: regulator@1c {
+		compatible = "tcs,tcs4525";
+		reg = <0x1c>;
+		fcs,suspend-voltage-selector = <1>;
+		regulator-name = "vdd_cpu";
+		regulator-always-on;
+		regulator-boot-on;
+		regulator-min-microvolt = <800000>;
+		regulator-max-microvolt = <1150000>;
+		regulator-ramp-delay = <2300>;
+		vin-supply = <&vcc_sysin_b>;
+
+		regulator-state-mem {
+			regulator-off-in-suspend;
+		};
+	};
+
+	rk817: pmic@20 {
+		compatible = "rockchip,rk817";
+		reg = <0x20>;
+		interrupt-parent = <&gpio0>;
+		interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
+
+		pinctrl-names = "default", "pmic-sleep",
+				"pmic-power-off", "pmic-reset";
+		pinctrl-0 = <&pmic_int>;
+		pinctrl-1 = <&soc_slppin_slp>, <&rk817_slppin_slp>;
+		pinctrl-2 = <&soc_slppin_gpio>, <&rk817_slppin_pwrdn>;
+		pinctrl-3 = <&soc_slppin_gpio>, <&rk817_slppin_rst>;
+		rockchip,system-power-controller;
+		wakeup-source;
+		#clock-cells = <1>;
+		clock-output-names = "rk808-clkout1", "rk808-clkout2";
+		//fb-inner-reg-idxs = <2>;
+		/* 1: rst regs (default in codes), 0: rst the pmic */
+		pmic-reset-func = <0>;
+
+		vcc1-supply = <&vcc_sysin_b>;
+		vcc2-supply = <&vcc_sysin_b>;
+		vcc3-supply = <&vcc_sysin_b>;
+		vcc4-supply = <&vcc_sysin_b>;
+		vcc5-supply = <&vcc_sysin_b>;
+		vcc6-supply = <&vcc_sysin_b>;
+		vcc7-supply = <&vcc_sysin_b>;
+		vcc8-supply = <&vcc_sysin_b>;
+		vcc9-supply = <&dcdc_boost>;
+
+		pwrkey {
+			status = "okay";
+		};
+
+		pinctrl_rk8xx: pinctrl_rk8xx {
+			gpio-controller;
+			#gpio-cells = <2>;
+
+			rk817_slppin_null: rk817_slppin_null {
+				pins = "gpio_slp";
+				function = "pin_fun0";
+			};
+
+			rk817_slppin_slp: rk817_slppin_slp {
+				pins = "gpio_slp";
+				function = "pin_fun1";
+			};
+
+			rk817_slppin_pwrdn: rk817_slppin_pwrdn {
+				pins = "gpio_slp";
+				function = "pin_fun2";
+			};
+
+			rk817_slppin_rst: rk817_slppin_rst {
+				pins = "gpio_slp";
+				function = "pin_fun3";
+			};
+		};
+
+		regulators {
+			vdd_logic: DCDC_REG1 {
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-init-microvolt = <900000>;
+				regulator-initial-mode = <0x2>;
+				regulator-min-microvolt = <500000>;
+				regulator-max-microvolt = <1350000>;
+				regulator-name = "vdd_logic";
+				regulator-ramp-delay = <6001>;
+
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			vdd_gpu: DCDC_REG2 {
+				regulator-always-on;
+				regulator-init-microvolt = <900000>;
+				regulator-initial-mode = <0x2>;
+				regulator-min-microvolt = <500000>;
+				regulator-max-microvolt = <1350000>;
+				regulator-name = "vdd_gpu";
+				regulator-ramp-delay = <6001>;
+
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			vcc_ddr: DCDC_REG3 {
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-initial-mode = <0x2>;
+				regulator-name = "vcc_ddr";
+
+				regulator-state-mem {
+					regulator-on-in-suspend;
+				};
+			};
+
+			vcc3v3_sys: DCDC_REG4 {
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-initial-mode = <0x2>;
+				regulator-name = "vcc3v3_sys";
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			vcca1v8_pmu: LDO_REG1 {
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcca1v8_pmu";
+				regulator-state-mem {
+					regulator-on-in-suspend;
+					regulator-suspend-microvolt = <1800000>;
+				};
+			};
+
+			vdda_0v9: LDO_REG2 {
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <900000>;
+				regulator-name = "vdda_0v9";
+
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			vdda0v9_pmu: LDO_REG3 {
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <900000>;
+				regulator-name = "vdda0v9_pmu";
+
+				regulator-state-mem {
+					regulator-on-in-suspend;
+					regulator-suspend-microvolt = <900000>;
+				};
+			};
+
+			vccio_acodec: LDO_REG4 {
+				regulator-always-on;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "vccio_acodec";
+
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			vccio_sd: LDO_REG5 {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "vccio_sd";
+
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			vcc3v3_pmu: LDO_REG6 {
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "vcc3v3_pmu";
+
+				regulator-state-mem {
+					regulator-on-in-suspend;
+					regulator-suspend-microvolt = <3300000>;
+				};
+			};
+
+			vcca_1v8_en: LDO_REG7 {
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcca_1v8_en";
+
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			vdda0v9_image_p: LDO_REG8 {
+				regulator-boot-on;
+				regulator-always-on;
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <900000>;
+				regulator-name = "vdda0v9_image_p";
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			vcca1v8_image_p: LDO_REG9 {
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "vcca1v8_image_p";
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			dcdc_boost: BOOST {
+				regulator-always-on;
+				regulator-boot-on;
+				regulator-min-microvolt = <4700000>;
+				regulator-max-microvolt = <5400000>;
+				regulator-name = "boost";
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+
+			otg_switch: OTG_SWITCH {
+				regulator-name = "otg_switch";
+				regulator-state-mem {
+					regulator-off-in-suspend;
+				};
+			};
+		};
+	};
+};
+
+&combphy2 {
+	status = "okay";
+};
+
+&pcie2x1 {
+	reset-gpios = <&gpio3 RK_PC1 GPIO_ACTIVE_HIGH>;
+	vpcie3v3-supply = <&vcc_3v3_wifi>;
+	status = "okay";
+};
+
+&pcie30phy {
+	phy-supply = <&pcie_pi6c_oe>;
+	data-lanes = <1 2>;
+	status = "okay";
+};
+
+&pcie3x2 {
+	num-lanes = <1>;
+	reset-gpios = <&gpio2 RK_PD6 GPIO_ACTIVE_HIGH>;
+	vpcie3v3-supply = <&vcc_4v0_5g>;
+	status = "okay";
+};
+
+&pcie3x1 {
+	num-lanes = <1>;
+	reset-gpios = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>;
+	vpcie3v3-supply = <&vcc_3v3_wifi>;
+	status = "okay";
+};
+
+&pinctrl {
+
+	leds {
+		sys_led_pin: sys-led-pin {
+			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	fusb30x {
+		fusb0_int: fusb0-int {
+			rockchip,pins = <0 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
+
+	usb {
+		vcc5v0_usb_otg0_en: vcc5v0_usb_otg0_en {
+			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	pmic {
+		pmic_int: pmic_int {
+			rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+
+		soc_slppin_gpio: soc_slppin_gpio {
+			rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_output_low>;
+		};
+
+		soc_slppin_rst: soc_slppin_rst {
+			rockchip,pins = <0 RK_PA2 2 &pcfg_pull_none>;
+		};
+
+		soc_slppin_slp: soc_slppin_slp {
+			rockchip,pins = <0 RK_PA2 1 &pcfg_pull_none>;
+		};
+	};
+
+        pcie {
+		pcie_all_power_en_pin: pcie-all-power-en-pin {
+			rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+};
+
+&pmu_io_domains {
+	//fixed, pmuio0-supply = <&vcca1v8_pmu>;
+	pmuio1-supply = <&vcc3v3_pmu>;
+	pmuio2-supply = <&vcc3v3_pmu>;
+	vccio1-supply = <&vccio_acodec>;
+	//configure by hardware FLASH_VOL_SEL pin, vccio2-supply = <&vcca_1v8>;
+	vccio3-supply = <&vccio_sd>;
+	vccio4-supply = <&vcca1v8_pmu>;
+	vccio5-supply = <&vcc_1v8>;
+	vccio6-supply = <&vcca1v8_image_p>;
+	vccio7-supply = <&vcc_3v3>;
+	status = "okay";
+};
+
+&rng {
+	status = "okay";
+};
+
+&saradc {
+	vref-supply = <&vcca_1v8_en>;
+	status = "okay";
+};
+
+&sdhci {
+	bus-width = <8>;
+	max-frequency = <200000000>;
+	non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
+	status = "okay";
+};
+
+&sdmmc0 {
+	bus-width = <4>;
+	cap-sd-highspeed;
+	cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
+	disable-wp;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
+	sd-uhs-sdr104;
+	vmmc-supply = <&vcc3v3_sd>;
+	vqmmc-supply = <&vccio_sd>;
+	status = "okay";
+};
+
+&uart2 {
+	status = "okay";
+};
+
+&combphy0 {
+	status = "okay";
+};
+
+&combphy1 {
+	status = "okay";
+};
+
+&usb2phy0 {
+	status = "okay";
+};
+
+&usb2phy1 {
+	status = "okay";
+};
+
+&usb2phy0_otg {
+	phy-supply = <&vcc5v0_usb_otg0>;
+	status = "okay";
+};
+
+&usb_host0_xhci {
+	extcon = <&usb2phy0>;
+	status = "okay";
+};
+
+&usb2phy0_host {
+	//phy-supply = <&vcc5v0_usb_host>;
+	status = "okay";
+};
+
+&usb_host1_xhci {
+	status = "okay";
+};
+
+&usb2phy1_otg {
+	//phy-supply = <&vcc5v0_usb_host>;
+	status = "okay";
+};
+
+&usb_host0_ehci {
+	status = "okay";
+};
+
+&usb_host0_ohci {
+	status = "okay";
+};
+
+&usb2phy1_host {
+	//phy-supply = <&vcc5v0_usb_host>;
+	status = "okay";
+};
+
+&usb_host1_ehci {
+	status = "okay";
+};
+
+&usb_host1_ohci {
+	status = "okay";
+};
+
+#ifdef DTS_NO_LEGACY
+&gpu {
+	mali-supply = <&vdd_gpu>;
+	status = "okay";
+};
+
+&hdmi {
+	avdd-0v9-supply = <&vdda0v9_image>;
+	avdd-1v8-supply = <&vcca1v8_image>;
+	status = "okay";
+};
+
+&hdmi_in {
+	hdmi_in_vp0: endpoint {
+		remote-endpoint = <&vp0_out_hdmi>;
+	};
+};
+
+&hdmi_out {
+	hdmi_out_con: endpoint {
+		remote-endpoint = <&hdmi_con_in>;
+	};
+};
+
+&hdmi_sound {
+	status = "okay";
+};
+#endif
+
+#ifdef DTS_NO_LEGACY
+&vop {
+	assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
+	assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
+	status = "okay";
+};
+
+&vop_mmu {
+	status = "okay";
+};
+
+&vp0 {
+	vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
+		reg = <ROCKCHIP_VOP2_EP_HDMI0>;
+		remote-endpoint = <&hdmi_in_vp0>;
+	};
+};
+#endif
+
+&i2c5 {
+	status = "okay";
+};

+ 86 - 0
devices/rockchip_armv8/diy/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-xgp-v3.dts

@@ -0,0 +1,86 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+/dts-v1/;
+
+#include "rk3568-xgp.dts"
+
+/delete-node/ &backlight;
+/delete-node/ &spi_gpio;
+
+/ {
+	model = "NLnet XiGuaPi Board V3";
+
+	leds {
+		pinctrl-0 = <&sys_led &net_led_pin>;
+
+		net_led: net-led {
+			gpios = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>;
+			label = "blue:net";
+		};
+	};
+
+	led-controller {
+		compatible = "pwm-leds";
+
+		backlight: backlight {
+			label = "lcd:backlight";
+			pwms = <&pwm14 0 1000000 0>;
+			max-brightness = <255>;
+			linux,default-trigger = "default-on";
+		};
+	};
+};
+
+&pmu_io_domains {
+	vccio5-supply = <&vcc_3v3>;
+};
+
+&spi3 {
+	status = "okay";
+};
+
+&pinctrl {
+	/delete-property/ spi_gpio;
+	leds {
+		net_led_pin: net-led-pin {
+			rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	display {
+		/delete-property/ display_dc_pin;
+		spi3_display_dc_pin: spi3_display_dc_pin {
+			rockchip,pins = <4 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+
+		display_reset_pin: display_reset_pin {
+			rockchip,pins = <4 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	spi3 {
+		spi3_sck: spi3_sck {
+			rockchip,pins = <4 RK_PC2 2 &pcfg_pull_none>;
+		};
+		spi3_mosi: spi3_mosi {
+			rockchip,pins = <4 RK_PC3 2 &pcfg_pull_none>;
+		};
+	};
+
+	modem {
+		modem_reset_pins: modem-reset-pins {
+			rockchip,pins = <2 RK_PD7 RK_FUNC_GPIO &pcfg_pull_down>;
+		};
+	};
+};
+
+&pwm14 {
+	pinctrl-0 = <&pwm14m0_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&usb2phy0_host {
+	pinctrl-0 = <&modem_reset_pins>;
+	pinctrl-names = "default";
+};

+ 286 - 0
devices/rockchip_armv8/diy/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-xgp.dts

@@ -0,0 +1,286 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+/dts-v1/;
+
+#include "rk3568-nlnet-xgz68.dtsi"
+
+/ {
+	model = "NLnet XiGuaPi Board";
+	compatible = "nlnet,xgp", "rockchip,rk3568";
+
+	aliases {
+		ethernet0 = &gmac0;
+		ethernet1 = &gmac1;
+		led-boot = &sys_led;
+		led-failsafe = &sys_led;
+		led-running = &sys_led;
+		led-upgrade = &sys_led;
+	};
+
+	backlight: backlight {
+		compatible = "gpio-backlight";
+		pinctrl-names = "default";
+		pinctrl-0 = <&backlight_led_pin>;
+		gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_HIGH>;
+		default-on;
+	};
+
+	fan0: pwm-fan {
+		compatible = "pwm-fan";
+		pinctrl-names = "default";
+		#cooling-cells = <2>;
+		pwms = <&pwm7 0 40000 0>;
+		cooling-levels = <0 50 80 110 140 170 200 230 255>;
+	};
+
+	spi_gpio: spi-gpio {
+		compatible = "spi-gpio";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		num-chipselects = <1>;
+	};
+};
+
+&gmac0 {
+	assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
+	assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>;
+	assigned-clock-rates = <0>, <125000000>;
+	clock_in_out = "output";
+	phy-mode = "rgmii-id";
+	pinctrl-names = "default";
+	pinctrl-0 = <&gmac0_miim
+		     &gmac0_tx_bus2
+		     &gmac0_rx_bus2
+		     &gmac0_rgmii_clk
+		     &gmac0_rgmii_bus>;
+	snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
+	snps,reset-active-low;
+	snps,reset-delays-us = <0 20000 100000>;
+	tx_delay = <0x3c>;
+	rx_delay = <0x2f>;
+	phy-handle = <&rgmii_phy0>;
+	status = "okay";
+};
+
+&gmac1 {
+	assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
+	assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>;
+	assigned-clock-rates = <0>, <125000000>;
+	clock_in_out = "output";
+	phy-mode = "rgmii";
+	pinctrl-names = "default";
+	pinctrl-0 = <&gmac1m1_miim
+		     &gmac1m1_tx_bus2
+		     &gmac1m1_rx_bus2
+		     &gmac1m1_rgmii_clk
+		     &gmac1m1_rgmii_bus>;
+	snps,reset-gpio = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>;
+	snps,reset-active-low;
+	snps,reset-delays-us = <0 20000 100000>;
+	tx_delay = <0x3c>;
+	rx_delay = <0x2f>;
+	phy-handle = <&rgmii_phy1>;
+	phy-supply = <&vcca1v8_image_p>;
+	status = "okay";
+};
+
+&mdio0 {
+	rgmii_phy0: ethernet-phy@0 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x1>;
+	};
+};
+
+&mdio1 {
+	rgmii_phy1: ethernet-phy@0 {
+		compatible = "ethernet-phy-ieee802.3-c22";
+		reg = <0x1>;
+	};
+};
+
+&spi3 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi3m1_cs0 &spi3_sck &spi3_mosi>;
+	status = "disabled";
+
+	display@0 {
+		pinctrl-names = "default";
+		pinctrl-0 = <&spi3_display_dc_pin &display_reset_pin>;
+		compatible = "sitronix,st7735r";
+		reg = <0>;
+		rotate = <0>;
+		dc-gpios = <&gpio4 RK_PC5 GPIO_ACTIVE_HIGH>;
+		reset-gpios = <&gpio4 RK_PC4 GPIO_ACTIVE_LOW>;
+		backlight = <&backlight>;
+		buswidth = <8>;
+		debug = <0x0>;
+		status = "okay";
+	};
+};
+
+&spi_gpio {
+	pinctrl-names = "default";
+	pinctrl-0 = <&spi_gpio_sck &spi_gpio_mosi &spi_gpio_cs>;
+	sck-gpios = <&gpio4 RK_PC2 GPIO_ACTIVE_HIGH>;
+	mosi-gpios = <&gpio4 RK_PC5 GPIO_ACTIVE_HIGH>;
+	cs-gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
+	status = "okay";
+
+	display@0 {
+		pinctrl-names = "default";
+		pinctrl-0 = <&display_dc_pin &display_reset_pin>;
+		compatible = "sitronix,st7735r";
+		reg = <0>;
+		rotate = <0>;
+		dc-gpios = <&gpio4 RK_PC3 GPIO_ACTIVE_HIGH>;
+		reset-gpios = <&gpio4 RK_PC4 GPIO_ACTIVE_LOW>;
+		backlight = <&backlight>;
+		buswidth = <8>;
+		debug = <0x0>;
+		status = "okay";
+	};
+};
+
+&pinctrl {
+	spi_gpio {
+		spi_gpio_sck: spi_gpio_sck {
+			rockchip,pins = <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+		spi_gpio_mosi: spi_gpio_mosi {
+			rockchip,pins = <4 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+		spi_gpio_cs: spi_gpio_cs {
+			rockchip,pins = <4 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
+
+	spi3 {
+		spi3_sck: spi3_sck {
+			rockchip,pins = <4 RK_PC2 2 &pcfg_pull_none>;
+		};
+		spi3_mosi: spi3_mosi {
+			rockchip,pins = <4 RK_PC3 2 &pcfg_pull_none>;
+		};
+	};
+
+	display {
+		spi3_display_dc_pin: spi3_display_dc_pin {
+			rockchip,pins = <4 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+		display_dc_pin: display_dc_pin {
+			rockchip,pins = <4 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+		display_reset_pin: display_reset_pin {
+			rockchip,pins = <4 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	backlight {
+		backlight_led_pin: backlight-led-pin {
+			rockchip,pins = <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+
+	pwmfan {
+		pwm_fan_sense_pin: pwm-fan-sense-pin {
+			rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_up>;
+		};
+	};
+};
+
+&pwm7 {
+	status = "okay";
+	pinctrl-0 = <&pwm7_pins>;
+	pinctrl-names = "default";
+};
+
+&pwm3 {
+	compatible = "rockchip,remotectl-pwm";
+	pinctrl-names = "default";
+	pinctrl-0 = <&pwm3_pins>;
+	remote_pwm_id = <3>;
+	handle_cpu_id = <1>;
+	remote_support_psci = <0>;
+	interrupts = <GIC_SPI 82 IRQ_TYPE_LEVEL_HIGH>,
+	     <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
+	status = "okay";
+
+	/* China Mobile TV Box */
+	ir_key1 {
+		rockchip,usercode = <0xdd22>;
+		rockchip,key_table =
+			<0x6a	KEY_BACK>,
+			<0x35	KEY_UP>,
+			<0x2d	KEY_DOWN>,
+			<0x66	KEY_LEFT>,
+			<0x3e	KEY_RIGHT>,
+			<0x77	KEY_HOME>,
+			<0x7f	KEY_VOLUMEUP>,
+			<0x7e	KEY_VOLUMEDOWN>,
+			<0x23	KEY_POWER>,
+			<0x7d	KEY_MENU>,
+			<0x6d	KEY_1>,
+			<0x6c	KEY_2>,
+			<0x33	KEY_3>,
+			<0x71	KEY_4>,
+			<0x70	KEY_5>,
+			<0x37	KEY_6>,
+			<0x75	KEY_7>,
+			<0x74	KEY_8>,
+			<0x3b	KEY_9>,
+			<0x78	KEY_0>;
+	};
+};
+
+&cpu_thermal {
+	trips {
+		cpu_idle: cpu_idle {
+			temperature = <20000>;
+			hysteresis = <5000>;
+			type = "passive";
+		};
+		cpu_low: cpu_low {
+			temperature = <40000>;
+			hysteresis = <5000>;
+			type = "active";
+		};
+		cpu_warm: cpu_warm {
+			temperature = <50000>;
+			hysteresis = <5000>;
+			type = "active";
+		};
+		cpu_hot: cpu_hot {
+			temperature = <60000>;
+			hysteresis = <5000>;
+			type = "active";
+		};
+		cpu_hall: cpu_hall {
+			temperature = <70000>;
+			hysteresis = <5000>;
+			type = "active";
+		};
+	};
+
+	cooling-maps {
+		map0 {
+			trip = <&cpu_idle>;
+			cooling-device = <&fan0 0 1>;
+		};
+		map1 {
+			trip = <&cpu_low>;
+			cooling-device = <&fan0 1 3>;
+		};
+		map2 {
+			trip = <&cpu_warm>;
+			cooling-device = <&fan0 3 5>;
+		};
+		map3 {
+			trip = <&cpu_hot>;
+			cooling-device = <&fan0 5 7>;
+		};
+		map4 {
+			trip = <&cpu_hall>;
+			cooling-device = <&fan0 7 THERMAL_NO_LIMIT>;
+		};
+	};
+};

+ 0 - 0
devices/rockchip_armv8/diy/target/linux/rockchip/patches-6.1/205-rockchip-rk3328-add-support-for-FriendlyARM-NanoPi-Neo3.patch → devices/rockchip_armv8/diy/target/linux/rockchip/patches-6.6/205-rockchip-rk3328-add-support-for-FriendlyARM-NanoPi-Neo3.patch


+ 13 - 12
devices/rockchip_armv8/patches/01-hinlink.patch

@@ -46,8 +46,8 @@
   	rk3399-orangepi.dtb \
   	rk3399-pinebook-pro.dtb \
   	rk3399-pinephone-pro.dtb \
--@@ -181,11 +183,16 @@ dtb-$(CONFIG_ROCKCHIP_RK3568) += \
-+@@ -181,11 +183,19 @@ dtb-$(CONFIG_ROCKCHIP_RK3568) += \
+-@@ -182,12 +184,17 @@ dtb-$(CONFIG_ROCKCHIP_RK3568) += \
++@@ -182,12 +184,20 @@ dtb-$(CONFIG_ROCKCHIP_RK3568) += \
   	rk3566-soquartz-model-a.dtb \
   	rk3568-bpi-r2-pro.dtb \
   	rk3568-evb.dtb \
@@ -83,11 +83,11 @@
  		;;
  	hinlink,opc-h68k|\
 @@ -67,7 +69,10 @@
- 	friendlyarm,nanopi-r2c-plus|\
  	friendlyarm,nanopi-r4s|\
  	friendlyarm,nanopi-r5s|\
--	friendlyarm,nanopi-r6s)
-+	friendlyarm,nanopi-r6s|\
+ 	friendlyarm,nanopi-r6s|\
+-	sinovoip,rk3568-bpi-r2pro)
++	sinovoip,rk3568-bpi-r2pro|\
 +	hinlink,opc-h66k|\
 +	hinlink,opc-h68k|\
 +	hinlink,opc-h69k)
@@ -126,23 +126,24 @@
  	;;
  esac
 
---- a/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch
-+++ b/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch
-@@ -16,13 +16,16 @@
+--- a/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch
++++ b/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch
+@@ -16,7 +16,7 @@
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4s-enterprise.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pinebook-pro.dtb
--@@ -78,8 +80,10 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bp
-+@@ -78,8 +80,13 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bp
+-@@ -90,9 +92,11 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bp
++@@ -90,9 +92,14 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bp
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb1-v10.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-fastrhino-r66s.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-fastrhino-r68s.dtb
- +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-mrkaio-m68s.dtb
+@@ -24,6 +24,9 @@
+  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-lubancat-2.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-nanopi-r5c.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-nanopi-r5s.dtb
 ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-opc-h66k.dtb
 ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-opc-h68k.dtb
 ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-opc-h69k.dtb
  +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-photonicat.dtb
+  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-odroid-m1.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-radxa-e25.dtb
-  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-roc-pc.dtb

+ 11 - 9
devices/rockchip_armv8/patches/22-H3399PC.patch

@@ -54,22 +54,24 @@ diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/tar
 index 7eb99ade652..92ede0f46e6 100644
 --- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
 +++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
-@@ -18,6 +18,8 @@ rockchip_setup_interfaces()
+@@ -18,6 +18,9 @@ rockchip_setup_interfaces()
  	friendlyarm,nanopi-r4s-enterprise|\
  	friendlyarm,nanopi-r6c|\
  	radxa,rockpi-e|\
 +	rocktech,mpc1903|\
 +	sharevdi,h3399pc|\
++	nlnet,xgp|\
  	xunlong,orangepi-r1-plus|\
  	xunlong,orangepi-r1-plus-lts)
  		ucidef_set_interfaces_lan_wan 'eth1' 'eth0'
-@@ -59,7 +60,9 @@ rockchip_setup_macs()
+@@ -59,7 +60,10 @@ rockchip_setup_macs()
  	friendlyarm,nanopi-r2c|\
  	friendlyarm,nanopi-r2s|\
  	lunzn,fastrhino-r66s|\
 -	lunzn,fastrhino-r68s)
 +	lunzn,fastrhino-r68s|\
 +	rocktech,mpc1903|\
++	nlnet,xgp|\
 +	sharevdi,h3399pc)
  		wan_mac=$(macaddr_generate_from_mmc_cid mmcblk0)
  		lan_mac=$(macaddr_add "$wan_mac" 1)
@@ -123,15 +125,15 @@ index 7eb99ade652..92ede0f46e6 100644
  define Device/xunlong_orangepi-5
    DEVICE_VENDOR := Xunlong
    DEVICE_MODEL := Orange Pi 5
-diff --git a/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch b/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch
+diff --git a/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch b/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch
 index 231bca2b544..441ce2f4e59 100644
---- a/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch
-+++ b/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch
+--- a/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch
++++ b/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch
 @@ -1,10 +1,13 @@
  --- a/arch/arm64/boot/dts/rockchip/Makefile
  +++ b/arch/arm64/boot/dts/rockchip/Makefile
--@@ -34,6 +34,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-gr
-+@@ -34,6 +34,10 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-gr
+-@@ -38,6 +38,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-gr
++@@ -38,6 +38,10 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-gr
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-gru-scarlet-dumo.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-gru-scarlet-inx.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-gru-scarlet-kd.dtb
@@ -149,8 +151,8 @@ index ac01f8bb352..6f08c2d1190 100644
 @@ -1,10 +1,12 @@
  --- a/arch/arm/dts/Makefile
  +++ b/arch/arm/dts/Makefile
--@@ -147,6 +147,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \
-+@@ -147,6 +147,9 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \
+-@@ -148,6 +148,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \
++@@ -148,6 +148,9 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \
   	rk3399-firefly.dtb \
   	rk3399-gru-bob.dtb \
   	rk3399-gru-kevin.dtb \

+ 42 - 17
devices/rockchip_armv8/patches/33-rk3568.patch

@@ -1,26 +1,28 @@
-diff --git a/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch b/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch
+diff --git a/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch b/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch
 index 231bca2b544..0c4b2c55d9a 100644
---- a/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch
-+++ b/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch
+--- a/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch
++++ b/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch
 @@ -19,7 +19,7 @@
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4s-enterprise.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pinebook-pro.dtb
--@@ -78,8 +80,13 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bp
-+@@ -78,8 +80,16 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bp
+-@@ -90,9 +92,14 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bp
++@@ -90,9 +92,19 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bp
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb1-v10.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-fastrhino-r66s.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-fastrhino-r68s.dtb
-@@ -30,6 +30,9 @@
- +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-opc-h68k.dtb
+@@ -32,6 +32,11 @@
  +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-opc-h69k.dtb
  +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-photonicat.dtb
+  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-odroid-m1.dtb
 ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-seewo-sv21.dtb
 ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-t68m.dtb
 ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3566-panther-x2.dtb
+++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-xgp.dtb
+++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-xgp-v3.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-radxa-e25.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-roc-pc.dtb
-  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-rock-3a.dtb
+ @@ -103,6 +107,8 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-ev
 
 --- a/package/boot/uboot-rockchip/Makefile
 +++ b/package/boot/uboot-rockchip/Makefile
@@ -39,7 +41,7 @@ index 231bca2b544..0c4b2c55d9a 100644
  # RK3568 boards
  
  define U-Boot/Default/rk3568
-@@ -188,6 +195,20 @@
+@@ -188,6 +195,27 @@
    DEPENDS:=+PACKAGE_u-boot-$(1):trusted-firmware-a-rk3568
    ATF:=$(RK3568_ATF)
    TPL:=$(RK3568_TPL)
@@ -52,6 +54,13 @@ index 231bca2b544..0c4b2c55d9a 100644
 +    lyt_t68m
 +endef
 +
++define U-Boot/nlnet-xgp-rk3568
++  $(U-Boot/Default/rk3568)
++  NAME:=NLnet XGP Board
++  BUILD_DEVICES:= \
++    nlnet_xgp
++endef
++
 +define U-Boot/seewo-sv21-rk3568
 +  $(U-Boot/Default/rk3568)
 +  NAME:=Seewo sv21-rk3568
@@ -60,14 +69,15 @@ index 231bca2b544..0c4b2c55d9a 100644
  endef
  
  define U-Boot/fastrhino-r66s-rk3568
-@@ -355,8 +376,11 @@
-   rock-pi-e-rk3328 \
+@@ -355,8 +376,12 @@
    rock64-rk3328 \
    radxa-cm3-io-rk3566 \
+   bpi-r2-pro-rk3568 \
 +  panther-x2-rk3566 \
    fastrhino-r66s-rk3568 \
    fastrhino-r68s-rk3568 \
 +  lyt-t68m-rk3568 \
++  nlnet-xgp-rk3568 \
 +  seewo-sv21-rk3568 \
    mrkaio-m68s-rk3568 \
    nanopi-r5c-rk3568 \
@@ -75,7 +85,7 @@ index 231bca2b544..0c4b2c55d9a 100644
 
 --- a/target/linux/rockchip/image/armv8.mk
 +++ b/target/linux/rockchip/image/armv8.mk
-@@ -319,6 +319,36 @@
+@@ -319,6 +320,49 @@
  endef
  TARGET_DEVICES += friendlyarm_nanopi-neo3
  
@@ -89,6 +99,19 @@ index 231bca2b544..0c4b2c55d9a 100644
 +endef
 +TARGET_DEVICES += lyt_t68m
 +
++define Device/nlnet_xgp
++  DEVICE_VENDOR := NLnet
++  DEVICE_MODEL := XiGuaPi
++  SOC := rk3568
++  KERNEL := kernel-bin
++  DEVICE_DTS := rockchip/rk3568-xgp rockchip/rk3568-xgp-v3
++  UBOOT_DEVICE_NAME := nlnet-xgp-rk3568
++  BOOT_FLOW := pine64-img
++  IMAGE/sysupgrade.img.gz := boot-combined | boot-script nlnet-xgp | pine64-img | gzip | append-metadata
++  DEVICE_PACKAGES := kmod-r8125 wpad-basic-mbedtls
++endef
++TARGET_DEVICES += nlnet_xgp
++
 +define Device/panther_x2
 +  DEVICE_VENDOR := Panther
 +  DEVICE_MODEL := X2
@@ -134,7 +157,7 @@ index 231bca2b544..0c4b2c55d9a 100644
  		ucidef_set_interface_lan 'eth0'
  		;;
 @@ -75,9 +79,15 @@
- 	friendlyarm,nanopi-r6s|\
+ 	sinovoip,rk3568-bpi-r2pro|\
  	hinlink,opc-h66k|\
  	hinlink,opc-h68k|\
 -	hinlink,opc-h69k)
@@ -164,19 +187,21 @@ index 231bca2b544..0c4b2c55d9a 100644
 
 --- a/package/boot/uboot-rockchip/patches/900-arm-add-dts-files.patch
 +++ b/package/boot/uboot-rockchip/patches/900-arm-add-dts-files.patch
-@@ -18,13 +18,14 @@
+@@ -18,7 +18,7 @@
   	rk3399-orangepi.dtb \
   	rk3399-pinebook-pro.dtb \
   	rk3399-pinephone-pro.dtb \
--@@ -181,11 +183,19 @@ dtb-$(CONFIG_ROCKCHIP_RK3568) += \
-+@@ -181,11 +183,20 @@ dtb-$(CONFIG_ROCKCHIP_RK3568) += \
+-@@ -182,12 +184,20 @@ dtb-$(CONFIG_ROCKCHIP_RK3568) += \
++@@ -182,12 +184,22 @@ dtb-$(CONFIG_ROCKCHIP_RK3568) += \
   	rk3566-soquartz-model-a.dtb \
   	rk3568-bpi-r2-pro.dtb \
   	rk3568-evb.dtb \
- +	rk3568-fastrhino-r66s.dtb \
+@@ -26,6 +26,8 @@
  +	rk3568-fastrhino-r68s.dtb \
+  	rk3568-generic.dtb \
   	rk3568-lubancat-2.dtb \
 ++	rk3568-lyt-t68m.dtb \
+++	rk3568-xgp.dtb \
  +	rk3568-mrkaio-m68s.dtb \
   	rk3568-nanopi-r5c.dtb \
   	rk3568-nanopi-r5s.dtb \

+ 6 - 6
devices/rockchip_armv8/patches/44-m68s-plus.patch

@@ -52,19 +52,19 @@
    DEVICE_VENDOR := Firefly
    DEVICE_MODEL := ROC-RK3328-CC
 
---- a/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch
-+++ b/target/linux/rockchip/patches-6.1/900-arm64-boot-add-dts-files.patch
-@@ -16,11 +16,12 @@
+--- a/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch
++++ b/target/linux/rockchip/patches-6.6/900-arm64-boot-add-dts-files.patch
+@@ -19,11 +19,12 @@
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4s-enterprise.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pinebook-pro.dtb
--@@ -78,8 +80,16 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bp
-+@@ -78,8 +80,17 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bp
+-@@ -90,9 +92,19 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bp
++@@ -90,9 +92,20 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-bp
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb1-v10.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-fastrhino-r66s.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-fastrhino-r68s.dtb
  +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-mrkaio-m68s.dtb
 ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-mrkaio-m68s-plus.dtb
+  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-lubancat-2.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-nanopi-r5c.dtb
   dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-nanopi-r5s.dtb
- +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-opc-h66k.dtb

+ 70 - 0
devices/rockchip_armv8/patches/55-xgp.patch

@@ -0,0 +1,70 @@
+--- a/target/linux/rockchip/image/Makefile
++++ b/target/linux/rockchip/image/Makefile
+@@ -20,6 +20,23 @@ define Build/boot-common
+ 	$(CP) $(IMAGE_KERNEL) [email protected]/kernel.img
+ endef
+ 
++define Build/boot-combined
++	# This creates a new folder copies the dtbs (as rockchip*.dtb)
++	# and the kernel image (as kernel.img)
++	rm -fR [email protected]
++	mkdir -p [email protected]
++
++	i=0; \
++	for dts in $(DEVICE_DTS); do \
++		dts=$$(echo $${dts} | cut -d'/' -f2); \
++		$(CP) $(KDIR)/image-$$(echo $${dts} | cut -d'/' -f2).dtb [email protected]/rockchip$$(perl -e 'printf "%b\n",'$$i).dtb; \
++		let i+=1; \
++	done
++
++	$(LN) rockchip0.dtb [email protected]/rockchip.dtb
++	$(CP) $(IMAGE_KERNEL) [email protected]/kernel.img
++endef
++
+ define Build/boot-script
+ 	# Make an U-boot image and copy it to the boot partition
+ 	mkimage -A arm -O linux -T script -C none -a 0 -e 0 -d $(if $(1),$(1),mmc).bootscript [email protected]/boot.scr
+diff --git a/target/linux/rockchip/image/nlnet-xgp.bootscript b/target/linux/rockchip/image/nlnet-xgp.bootscript
+new file mode 100644
+index 0000000000000..80df26f6c1520
+--- /dev/null
++++ b/target/linux/rockchip/image/nlnet-xgp.bootscript
+@@ -0,0 +1,38 @@
++# nlnet-xgp rk3568 combined image, board detected by ADC
++
++env delete hwrev
++env delete coreboard_adc_value
++env delete motherboard_adc_value
++
++# using SARADC CH1 to detect coreboard hwrev
++# using SARADC CH7 to detect motherboard hwrev
++
++adc single saradc@fe720000 1 coreboard_adc_value
++adc single saradc@fe720000 7 motherboard_adc_value
++
++if test -n "$coreboard_adc_value"; then
++    if test "$coreboard_adc_value" -lt 225000; then
++        echo coreboard rev02
++    fi
++fi
++
++if test -n "$motherboard_adc_value"; then
++    if test "$motherboard_adc_value" -lt 225000; then
++        echo motherboard rev03
++        setenv hwrev 1
++    fi
++fi
++
++env delete coreboard_adc_value
++env delete motherboard_adc_value
++
++part uuid mmc ${devnum}:2 uuid
++
++setenv bootargs "console=ttyS2,1500000 earlycon=uart8250,mmio32,0xfe660000 root=PARTUUID=${uuid} rw rootwait"
++
++load mmc ${devnum}:1 ${fdt_addr_r} rockchip${hwrev}.dtb
++load mmc ${devnum}:1 ${kernel_addr_r} kernel.img
++
++env delete hwrev
++
++booti ${kernel_addr_r} - ${fdt_addr_r}

+ 0 - 2
devices/sunxi_cortexa53/.config

@@ -11,8 +11,6 @@ CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_xunlong_orangepi-zero-plus=y
 CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_xunlong_orangepi-zero2=y
 CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_xunlong_orangepi-zero3=y
 
-CONFIG_PACKAGE_kmod-rtl8189es=y
-
 CONFIG_PACKAGE_luci-ssl=y # uhttpd服务
 
 

+ 0 - 2
devices/sunxi_cortexa7/.config

@@ -21,8 +21,6 @@ CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sinovoip_bananapi-m2-berry=y
 CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_sinovoip_bananapi-m2-ultra=y
 CONFIG_TARGET_DEVICE_sunxi_cortexa7_DEVICE_mele_m9=y
 
-CONFIG_PACKAGE_kmod-rtl8189es=y
-
 CONFIG_PACKAGE_luci-ssl=y # uhttpd服务
 
 

+ 1 - 3
devices/x86_64/diy.sh

@@ -4,9 +4,7 @@ SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
 #bash $SHELL_FOLDER/../common/kernel_6.1.sh
 
-git_clone_path master https://github.com/coolsnowwolf/lede target/linux/x86/files
-
-git_clone_path master https://github.com/coolsnowwolf/lede target/linux/x86/patches-5.15
+git_clone_path master https://github.com/coolsnowwolf/lede target/linux/x86/files target/linux/x86/patches-5.15
 
 curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/target/linux/x86/base-files/etc/board.d/02_network -o target/linux/x86/base-files/etc/board.d/02_network
 

+ 2 - 0
devices/x86_generic/.config

@@ -23,5 +23,7 @@ CONFIG_KERNEL_XDP_SOCKETS=y
 CONFIG_PACKAGE_luci-ssl=n # uhttpd服务
 CONFIG_PACKAGE_luci-ssl-nginx=y # nginx
 
+CONFIG_PACKAGE_kmod-pcie_mhi=m
+
 CONFIG_OPENSSL_PREFER_CHACHA_OVER_GCM=n
 

+ 1 - 3
devices/x86_generic/diy.sh

@@ -4,9 +4,7 @@ SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
 #bash $SHELL_FOLDER/../common/kernel_6.1.sh
 
-git_clone_path master https://github.com/coolsnowwolf/lede target/linux/x86/files
-
-git_clone_path master https://github.com/coolsnowwolf/lede target/linux/x86/patches-5.15
+git_clone_path master https://github.com/coolsnowwolf/lede target/linux/x86/files target/linux/x86/patches-5.15
 
 curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/target/linux/x86/base-files/etc/board.d/02_network -o target/linux/x86/base-files/etc/board.d/02_network