kiddin9 1 年之前
父节点
当前提交
049402d82a
共有 73 个文件被更改,包括 4272 次插入1068 次删除
  1. 25 55
      .github/workflows/Openwrt-AutoBuild.yml
  2. 0 5
      .github/workflows/repo-dispatcher.yml
  3. 0 6
      Dockerfile
  4. 0 1
      devices/common/.config
  5. 6 4
      devices/common/diy.sh
  6. 2 2
      devices/common/patches/imagebuilder.patch
  7. 30 0
      devices/common/patches/kernel_version.patch
  8. 0 38
      devices/common/patches/mt7922.patch
  9. 0 31
      devices/common/patches/rootfstargz.patch
  10. 11 0
      devices/common/patches/seccomp.patch
  11. 0 11
      devices/ipq50xx_arm/patches/cr880x.patch
  12. 4 0
      devices/mediatek_filogic/.config
  13. 0 19
      devices/mediatek_filogic/patches/1-360t7.patch
  14. 0 0
      devices/mediatek_filogic/patches/2-ax6000.patch
  15. 0 0
      devices/mediatek_filogic/patches/3-nx30.patch
  16. 375 0
      devices/mediatek_filogic/patches/4-ax3000t.patch
  17. 379 0
      devices/mediatek_filogic/patches/7-jdcloud_re-cs-05.patch
  18. 3 0
      devices/mediatek_mt7981/.config
  19. 5 5
      devices/mediatek_mt7981/diy.sh
  20. 8 10
      devices/mediatek_mt7981/patches/targets.patch
  21. 0 138
      devices/mediatek_mt7986/.config
  22. 0 1
      devices/mediatek_mt7986/README.md
  23. 0 22
      devices/mediatek_mt7986/diy.sh
  24. 0 4
      devices/mediatek_mt7986/feeds.conf
  25. 0 22
      devices/mediatek_mt7986/patches/base-files.patch
  26. 0 67
      devices/mediatek_mt7986/patches/fix.patch
  27. 0 40
      devices/mediatek_mt7986/patches/iptables-mod-socket.patch
  28. 0 10
      devices/mediatek_mt7986/patches/kernel-defaults.patch
  29. 0 44
      devices/mediatek_mt7986/patches/targets.patch
  30. 0 2
      devices/mediatek_mt7986/settings.ini
  31. 0 1
      devices/meson_meson8b/.config
  32. 3 3
      devices/meson_meson8b/diy.sh
  33. 30 0
      devices/meson_meson8b/patches/kernel_version.patch
  34. 13 15
      devices/meson_meson8b/patches/onecloud.patch
  35. 81 0
      devices/meson_meson8b/patches/rootfstargz.patch
  36. 1 5
      devices/qualcommax_ipq60xx/.config
  37. 2 0
      devices/qualcommax_ipq60xx/diy.sh
  38. 二进制
      devices/qualcommax_ipq60xx/diy/package/firmware/ipq-wifi/src/board-zyxel_nbg7815.ipq8074
  39. 0 71
      devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-ax18.dts
  40. 0 204
      devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-cmiot.dtsi
  41. 22 0
      devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-upstreamable.dtsi
  42. 1 1
      devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-v6.dts
  43. 30 0
      devices/qualcommax_ipq60xx/patches/kernel_version.patch
  44. 34 51
      devices/qualcommax_ipq60xx/patches/v6m2.patch
  45. 1 0
      devices/ramips_mt7621/.config
  46. 1 1
      devices/ramips_mt7621/patches/c-life_xg1.patch
  47. 613 0
      devices/ramips_mt7621/patches/gateboard-one.patch
  48. 13 0
      devices/rockchip_armv8/.config
  49. 9 4
      devices/rockchip_armv8/diy.sh
  50. 24 0
      devices/rockchip_armv8/diy/package/boot/uboot-rockchip/patches/318-rockchip-rk3568-Add-saradc-data.patch
  51. 27 0
      devices/rockchip_armv8/diy/package/boot/uboot-rockchip/patches/319-rockchip-rk3568-Fix-download-key-adc-channel.patch
  52. 593 0
      devices/rockchip_armv8/diy/package/boot/uboot-rockchip/patches/320-rockchip-rk3568-Add-support-for-nlnet-xgp.patch
  53. 3 0
      devices/rockchip_armv8/diy/package/boot/uboot-rockchip/src/arch/arm/dts/rk3328-nanopi-r2c-plus-u-boot.dtsi
  54. 33 0
      devices/rockchip_armv8/diy/package/boot/uboot-rockchip/src/arch/arm/dts/rk3328-nanopi-r2c-plus.dts
  55. 114 0
      devices/rockchip_armv8/diy/package/boot/uboot-rockchip/src/configs/nanopi-r2c-plus-rk3328_defconfig
  56. 655 0
      devices/rockchip_armv8/diy/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-nlnet-xgz68.dtsi
  57. 86 0
      devices/rockchip_armv8/diy/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-xgp-v3.dts
  58. 248 0
      devices/rockchip_armv8/diy/target/linux/rockchip/files/arch/arm64/boot/dts/rockchip/rk3568-xgp.dts
  59. 64 0
      devices/rockchip_armv8/diy/target/linux/rockchip/patches-5.15/206-arm64-dts-rockchip-Add-FriendlyARM-NanoPi-R2C-Plus.patch
  60. 109 0
      devices/rockchip_armv8/diy/target/linux/rockchip/patches-5.15/805-arm64-dts-rockchip-add-rk3328-ddr-relate-node.patch
  61. 175 0
      devices/rockchip_armv8/patches/97-xgp.patch
  62. 69 0
      devices/rockchip_armv8/patches/98-r2c-plus.patch
  63. 212 0
      devices/rockchip_armv8/patches/99-more.patch
  64. 0 19
      devices/rockchip_armv8/patches/fix.patch
  65. 0 147
      devices/rockchip_armv8/patches/r6s.patch.b
  66. 18 0
      devices/rockchip_rk3588_bsp/.config
  67. 3 1
      devices/rockchip_rk3588_bsp/diy.sh
  68. 30 0
      devices/rockchip_rk3588_bsp/patches/kernel_version.patch
  69. 81 0
      devices/rockchip_rk3588_bsp/patches/rootfstargz.patch
  70. 11 0
      devices/x86_64/.config
  71. 2 4
      devices/x86_64/diy.sh
  72. 11 0
      devices/x86_generic/.config
  73. 2 4
      devices/x86_generic/diy.sh

+ 25 - 55
.github/workflows/Openwrt-AutoBuild.yml

@@ -116,11 +116,11 @@ jobs:
         DEBIAN_FRONTEND: noninteractive
       run: |
         sudo -E apt-get -qq update
-        sudo -E apt-get -qq install build-essential clang flex g++ gawk gcc-multilib gettext \
+        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
-        sudo -E apt-get -qq purge azure-cli ghc* zulu* llvm* firefox powershell openjdk* dotnet* google* mysql* php* android*
+        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
         sudo -E apt-get -qq clean
@@ -141,7 +141,9 @@ 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)"
-        echo "CONFIG_VERSION_REPO=\"https://dl.openwrt.ai/`echo $REPO_BRANCH  | cut -d . -f 1,2 | sed -e 's/^v//'`\"">>devices/common/.config
+        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
             git clone $REPO_URL -b $REPO_BRANCH openwrt
         elif [[ ! "${{ env.REPO_BRANCH }}" ]]; then
@@ -162,6 +164,21 @@ jobs:
 
     - name: Load custom configuration
       run: |
+        function git_clone_path() {
+          branch="$1" rurl="$2" localdir="gitemp" && shift 2
+          git clone -b $branch --depth 1 --filter=blob:none --sparse $rurl $localdir
+          if [ "$?" != 0 ]; then
+            echo "error on $rurl"
+            return 0
+          fi
+          cd $localdir
+          git sparse-checkout init --cone
+          git sparse-checkout set $@
+          cp -rn $@ ../$(dirname "$@")/
+          cd ..
+          rm -rf gitemp
+          }
+        export -f git_clone_path
         cp -rf devices/common/. openwrt/
         cp -rf devices/${{matrix.target}}/. openwrt/
         cp -rf devices openwrt/
@@ -247,10 +264,11 @@ jobs:
         shopt -s extglob
         cd openwrt
         echo -e "$(($(nproc)+1)) thread compile"
-        make -j$(($(nproc)+1)) || make V=s &>build.log || (tail -50 build.log; curl -k --data chat_id="${{ env.TELEGRAM_CHAT_ID }}" --data "text=❌ OpenWrt ${{ env.VERSION }} ${{matrix.target}} 编译失败 😂" "https://api.telegram.org/bot${{ env.TELEGRAM_TOKEN }}/sendMessage";exit 1)
+        make -j$(($(nproc)+1)) || make V=s &>build.log || (tail -50 build.log; curl -k --data chat_id="${{ env.TELEGRAM_CHAT_ID }}" --data "text=❌ OpenWrt ${{ env.VERSION }} ${{matrix.target}} 编译失败 😂" "https://api.telegram.org/bot${{ env.TELEGRAM_TOKEN }}/sendMessage";df -hT;exit 1)
         sed -i "s/# CONFIG_IB is not set/CONFIG_IB=y/" .config
         rm -rf staging_dir/toolchain-*/bin/*openwrt-linux-musl-lto-dump
         rm -rf staging_dir/toolchain-*/initial
+        df -hT
 
     - name: Organize files
       id: organize
@@ -258,7 +276,6 @@ jobs:
       run: |
         shopt -s extglob
         mkdir -p firmware/${{matrix.target}}
-        cd openwrt; kernel_v="$(make --file=info.mk kernel_version)"; cd -
         cp -rf openwrt/bin/targets/*/*/*{combined,sysupgrade}* ./firmware/${{matrix.target}}/ || true
         cd openwrt/bin/targets/*/*/
         mv -f profiles.json profiles.json.b || true
@@ -266,9 +283,6 @@ jobs:
         cp $GITHUB_WORKSPACE/openwrt/build_dir/target-*/linux-*/linux-*/.config ${{matrix.target}}_kernel.config || true
         cd -
         rename -v "s/openwrt-/${{ env.VERSION }}-openwrt-/" ./firmware/*/* || true
-        rename -v "s/friendlyarm_//" ./firmware/*/*gz || true
-        rename -v "s/embedfire_//" ./firmware/*/*gz || true
-        rename -v "s/xiaomi_redmi-router/redmi/" ./firmware/*/*bin || true
         Emoji=("🎉" "🤞" "✨" "🎁" "🎈" "🎄" "🎨" "💋" "🍓" "🍕" "🍉" "💐" "🌴" "🚀" "🛸" "🗽" "⛅" "🌈" "🔥" "⛄" "🐶" "🏅" "🦄" "🐤")
         echo "EMOJI=${Emoji[$[$RANDOM % ${#Emoji[@]}]]}" >> $GITHUB_ENV
         if [ ${{matrix.target}} == "x86_64" ]; then
@@ -287,7 +301,7 @@ jobs:
         REMOTE_HOST: ${{ secrets.SERVER_HOST }}
         REMOTE_PORT: ${{ secrets.SERVER_PORT }}
         REMOTE_USER: root
-        TARGET: "/www/wwwroot/op.supes.top/releases/tmp/"
+        TARGET: "/www/wwwroot/dl.openwrt.ai/releases/tmp/"
 
     - name: Upload firmware for artifact
       uses: actions/upload-artifact@main
@@ -297,33 +311,13 @@ jobs:
         path: |
           openwrt/bin/targets/
 
-    - name: Upload firmware to cowtransfer
-      if: env.UPLOAD_FIRMWARE_TO_COWTRANSFER == 'true'
-      continue-on-error: true
-      run: |
-        curl -fsSL git.io/file-transfer | sh
-        cowurl=$(./transfer cow --block 2621440 -s --no-progress ${FIRMWARE})
-        cowurl=$(echo $cowurl | grep -o -E "https[^ ]*")
-        echo "COWURL=$cowurl" >> $GITHUB_ENV
-        echo "Download Link: ${{ env.EMOJI }} $cowurl ${{ env.EMOJI }} 🚀"
- 
-    - name: Upload firmware to WeTransfer
-      if: env.UPLOAD_FIRMWARE_TO_WETRANSFER == 'true' && ! contains(github.event.action, 'noup')
-      continue-on-error: true
-      run: |
-        curl -fsSL git.io/file-transfer | sh
-        wetrans=$(./transfer wet -s -p 16 --no-progress ${FIRMWARE})
-        wetrans=$(echo $wetrans | grep -o -E "https[^ ]*")
-        echo "WETRANS=$wetrans" >> $GITHUB_ENV
-        echo "Download Link: ${{ env.EMOJI }} $wetrans ${{ env.EMOJI }} 🚀"
-
     - name: Create release
       id: create_release
       if: env.REPO_TOKEN && env.UPLOAD_FIRMWARE_FOR_RELEASE == 'true'
       continue-on-error: true
       run: |
         echo -e "墙内加速下载 🚀:\n" >> release.txt
-        echo -e "[腾讯云] (https://op.supes.top/firmware/${{matrix.target}}/ ☁)\n" >> release.txt
+        echo -e "[腾讯云] (https://dl.openwrt.ai/firmware/${{matrix.target}}/ ☁)\n" >> release.txt
         [ ${{ env.WETRANS }} ] && echo -e "[WeTransfer] (${{ env.WETRANS }} 🗽)\n" >> release.txt
         [ ${{ env.COWURL }} ] && echo -e "[奶牛上传] (${{ env.COWURL }} 🐮)\n" >> release.txt
         [ ${{ env.NOTICE }} ] && echo -e "${{ env.NOTICE }}" >> release.txt || true
@@ -339,30 +333,6 @@ jobs:
         name: ${{ env.date2 }} ${{matrix.target}} ${{ env.EMOJI }}
         tag_name: ${{ env.date }}_${{matrix.target}}
         body_path: release.txt
-      
-    - name: Set Up Docker Buildx
-      uses: docker/setup-buildx-action@master
-      if: env.DOCKER_ID && env.DOCKER_PASSWD
-
-    - name: Login To DockerHub
-      uses: docker/login-action@master
-      if: env.DOCKER_ID && env.DOCKER_PASSWD
-      with:
-        username: ${{ secrets.DOCKER_ID }}
-        password: ${{ secrets.DOCKER_PASSWD }}
-
-    - name: Build and push docker image
-      uses: docker/build-push-action@master
-      continue-on-error: true
-      if: env.DOCKER_ID && env.DOCKER_PASSWD && ! contains(github.event.action, 'noser') && github.event.client_payload.target == 'x86_64'
-      with:
-        platforms: ${{ env.ARCH }}
-        file: Dockerfile
-        context: .
-        push: true
-        tags: |
-          ${{ secrets.DOCKER_ID }}/openwrt-nginx:${{ matrix.target }}
-          ${{ env.DOCKERTAG }}
     
     - name: WeChat notification
       continue-on-error: true
@@ -374,7 +344,7 @@ jobs:
       if: env.TELEGRAM_TOKEN && ! contains(github.event.action, 'notg')
       continue-on-error: true
       run: |
-        curl -k --data chat_id="${{ env.TELEGRAM_CHAT_ID }}" --data "text=🎉 OpenWrt ${{ env.VERSION }} ${{matrix.target}} 编译成功 😋  https://op.supes.top/firmware/${{matrix.target}}/  ${{ env.COWURL }}   ${{ env.WETRANS }} 🚀" "https://api.telegram.org/bot${{ env.TELEGRAM_TOKEN }}/sendMessage"
+        curl -k --data chat_id="${{ env.TELEGRAM_CHAT_ID }}" --data "text=🎉 OpenWrt ${{ env.VERSION }} ${{matrix.target}} 编译成功 😋  https://dl.openwrt.ai/firmware/${{matrix.target}}/  ${{ env.COWURL }}   ${{ env.WETRANS }} 🚀" "https://api.telegram.org/bot${{ env.TELEGRAM_TOKEN }}/sendMessage"
 
     - name: Delete workflow runs
       uses: GitRML/delete-workflow-runs@main

+ 0 - 5
.github/workflows/repo-dispatcher.yml

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

+ 0 - 6
Dockerfile

@@ -1,6 +0,0 @@
-FROM scratch
-
-MAINTAINER Kiddin9 "https://github.com/kiddin9/OpenWrt_x86-r2s-r4s"
-
-ADD openwrt/bin/targets/*/*/*rootfs*.tar.gz /
-

+ 0 - 1
devices/common/.config

@@ -5,7 +5,6 @@ CONFIG_TARGET_ROOTFS_EXT4FS=n
 
 CONFIG_TARGET_ROOTFS_CPIOGZ=n
 CONFIG_LUCI_CSSTIDY=n
-CONFIG_GRUB_CONSOLE=n
 CONFIG_SIGNED_PACKAGES=n
 CONFIG_SIGNATURE_CHECK=n
 

+ 6 - 4
devices/common/diy.sh

@@ -37,11 +37,11 @@ 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
 
-(
-svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-5.15 target/linux/generic/hack-5.15
+#sed -i "/call Build\/check-size,\$\$(KERNEL_SIZE)/d" include/image.mk
+
+git_clone_path master https://github.com/coolsnowwolf/lede target/linux/generic/hack-5.15
 curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/target/linux/generic/pending-5.15/613-netfilter_optional_tcp_window_check.patch -o target/linux/generic/pending-5.15/613-netfilter_optional_tcp_window_check.patch
 sed -i "s/CONFIG_WERROR=y/CONFIG_WERROR=n/" target/linux/generic/config-5.15
-) &
 
 grep -q "23.05" include/version.mk && [ -d package/kernel/mt76 ] && {
 mkdir package/kernel/mt76/patches
@@ -50,7 +50,7 @@ curl -sfL https://raw.githubusercontent.com/immortalwrt/immortalwrt/master/packa
 
 grep -q "1.8.8" package/network/utils/iptables/Makefile && {
 rm -rf package/network/utils/iptables
-svn co https://github.com/openwrt/openwrt/branches/openwrt-22.03/package/network/utils/iptables package/network/utils/iptables
+git_clone_path openwrt-22.03 https://github.com/openwrt/openwrt package/network/utils/iptables
 }
 
 grep -q 'PKG_RELEASE:=9' package/libs/openssl/Makefile && {
@@ -81,6 +81,8 @@ sed -i \
 	-e 's?../../lang?$(TOPDIR)/feeds/packages/lang?' \
 	package/feeds/kiddin9/*/Makefile
 
+rm -rf package/network/utils/xdp-tools package/feeds/packages/v4l2loopback
+
 (
 if [ -f sdk.tar.xz ]; then
 	sed -i 's,$(STAGING_DIR_HOST)/bin/upx,upx,' package/feeds/kiddin9/*/Makefile

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

@@ -13,8 +13,8 @@
  	$(call FeedSourcesAppend,$(PKG_BUILD_DIR)/repositories.conf)
  	$(VERSION_SED_SCRIPT) $(PKG_BUILD_DIR)/repositories.conf
 -endif
-+	$(SED) 's/^src\/gz \(.*\) https.*ai\/\(.*packages.*\)/src \1 file:\/\/www\/wwwroot\/op.supes.top\/\2/' $(PKG_BUILD_DIR)/repositories.conf
-+	$(SED) 's/^src\/gz \(.*\) https.*ai\/\(.*targets.*\)/src \1 file:\/\/www\/wwwroot\/op.supes.top\/\2/' $(PKG_BUILD_DIR)/repositories.conf
++	$(SED) 's/^src\/gz \(.*\) https.*ai\/\(.*packages.*\)/src \1 file:\/\/www\/wwwroot\/dl.openwrt.ai\/\2/' $(PKG_BUILD_DIR)/repositories.conf
++	$(SED) 's/^src\/gz \(.*\) https.*ai\/\(.*targets.*\)/src \1 file:\/\/www\/wwwroot\/dl.openwrt.ai\/\2/' $(PKG_BUILD_DIR)/repositories.conf
 +	$(SED) '/openwrt_core/d' $(PKG_BUILD_DIR)/repositories.conf
  
  	$(INSTALL_DIR) $(PKG_BUILD_DIR)/packages

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

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

+ 0 - 38
devices/common/patches/mt7922.patch

@@ -1,38 +0,0 @@
---- a/package/kernel/mt76/Makefile
-+++ b/package/kernel/mt76/Makefile
-@@ -262,6 +262,12 @@ define KernelPackage/mt7921-firmware
-   TITLE:=MediaTek MT7921 firmware
- endef
- 
-+define KernelPackage/mt7922-firmware
-+  $(KernelPackage/mt76-default)
-+  DEPENDS+=+kmod-mt7921-common
-+  TITLE:=MediaTek MT7922 firmware
-+endef
-+
- define KernelPackage/mt792x-common
-   $(KernelPackage/mt76-default)
-   TITLE:=MediaTek MT792x wireless driver common code
-@@ -555,6 +561,14 @@ define KernelPackage/mt7921-firmware/install
- 		$(1)/lib/firmware/mediatek
- endef
- 
-+define KernelPackage/mt7922-firmware/install
-+	$(INSTALL_DIR) $(1)/lib/firmware/mediatek
-+	cp \
-+		$(PKG_BUILD_DIR)/firmware/WIFI_MT7922_patch_mcu_1_1_hdr.bin \
-+		$(PKG_BUILD_DIR)/firmware/WIFI_RAM_CODE_MT7922_1.bin \
-+		$(1)/lib/firmware/mediatek
-+endef
-+
- define Package/mt76-test/install
- 	mkdir -p $(1)/usr/sbin
- 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/mt76-test $(1)/usr/sbin
-@@ -588,6 +602,7 @@ $(eval $(call KernelPackage,mt7916-firmware))
- $(eval $(call KernelPackage,mt7981-firmware))
- $(eval $(call KernelPackage,mt7986-firmware))
- $(eval $(call KernelPackage,mt7921-firmware))
-+$(eval $(call KernelPackage,mt7922-firmware))
- $(eval $(call KernelPackage,mt792x-common))
- $(eval $(call KernelPackage,mt792x-usb))
- $(eval $(call KernelPackage,mt7921-common))

+ 0 - 31
devices/common/patches/fix.patch → devices/common/patches/rootfstargz.patch

@@ -79,34 +79,3 @@
    $$(eval $$(foreach compile,$$(COMPILE), \
      $$(call Device/Build/compile,$$(compile),$(1))))
  
-
---- a/scripts/json_overview_image_info.py
-+++ b/scripts/json_overview_image_info.py
-@@ -47,7 +47,7 @@ def get_initial_output(image_info):
- 
- 
- if output:
--    default_packages, output["arch_packages"] = run(
-+    default_packages, output["arch_packages"], output["kernel_version"] = run(
-         [
-             "make",
-             "--no-print-directory",
-@@ -55,6 +55,7 @@ def get_initial_output(image_info):
-             "target/linux/",
-             "val.DEFAULT_PACKAGES",
-             "val.ARCH_PACKAGES",
-+            "val.LINUX_VERSION",
-         ],
-         stdout=PIPE,
-         stderr=PIPE,
-
---- a/scripts/json_add_image_info.py
-+++ b/scripts/json_add_image_info.py
-@@ -55,6 +55,7 @@ def get_titles():
-     "profiles": {
-         device_id: {
-             "image_prefix": getenv("DEVICE_IMG_PREFIX"),
-+            "image_initramfs": getenv("KERNEL_INITRAMFS_IMAGE"),
-             "images": [
-                 {
-                     "type": getenv("FILE_TYPE"),

+ 11 - 0
devices/common/patches/seccomp.patch

@@ -0,0 +1,11 @@
+--- a/package/system/procd/files/procd.sh
++++ b/package/system/procd/files/procd.sh
+@@ -260,7 +260,7 @@ _procd_set_param() {
+ 		reload_signal)
+ 			json_add_int "$type" $(kill -l "$1")
+ 		;;
+-		pidfile|user|group|seccomp|capabilities|facility|\
++		pidfile|user|group|capabilities|facility|\
+ 		extroot|overlaydir|tmpoverlaysize)
+ 			json_add_string "$type" "$1"
+ 		;;

+ 0 - 11
devices/ipq50xx_arm/patches/cr880x.patch

@@ -1,11 +0,0 @@
---- a/target/linux/ipq50xx/image/Makefile
-+++ b/target/linux/ipq50xx/image/Makefile
-@@ -35,6 +35,8 @@ define Device/redmi_ax3000
-   SOC := ipq5000
-   DEVICE_VENDOR := Redmi
-   DEVICE_MODEL := AX3000
-+  DEVICE_ALT0_VENDOR := Xiaomi
-+  DEVICE_ALT0_MODEL := CR880X
-   BLOCKSIZE := 128k
-   PAGESIZE := 2048
-   DEVICE_DTS_CONFIG := [email protected]

+ 4 - 0
devices/mediatek_filogic/.config

@@ -12,4 +12,8 @@ CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_h3c_magic-nx30-pro=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_xiaomi_mi-router-wr30u-112m-nmbm=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_xiaomi_redmi-router-ax6000=y
 CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_qihoo_360t7=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_xiaomi_mi-router-ax3000t=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_jcg_q30-pro=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_glinet_gl-mt6000=y
+CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_jdcloud_re-cs-05=y
 CONFIG_PACKAGE_luci-ssl=y # uhttpd服务

+ 0 - 19
devices/mediatek_filogic/patches/360t7.patch → devices/mediatek_filogic/patches/1-360t7.patch

@@ -46,22 +46,3 @@
 -  ARTIFACT/bl31-uboot.fip := mt7981-bl31-uboot qihoo_360t7
  endef
  TARGET_DEVICES += qihoo_360t7
-
---- a/package/boot/uboot-envtools/files/mediatek_filogic
-+++ b/package/boot/uboot-envtools/files/mediatek_filogic
-@@ -53,8 +53,12 @@ xiaomi,redmi-router-ax6000-stock)
- 	ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x10000" "0x20000"
- 	ubootenv_add_uci_sys_config "/dev/mtd2" "0x0" "0x10000" "0x20000"
- 	;;
-+qihoo,360t7)
-+	ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x20000" "0x20000" "1"
-+	;;
-+h3c,magic-nx30-pro)
-+	ubootenv_add_uci_config "/dev/mtd2" "0x0" "0x80000" "0x20000" "4"
-+	;;
--h3c,magic-nx30-pro|\
--qihoo,360t7|\
- tplink,tl-xdr4288|\
- tplink,tl-xdr6086|\
- tplink,tl-xdr6088|\
- 

+ 0 - 0
devices/mediatek_filogic/patches/ax6000.patch → devices/mediatek_filogic/patches/2-ax6000.patch


+ 0 - 0
devices/mediatek_filogic/patches/nx30.patch → devices/mediatek_filogic/patches/3-nx30.patch


+ 375 - 0
devices/mediatek_filogic/patches/4-ax3000t.patch

@@ -0,0 +1,375 @@
+From 02b57804f8602ff95f298be332d471283759e27c Mon Sep 17 00:00:00 2001
+From: AmadeusGhost <[email protected]>
+Date: Fri, 15 Sep 2023 23:06:10 +0800
+Subject: [PATCH] mediatek: add Xiaomi AX3000T support
+
+---
+ .../uboot-envtools/files/mediatek_filogic     |   1 +
+ .../mediatek/dts/mt7981b-xiaomi-ax3000t.dts   |  49 ++++
+ .../dts/mt7981b-xiaomi_mi-router.dtsi         | 241 ++++++++++++++++
+ .../filogic/base-files/etc/board.d/02_network |   4 +-
+ target/linux/mediatek/image/filogic.mk        |  14 +
+ 7 files changed, 325 insertions(+), 248 deletions(-)
+ create mode 100644 target/linux/mediatek/dts/mt7981b-xiaomi-ax3000t.dts
+ create mode 100644 target/linux/mediatek/dts/mt7981b-xiaomi_mi-router.dtsi
+
+diff --git a/package/boot/uboot-envtools/files/mediatek_filogic b/package/boot/uboot-envtools/files/mediatek_filogic
+index a8def1d00b764..3ad8f80c750e0 100644
+--- a/package/boot/uboot-envtools/files/mediatek_filogic
++++ b/package/boot/uboot-envtools/files/mediatek_filogic
+@@ -62,6 +62,7 @@
+ tplink,tl-xdr4288|\
+ tplink,tl-xdr6086|\
+ tplink,tl-xdr6088|\
++xiaomi,mi-router-ax3000t|\
+ xiaomi,mi-router-wr30u-ubootmod|\
+ xiaomi,redmi-router-ax6000-ubootmod)
+ 	. /lib/upgrade/nand.sh
+
+diff --git a/target/linux/mediatek/dts/mt7981b-xiaomi-ax3000t.dts b/target/linux/mediatek/dts/mt7981b-xiaomi-ax3000t.dts
+new file mode 100644
+index 0000000000000..96f7680ef23a8
+--- /dev/null
++++ b/target/linux/mediatek/dts/mt7981b-xiaomi-ax3000t.dts
+@@ -0,0 +1,49 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++
++/dts-v1/;
++
++#include "mt7981b-xiaomi_mi-router.dtsi"
++
++/ {
++	model = "Xiaomi Mi Router AX3000T";
++	compatible = "xiaomi,mi-router-ax3000t", "mediatek,mt7981";
++};
++
++&gmac0 {
++	nvmem-cells = <&macaddr_factory_4>;
++	nvmem-cell-names = "mac-address";
++	mac-address-increment = <(-2)>;
++};
++
++&i2c0 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&i2c_pins>;
++	status = "okay";
++
++	nfc@57 {
++		compatible = "nt082c";
++		reg = <0x57>;
++	};
++};
++
++&partitions {
++	partition@600000 {
++		label = "ubi";
++		reg = <0x0600000 0x6400000>;
++	};
++
++	partition@6a00000 {
++		label = "data";
++		reg = <0x6a00000 0x0c00000>;
++		read-only;
++	};
++};
++
++&pio {
++	i2c_pins: i2c-pins {
++		mux {
++			function = "i2c";
++			groups = "i2c0_1";
++		};
++	};
++};
+diff --git a/target/linux/mediatek/dts/mt7981b-xiaomi_mi-router.dtsi b/target/linux/mediatek/dts/mt7981b-xiaomi_mi-router.dtsi
+new file mode 100644
+index 0000000000000..3b0e158a0b812
+--- /dev/null
++++ b/target/linux/mediatek/dts/mt7981b-xiaomi_mi-router.dtsi
+@@ -0,0 +1,241 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++
++#include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/input/input.h>
++
++#include "mt7981.dtsi"
++
++/ {
++	aliases {
++		serial0 = &uart0;
++		led-boot = &led_system_orange;
++		led-failsafe = &led_system_blue;
++		led-running = &led_system_blue;
++		led-upgrade = &led_system_orange;
++	};
++
++	chosen {
++		stdout-path = "serial0:115200n8";
++	};
++
++	memory {
++		reg = <0 0x40000000 0 0x10000000>;
++	};
++
++	gpio-keys {
++		compatible = "gpio-keys";
++
++		reset {
++			label = "reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&pio 1 GPIO_ACTIVE_LOW>;
++		};
++
++		mesh {
++			label = "mesh";
++			linux,code = <BTN_9>;
++			linux,input-type = <EV_SW>;
++			gpios = <&pio 0 GPIO_ACTIVE_LOW>;
++		};
++	};
++
++	leds: leds {
++		compatible = "gpio-leds";
++
++		led_system_blue: system_blue {
++			label = "blue:system";
++			gpios = <&pio 9 GPIO_ACTIVE_LOW>;
++		};
++
++		led_system_orange: system_orange {
++			label = "orange:system";
++			gpios = <&pio 10 GPIO_ACTIVE_LOW>;
++		};
++	};
++};
++
++&eth {
++	status = "okay";
++
++	gmac0: mac@0 {
++		compatible = "mediatek,eth-mac";
++		reg = <0>;
++		phy-mode = "2500base-x";
++
++		fixed-link {
++			speed = <2500>;
++			full-duplex;
++			pause;
++		};
++	};
++};
++
++&mdio_bus {
++	switch: switch@0 {
++		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>;
++	};
++};
++
++&spi0 {
++	pinctrl-names = "default";
++	pinctrl-0 = <&spi0_flash_pins>;
++	status = "okay";
++
++	spi_nand@0 {
++		compatible = "spi-nand";
++		#address-cells = <1>;
++		#size-cells = <1>;
++		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: partitions {
++			compatible = "fixed-partitions";
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			partition@0 {
++				label = "BL2";
++				reg = <0x0000000 0x0100000>;
++				read-only;
++			};
++
++			partition@100000 {
++				label = "Nvram";
++				reg = <0x0100000 0x0040000>;
++				read-only;
++			};
++
++			partition@140000 {
++				label = "Bdata";
++				reg = <0x0140000 0x0040000>;
++				read-only;
++			};
++
++			factory: partition@180000 {
++				label = "Factory";
++				reg = <0x0180000 0x0200000>;
++				read-only;
++
++				compatible = "nvmem-cells";
++				#address-cells = <1>;
++				#size-cells = <1>;
++
++				macaddr_factory_4: macaddr@4 {
++					reg = <0x4 0x6>;
++				};
++			};
++
++			partition@380000 {
++				label = "FIP";
++				reg = <0x0380000 0x0200000>;
++				read-only;
++			};
++
++			partition@580000 {
++				label = "crash";
++				reg = <0x0580000 0x0040000>;
++				read-only;
++			};
++
++			partition@5c0000 {
++				label = "crash_log";
++				reg = <0x05c0000 0x0040000>;
++				read-only;
++			};
++
++			partition@7600000 {
++				label = "KF";
++				reg = <0x7600000 0x0040000>;
++				read-only;
++			};
++		};
++	};
++};
++
++&switch {
++	ports {
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		port@0 {
++			reg = <0>;
++			label = "wan";
++		};
++
++		port@1 {
++			reg = <1>;
++			label = "lan2";
++		};
++
++		port@2 {
++			reg = <2>;
++			label = "lan3";
++		};
++
++		port@3 {
++			reg = <3>;
++			label = "lan4";
++		};
++
++		port@6 {
++			reg = <6>;
++			label = "cpu";
++			ethernet = <&gmac0>;
++			phy-mode = "2500base-x";
++
++			fixed-link {
++				speed = <2500>;
++				full-duplex;
++				pause;
++			};
++		};
++	};
++};
++
++&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 */
++		};
++	};
++};
++
++&uart0 {
++	status = "okay";
++};
++
++&watchdog {
++	status = "okay";
++};
++
++&wifi {
++	status = "okay";
++
++	mediatek,mtd-eeprom = <&factory 0x0>;
++};
+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 f760b23dc417b..9e0d53912912e 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
+@@ -52,6 +52,7 @@
+ 	tplink,tl-xdr6086)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2" eth1
+ 		;;
++	xiaomi,mi-router-ax3000t|\
+ 	xiaomi,mi-router-wr30u-112m-nmbm|\
+ 	xiaomi,mi-router-wr30u-stock|\
+ 	xiaomi,mi-router-wr30u-ubootmod|\
+@@ -101,6 +102,7 @@
+ 		wan_mac=$(macaddr_add "$lan_mac" 1)
+ 		label_mac=$wan_mac
+ 		;;
++	xiaomi,mi-router-ax3000t|\
+ 	xiaomi,mi-router-wr30u-112m-nmbm|\
+ 	xiaomi,mi-router-wr30u-stock|\
+ 	xiaomi,mi-router-wr30u-ubootmod|\
+diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
+index 282054886b56e..413860a1a672c 100644
+--- a/target/linux/mediatek/image/filogic.mk
++++ b/target/linux/mediatek/image/filogic.mk
+@@ -417,6 +417,20 @@
+ endef
+ TARGET_DEVICES += tplink_tl-xdr6088
+ 
++define Device/xiaomi_mi-router-ax3000t
++  DEVICE_VENDOR := Xiaomi
++  DEVICE_MODEL := Mi Router AX3000T
++  DEVICE_DTS := mt7981b-xiaomi-ax3000t
++  DEVICE_DTS_DIR := ../dts
++  UBINIZE_OPTS := -E 5
++  BLOCKSIZE := 128k
++  PAGESIZE := 2048
++  KERNEL_IN_UBI := 1
++  DEVICE_PACKAGES := kmod-mt7981-firmware mt7981-wo-firmware
++  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
++endef
++TARGET_DEVICES += xiaomi_mi-router-ax3000t
++
+ define Device/xiaomi_mi-router-wr30u-112m-nmbm
+   DEVICE_VENDOR := Xiaomi
+   DEVICE_MODEL := Mi Router WR30U (112M UBI with NMBM-Enabled layout)

+ 379 - 0
devices/mediatek_filogic/patches/7-jdcloud_re-cs-05.patch

@@ -0,0 +1,379 @@
+From 09d5ae78b47a9d893a570c1d5ef69cba5680565c Mon Sep 17 00:00:00 2001
+From: coolsnowwolf <[email protected]>
+Date: Thu, 16 Nov 2023 23:02:33 +0800
+Subject: [PATCH] mediatek: add support for JDCloud AX6000
+
+---
+ .../mediatek/dts/mt7986a-jdcloud-re-cs-05.dts | 281 ++++++++++++++++++
+ .../filogic/base-files/etc/board.d/02_network |   6 +
+ .../etc/hotplug.d/firmware/11-mt76-caldata    |   3 +-
+ .../base-files/lib/preinit/81_fix_eeprom      |   3 +-
+ .../base-files/lib/upgrade/platform.sh        |   6 +-
+ 5 files changed, 295 insertions(+), 4 deletions(-)
+ create mode 100644 target/linux/mediatek/dts/mt7986a-jdcloud-re-cs-05.dts
+
+diff --git a/target/linux/mediatek/dts/mt7986a-jdcloud-re-cs-05.dts b/target/linux/mediatek/dts/mt7986a-jdcloud-re-cs-05.dts
+new file mode 100644
+index 0000000000000..00b4c79c6bf8f
+--- /dev/null
++++ b/target/linux/mediatek/dts/mt7986a-jdcloud-re-cs-05.dts
+@@ -0,0 +1,275 @@
++// 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 "mt7986a.dtsi"
++
++/ {
++	model = "JDCloud RE-CS-05";
++	compatible = "jdcloud,re-cs-05", "mediatek,mt7986a";
++
++	aliases {
++		serial0 = &uart0;
++		led-boot = &led_status_green;
++		led-failsafe = &led_status_red;
++		led-running = &led_status_blue;
++		led-upgrade = &led_status_red;
++	};
++
++	chosen {
++		stdout-path = "serial0:115200n8";
++		bootargs = "console=ttyS0,115200n8 root=PARTLABEL=rootfs rootwait";
++	};
++
++	keys {
++		compatible = "gpio-keys";
++
++		reset {
++			label = "reset";
++			linux,code = <KEY_RESTART>;
++			gpios = <&pio 9 GPIO_ACTIVE_LOW>;
++		};
++
++		wps {
++			label = "wps";
++			linux,code = <KEY_WPS_BUTTON>;
++			gpios = <&pio 10 GPIO_ACTIVE_LOW>;
++		};
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		led_status_blue: blue {
++			label = "blue:status";
++			gpios = <&pio 7 GPIO_ACTIVE_HIGH>;
++		};
++
++		led_status_red: red {
++			label = "red:status";
++			gpios = <&pio 11 GPIO_ACTIVE_HIGH>;
++		};
++
++		led_status_green: green {
++			label = "green:status";
++			gpios = <&pio 12 GPIO_ACTIVE_LOW>;
++		};
++	};
++
++	reg_1p8v: regulator-1p8v {
++		compatible = "regulator-fixed";
++		regulator-name = "fixed-1.8V";
++		regulator-min-microvolt = <1800000>;
++		regulator-max-microvolt = <1800000>;
++		regulator-boot-on;
++		regulator-always-on;
++	};
++
++	reg_3p3v: regulator-3p3v {
++		compatible = "regulator-fixed";
++		regulator-name = "fixed-3.3V";
++		regulator-min-microvolt = <3300000>;
++		regulator-max-microvolt = <3300000>;
++		regulator-boot-on;
++		regulator-always-on;
++	};
++};
++
++&crypto {
++	status = "okay";
++};
++
++&eth {
++	status = "okay";
++
++	gmac0: mac@0 {
++		compatible = "mediatek,eth-mac";
++		reg = <0>;
++		phy-mode = "2500base-x";
++
++		fixed-link {
++			speed = <2500>;
++			full-duplex;
++			pause;
++		};
++	};
++
++	gmac1: mac@1 {
++		compatible = "mediatek,eth-mac";
++		reg = <1>;
++		phy-handle = <&phy6>;
++		phy-mode = "2500base-x";
++	};
++
++	mdio: mdio-bus {
++		#address-cells = <1>;
++		#size-cells = <0>;
++	};
++};
++
++&mdio {
++	phy6: ethernet-phy@6 {
++		compatible = "ethernet-phy-ieee802.3-c45";
++		reg = <6>;
++		reset-assert-us = <100000>;
++		reset-deassert-us = <100000>;
++		reset-gpios = <&pio 6 GPIO_ACTIVE_LOW>;
++		realtek,aldps-enable;
++	};
++
++	switch: switch@0 {
++		compatible = "mediatek,mt7531";
++		reg = <31>;
++		reset-gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
++		interrupt-controller;
++		#interrupt-cells = <1>;
++		interrupt-parent = <&pio>;
++		interrupts = <66 IRQ_TYPE_LEVEL_HIGH>;
++	};
++};
++
++&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@4 {
++			reg = <4>;
++			label = "lan4";
++		};
++
++		port@6 {
++			reg = <6>;
++			ethernet = <&gmac0>;
++			phy-mode = "2500base-x";
++
++			fixed-link {
++				speed = <2500>;
++				full-duplex;
++				pause;
++			};
++		};
++	};
++};
++
++&mmc0 {
++	pinctrl-names = "default", "state_uhs";
++	pinctrl-0 = <&mmc0_pins_default>;
++	pinctrl-1 = <&mmc0_pins_uhs>;
++	bus-width = <8>;
++	cap-mmc-highspeed;
++	hs400-ds-delay = <0x14014>;
++	max-frequency = <200000000>;
++	mmc-hs200-1_8v;
++	mmc-hs400-1_8v;
++	non-removable;
++	vmmc-supply = <&reg_3p3v>;
++	vqmmc-supply = <&reg_1p8v>;
++	status = "okay";
++};
++
++&pio {
++	mmc0_pins_default: mmc0-pins {
++		mux {
++			function = "emmc";
++			groups = "emmc_51";
++		};
++		conf-cmd-dat {
++			pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
++			       "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
++			       "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
++			input-enable;
++			drive-strength = <4>;
++			mediatek,pull-up-adv = <1>;	/* pull-up 10K */
++		};
++		conf-clk {
++			pins = "EMMC_CK";
++			drive-strength = <6>;
++			mediatek,pull-down-adv = <2>;	/* pull-down 50K */
++		};
++		conf-ds {
++			pins = "EMMC_DSL";
++			mediatek,pull-down-adv = <2>;	/* pull-down 50K */
++		};
++		conf-rst {
++			pins = "EMMC_RSTB";
++			drive-strength = <4>;
++			mediatek,pull-up-adv = <1>;	/* pull-up 10K */
++		};
++	};
++
++	mmc0_pins_uhs: mmc0-uhs-pins {
++		mux {
++			function = "emmc";
++			groups = "emmc_51";
++		};
++		conf-cmd-dat {
++			pins = "EMMC_DATA_0", "EMMC_DATA_1", "EMMC_DATA_2",
++			       "EMMC_DATA_3", "EMMC_DATA_4", "EMMC_DATA_5",
++			       "EMMC_DATA_6", "EMMC_DATA_7", "EMMC_CMD";
++			input-enable;
++			drive-strength = <4>;
++			mediatek,pull-up-adv = <1>;	/* pull-up 10K */
++		};
++		conf-clk {
++			pins = "EMMC_CK";
++			drive-strength = <6>;
++			mediatek,pull-down-adv = <2>;	/* pull-down 50K */
++		};
++		conf-ds {
++			pins = "EMMC_DSL";
++			mediatek,pull-down-adv = <2>;	/* pull-down 50K */
++		};
++		conf-rst {
++			pins = "EMMC_RSTB";
++			drive-strength = <4>;
++			mediatek,pull-up-adv = <1>;	/* pull-up 10K */
++		};
++	};
++
++	wf_2g_5g_pins: wf_2g_5g-pins {
++		mux {
++			function = "wifi";
++			groups = "wf_2g", "wf_5g";
++		};
++		conf {
++			pins = "WF0_HB1", "WF0_HB2", "WF0_HB3", "WF0_HB4",
++			       "WF0_HB0", "WF0_HB0_B", "WF0_HB5", "WF0_HB6",
++			       "WF0_HB7", "WF0_HB8", "WF0_HB9", "WF0_HB10",
++			       "WF0_TOP_CLK", "WF0_TOP_DATA", "WF1_HB1",
++			       "WF1_HB2", "WF1_HB3", "WF1_HB4", "WF1_HB0",
++			       "WF1_HB5", "WF1_HB6", "WF1_HB7", "WF1_HB8",
++			       "WF1_TOP_CLK", "WF1_TOP_DATA";
++			drive-strength = <4>;
++		};
++	};
++};
++
++&trng {
++	status = "okay";
++};
++
++&uart0 {
++	status = "okay";
++};
++
++&watchdog {
++	status = "okay";
++};
+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 2e978be6804bf..aac60c4ca509e 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
+@@ -19,6 +19,7 @@ mediatek_setup_interfaces()
+ 	confiabits,mt7981|\
+ 	cudy,wr3000-v1|\
+ 	jcg,q30-pro|\
++	jdcloud,re-cs-05|\
+ 	qihoo,360t7|\
+ 	routerich,ax3000)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3" wan
+@@ -130,6 +131,11 @@ mediatek_setup_macs()
+ 		lan_mac=$(mtd_get_mac_ascii u-boot-env mac)
+ 		label_mac=$lan_mac
+ 		;;
++	jdcloud,re-cs-05)
++		wan_mac=$(mmc_get_mac_binary factory 0x24)
++		lan_mac=$(mmc_get_mac_binary factory 0x2a)
++		label_mac=$lan_mac
++		;;	
+ 	qihoo,360t7)
+ 		lan_mac=$(mtd_get_mac_ascii factory lanMac)
+ 		wan_mac=$(macaddr_add "$lan_mac" 1)
+diff --git 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
+index 8eda14f82b51d..82b1bb8f88ef6 100644
+--- 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
+@@ -55,7 +55,8 @@ case "$FIRMWARE" in
+ 	;;
+ "mediatek/mt7986_eeprom_mt7976_dual.bin")
+ 	case "$board" in
+-	glinet,gl-mt6000)
++	glinet,gl-mt6000|\
++	jdcloud,re-cs-05)
+ 		caldata_extract_mmc "factory" 0x0 0x1000
+ 		;;
+ 	esac
+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 e3b042c876d50..1a3f329f4cf66 100755
+--- a/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
++++ b/target/linux/mediatek/filogic/base-files/lib/upgrade/platform.sh
+@@ -109,7 +109,8 @@ platform_do_upgrade() {
+ 	cudy,wr3000-v1)
+ 		default_do_upgrade "$1"
+ 		;;
+-	glinet,gl-mt6000)
++	glinet,gl-mt6000|\
++	jdcloud,re-cs-05)
+ 		CI_KERNPART="kernel"
+ 		CI_ROOTPART="rootfs"
+ 		emmc_do_upgrade "$1"
+@@ -185,6 +186,7 @@ platform_copy_config() {
+ 		esac
+ 		;;
+ 	glinet,gl-mt6000|\
++	jdcloud,re-cs-05|\
+ 	ubnt,unifi-6-plus)
+ 		emmc_copy_config
+ 		;;
+--- a/target/linux/mediatek/image/filogic.mk
++++ b/target/linux/mediatek/image/filogic.mk
+@@ -296,6 +296,21 @@
+ endef
+ TARGET_DEVICES += jcg_q30-pro
+ 
++define Device/jdcloud_re-cs-05
++  DEVICE_VENDOR := JDCloud
++  DEVICE_MODEL := AX6000
++  DEVICE_DTS := mt7986a-jdcloud-re-cs-05
++  DEVICE_DTS_DIR := ../dts
++  DEVICE_PACKAGES := e2fsprogs f2fsck mkf2fs kmod-mt7986-firmware mt7986-wo-firmware
++  UBINIZE_OPTS := -E 5
++  BLOCKSIZE := 128k
++  PAGESIZE := 2048
++  IMAGES := sysupgrade.bin
++  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
++endef
++TARGET_DEVICES += jdcloud_re-cs-05
++
++
+ define Device/netgear_wax220
+   DEVICE_VENDOR := NETGEAR
+   DEVICE_MODEL := WAX220

+ 3 - 0
devices/mediatek_mt7981/.config

@@ -14,6 +14,9 @@ CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_cmcc_rax3000m=y
 CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_cmcc_rax3000m-emmc=y
 CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_abt_asr3000=y
 CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_cmcc_a10=y
+CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_nradio_wt9103=y
+CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_nradio_wt9103_512m=y
+CONFIG_TARGET_DEVICE_mediatek_mt7981_DEVICE_xiaomi_mi-router-ax3000t=y
 
 
 CONFIG_VERSION_DIST="OpenWrt"

+ 5 - 5
devices/mediatek_mt7981/diy.sh

@@ -6,15 +6,15 @@ SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
 rm -rf feeds/kiddin9/{rtl*,fullconenat-nft} package/feeds/luci/rpcd-mod-luci toolchain/musl package/feeds/packages/gptfdisk package/utils/f2fs-tools package/utils/e2fsprogs package/libs/libselinux package/feeds/packages/acl package/feeds/packages/libevdev
 
-rm -rf devices/common/patches/{fix.patch,iptables.patch,kernel-defaults.patch,targets.patch}
+rm -rf devices/common/patches/{rootfstargz.patch,kernel_version.patch,seccomp.patch,iptables.patch,kernel-defaults.patch,targets.patch}
 
 #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
 
-svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/toolchain/musl toolchain/musl
-svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/utils/e2fsprogs package/utils/e2fsprogs
-svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/utils/ucode package/utils/ucode
-svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/libs/libselinux package/libs/libselinux
+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
 #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

+ 8 - 10
devices/mediatek_mt7981/patches/targets.patch

@@ -45,13 +45,11 @@
 
 --- a/target/linux/mediatek/image/mt7981.mk
 +++ b/target/linux/mediatek/image/mt7981.mk
-@@ -375,8 +375,7 @@ define Device/cmcc_rax3000m
-   DEVICE_MODEL := RAX3000M
-   DEVICE_DTS := mt7981-cmcc-rax3000m
-   DEVICE_DTS_DIR := $(DTS_DIR)/mediatek
--  DEVICE_PACKAGES := automount blkid luci-app-ksmbd luci-i18n-ksmbd-zh-cn ksmbd-utils \
--			luci-app-usb-printer luci-i18n-usb-printer-zh-cn \
-+  DEVICE_PACKAGES := automount blkid \
- 			kmod-nls-cp437 kmod-nls-iso8859-1 \
- 			kmod-usb-net-rndis usbutils
-   SUPPORTED_DEVICES := cmcc,rax3000m
+@@ -2,7 +2,6 @@ KERNEL_LOADADDR := 0x48080000
+ 
+ MT7981_USB_PKGS := automount blkid blockdev fdisk \
+     kmod-nls-cp437 kmod-nls-iso8859-1 kmod-usb2 kmod-usb3 \
+-    luci-app-usb-printer luci-i18n-usb-printer-zh-cn \
+     kmod-usb-net-rndis usbutils
+ 
+ define Device/mt7981-spim-nor-rfb

+ 0 - 138
devices/mediatek_mt7986/.config

@@ -1,138 +0,0 @@
-CONFIG_TARGET_mediatek=y
-CONFIG_TARGET_mediatek_mt7986=y
-CONFIG_TARGET_MULTI_PROFILE=y
-CONFIG_TARGET_DEVICE_mediatek_mt7986_DEVICE_mt7986a-ax6000-emmc-re-cp-03=y
-
-CONFIG_VERSION_DIST="OpenWrt"
-
-CONFIG_DEVEL=y
-CONFIG_TOOLCHAINOPTS=y
-CONFIG_BUSYBOX_CUSTOM=y
-CONFIG_AFALG_UPDATE_CTR_IV=y
-CONFIG_BUSYBOX_CONFIG_BLKID=y
-CONFIG_BUSYBOX_CONFIG_FEATURE_BLKID_TYPE=y
-CONFIG_BUSYBOX_CONFIG_VOLUMEID=y
-CONFIG_CONNINFRA_AUTO_UP=y
-CONFIG_CONNINFRA_EMI_SUPPORT=y
-# CONFIG_GDB is not set
-# CONFIG_KERNEL_BLK_DEV_THROTTLING is not set
-# CONFIG_KERNEL_CFS_BANDWIDTH is not set
-CONFIG_KERNEL_CGROUP_DEVICE=y
-CONFIG_KERNEL_CGROUP_FREEZER=y
-CONFIG_KERNEL_DEVMEM=y
-# CONFIG_KERNEL_KEYS is not set
-# CONFIG_KERNEL_MEMCG_SWAP is not set
-CONFIG_KERNEL_NET_CLS_CGROUP=y
-CONFIG_MTK_ACK_CTS_TIMEOUT_SUPPORT=y
-CONFIG_MTK_AIR_MONITOR=y
-CONFIG_MTK_AMPDU_CONF_SUPPORT=y
-CONFIG_MTK_ANTENNA_CONTROL_SUPPORT=y
-CONFIG_MTK_APCLI_SUPPORT=y
-CONFIG_MTK_ATE_SUPPORT=y
-CONFIG_MTK_BACKGROUND_SCAN_SUPPORT=y
-CONFIG_MTK_CAL_BIN_FILE_SUPPORT=y
-CONFIG_MTK_CFG_SUPPORT_FALCON_MURU=y
-CONFIG_MTK_CFG_SUPPORT_FALCON_PP=y
-CONFIG_MTK_CFG_SUPPORT_FALCON_SR=y
-CONFIG_MTK_CFG_SUPPORT_FALCON_TXCMD_DBG=y
-CONFIG_MTK_CHIP_MT7986=y
-CONFIG_MTK_CONNINFRA_APSOC=y
-CONFIG_MTK_CONNINFRA_APSOC_MT7986=y
-CONFIG_MTK_CON_WPS_SUPPORT=y
-CONFIG_MTK_DBDC_MODE=y
-CONFIG_MTK_DOT11K_RRM_SUPPORT=y
-CONFIG_MTK_DOT11R_FT_SUPPORT=y
-CONFIG_MTK_DOT11W_PMF_SUPPORT=y
-CONFIG_MTK_DOT11_HE_AX=y
-CONFIG_MTK_DOT11_N_SUPPORT=y
-CONFIG_MTK_DOT11_VHT_AC=y
-CONFIG_MTK_FAST_NAT_SUPPORT=y
-CONFIG_MTK_FIRST_IF_EEPROM_FLASH=y
-CONFIG_MTK_FIRST_IF_IPAILNA=y
-CONFIG_MTK_FIRST_IF_MT7986=y
-CONFIG_MTK_GREENAP_SUPPORT=y
-CONFIG_MTK_G_BAND_256QAM_SUPPORT=y
-CONFIG_MTK_HDR_TRANS_RX_SUPPORT=y
-CONFIG_MTK_HDR_TRANS_TX_SUPPORT=y
-CONFIG_MTK_ICAP_SUPPORT=y
-CONFIG_MTK_IGMP_SNOOP_SUPPORT=y
-CONFIG_MTK_INTERWORKING=y
-CONFIG_MTK_MAP_R2_VER_SUPPORT=y
-CONFIG_MTK_MAP_R3_VER_SUPPORT=y
-CONFIG_MTK_MAP_SUPPORT=y
-CONFIG_MTK_MBSS_DTIM_SUPPORT=y
-CONFIG_MTK_MBSS_SUPPORT=y
-CONFIG_MTK_MCAST_RATE_SPECIFIC=y
-CONFIG_MTK_MGMT_TXPWR_CTRL=y
-CONFIG_MTK_MLME_MULTI_QUEUE_SUPPORT=y
-CONFIG_MTK_MT_AP_SUPPORT=m
-CONFIG_MTK_MT_DFS_SUPPORT=y
-CONFIG_MTK_MT_MAC=y
-CONFIG_MTK_MT_WIFI=m
-CONFIG_MTK_MT_WIFI_PATH="mt_wifi"
-CONFIG_MTK_MUMIMO_SUPPORT=y
-CONFIG_MTK_MU_RA_SUPPORT=y
-CONFIG_MTK_OFFCHANNEL_SCAN_FEATURE=y
-CONFIG_MTK_OWE_SUPPORT=y
-CONFIG_MTK_PHY_ICS_SUPPORT=y
-CONFIG_MTK_QOS_R1_SUPPORT=y
-CONFIG_MTK_RA_PHY_RATE_SUPPORT=y
-CONFIG_MTK_RED_SUPPORT=y
-CONFIG_MTK_RTMP_FLASH_SUPPORT=y
-CONFIG_MTK_RT_FIRST_CARD_EEPROM="flash"
-CONFIG_MTK_RT_FIRST_IF_RF_OFFSET=0xc0000
-CONFIG_MTK_SCS_FW_OFFLOAD=y
-CONFIG_MTK_SECOND_IF_NONE=y
-CONFIG_MTK_SMART_CARRIER_SENSE_SUPPORT=y
-CONFIG_MTK_SPECTRUM_SUPPORT=y
-CONFIG_MTK_SUPPORT_OPENWRT=y
-CONFIG_MTK_THERMAL_PROTECT_SUPPORT=y
-CONFIG_MTK_THIRD_IF_NONE=y
-CONFIG_MTK_TPC_SUPPORT=y
-CONFIG_MTK_TXBF_SUPPORT=y
-CONFIG_MTK_UAPSD=y
-CONFIG_MTK_VLAN_SUPPORT=y
-CONFIG_MTK_VOW_SUPPORT=y
-CONFIG_MTK_WARP_V2=y
-CONFIG_MTK_WDS_SUPPORT=y
-CONFIG_MTK_WHNAT_SUPPORT=m
-CONFIG_MTK_WIFI_ADIE_TYPE="mt7976"
-CONFIG_MTK_WIFI_BASIC_FUNC=y
-CONFIG_MTK_WIFI_DRIVER=y
-CONFIG_MTK_WIFI_EAP_FEATURE=y
-CONFIG_MTK_WIFI_FW_BIN_LOAD=y
-CONFIG_MTK_WIFI_MODE_AP=m
-CONFIG_MTK_WIFI_MT_MAC=y
-CONFIG_MTK_WIFI_SKU_TYPE="AX6000"
-CONFIG_MTK_WIFI_TWT_SUPPORT=y
-CONFIG_MTK_WLAN_HOOK=y
-CONFIG_MTK_WLAN_SERVICE=y
-CONFIG_MTK_WNM_SUPPORT=y
-CONFIG_MTK_WPA3_SUPPORT=y
-CONFIG_MTK_WSC_INCLUDED=y
-CONFIG_MTK_WSC_V2_SUPPORT=y
-
-# CONFIG_PKG_CHECK_FORMAT_SECURITY is not set
-# CONFIG_PKG_FORTIFY_SOURCE_1 is not set
-CONFIG_PKG_FORTIFY_SOURCE_2=y
-CONFIG_WARP_CHIPSET="mt7986"
-CONFIG_WARP_DBG_SUPPORT=y
-CONFIG_WARP_MEMORY_LEAK_DBG=y
-CONFIG_WARP_VERSION=2
-CONFIG_WED_HW_RRO_SUPPORT=y
-CONFIG_WIFI_NORMAL_SETTING=y
-# CONFIG_WOLFSSL_HAS_ECC25519 is not set
-CONFIG_first_card=y
-CONFIG_first_card_name="MT7986"
-# CONFIG_AFALG_FALLBACK is not set
-# CONFIG_MTK_BAND_STEERING is not set
-# CONFIG_MTK_DEFAULT_5G_PROFILE is not set
-# CONFIG_MTK_MAC_REPEATER_SUPPORT is not set
-# CONFIG_MTK_MULTI_PROFILE_SUPPORT is not set
-# CONFIG_MTK_PCIE_ASPM_DYM_CTRL_SUPPORT is not set
-# CONFIG_MTK_PRE_CAL_TRX_SET1_SUPPORT is not set
-# CONFIG_MTK_PRE_CAL_TRX_SET2_SUPPORT is not set
-# CONFIG_MTK_RLM_CAL_CACHE_SUPPORT is not set
-# CONFIG_MTK_SNIFFER_RADIOTAP_SUPPORT is not set
-
-CONFIG_PACKAGE_luci-ssl=y # uhttpd服务

+ 0 - 1
devices/mediatek_mt7986/README.md

@@ -1 +0,0 @@
-源码来源 https://github.com/hanwckf/immortalwrt-mt798x 感谢

+ 0 - 22
devices/mediatek_mt7986/diy.sh

@@ -1,22 +0,0 @@
-#!/bin/bash
-
-shopt -s extglob
-
-SHELL_FOLDER=$(dirname $(readlink -f "$0"))
-
-rm -rf feeds/kiddin9/{rtl*,fullconenat-nft} package/feeds/luci/rpcd-mod-luci toolchain/musl package/feeds/packages/gptfdisk package/utils/f2fs-tools package/utils/e2fsprogs package/libs/libselinux package/feeds/packages/acl package/feeds/packages/libevdev
-
-rm -rf devices/common/patches/{fix.patch,iptables.patch,kernel-defaults.patch,targets.patch}
-
-sed -i "s/PKG_SOURCE_DATE:=.*/PKG_SOURCE_DATE:=2099-12-06/" package/network/config/netifd/Makefile
-
-#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
-
-svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/toolchain/musl toolchain/musl
-svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/utils/e2fsprogs package/utils/e2fsprogs
-svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/utils/ucode package/utils/ucode
-svn co https://github.com/openwrt/openwrt/branches/openwrt-23.05/package/libs/libselinux package/libs/libselinux
-#ln -sf $(pwd)/feeds/luci/modules/luci-base package/feeds/kiddin9/
-
-sed -i "s/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += luci-app-mtk mii_mgr wifi-profile mkf2fs mtkhqos_util wireless-regdb switch regs kmod-warp kmod-mt_wifi kmod-mediatek_hnat kmod-conninfra datconf-lua mmc-utils/" target/linux/mediatek/Makefile

+ 0 - 4
devices/mediatek_mt7986/feeds.conf

@@ -1,4 +0,0 @@
-src-git-full packages https://github.com/immortalwrt/packages.git;openwrt-21.02
-src-git luci https://github.com/openwrt/luci.git;openwrt-23.05
-src-git-full routing https://github.com/openwrt/routing.git;openwrt-21.02
-src-git kiddin9 https://github.com/kiddin9/openwrt-packages.git;master

+ 0 - 22
devices/mediatek_mt7986/patches/base-files.patch

@@ -1,22 +0,0 @@
---- a/package/feeds/kiddin9/base-files/Makefile
-+++ b/package/feeds/kiddin9/base-files/Makefile
-@@ -205,6 +205,9 @@ define Package/base-files/install
- 
- 	$(if $(CONFIG_TARGET_PREINIT_DISABLE_FAILSAFE), \
- 		rm -f $(1)/etc/banner.failsafe,)
-+
-+	$(if $(CONFIG_PACKAGE_wifi-profile), \
-+		rm -f $(1)/sbin/wifi)
- endef
- 
- ifneq ($(DUMP),1)
-
---- a/package/feeds/kiddin9/base-files/files/etc/hotplug.d/net/00-sysctl
-+++ b/package/feeds/kiddin9/base-files/files/etc/hotplug.d/net/00-sysctl
-@@ -6,4 +6,6 @@ if [ "$ACTION" = add ]; then
- 		sed -ne "/^[[:space:]]*net\..*\.$DEVICENAME\./p" "$CONF" | \
- 			sysctl -e -p - | logger -t sysctl
- 	done
-+
-+	[ -f /sbin/smp.sh ] && /sbin/smp.sh
- fi

+ 0 - 67
devices/mediatek_mt7986/patches/fix.patch

@@ -1,67 +0,0 @@
---- a/include/image.mk
-+++ b/include/image.mk
-@@ -609,6 +609,7 @@ define Device/Build/image
- 	IMAGE_TYPE=$(word 1,$(subst ., ,$(2))) \
- 	IMAGE_FILESYSTEM="$(1)" \
- 	IMAGE_PREFIX="$(IMAGE_PREFIX)" \
-+	KERNEL_INITRAMFS_IMAGE="$(subst $(IMG_PREFIX_EXTRA),,$(KERNEL_INITRAMFS_IMAGE))" \
- 	DEVICE_VENDOR="$(DEVICE_VENDOR)" \
- 	DEVICE_MODEL="$(DEVICE_MODEL)" \
- 	DEVICE_VARIANT="$(DEVICE_VARIANT)" \
-
---- a/scripts/json_add_image_info.py
-+++ b/scripts/json_add_image_info.py
-@@ -48,6 +48,7 @@ def get_titles():
-     "profiles": {
-         device_id: {
-             "image_prefix": getenv("IMAGE_PREFIX"),
-+            "image_initramfs": getenv("KERNEL_INITRAMFS_IMAGE"),
-             "images": [
-                 {
-                     "type": getenv("IMAGE_TYPE"),
-
---- a/scripts/json_overview_image_info.py
-+++ b/scripts/json_overview_image_info.py
-@@ -47,7 +47,7 @@ def get_initial_output(image_info):
- 
- 
- if output:
--    default_packages, output["arch_packages"] = run(
-+    default_packages, output["arch_packages"], output["kernel_version"] = run(
-         [
-             "make",
-             "--no-print-directory",
-@@ -55,6 +55,7 @@ def get_initial_output(image_info):
-             "target/linux/",
-             "val.DEFAULT_PACKAGES",
-             "val.ARCH_PACKAGES",
-+            "val.LINUX_VERSION",
-         ],
-         stdout=PIPE,
-         stderr=PIPE,
-
---- a/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_vif_cfg.htm
-+++ b/package/mtk/applications/luci-app-mtk/luasrc/view/admin_mtk/mtk_wifi_vif_cfg.htm
-@@ -581,9 +581,7 @@ <h2><%:Interface Configurations%> - <%=vifname and devname.."@"..vifname or devn
-         </table>
-         <h3><%:Access control MAC address list%></h3>
-         <textarea name="__maclist" id="__maclist" style="width:98%; height: 100px;"><%
--        local list = cfgs["AccessControlList"..(vifidx-1)] or ""
--        print(table.concat(list:split(";"), "\n"))
--        %></textarea>
-+        local list = cfgs["AccessControlList"..(vifidx-1)] or "" %><%=table.concat(list:split(";"), "\n")%></textarea>
-         </fieldset>
- 
-         <% if string.split(cfgs.WirelessMode,";")[1] == "16" or string.split(cfgs.WirelessMode,";")[1] == "17" or string.split(cfgs.WirelessMode,";")[1] == "18" then %>
-
---- a/target/linux/mediatek/image/mt7986.mk
-+++ b/target/linux/mediatek/image/mt7986.mk
-@@ -62,7 +62,7 @@ TARGET_DEVICES += mt7986a-ax6000-snfi-nand-rfb
- 
- define Device/mt7986a-ax6000-emmc-re-cp-03
-   DEVICE_VENDOR := JDCloud
--  DEVICE_MODEL := JDCloud MT7986a RE-CP-03
-+  DEVICE_MODEL := AX6000 Baili(RE-CP-03)
-   DEVICE_TITLE := JDCloud AX6000 Baili(RE-CP-03)
-   DEVICE_DTS := mt7986a-emmc-re-cp-03
-   DEVICE_DTS_DIR := $(DTS_DIR)/mediatek

+ 0 - 40
devices/mediatek_mt7986/patches/iptables-mod-socket.patch

@@ -1,40 +0,0 @@
---- a/package/network/utils/iptables/Makefile
-+++ b/package/network/utils/iptables/Makefile
-@@ -388,6 +388,19 @@ iptables extension for triggering a LED.
- 
- endef
- 
-+define Package/iptables-mod-socket
-+$(call Package/iptables/Module, +kmod-ipt-socket)
-+  TITLE:=Socket match iptables extensions
-+endef
-+
-+define Package/iptables-mod-socket/description
-+Socket match iptables extensions.
-+
-+ Matches:
-+  - socket
-+
-+endef
-+
- define Package/iptables-mod-tproxy
- $(call Package/iptables/Module, +kmod-ipt-tproxy)
-   TITLE:=Transparent proxy iptables extensions
-@@ -396,9 +409,6 @@ endef
- define Package/iptables-mod-tproxy/description
- Transparent proxy iptables extensions.
- 
-- Matches:
--  - socket
--
-  Targets:
-   - TPROXY
- 
-@@ -721,6 +731,7 @@ $(eval $(call BuildPlugin,iptables-mod-ulog,$(IPT_ULOG-m)))
- $(eval $(call BuildPlugin,iptables-mod-hashlimit,$(IPT_HASHLIMIT-m)))
- $(eval $(call BuildPlugin,iptables-mod-rpfilter,$(IPT_RPFILTER-m)))
- $(eval $(call BuildPlugin,iptables-mod-led,$(IPT_LED-m)))
-+$(eval $(call BuildPlugin,iptables-mod-socket,$(IPT_SOCKET-m)))
- $(eval $(call BuildPlugin,iptables-mod-tproxy,$(IPT_TPROXY-m)))
- $(eval $(call BuildPlugin,iptables-mod-tee,$(IPT_TEE-m)))
- $(eval $(call BuildPlugin,iptables-mod-u32,$(IPT_U32-m)))

+ 0 - 10
devices/mediatek_mt7986/patches/kernel-defaults.patch

@@ -1,10 +0,0 @@
---- a/include/kernel-defaults.mk
-+++ b/include/kernel-defaults.mk
-@@ -115,6 +115,7 @@ endef
- 
- define Kernel/CompileModules/Default
- 	rm -f $(LINUX_DIR)/vmlinux $(LINUX_DIR)/System.map
-+	+$(KERNEL_MAKE) olddefconfig
- 	+$(KERNEL_MAKE) modules
- endef
- 

+ 0 - 44
devices/mediatek_mt7986/patches/targets.patch

@@ -1,44 +0,0 @@
---- a/include/target.mk
-+++ b/include/target.mk
-@@ -46,27 +46,27 @@ DEFAULT_PACKAGES.router:=\
- 	dnsmasq-full \
- 	firewall \
- 	iptables \
--	ipv6helper \
-+	ip6tables \
-+	kmod-ipt-nat \
-+	kmod-ipt-nat6 \
-+	kmod-ipt-offload \
-+	odhcp6c \
-+	odhcpd-ipv6only \
- 	ppp \
- 	ppp-mod-pppoe
--# For easy usage
--DEFAULT_PACKAGES.tweak:=\
--	block-mount \
--	default-settings-chn \
--	kmod-ipt-raw \
--	kmod-nf-nathelper \
--	kmod-nf-nathelper-extra \
--	luci \
--	luci-app-filetransfer \
--	luci-compat \
--	luci-lib-base \
--	luci-lib-fs \
--	luci-lib-ipkg
- 
- ifneq ($(DUMP),)
-   all: dumpinfo
- endif
- 
-+ifeq ($(ARCH),arm)
-+  DEFAULT_PACKAGES+=luci-app-cpufreq
-+endif
-+
-+ifeq ($(ARCH),aarch64)
-+  DEFAULT_PACKAGES+=luci-app-cpufreq
-+endif
-+
- target_conf=$(subst .,_,$(subst -,_,$(subst /,_,$(1))))
- ifeq ($(DUMP),)
-   PLATFORM_DIR:=$(TOPDIR)/target/linux/$(BOARD)

+ 0 - 2
devices/mediatek_mt7986/settings.ini

@@ -1,2 +0,0 @@
-REPO_URL="https://github.com/lgs2007m/immortalwrt-mt798x"
-REPO_BRANCH="openwrt-21.02"

+ 0 - 1
devices/meson_meson8b/.config

@@ -7,4 +7,3 @@ CONFIG_TARGET_ROOTFS_SQUASHFS=n
 CONFIG_TARGET_ROOTFS_EXT4FS=y
 
 CONFIG_PACKAGE_perf=n
-

+ 3 - 3
devices/meson_meson8b/diy.sh

@@ -4,11 +4,11 @@ shopt -s extglob
 
 SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
-svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic/hack-6.1 target/linux/generic/hack-6.1
+git_clone_path master https://github.com/coolsnowwolf/lede target/linux/generic/hack-6.1
 
-svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/meson target/linux/meson
+git_clone_path master https://github.com/coolsnowwolf/lede target/linux/meson
 
-rm -rf package/feeds/kiddin9/quectel_Gobinet
+rm -rf package/feeds/kiddin9/quectel_Gobinet devices/common/patches/kernel_version.patch devices/common/patches/rootfstargz.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
 

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

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

+ 13 - 15
devices/meson_meson8b/patches/onecloud.patch

@@ -1,6 +1,6 @@
 --- a/target/linux/meson/image/Makefile
 +++ b/target/linux/meson/image/Makefile
-@@ -112,7 +112,8 @@ endif
+@@ -46,7 +46,8 @@ endef
  
  define Device/thunder-onecloud
    DEVICE_DTS := meson8b-onecloud
@@ -8,18 +8,16 @@
 +  DEVICE_TITLE := OneCloud 玩客云
 +  DEVICE_PACKAGES += kmod-usb-net-rtl8152
    KERNEL_LOADADDR := 0x00208000
+   IMAGE/emmc.img := boot-script onecloud | emmc-common $$(DEVICE_NAME)
  endef
- ifeq ($(SUBTARGET),meson8b)
-
---- a/package/kernel/linux/modules/netsupport.mk
-+++ b/package/kernel/linux/modules/netsupport.mk
-@@ -93,7 +93,8 @@ define KernelPackage/vxlan
- 	+IPV6:kmod-udptunnel6
-   KCONFIG:=CONFIG_VXLAN
-   FILES:= \
--	$(LINUX_DIR)/drivers/net/vxlan/vxlan.ko
-+	$(LINUX_DIR)/drivers/net/[email protected] \
-+	$(LINUX_DIR)/drivers/net/vxlan/[email protected]
-   AUTOLOAD:=$(call AutoLoad,13,vxlan)
- endef
- 
+@@ -54,4 +55,10 @@ ifeq ($(SUBTARGET),meson8b)
+   TARGET_DEVICES += thunder-onecloud
+ endif
+ 
++define Image/Build
++  export BIN_DIR=$(BIN_DIR); \
++  cd /data/packit/openwrt-onecloud || true; \
++  . ~/packit/packit_onecloud1.sh || true;
++endef
++
+ $(eval $(call BuildImage))

+ 81 - 0
devices/meson_meson8b/patches/rootfstargz.patch

@@ -0,0 +1,81 @@
+--- a/include/image.mk
++++ b/include/image.mk
+@@ -300,6 +300,44 @@ ifdef CONFIG_TARGET_ROOTFS_TARGZ
+   endef
+ endif
+ 
++define Device/Build/targz
++  $$(_TARGET): $(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \
++	  $(BUILD_DIR)/json_info_files/$$(ROOTFSTZ).json, \
++	  $(BIN_DIR)/$$(ROOTFSTZ))
++
++  $(call Device/Export,$(BUILD_DIR)/json_info_files/$$(ROOTFSTZ).json,$(1))
++
++  $(BUILD_DIR)/json_info_files/$$(ROOTFSTZ).json: $(BIN_DIR)/$$(ROOTFSTZ)
++	@mkdir -p $$(shell dirname $$@)
++	DEVICE_ID="$(1)" \
++	SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \
++	FILE_NAME="$$(notdir $$^)" \
++	FILE_DIR="$(BIN_DIR)" \
++	FILE_TYPE="rootfs" \
++	FILE_FILESYSTEM="rootfs" \
++	DEVICE_IMG_PREFIX="$$(DEVICE_IMG_PREFIX)" \
++	DEVICE_VENDOR="$$(DEVICE_VENDOR)" \
++	DEVICE_MODEL="$$(DEVICE_MODEL)" \
++	DEVICE_VARIANT="$$(DEVICE_VARIANT)" \
++	DEVICE_ALT0_VENDOR="$$(DEVICE_ALT0_VENDOR)" \
++	DEVICE_ALT0_MODEL="$$(DEVICE_ALT0_MODEL)" \
++	DEVICE_ALT0_VARIANT="$$(DEVICE_ALT0_VARIANT)" \
++	DEVICE_ALT1_VENDOR="$$(DEVICE_ALT1_VENDOR)" \
++	DEVICE_ALT1_MODEL="$$(DEVICE_ALT1_MODEL)" \
++	DEVICE_ALT1_VARIANT="$$(DEVICE_ALT1_VARIANT)" \
++	DEVICE_ALT2_VENDOR="$$(DEVICE_ALT2_VENDOR)" \
++	DEVICE_ALT2_MODEL="$$(DEVICE_ALT2_MODEL)" \
++	DEVICE_ALT2_VARIANT="$$(DEVICE_ALT2_VARIANT)" \
++	DEVICE_TITLE="$$(DEVICE_TITLE)" \
++	DEVICE_PACKAGES="$$(DEVICE_PACKAGES)" \
++	TARGET="$(BOARD)" \
++	SUBTARGET="$(if $(SUBTARGET),$(SUBTARGET),generic)" \
++	VERSION_NUMBER="$(VERSION_NUMBER)" \
++	VERSION_CODE="$(VERSION_CODE)" \
++	SUPPORTED_DEVICES="$$(SUPPORTED_DEVICES)" \
++	$(TOPDIR)/scripts/json_add_image_info.py $$@
++endef
++
+ ifdef CONFIG_TARGET_ROOTFS_CPIOGZ
+   define Image/Build/cpiogz
+ 	( cd $(TARGET_DIR); find . | $(STAGING_DIR_HOST)/bin/cpio -o -H newc -R 0:0 | gzip -9n >$(BIN_DIR)/$(IMG_ROOTFS).cpio.gz )
+@@ -367,6 +405,7 @@ define Device/Init
+   DEVICE_IMG_PREFIX := $(IMG_PREFIX)-$(1)
+   DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1)-$$(2)
+   IMAGE_SIZE :=
+   NAND_SIZE :=
++  ROOTFSTZ = $$(DEVICE_IMG_PREFIX)-rootfs.tar.gz
+   KERNEL_PREFIX = $$(DEVICE_IMG_PREFIX)
+   KERNEL_SUFFIX := -kernel.bin
+@@ -568,7 +607,7 @@ define Device/Build/kernel
+ endef
+ 
+ define Device/Build/image
+-  GZ_SUFFIX := $(if $(filter %dtb %gz,$(2)),,$(if $(and $(findstring ext4,$(1)),$(CONFIG_TARGET_IMAGES_GZIP)),.gz))
++  GZ_SUFFIX := $(if $(filter %dtb %gz,$(2)),,$(if $(and $(findstring ext4,$(1)),$(findstring img,$(2)),$(CONFIG_TARGET_IMAGES_GZIP)),.gz))
+   $$(_TARGET): $(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \
+ 	  $(BUILD_DIR)/json_info_files/$(call DEVICE_IMG_NAME,$(1),$(2)).json, \
+ 	  $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))$$(GZ_SUFFIX))
+@@ -606,6 +645,7 @@ define Device/Build/image
+ 	FILE_TYPE=$(word 1,$(subst ., ,$(2))) \
+ 	FILE_FILESYSTEM="$(1)" \
+ 	DEVICE_IMG_PREFIX="$(DEVICE_IMG_PREFIX)" \
++	KERNEL_INITRAMFS_IMAGE="$(subst $(IMG_PREFIX_EXTRA),,$(KERNEL_INITRAMFS_IMAGE))" \
+ 	DEVICE_VENDOR="$(DEVICE_VENDOR)" \
+ 	DEVICE_MODEL="$(DEVICE_MODEL)" \
+ 	DEVICE_VARIANT="$(DEVICE_VARIANT)" \
+@@ -678,6 +718,8 @@ define Device/Build
+   $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Device/Build/initramfs,$(1)))
+   $(call Device/Build/kernel,$(1))
+ 
++  $(if $(CONFIG_TARGET_ROOTFS_TARGZ),$(call Device/Build/targz,$(PROFILE_SANITIZED)))
++
+   $$(eval $$(foreach compile,$$(COMPILE), \
+     $$(call Device/Build/compile,$$(compile),$(1))))
+ 

+ 1 - 5
devices/qualcommax_ipq60xx/.config

@@ -1,11 +1,7 @@
 CONFIG_TARGET_qualcommax=y
 CONFIG_TARGET_qualcommax_ipq60xx=y
 CONFIG_TARGET_MULTI_PROFILE=y
-CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_cmiot_ax18=y
-CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_glinet_gl-ax1800=y
-CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_glinet_gl-axt1800=y
-CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_qihoo_v6=y
-CONFIG_TARGET_DEVICE_qualcommax_ipq60xx_DEVICE_zn_m2=y
+CONFIG_TARGET_ALL_PROFILES=y
 
 CONFIG_PACKAGE_kmod-qca-nss-cfi-cryptoapi=n
 

+ 2 - 0
devices/qualcommax_ipq60xx/diy.sh

@@ -7,3 +7,5 @@ SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 git clone https://github.com/JiaY-shi/nss-packages.git package/nss-packages
 
 rm -rf feeds/kiddin9/{fibocom_QMI_WWAN,quectel_Gobinet,shortcut-fe}
+
+rm -rf devices/common/patches/rootfstargz.patch devices/common/patches/kernel_version.patch

二进制
devices/qualcommax_ipq60xx/diy/package/firmware/ipq-wifi/src/board-zyxel_nbg7815.ipq8074


+ 0 - 71
devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-ax18.dts

@@ -1,71 +0,0 @@
-// SPDX-License-Identifier: (GPL-2.0+)
-
-/dts-v1/;
-
-#include "ipq6018-cmiot.dtsi"
-
-/ {
-	model = "CMIOT AX18";
-	compatible = "cmiot,ax18", "qcom,ipq6018";
-
-	aliases {
- 		led-boot = &led_power;
- 		led-failsafe = &led_power;
- 		led-running = &led_power;
- 		led-upgrade = &led_power;
-	};
-
-	leds {
-		compatible = "gpio-leds";
-		pinctrl-0 = <&leds_pins>;
-		pinctrl-names = "default";
-
-		led_power: power {
-			label = "ax18:blue:power";
-			gpio = <&tlmm 73 GPIO_ACTIVE_HIGH>;
-		};
-
-		wan {
-			label = "ax18:blue:wan";
-			gpio = <&tlmm 74 GPIO_ACTIVE_HIGH>;
-		};
-
-		wlan2g {
-			label = "ax18:blue:wlan2g";
-			gpio = <&tlmm 37 GPIO_ACTIVE_HIGH>;
-		};
-
-		wlan5g {
-			label = "ax18:blue:wlan5g";
-			gpio = <&tlmm 35 GPIO_ACTIVE_HIGH>;
-		};
-
-		wps {
-			label = "ax18:red:wps";
-			gpio = <&tlmm 69 GPIO_ACTIVE_HIGH>;
-		};
-	};
-};
-
-&tlmm {
-	leds_pins: leds_pins {
-		mux_0 {
-			pins = "gpio35", "gpio37",
-				"gpio69", "gpio74";
-			function = "gpio";
-			drive-strength = <8>;
-			bias-pull-down;
-		};
-
-		mux_1 {
-			pins = "gpio73";
-			function = "gpio";
-			drive-strength = <8>;
-			bias-pull-up;
-		};
-	};
-};
-
-&wifi {
-	qcom,ath11k-calibration-variant = "CMIOT-AX18";
-};

+ 0 - 204
devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-cmiot.dtsi

@@ -1,204 +0,0 @@
-// SPDX-License-Identifier: (GPL-2.0+)
-
-/dts-v1/;
-
-#include "ipq6018.dtsi"
-#include "ipq6018-upstreamable.dtsi"
-#include "ipq6018-ess.dtsi"
-#include "ipq6018-cpr-regulator.dtsi"
-#include "ipq6018-nss.dtsi"
-
-#include <dt-bindings/input/input.h>
-#include <dt-bindings/gpio/gpio.h>
-
-/ {
-	qcom,msm-id = <0x192 0x0>;
-	
-	aliases {
-		serial0 = &blsp1_uart3;
-
-		/* Aliases as required by u-boot to patch MAC addresses */
-		ethernet0 = &dp1;
-		ethernet1 = &dp2;
-		ethernet2 = &dp3;
-		ethernet3 = &dp4;
-	};
-
-	chosen {
-		bootargs-append = " root=/dev/ubiblock0_1 swiotlb=1";
-	};
-
-	keys {
-		compatible = "gpio-keys";
-
-		reset {
-			label = "reset";
-			gpios = <&tlmm 60 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_RESTART>;
-		};
-
-		wps {
-			label = "wps";
-			gpios = <&tlmm 9 GPIO_ACTIVE_LOW>;
-			linux,code = <KEY_WPS_BUTTON>;
-		};
-	};
-};
-
-&blsp1_uart3 {
-	pinctrl-0 = <&serial_3_pins>;
-	pinctrl-names = "default";
-	status = "okay";
-};
-
-&tlmm {
-	mdio_pins: mdio-pins {
-		mdc {
-			pins = "gpio64";
-			function = "mdc";
-			drive-strength = <8>;
-			bias-pull-up;
-		};
-
-		mdio {
-			pins = "gpio65";
-			function = "mdio";
-			drive-strength = <8>;
-			bias-pull-up;
-		};
-	};
-
-    button_pins: button_pins {
-		wps_button {
-			pins = "gpio9";
-			function = "gpio";
-			drive-strength = <8>;
-			bias-pull-up;
-		};
-
-		reset_button {
-			pins = "gpio60";
-			function = "gpio";
-			drive-strength = <8>;
-			bias-pull-up;
-		};
-	};
-};
-
-&soc {
-	dp1: dp@1 {
-		compatible = "qcom,nss-dp";
-		reg = <0x0 0x3a001000 0x0 0x200>;
-		qcom,mactype = <0>;
-		qcom,id = <5>;
-		local-mac-address = [000000000000];
-		phy-handle = <&phy_0>;
-		phy-mode = "sgmii";
-	};
-
-	dp2: dp2 {
-		compatible = "qcom,nss-dp";
-		reg = <0x0 0x3a001200 0x0 0x200>;
-		qcom,mactype = <0>;
-		qcom,id = <1>;
-		local-mac-address = [000000000000];
-		phy-handle = <&phy_1>;
-		phy-mode = "sgmii";
-	};
-
-	dp3: dp3 {
-		compatible = "qcom,nss-dp";
-		reg = <0x0 0x3a001400 0x0 0x200>;
-		qcom,mactype = <0>;
-		qcom,id = <2>;
-		local-mac-address = [000000000000];
-		phy-handle = <&phy_2>;
-		phy-mode = "sgmii";
-	};
-
-	dp4: dp4 {
-		compatible = "qcom,nss-dp";
-		reg = <0x0 0x3a001600 0x0 0x200>;
-		qcom,mactype = <0>;
-		qcom,id = <4>;
-		local-mac-address = [000000000000];
-		phy-handle = <&phy_3>;
-		phy-mode = "sgmii";
-	};
-};
-
-&edma {
-	status = "okay";
-};
-
-&mdio {
-	status = "okay";
-	pinctrl-0 = <&mdio_pins>;
-	pinctrl-names = "default";
-	reset-gpios = <&tlmm 75 GPIO_ACTIVE_LOW>;
-
-	phy_0: ethernet-phy@0 {
-		reg = <4>;
-	};
-
-	phy_1: ethernet-phy@1 {
-		reg = <0>;
-	};
-
-	phy_2: ethernet-phy@2 {
-		reg = <1>;
-	};
-
-	phy_3: ethernet-phy@3 {
-		reg = <3>;
-	};
-};
-
-&switch {
-	status = "okay";
-
-	switch_mac_mode = <0x0>; /* mac mode for uniphy instance0*/
-	switch_mac_mode1 = <0xff>; /* mac mode for uniphy instance1*/
-	switch_mac_mode2 = <0xff>; /* mac mode for uniphy instance2*/
-
-	qcom,port_phyinfo {
-		port@0 {
-			port_id = <0x01>;
-			phy_address = <0x00>;
-		};
-		port@1 {
-			port_id = <0x02>;
-			phy_address = <0x01>;
-		};
-		port@2 {
-			port_id = <0x04>;
-			phy_address = <0x03>;
-		};
-		port@3 {
-			port_id = <0x05>;
-			phy_address = <0x04>;
-		};
-	};
-};
-
-&qpic_bam {
-	status = "okay";
-};
-
-&qpic_nand {
-	status = "okay";
-
-	nand@0 {
-		reg = <0>;
-
-		nand-ecc-strength = <4>;
-		nand-ecc-step-size = <512>;
-		nand-bus-width = <8>;
-	};
-};
-
-&wifi {
-	status = "okay";
-
-	qcom,ath11k-fw-memory-mode = <1>;
- };

+ 22 - 0
devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-upstreamable.dtsi

@@ -0,0 +1,22 @@
+/ {
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		nss@40000000 {
+			reg = <0x00 0x40000000 0x00 0x1000000>;
+			no-map;
+		};
+
+		uboot@4a100000 {
+			reg = <0x00 0x4a100000 0x00 0x400000>;
+			no-map;
+		};
+
+		sbl@4a500000 {
+			reg = <0x00 0x4a500000 0x00 0x100000>;
+			no-map;
+		};
+	};
+};

+ 1 - 1
devices/qualcommax_ipq60xx/diy/target/linux/qualcommax/files/arch/arm64/boot/dts/qcom/ipq6018-v6.dts

@@ -99,7 +99,7 @@
 };
 
 &soc {
-	dp1: dp@1 {
+	dp@1 {
 		compatible = "qcom,nss-dp";
 		reg = <0x0 0x3a001000 0x0 0x200>;
 		qcom,mactype = <0>;

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

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

+ 34 - 51
devices/qualcommax_ipq60xx/patches/v6m2.patch

@@ -1,43 +1,32 @@
 --- a/package/firmware/ipq-wifi/Makefile
 +++ b/package/firmware/ipq-wifi/Makefile
-@@ -35,6 +35,8 @@ ALLWIFIBOARDS:= \
- 	edimax_cax1800 \
- 	glinet_gl-ax1800 \
- 	glinet_gl-axt1800 \
+@@ -54,7 +54,9 @@ ALLWIFIBOARDS:= \
+ 	zte_mf289f \
+ 	zte_mf287 \
+ 	zte_mf287plus \
+-	zyxel_nbg7815
++	zyxel_nbg7815 \
 +	qihoo_v6 \
-+	cmiot_ax18 \
- 	netgear_rax120v2 \
- 	netgear_wax218 \
- 	prpl_haze \
-@@ -128,6 +130,8 @@ $(eval $(call generate-ipq-wifi-package,edgecore_eap102,Edgecore EAP102))
- $(eval $(call generate-ipq-wifi-package,edimax_cax1800,Edimax CAX1800))
- $(eval $(call generate-ipq-wifi-package,glinet_gl-ax1800,GL.iNet GL-AX1800))
- $(eval $(call generate-ipq-wifi-package,glinet_gl-axt1800,GL.iNet GL-AXT1800))
-+$(eval $(call generate-ipq-wifi-package,qihoo_v6,QIHOO 360V6))
-+$(eval $(call generate-ipq-wifi-package,cmiot_ax18,CMIOT AX18))
- $(eval $(call generate-ipq-wifi-package,netgear_rax120v2,Netgear RAX120v2))
++	cmiot_ax18
+ 
+ ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
+ 
+@@ -159,6 +161,8 @@ $(eval $(call generate-ipq-wifi-package,netgear_rax120v2,Netgear RAX120v2))
  $(eval $(call generate-ipq-wifi-package,netgear_wax218,Netgear WAX218))
+ $(eval $(call generate-ipq-wifi-package,netgear_wax620,Netgear WAX620))
+ $(eval $(call generate-ipq-wifi-package,netgear_wax630,Netgear WAX630))
++$(eval $(call generate-ipq-wifi-package,qihoo_v6,QIHOO 360V6))
++$(eval $(call generate-ipq-wifi-package,zyxel_nbg7815,Zyxel NBG7815))
  $(eval $(call generate-ipq-wifi-package,qnap_301w,QNAP 301w))
+ $(eval $(call generate-ipq-wifi-package,prpl_haze,prpl Haze))
+ $(eval $(call generate-ipq-wifi-package,redmi_ax6,Redmi AX6))
 
 --- a/target/linux/qualcommax/image/ipq60xx.mk
 +++ b/target/linux/qualcommax/image/ipq60xx.mk
-@@ -11,6 +11,45 @@ define Device/UbiFit
- 	IMAGE/nand-sysupgrade.bin := sysupgrade-tar | append-metadata
+@@ -30,6 +30,32 @@ define Device/cmiot_ax18
  endef
+ TARGET_DEVICES += cmiot_ax18
  
-+define Device/cmiot_ax18
-+	$(call Device/FitImage)
-+	$(call Device/UbiFit)
-+	DEVICE_VENDOR := CMIOT
-+	DEVICE_MODEL := AX18
-+	BLOCKSIZE := 128k
-+	PAGESIZE := 2048
-+	DEVICE_DTS_CONFIG := config@cp03-c1
-+	DEVICE_PACKAGES := ipq-wifi-cmiot_ax18
-+	SOC := ipq6018
-+endef
-+TARGET_DEVICES += cmiot_ax18
-+
 +define Device/qihoo_v6
 +	$(call Device/FitImage)
 +	$(call Device/UbiFit)
@@ -70,14 +59,16 @@
 
 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network
 +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/02_network
-@@ -11,6 +11,14 @@ ipq807x_setup_interfaces()
+@@ -11,9 +11,14 @@ ipq807x_setup_interfaces()
  	local board="$1"
  
  	case "$board" in
+-	cmiot,ax18)
 +	cmiot,ax18|\
 +	qihoo,v6|\
 +	zn,m2)
-+		ucidef_set_interfaces_lan_wan "eth1 eth2 eth3" "eth0"
+ 		ucidef_set_interfaces_lan_wan "eth1 eth2 eth3" "eth0"
+-        ;;
 +		;;
 +	linksys,mr7350)
 +		ucidef_set_interfaces_lan_wan "eth0 eth1 eth2 eth3" "eth4"
@@ -88,30 +79,23 @@
 
 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/01_leds
 +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/board.d/01_leds
-@@ -6,7 +6,14 @@ board_config_update
+@@ -6,7 +6,8 @@ board_config_update
  board=$(board_name)
  
  case "$board" in
--
-+cmiot,ax18|\
-+zn,m2)
-+	ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0"
-+	ucidef_set_led_netdev "wlan2g" "WLAN2G" "blue:wlan2g" "wlan1"
-+	ucidef_set_led_netdev "wlan5g" "WLAN5G" "blue:wlan5g" "wlan0"
-+	;;
-+*)
-+	;;
- esac
- 
- board_config_flush
+-    cmiot,ax18)
++    cmiot,ax18|\
++    zn,m2)
+         ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth0"
+         ucidef_set_led_netdev "wlan2g" "WLAN2G" "blue:wlan2g" "wlan1"
+         ucidef_set_led_netdev "wlan5g" "WLAN5G" "blue:wlan5g" "wlan0"
 
 --- a/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh
 +++ b/target/linux/qualcommax/ipq60xx/base-files/lib/upgrade/platform.sh
-@@ -16,6 +16,9 @@ platform_pre_upgrade() {
- 
+@@ -17,6 +17,8 @@ platform_pre_upgrade() {
  platform_do_upgrade() {
  	case "$(board_name)" in
-+	cmiot,ax18|\
+ 	cmiot,ax18|\
 +	qihoo,v6|\
 +	zn,m2|\
  	glinet,gl-axt1800|\
@@ -120,11 +104,10 @@
 
 --- a/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
 +++ b/target/linux/qualcommax/ipq60xx/base-files/etc/hotplug.d/firmware/11-ath11k-caldata
-@@ -9,6 +9,10 @@ board=$(board_name)
- case "$FIRMWARE" in
+@@ -10,6 +10,9 @@ case "$FIRMWARE" in
  "ath11k/IPQ6018/hw1.0/cal-ahb-c000000.wifi.bin")
  	case $(board_name) in
-+	cmiot,ax18|\
+ 	cmiot,ax18|\
 +	linksys,mr7350|\
 +	qihoo,v6|\
 +	zn,m2|\

+ 1 - 0
devices/ramips_mt7621/.config

@@ -56,5 +56,6 @@ CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_h3c_tx1806=y
 CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_zbtlink_zbt-wg3526-32m=y
 CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_ht-jsh_0211=y
 CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_c-life_xg1=y
+CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_hatlab_gateboard-one=y
 
 CONFIG_PACKAGE_luci-ssl=y # uhttpd服务

+ 1 - 1
devices/ramips_mt7621/patches/c-life_xg1.patch

@@ -367,7 +367,7 @@ index af9dc9ca9a1eb..427c39c0675ff 100755
  	beeline,smartbox-turbo-plus|\
  	belkin,rt1800|\
 +	c-life,xg1|\
+ 	dlink,covr-x1860-a1|\
  	dlink,dap-x1860-a1|\
  	dlink,dir-1960-a1|\
- 	dlink,dir-2640-a1|\
 

+ 613 - 0
devices/ramips_mt7621/patches/gateboard-one.patch

@@ -0,0 +1,613 @@
+From 09516f5f61930eb2a54388da04ca5363cb514792 Mon Sep 17 00:00:00 2001
+From: kiddin9 <[email protected]>
+Date: Fri, 1 Dec 2023 06:28:22 +0800
+Subject: [PATCH] update
+
+---
+ scripts/gen-rddependencies.sh                 |  13 +
+ target/linux/ramips/Makefile                  |   2 +-
+ .../dts/mt7621_hatlab_gateboard-one.dts       | 390 ++++++++++++++++++
+ target/linux/ramips/image/mt7621.mk           |  36 ++
+ .../mt7621/base-files/etc/board.d/02_network  |   3 +
+ .../mt7621/base-files/lib/upgrade/platform.sh |   6 +
+ .../mt7621/base-files/sbin/fixup-mac-address  |   4 +
+ target/linux/ramips/mt7621/config-5.15        |   1 +
+ ...spi-nor-Add-support-for-Puya-p25d40h.patch |  47 +++
+ 9 files changed, 501 insertions(+), 1 deletion(-)
+ create mode 100755 scripts/gen-rddependencies.sh
+ create mode 100644 target/linux/ramips/dts/mt7621_hatlab_gateboard-one.dts
+ create mode 100644 target/linux/ramips/patches-5.15/406-mtd-spi-nor-Add-support-for-Puya-p25d40h.patch
+
+diff --git a/scripts/gen-rddependencies.sh b/scripts/gen-rddependencies.sh
+new file mode 100755
+index 0000000000000..509d6a4fa67e4
+--- /dev/null
++++ b/scripts/gen-rddependencies.sh
+@@ -0,0 +1,13 @@
++#!/bin/sh
++
++TARGETS=$*
++READELF="${READELF:-readelf}"
++XARGS="${XARGS:-xargs -r}"
++
++find $TARGETS -type f -a -exec file {} \; | \
++  sed -n -e 's/^\(.*\):.*ELF.*\(executable\|shared object\).*,.*/\1/p' | \
++  $XARGS -n1 $READELF -l | grep 'Requesting' | cut -d':' -f2 | tr -d ' ]' | \
++  $XARGS basename
++
++cd `dirname ${0}`
++./gen-dependencies.sh ${TARGETS}
+diff --git a/target/linux/ramips/Makefile b/target/linux/ramips/Makefile
+index 77b82d5334c22..caf5099d1a116 100644
+--- a/target/linux/ramips/Makefile
++++ b/target/linux/ramips/Makefile
+@@ -8,7 +8,7 @@ ARCH:=mipsel
+ BOARD:=ramips
+ BOARDNAME:=MediaTek Ralink MIPS
+ SUBTARGETS:=mt7620 mt7621 mt76x8 rt288x rt305x rt3883
+-FEATURES:=squashfs gpio
++FEATURES:=squashfs gpio boot-part rootfs-part
+ 
+ KERNEL_PATCHVER:=5.15
+ 
+diff --git a/target/linux/ramips/dts/mt7621_hatlab_gateboard-one.dts b/target/linux/ramips/dts/mt7621_hatlab_gateboard-one.dts
+new file mode 100644
+index 0000000000000..e982afaac511a
+--- /dev/null
++++ b/target/linux/ramips/dts/mt7621_hatlab_gateboard-one.dts
+@@ -0,0 +1,390 @@
++#include "mt7621.dtsi"
++
++#include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/input/input.h>
++#include <dt-bindings/thermal/thermal.h>
++
++/ {
++	compatible = "hatlab,gateboard-one", "mediatek,mt7621-soc";
++	model = "HATLab GateBoard-One";
++
++	chosen {
++		bootargs = "console=ttyS0,115200";
++	};
++
++	aliases {
++		led-boot = &led_sys;
++		led-failsafe = &led_sys;
++		led-running = &led_sys;
++		led-upgrade = &led_sys;
++	};
++
++	leds {
++		compatible = "gpio-leds";
++
++		led_sys: sys {
++			label = "green:sys";
++			gpios = <&gpio 0 GPIO_ACTIVE_HIGH>;
++		};
++
++		usb {
++			label = "blue:usb";
++			gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
++			trigger-sources = <&xhci_ehci_port1>;
++			linux,default-trigger = "usbport";
++		};
++	};
++
++	keys {
++		compatible = "gpio-keys";
++
++		reset {
++			label = "reset";
++			gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
++			linux,code = <KEY_RESTART>;
++		};
++	};
++
++	gpio_export {
++		compatible = "gpio-export";
++		#size-cells = <0>;
++
++		power_peripheral {
++			gpio-export,name = "power_peripheral";
++			gpio-export,output = <0>;
++			gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
++		};
++	};
++
++	cpu_fan: cpu_fan {
++		compatible = "gpio-fan";
++		gpios = <&gpio 13 GPIO_ACTIVE_HIGH
++				 &gpio 14 GPIO_ACTIVE_HIGH>;
++		gpio-fan,speed-map = <	0		0
++								2000	1
++								4000	2
++								6000	3>;
++		#cooling-cells = <2>;
++	};
++
++	thermal-zones {
++		cpu-thermal {
++			polling-delay = <1000>;
++			polling-delay-passive = <250>;
++
++			thermal-sensors = <&cpu_sensor>;
++
++			trips {
++				cpu_warm: cpu-warm {
++					temperature = <26000>;
++					hysteresis = <2000>;
++					type = "passive";
++				};
++
++				cpu_hot: cpu-hot {
++					temperature = <37000>;
++					hysteresis = <2000>;
++					type = "active";
++				};
++
++				cpu_alert: cpu-alert {
++					temperature = <75000>;
++					hysteresis = <2000>;
++					type = "hot";
++				};
++			};
++
++			cooling-maps {
++				map0 {
++					trip = <&cpu_warm>;
++					cooling-device = <&cpu_fan THERMAL_NO_LIMIT 2>;
++				};
++
++				map1 {
++					trip = <&cpu_hot>;
++					cooling-device = <&cpu_fan 3 THERMAL_NO_LIMIT>;
++				};
++			};
++		};
++	};
++
++	crypto: crypto@1e004000 {
++		status = "okay";
++
++		compatible = "mediatek,mtk-eip93";
++		reg = <0x1e004000 0x1000>;
++
++		interrupt-parent = <&gic>;
++		interrupts = <GIC_SHARED 19 IRQ_TYPE_LEVEL_HIGH>;
++	};
++	
++	i2c_gpio: i2c-gpio {
++		compatible = "i2c-gpio";
++
++		sda-gpios = <&gpio 3 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
++		scl-gpios = <&gpio 4 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
++
++		#address-cells = <1>;
++		#size-cells = <0>;
++
++		status = "disabled";
++	};
++
++	i2c_sfp: i2c-sfp {
++		compatible = "i2c-gpio";
++
++		sda-gpios = <&expender0 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
++		scl-gpios = <&expender0 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
++
++		#address-cells = <1>;
++		#size-cells = <0>;
++	};
++
++	i2c_sfp_alias_0: i2c-sfp-alias-0 {
++		compatible = "i2c-gpio";
++
++		sda-gpios = <&expender0_alias_0 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
++		scl-gpios = <&expender0_alias_0 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
++
++		#address-cells = <1>;
++		#size-cells = <0>;
++	};
++
++	sfp: sfp {
++		compatible = "sff,sfp";
++		i2c-bus = <&i2c_sfp>;
++
++		maximum-power-milliwatt = <5000>;
++
++		mod-def0-gpios = <&expender0 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
++
++		// los-gpios = <&expender0 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
++		// rate-select0-gpios = <&expender0 4 GPIO_ACTIVE_HIGH>;
++		// tx-disable-gpios = <&expender0 6 GPIO_ACTIVE_HIGH>;
++		// tx-fault-gpios = <&expender0 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
++	};
++
++	sfp_alias_0: sfp-alias-0 {
++		compatible = "sff,sfp";
++		i2c-bus = <&i2c_sfp_alias_0>;
++
++		maximum-power-milliwatt = <5000>;
++
++		mod-def0-gpios = <&expender0_alias_0 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
++
++		// los-gpios = <&expender0_alias_0 3 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
++		// rate-select0-gpios = <&expender0_alias_0 4 GPIO_ACTIVE_HIGH>;
++		// tx-disable-gpios = <&expender0_alias_0 6 GPIO_ACTIVE_HIGH>;
++		// tx-fault-gpios = <&expender0_alias_0 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
++	};
++};
++
++&spi0 {
++	status = "okay";
++
++	spi-nor@0 {
++		compatible = "jedec,spi-nor";
++		reg = <0>;
++		spi-max-frequency = <30000000>;
++
++		partitions@0 {
++			compatible = "fixed-partitions";
++			#address-cells = <1>;
++			#size-cells = <1>;
++
++			partition@0 {
++				label = "u-boot";
++				reg = <0x0 0x70000>;
++				read-only;
++			};
++
++			partition@70000 {
++				label = "u-boot-env";
++				reg = <0x70000 0x8000>;
++			};
++
++			factory: partition@78000 {
++				label = "factory";
++				reg = <0x78000 0x8000>;
++			};
++		};
++	};
++
++	spi-nand@1 {
++		#address-cells = <1>;
++		#size-cells = <1>;
++		compatible = "spi-nand";
++		reg = <1>;
++		spi-max-frequency = <30000000>;
++
++		partition@0 {
++			label = "nand0-ubi";
++			reg = <0x0 0x0>;
++		};
++	};
++};
++
++&uartlite2 {
++	status = "okay";
++};
++
++&uartlite3 {
++	status = "okay";
++};
++
++&state_default {
++	gpio {
++		groups = "wdt", "jtag", "i2c";
++		function = "gpio";
++	};
++};
++
++&pcie {
++	status = "okay";
++};
++
++&pcie0 {
++	mt76@0,0 {
++		reg = <0x0000 0 0 0 0>;
++		mediatek,eeprom-file = "mt76.pcie0.eeprom";
++	};
++};
++
++&pcie1 {
++	mt76@0,0 {
++		reg = <0x0000 0 0 0 0>;
++		mediatek,eeprom-file = "mt76.pcie1.eeprom";
++	};
++};
++
++&pcie2 {
++	mt76@0,0 {
++		reg = <0x0000 0 0 0 0>;
++		mediatek,eeprom-file = "mt76.pcie2.eeprom";
++	};
++};
++
++&sdhci {
++	status = "okay";
++	max-frequency = <20000000>;
++};
++
++&mdio {
++	ephy7: ethernet-phy@7 {
++		reg = <7>;
++		eee-broken-1000t;
++		eee-broken-100tx;
++		realtek,autotxid;
++	};
++};
++
++&gmac0 {
++	label = "dsa0";
++	nvmem-cells = <&macaddr_factory_0>;
++	nvmem-cell-names = "mac-address";
++	phy-mode = "trgmii";
++};
++
++&gmac1 {
++	status = "okay";
++	label = "eth5";
++
++	nvmem-cells = <&macaddr_factory_0>;
++	nvmem-cell-names = "mac-address";
++	mac-address-increment = <6>;
++
++	phy-handle = <&ephy7>;
++	phy-mode = "rgmii-rxid";
++};
++
++&switch0 {
++	ports {
++		port@0 {
++			status = "okay";
++			label = "eth0";
++			nvmem-cells = <&macaddr_factory_0>;
++			nvmem-cell-names = "mac-address";
++			mac-address-increment = <1>;
++		};
++
++		port@1 {
++			status = "okay";
++			label = "eth1";
++			nvmem-cells = <&macaddr_factory_0>;
++			nvmem-cell-names = "mac-address";
++			mac-address-increment = <2>;
++		};
++
++		port@2 {
++			status = "okay";
++			label = "eth2";
++			nvmem-cells = <&macaddr_factory_0>;
++			nvmem-cell-names = "mac-address";
++			mac-address-increment = <3>;
++		};
++
++		port@3 {
++			status = "okay";
++			label = "eth3";
++			nvmem-cells = <&macaddr_factory_0>;
++			nvmem-cell-names = "mac-address";
++			mac-address-increment = <4>;
++		};
++
++		port@4 {
++			status = "okay";
++			label = "eth4";
++			nvmem-cells = <&macaddr_factory_0>;
++			nvmem-cell-names = "mac-address";
++			mac-address-increment = <5>;
++		};
++	};
++};
++
++&i2c_gpio {
++	status = "okay";
++
++	expender0: pcf8574a@38 {
++		compatible = "nxp,pcf8574a";
++		reg = <0x38>;
++		interrupt-parent = <&gpio>;
++		interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
++		gpio-controller;
++		#gpio-cells = <2>;
++		interrupt-controller;
++		#interrupt-cells = <2>;
++	};
++
++	expender0_alias_0: pcf8574@20 {
++		compatible = "nxp,pcf8574";
++		reg = <0x20>;
++		interrupt-parent = <&gpio>;
++		interrupts = <15 IRQ_TYPE_EDGE_FALLING>;
++		gpio-controller;
++		#gpio-cells = <2>;
++		interrupt-controller;
++		#interrupt-cells = <2>;
++	};
++
++	rtc0: pcf8563@51 {
++		compatible = "nxp,pcf8563";
++		reg = <0x51>;
++	};
++
++	cpu_sensor: lm75@4f {
++		compatible = "national,lm75";
++		reg = <0x4f>;
++		#thermal-sensor-cells = <0>;
++	};
++};
++
++&factory {
++	compatible = "nvmem-cells";
++	#address-cells = <1>;
++	#size-cells = <1>;
++	#mtd-mac-address = <&factory 0x0>;
++
++	macaddr_factory_0: macaddr@0 {
++		reg = <0x0 0x6>;
++	};
++};
+diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
+index d456176a0178e..0f81321a52248 100644
+--- a/target/linux/ramips/image/mt7621.mk
++++ b/target/linux/ramips/image/mt7621.mk
+@@ -42,6 +42,20 @@ define Build/haier-sim_wr1800k-factory
+   rm -rf "[email protected]" "[email protected]"
+ endef
+ 
++define Build/hatlab-gateboard-combined
++  rm -fR [email protected]
++
++	mkfs.fat [email protected] -C 16384
++	mcopy -i [email protected] $(IMAGE_KERNEL) ::vmlinux.itb
++
++	PADDING="1" SIGNATURE="$(IMG_PART_SIGNATURE)" \
++	GUID="$(IMG_PART_DISKGUID)" $(SCRIPT_DIR)/gen_image_generic.sh \
++	$@ \
++	$(CONFIG_TARGET_KERNEL_PARTSIZE) [email protected] \
++	$(CONFIG_TARGET_ROOTFS_PARTSIZE) $(IMAGE_ROOTFS) \
++	256
++endef
++
+ define Build/iodata-mstc-header
+ 	( \
+ 		data_size_crc="$$(dd if=$@ ibs=64 skip=1 2>/dev/null | gzip -c | \
+@@ -1123,6 +1137,28 @@ define Device/haier_har-20s2u1
+ endef
+ TARGET_DEVICES += haier_har-20s2u1
+ 
++define Device/hatlab_gateboard-one
++  $(Device/dsa-migration)
++  DEVICE_VENDOR := HATLab
++  DEVICE_MODEL := GateBoard-One
++  DEVICE_PACKAGES := kmod-i2c-gpio kmod-gpio-pcf857x kmod-sdhci-mt7620 kmod-usb3 kmod-usb-storage kmod-usb-ledtrig-usbport kmod-fs-ext4 kmod-hwmon-lm75 kmod-thermal kmod-hwmon-gpiofan kmod-rtc-pcf8563 kmod-phy-realtek kmod-sfp
++  MKUBIFS_OPTS := -m 2048 -e 124KiB -c 1024
++  KERNEL := kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
++  IMAGE/kernel.itb := append-kernel
++  IMAGE/rootfs.img := append-rootfs
++  IMAGE/rootfs.img.gz := append-rootfs | gzip
++  IMAGE/combined.img := hatlab-gateboard-combined | append-metadata
++  IMAGE/combined.img.gz := hatlab-gateboard-combined | gzip | append-metadata
++  IMAGE/sysupgrade.bin := sysupgrade-tar | append-metadata
++  IMAGES := kernel.itb sysupgrade.bin
++  ifeq ($(CONFIG_TARGET_IMAGES_GZIP),y)
++    IMAGES += rootfs.img.gz combined.img.gz
++  else
++    IMAGES += rootfs.img combined.img
++  endif
++endef
++TARGET_DEVICES += hatlab_gateboard-one
++
+ define Device/hilink_hlk-7621a-evb
+   $(Device/dsa-migration)
+   $(Device/uimage-lzma-loader)
+diff --git a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+index 4b23afc1cf291..dca281172348f 100644
+--- a/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
++++ b/target/linux/ramips/mt7621/base-files/etc/board.d/02_network
+@@ -150,6 +150,9 @@ ramips_setup_interfaces()
+ 	meig,slt866)
+ 		ucidef_set_interfaces_lan_wan "lan" "wan"
+ 		;;
++	hatlab,gateboard-one)
++		ucidef_set_interfaces_lan_wan "eth0 eth1 eth2 eth3 eth4" "eth5"
++		;;
+ 	*)
+ 		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
+ 		;;
+diff --git a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+index 5d8305b788cce..b38fe16145ad9 100755
+--- a/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
++++ b/target/linux/ramips/mt7621/base-files/lib/upgrade/platform.sh
+@@ -160,6 +160,12 @@ platform_do_upgrade() {
+ 		;;
+ 	zyxel,wsm20)
+ 		zyxel_mstc_upgrade_prepare
++		nand_do_upgrade "$1"
++		;;
++	hatlab,gateboard-one)
++		CI_KERNPART="vmlinux.itb"
++		CI_UBIPART="nand0-ubi"
++
+ 		nand_do_upgrade "$1"
+ 		;;
+ 	*)
+diff --git a/target/linux/ramips/mt7621/base-files/sbin/fixup-mac-address b/target/linux/ramips/mt7621/base-files/sbin/fixup-mac-address
+index dad15c584216d..375db51647b70 100755
+--- a/target/linux/ramips/mt7621/base-files/sbin/fixup-mac-address
++++ b/target/linux/ramips/mt7621/base-files/sbin/fixup-mac-address
+@@ -13,6 +13,10 @@ case $board in
+ 		partname=factory
+ 		offset=$((0xe000))
+ 	;;
++	hatlab,gateboard-one)
++		partname=factory
++		offset=$((0x0))
++	;;
+ 	*)
+ 		echo "Unsupported board"
+ 		exit 1
+diff --git a/target/linux/ramips/mt7621/config-5.15 b/target/linux/ramips/mt7621/config-5.15
+index 05e4c1ce87799..b93159ed079ef 100644
+--- a/target/linux/ramips/mt7621/config-5.15
++++ b/target/linux/ramips/mt7621/config-5.15
+@@ -156,6 +156,7 @@ CONFIG_MTD_PHYSMAP=y
+ CONFIG_MTD_RAW_NAND=y
+ CONFIG_MTD_ROUTERBOOT_PARTS=y
+ CONFIG_MTD_SERCOMM_PARTS=y
++CONFIG_MTD_SPI_NAND=y
+ CONFIG_MTD_SPI_NOR=y
+ CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE=y
+ CONFIG_MTD_SPLIT_FIT_FW=y
+diff --git a/target/linux/ramips/patches-5.15/406-mtd-spi-nor-Add-support-for-Puya-p25d40h.patch b/target/linux/ramips/patches-5.15/406-mtd-spi-nor-Add-support-for-Puya-p25d40h.patch
+new file mode 100644
+index 0000000000000..88ae591fca963
+--- /dev/null
++++ b/target/linux/ramips/patches-5.15/406-mtd-spi-nor-Add-support-for-Puya-p25d40h.patch
+@@ -0,0 +1,47 @@
++--- a/drivers/mtd/spi-nor/Makefile
+++++ b/drivers/mtd/spi-nor/Makefile
++@@ -12,6 +12,7 @@ spi-nor-objs			+= intel.o
++ spi-nor-objs			+= issi.o
++ spi-nor-objs			+= macronix.o
++ spi-nor-objs			+= micron-st.o
+++spi-nor-objs			+= puya.o
++ spi-nor-objs			+= spansion.o
++ spi-nor-objs			+= sst.o
++ spi-nor-objs			+= winbond.o
++--- /dev/null
+++++ b/drivers/mtd/spi-nor/puya.c
++@@ -0,0 +1,14 @@
+++#include <linux/mtd/spi-nor.h>
+++
+++#include "core.h"
+++
+++static const struct flash_info puya_parts[] = {
+++	/* PUYA */
+++	{ "p25d40h", INFO(0x856013, 0, 64 * 1024,  8,  SECT_4K) },
+++};
+++
+++const struct spi_nor_manufacturer spi_nor_puya = {
+++	.name = "puya",
+++	.parts = puya_parts,
+++	.nparts = ARRAY_SIZE(puya_parts),
+++};
++--- a/drivers/mtd/spi-nor/core.c
+++++ b/drivers/mtd/spi-nor/core.c
++@@ -1852,6 +1852,7 @@ static const struct spi_nor_manufacturer
++ 	&spi_nor_issi,
++ 	&spi_nor_macronix,
++ 	&spi_nor_micron,
+++	&spi_nor_puya,
++ 	&spi_nor_st,
++ 	&spi_nor_spansion,
++ 	&spi_nor_sst,
++--- a/drivers/mtd/spi-nor/core.h
+++++ b/drivers/mtd/spi-nor/core.h
++@@ -483,6 +483,7 @@ extern const struct spi_nor_manufacturer
++ extern const struct spi_nor_manufacturer spi_nor_issi;
++ extern const struct spi_nor_manufacturer spi_nor_macronix;
++ extern const struct spi_nor_manufacturer spi_nor_micron;
+++extern const struct spi_nor_manufacturer spi_nor_puya;
++ extern const struct spi_nor_manufacturer spi_nor_st;
++ extern const struct spi_nor_manufacturer spi_nor_spansion;
++ extern const struct spi_nor_manufacturer spi_nor_sst;

+ 13 - 0
devices/rockchip_armv8/.config

@@ -4,6 +4,19 @@ CONFIG_TARGET_rockchip_armv8=y
 CONFIG_TARGET_MULTI_PROFILE=y
 CONFIG_TARGET_ALL_PROFILES=y
 
+CONFIG_TARGET_KERNEL_PARTSIZE=32
+
+# daed
+CONFIG_DEVEL=y
+CONFIG_BPF_TOOLCHAIN_HOST=y
+# CONFIG_BPF_TOOLCHAIN_NONE is not set
+CONFIG_KERNEL_BPF_EVENTS=y
+CONFIG_KERNEL_CGROUP_BPF=y
+CONFIG_KERNEL_DEBUG_INFO=y
+CONFIG_KERNEL_DEBUG_INFO_BTF=y
+# CONFIG_KERNEL_DEBUG_INFO_REDUCED is not set
+CONFIG_KERNEL_XDP_SOCKETS=y
+
 CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_radxa_rock-pi-4=n
 CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_pine64_rockpro64=n
 

+ 9 - 4
devices/rockchip_armv8/diy.sh

@@ -3,14 +3,17 @@
 shopt -s extglob
 SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
+rm -rf package/devel/kselftests-bpf package/feeds/routing/batman-adv
+
 rm -rf package/boot/uboot-rockchip
-svn export --force https://github.com/coolsnowwolf/lede/trunk/package/boot/uboot-rockchip package/boot/uboot-rockchip
-svn export --force https://github.com/coolsnowwolf/lede/trunk/package/boot/arm-trusted-firmware-rockchip-vendor package/boot/arm-trusted-firmware-rockchip-vendor
+
+git_clone_path master https://github.com/coolsnowwolf/lede package/boot/uboot-rockchip
+git_clone_path master https://github.com/coolsnowwolf/lede package/boot/arm-trusted-firmware-rockchip-vendor
 
 rm -rf target/linux/generic target/linux/rockchip/!(Makefile)
 
-svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/generic target/linux/generic
-svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/rockchip target/linux/rockchip
+git_clone_path master https://github.com/coolsnowwolf/lede target/linux/generic
+git_clone_path master https://github.com/coolsnowwolf/lede target/linux/rockchip
 
 curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/include/kernel-5.15 -o include/kernel-5.15
 
@@ -28,6 +31,8 @@ sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += fdisk lsblk kmod-drm-rockchip/
 
 sed -i 's/Ariaboard/光影猫/' target/linux/rockchip/image/armv8.mk
 
+cp -Rf $SHELL_FOLDER/diy/* ./
+
 echo '
 CONFIG_SENSORS_PWM_FAN=y
 ' >> ./target/linux/rockchip/armv8/config-5.15

+ 24 - 0
devices/rockchip_armv8/diy/package/boot/uboot-rockchip/patches/318-rockchip-rk3568-Add-saradc-data.patch

@@ -0,0 +1,24 @@
+--- a/drivers/adc/rockchip-saradc.c
++++ b/drivers/adc/rockchip-saradc.c
+@@ -184,6 +184,12 @@ static const struct rockchip_saradc_data
+ 	.clk_rate = 1000000,
+ };
+ 
++static const struct rockchip_saradc_data rk3568_saradc_data = {
++	.num_bits = 10,
++	.num_channels = 8,
++	.clk_rate = 1000000,
++};
++
+ static const struct udevice_id rockchip_saradc_ids[] = {
+ 	{ .compatible = "rockchip,saradc",
+ 	  .data = (ulong)&saradc_data },
+@@ -191,6 +197,8 @@ static const struct udevice_id rockchip_
+ 	  .data = (ulong)&rk3066_tsadc_data },
+ 	{ .compatible = "rockchip,rk3399-saradc",
+ 	  .data = (ulong)&rk3399_saradc_data },
++	{ .compatible = "rockchip,rk3568-saradc",
++	  .data = (ulong)&rk3568_saradc_data },
+ 	{ }
+ };
+ 

+ 27 - 0
devices/rockchip_armv8/diy/package/boot/uboot-rockchip/patches/319-rockchip-rk3568-Fix-download-key-adc-channel.patch

@@ -0,0 +1,27 @@
+--- a/arch/arm/mach-rockchip/boot_mode.c
++++ b/arch/arm/mach-rockchip/boot_mode.c
+@@ -43,6 +43,9 @@
+ 	struct udevice *dev;
+ 	struct uclass *uc;
+ 	int ret;
++	const void *blob = gd->fdt_blob;
++	int node, channel = 1;
++	unsigned int chns[2];
+ 
+ 	ret = uclass_get(UCLASS_ADC, &uc);
+ 	if (ret)
+@@ -51,7 +54,13 @@
+ 	ret = -ENODEV;
+ 	uclass_foreach_dev(dev, uc) {
+ 		if (!strncmp(dev->name, "saradc", 6)) {
+-			ret = adc_channel_single_shot(dev->name, 1, &val);
++			node = fdt_node_offset_by_compatible(blob, 0, "adc-keys");
++			if (node >= 0) {
++				if (!fdtdec_get_int_array(blob, node, "io-channels", chns, 2))
++					channel = chns[1];
++			}
++
++			ret = adc_channel_single_shot(dev->name, channel, &val);
+ 			break;
+ 		}
+ 	}

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

@@ -0,0 +1,593 @@
+--- a/arch/arm/dts/Makefile
++++ b/arch/arm/dts/Makefile
+@@ -180,6 +180,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3568) += \
+	rk3568-opc-h68k.dtb \
+	rk3568-mrkaio-m68s.dtb \
+	rk3568-nanopi-r5s.dtb \
++	rk3568-nlnet-xgp.dtb \
+	rk3568-photonicat.dtb \
+	rk3566-radxa-cm3-io.dtb \
+	rk3568-rock-3a.dtb \
+--- /dev/null
++++ b/arch/arm/dts/rk3568-nlnet-xgp-u-boot.dtsi
+@@ -0,0 +1,16 @@
++// 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;
++	};
++};
++
++&uart2 {
++	clock-frequency = <24000000>;
++	bootph-pre-ram;
++	status = "okay";
++};
+--- /dev/null
++++ b/arch/arm/dts/rk3568-nlnet-xgp.dts
+@@ -0,0 +1,474 @@
++// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
++
++/dts-v1/;
++#include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/leds/common.h>
++#include <dt-bindings/pinctrl/rockchip.h>
++#include <dt-bindings/input/linux-event-codes.h>
++#include "rk3568.dtsi"
++
++/ {
++	model = "NLnet XiGuaPi Board";
++	compatible = "nlnet,xgp", "rockchip,rk3568";
++
++	aliases {
++		mmc0 = &sdmmc0;
++		mmc1 = &sdhci;
++	};
++
++	chosen: 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";
++			linux,default-trigger = "heartbeat";
++		};
++	};
++
++	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_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>;
++	};
++
++	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>;
++	};
++};
++
++&combphy0 {
++	status = "okay";
++};
++
++&combphy1 {
++	status = "okay";
++};
++
++&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 = <&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";
++		pinctrl-0 = <&pmic_int>;
++		rockchip,system-power-controller;
++		wakeup-source;
++		#clock-cells = <1>;
++		clock-output-names = "rk808-clkout1", "rk808-clkout2";
++
++		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>;
++
++		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;
++				};
++			};
++		};
++	};
++};
++
++&pinctrl {
++	leds {
++		sys_led_pin: sys-led-pin {
++			rockchip,pins = <0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
++		};
++	};
++
++	pmic {
++		pmic_int: pmic_int {
++			rockchip,pins = <0 RK_PA3 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>;
++		};
++	};
++};
++
++&pmu_io_domains {
++	pmuio1-supply = <&vcc3v3_pmu>;
++	pmuio2-supply = <&vcc3v3_pmu>;
++	vccio1-supply = <&vccio_acodec>;
++	vccio3-supply = <&vccio_sd>;
++	vccio4-supply = <&vcca1v8_pmu>;
++	vccio5-supply = <&vcc_3v3>;
++	vccio6-supply = <&vcca1v8_image_p>;
++	vccio7-supply = <&vcc_3v3>;
++	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";
++};
++
++&tsadc {
++	rockchip,hw-tshut-mode = <1>;
++	rockchip,hw-tshut-polarity = <0>;
++	status = "okay";
++};
++
++&uart2 {
++	status = "okay";
++};
++
++&usb_host0_ehci {
++	status = "okay";
++};
++
++&usb_host0_ohci {
++	status = "okay";
++};
++
++&usb_host0_xhci {
++	extcon = <&usb2phy0>;
++	status = "okay";
++};
++
++&usb_host1_ehci {
++	status = "okay";
++};
++
++&usb_host1_ohci {
++	status = "okay";
++};
++
++&usb_host1_xhci {
++	status = "okay";
++};
++
++&usb2phy0 {
++	status = "okay";
++};
++
++&usb2phy0_host {
++	status = "okay";
++};
++
++&usb2phy0_otg {
++	phy-supply = <&vcc5v0_usb_otg0>;
++	status = "okay";
++};
++
++&usb2phy1 {
++	status = "okay";
++};
++
++&usb2phy1_host {
++	status = "okay";
++};
++
++&usb2phy1_otg {
++	status = "okay";
++};
+--- /dev/null
++++ b/configs/nlnet-xgp-rk3568_defconfig
+@@ -0,0 +1,84 @@
++CONFIG_ARM=y
++CONFIG_SKIP_LOWLEVEL_INIT=y
++CONFIG_COUNTER_FREQUENCY=24000000
++CONFIG_ARCH_ROCKCHIP=y
++CONFIG_TEXT_BASE=0x00a00000
++CONFIG_SPL_LIBCOMMON_SUPPORT=y
++CONFIG_SPL_LIBGENERIC_SUPPORT=y
++CONFIG_NR_DRAM_BANKS=2
++CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
++CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0xc00000
++CONFIG_DEFAULT_DEVICE_TREE="rk3568-nlnet-xgp"
++CONFIG_ROCKCHIP_RK3568=y
++CONFIG_SPL_ROCKCHIP_COMMON_BOARD=y
++CONFIG_SPL_SERIAL=y
++CONFIG_SPL_STACK_R_ADDR=0x600000
++CONFIG_SPL_STACK=0x400000
++CONFIG_DEBUG_UART_BASE=0xFE660000
++CONFIG_DEBUG_UART_CLOCK=24000000
++CONFIG_SYS_LOAD_ADDR=0xc00800
++CONFIG_DEBUG_UART=y
++CONFIG_FIT=y
++CONFIG_FIT_VERBOSE=y
++CONFIG_SPL_LOAD_FIT=y
++CONFIG_LEGACY_IMAGE_FORMAT=y
++CONFIG_DEFAULT_FDT_FILE="rockchip/rk3568-nlnet-xgp.dtb"
++# CONFIG_DISPLAY_CPUINFO is not set
++CONFIG_DISPLAY_BOARDINFO_LATE=y
++CONFIG_SPL_MAX_SIZE=0x40000
++CONFIG_SPL_PAD_TO=0x7f8000
++CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
++CONFIG_SPL_BSS_START_ADDR=0x4000000
++CONFIG_SPL_BSS_MAX_SIZE=0x4000
++# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
++# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
++CONFIG_SPL_STACK_R=y
++CONFIG_SPL_ATF=y
++CONFIG_CMD_ADC=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_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
++CONFIG_SPL_REGMAP=y
++CONFIG_SPL_SYSCON=y
++CONFIG_SPL_CLK=y
++CONFIG_ROCKCHIP_GPIO=y
++CONFIG_SYS_I2C_ROCKCHIP=y
++CONFIG_MISC=y
++CONFIG_SUPPORT_EMMC_RPMB=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_ETH_DESIGNWARE=y
++CONFIG_GMAC_ROCKCHIP=y
++CONFIG_PHY_ROCKCHIP_INNO_USB2=y
++CONFIG_PHY_ROCKCHIP_NANENG_COMBOPHY=y
++CONFIG_SPL_PINCTRL=y
++CONFIG_DM_PMIC=y
++CONFIG_PMIC_RK8XX=y
++CONFIG_REGULATOR_RK8XX=y
++CONFIG_PWM_ROCKCHIP=y
++CONFIG_SPL_RAM=y
++CONFIG_BAUDRATE=1500000
++CONFIG_DEBUG_UART_SHIFT=2
++CONFIG_SYS_NS16550_MEM32=y
++CONFIG_SYSRESET=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_ERRNO_STR=y

+ 3 - 0
devices/rockchip_armv8/diy/package/boot/uboot-rockchip/src/arch/arm/dts/rk3328-nanopi-r2c-plus-u-boot.dtsi

@@ -0,0 +1,3 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "rk3328-nanopi-r2c-u-boot.dtsi"

+ 33 - 0
devices/rockchip_armv8/diy/package/boot/uboot-rockchip/src/arch/arm/dts/rk3328-nanopi-r2c-plus.dts

@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
+/*
+ * Copyright (c) 2021 FriendlyElec Computer Tech. Co., Ltd.
+ * (http://www.friendlyarm.com)
+ *
+ * Copyright (c) 2023 Tianling Shen <[email protected]>
+ */
+
+/dts-v1/;
+#include "rk3328-nanopi-r2c.dts"
+
+/ {
+	model = "FriendlyElec NanoPi R2C Plus";
+	compatible = "friendlyarm,nanopi-r2c-plus", "rockchip,rk3328";
+
+	aliases {
+		mmc1 = &emmc;
+	};
+};
+
+&emmc {
+	bus-width = <8>;
+	cap-mmc-highspeed;
+	max-frequency = <150000000>;
+	mmc-ddr-1_8v;
+	mmc-hs200-1_8v;
+	non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
+	vmmc-supply = <&vcc_io_33>;
+	vqmmc-supply = <&vcc18_emmc>;
+	status = "okay";
+};

+ 114 - 0
devices/rockchip_armv8/diy/package/boot/uboot-rockchip/src/configs/nanopi-r2c-plus-rk3328_defconfig

@@ -0,0 +1,114 @@
+CONFIG_ARM=y
+CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_COUNTER_FREQUENCY=24000000
+CONFIG_ARCH_ROCKCHIP=y
+CONFIG_TEXT_BASE=0x00200000
+CONFIG_SPL_GPIO=y
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
+CONFIG_SF_DEFAULT_SPEED=20000000
+CONFIG_ENV_OFFSET=0x3F8000
+CONFIG_DEFAULT_DEVICE_TREE="rk3328-nanopi-r2c-plus"
+CONFIG_DM_RESET=y
+CONFIG_ROCKCHIP_RK3328=y
+CONFIG_TPL_ROCKCHIP_COMMON_BOARD=y
+CONFIG_TPL_LIBCOMMON_SUPPORT=y
+CONFIG_TPL_LIBGENERIC_SUPPORT=y
+CONFIG_SPL_DRIVERS_MISC=y
+CONFIG_SPL_STACK_R_ADDR=0x600000
+CONFIG_SPL_STACK=0x400000
+CONFIG_TPL_SYS_MALLOC_F_LEN=0x800
+CONFIG_DEBUG_UART_BASE=0xFF130000
+CONFIG_DEBUG_UART_CLOCK=24000000
+CONFIG_SYS_LOAD_ADDR=0x800800
+CONFIG_DEBUG_UART=y
+# CONFIG_ANDROID_BOOT_IMAGE is not set
+CONFIG_FIT=y
+CONFIG_FIT_VERBOSE=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-nanopi-r2c-plus.dtb"
+# CONFIG_DISPLAY_CPUINFO is not set
+CONFIG_DISPLAY_BOARDINFO_LATE=y
+CONFIG_MISC_INIT_R=y
+CONFIG_SPL_MAX_SIZE=0x40000
+CONFIG_SPL_PAD_TO=0x7f8000
+CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
+CONFIG_SPL_BSS_START_ADDR=0x2000000
+CONFIG_SPL_BSS_MAX_SIZE=0x2000
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
+CONFIG_SPL_STACK_R=y
+CONFIG_SPL_I2C=y
+CONFIG_SPL_POWER=y
+CONFIG_SPL_ATF=y
+CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
+CONFIG_TPL_SYS_MALLOC_SIMPLE=y
+CONFIG_CMD_BOOTZ=y
+CONFIG_CMD_GPT=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_USB=y
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_CMD_TIME=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_TPL_OF_CONTROL=y
+CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
+CONFIG_TPL_OF_PLATDATA=y
+CONFIG_ENV_IS_IN_MMC=y
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_SYS_MMC_ENV_DEV=1
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_TPL_DM=y
+CONFIG_REGMAP=y
+CONFIG_SPL_REGMAP=y
+CONFIG_TPL_REGMAP=y
+CONFIG_SYSCON=y
+CONFIG_SPL_SYSCON=y
+CONFIG_TPL_SYSCON=y
+CONFIG_CLK=y
+CONFIG_SPL_CLK=y
+CONFIG_FASTBOOT_BUF_ADDR=0x800800
+CONFIG_FASTBOOT_CMD_OEM_FORMAT=y
+CONFIG_ROCKCHIP_GPIO=y
+CONFIG_SYS_I2C_ROCKCHIP=y
+CONFIG_MISC=y
+CONFIG_MMC_DW=y
+CONFIG_MMC_DW_ROCKCHIP=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_GMAC_ROCKCHIP=y
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+CONFIG_PINCTRL=y
+CONFIG_SPL_PINCTRL=y
+CONFIG_DM_PMIC=y
+CONFIG_PMIC_RK8XX=y
+CONFIG_SPL_PMIC_RK8XX=y
+CONFIG_SPL_DM_REGULATOR=y
+CONFIG_REGULATOR_PWM=y
+CONFIG_DM_REGULATOR_FIXED=y
+CONFIG_SPL_DM_REGULATOR_FIXED=y
+CONFIG_REGULATOR_RK8XX=y
+CONFIG_PWM_ROCKCHIP=y
+CONFIG_RAM=y
+CONFIG_SPL_RAM=y
+CONFIG_TPL_RAM=y
+CONFIG_BAUDRATE=1500000
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_SYS_NS16550_MEM32=y
+CONFIG_SYSINFO=y
+CONFIG_SYSRESET=y
+# CONFIG_TPL_SYSRESET is not set
+CONFIG_USB=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_EHCI_HCD=y
+CONFIG_USB_EHCI_GENERIC=y
+CONFIG_USB_OHCI_HCD=y
+CONFIG_USB_OHCI_GENERIC=y
+CONFIG_USB_DWC2=y
+CONFIG_USB_DWC3=y
+# CONFIG_USB_DWC3_GADGET is not set
+CONFIG_USB_DWC3_GENERIC=y
+CONFIG_USB_GADGET=y
+CONFIG_USB_GADGET_DWC2_OTG=y
+CONFIG_SPL_TINY_MEMSET=y
+CONFIG_TPL_TINY_MEMSET=y
+CONFIG_ERRNO_STR=y

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

@@ -0,0 +1,655 @@
+// 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";
+			linux,default-trigger = "heartbeat";
+		};
+	};
+
+	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;
+		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;
+		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";
+
+	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";
+		pinctrl-0 = <&pmic_int>;
+		wakeup-source;
+		#clock-cells = <1>;
+
+		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>;
+
+		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;
+				};
+			};
+
+			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;
+				};
+			};
+
+			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;
+				};
+			};
+
+			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>;
+		};
+	};
+
+	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>;
+		};
+	};
+
+	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 {
+	pmuio1-supply = <&vcc3v3_pmu>;
+	pmuio2-supply = <&vcc3v3_pmu>;
+	vccio1-supply = <&vccio_acodec>;
+	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 {
+	status = "okay";
+};
+
+&usb_host1_xhci {
+	status = "okay";
+};
+
+&usb2phy1_otg {
+	status = "okay";
+};
+
+&usb_host0_ehci {
+	status = "okay";
+};
+
+&usb_host0_ohci {
+	status = "okay";
+};
+
+&usb2phy1_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";
+};

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

@@ -0,0 +1,248 @@
+// 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";
+};
+
+&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>;
+		};
+	};
+};

+ 64 - 0
devices/rockchip_armv8/diy/target/linux/rockchip/patches-5.15/206-arm64-dts-rockchip-Add-FriendlyARM-NanoPi-R2C-Plus.patch

@@ -0,0 +1,64 @@
+From d211665c5a833873ee37e501af58adbf028e6b5f Mon Sep 17 00:00:00 2001
+From: Tianling Shen <[email protected]>
+Date: Sat, 13 May 2023 21:53:07 +0800
+Subject: [PATCH] arm64: dts: rockchip: Add FriendlyARM NanoPi R2C Plus
+
+The NanoPi R2C Plus is a small variant of NanoPi R2C with a on-board
+eMMC flash (8G) included.
+
+Signed-off-by: Tianling Shen <[email protected]>
+Link: https://lore.kernel.org/r/[email protected]
+Signed-off-by: Heiko Stuebner <[email protected]>
+---
+ arch/arm64/boot/dts/rockchip/Makefile              |  1 +
+ .../boot/dts/rockchip/rk3328-nanopi-r2c-plus.dts   | 33 ++++++++++++++++++++++
+ 2 files changed, 34 insertions(+)
+ create mode 100644 arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2c-plus.dts
+
+--- a/arch/arm64/boot/dts/rockchip/Makefile
++++ b/arch/arm64/boot/dts/rockchip/Makefile
+@@ -10,6 +10,7 @@
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-a1.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-evb.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2c.dtb
++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2c-plus.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-r2s.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-nanopi-neo3.dtb
+ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3328-orangepi-r1-plus.dtb
+
+--- /dev/null
++++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2c-plus.dts
+@@ -0,0 +1,33 @@
++// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
++/*
++ * Copyright (c) 2021 FriendlyElec Computer Tech. Co., Ltd.
++ * (http://www.friendlyarm.com)
++ *
++ * Copyright (c) 2023 Tianling Shen <[email protected]>
++ */
++
++/dts-v1/;
++#include "rk3328-nanopi-r2c.dts"
++
++/ {
++	model = "FriendlyElec NanoPi R2C Plus";
++	compatible = "friendlyarm,nanopi-r2c-plus", "rockchip,rk3328";
++
++	aliases {
++		mmc1 = &emmc;
++	};
++};
++
++&emmc {
++	bus-width = <8>;
++	cap-mmc-highspeed;
++	max-frequency = <150000000>;
++	mmc-ddr-1_8v;
++	mmc-hs200-1_8v;
++	non-removable;
++	pinctrl-names = "default";
++	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
++	vmmc-supply = <&vcc_io_33>;
++	vqmmc-supply = <&vcc18_emmc>;
++	status = "okay";
++};

+ 109 - 0
devices/rockchip_armv8/diy/target/linux/rockchip/patches-5.15/805-arm64-dts-rockchip-add-rk3328-ddr-relate-node.patch

@@ -0,0 +1,109 @@
+From 2d2a4b860ef60b4d10754d2e690d6fc170571a83 Mon Sep 17 00:00:00 2001
+From: Hecanyang <[email protected]>
+Date: Sat, 23 Dec 2017 15:40:21 +0800
+Subject: [PATCH] arm64: dts: rockchip: add rk3328 ddr relate node
+
+except add note to existing dts file, also add ddr timing and de-skew's
+dts file.
+
+Change-Id: I92b7e9c2c6572babd4be00beadbbb75aae431707
+Signed-off-by: CanYang He <[email protected]>
+Signed-off-by: hmz007 <[email protected]>
+---
+ .../rockchip/rk3328-dram-2layer-timing.dtsi   | 257 +++++++++++++++
+ .../rockchip/rk3328-dram-default-timing.dtsi  | 311 ++++++++++++++++++
+ .../boot/dts/rockchip/rk3328-evb-android.dts  |   9 +
+ arch/arm64/boot/dts/rockchip/rk3328.dtsi      |  67 ++++
+ 4 files changed, 644 insertions(+)
+ create mode 100644 arch/arm64/boot/dts/rockchip/rk3328-dram-2layer-timing.dtsi
+ create mode 100644 arch/arm64/boot/dts/rockchip/rk3328-dram-default-timing.dtsi
+
+--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
++++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
+@@ -11,6 +11,7 @@
+ #include <dt-bindings/power/rk3328-power.h>
+ #include <dt-bindings/soc/rockchip,boot-mode.h>
+ #include <dt-bindings/thermal/thermal.h>
++#include "rk3328-dram-default-timing.dtsi"
+ 
+ / {
+ 	compatible = "rockchip,rk3328";
+@@ -1010,6 +1011,78 @@
+ 		status = "disabled";
+ 	};
+ 
++	dfi: dfi@ff790000 {
++		reg = <0x00 0xff790000 0x00 0x400>;
++		compatible = "rockchip,rk3328-dfi";
++		rockchip,grf = <&grf>;
++		status = "okay";
++	};
++
++	dmc: dmc {
++		compatible = "rockchip,rk3328-dmc";
++		devfreq-events = <&dfi>;
++		clocks = <&cru SCLK_DDRCLK>;
++		clock-names = "dmc_clk";
++		operating-points-v2 = <&dmc_opp_table>;
++		ddr_timing = <&ddr_timing>;
++		upthreshold = <40>;
++		downdifferential = <20>;
++		auto-min-freq = <786000>;
++		auto-freq-en = <0>;
++		#cooling-cells = <2>;
++		status = "disabled";
++
++		ddr_power_model: ddr_power_model {
++			compatible = "ddr_power_model";
++			dynamic-power-coefficient = <120>;
++			static-power-coefficient = <200>;
++			ts = <32000 4700 (-80) 2>;
++			thermal-zone = "soc-thermal";
++		};
++	};
++
++	dmc_opp_table: dmc-opp-table {
++		compatible = "operating-points-v2";
++
++		rockchip,leakage-voltage-sel = <
++			1   10    0
++			11  254   1
++		>;
++		nvmem-cells = <&logic_leakage>;
++		nvmem-cell-names = "ddr_leakage";
++
++		opp-786000000 {
++			opp-hz = /bits/ 64 <786000000>;
++			opp-microvolt = <1075000>;
++			opp-microvolt-L0 = <1075000>;
++			opp-microvolt-L1 = <1050000>;
++		};
++		opp-798000000 {
++			opp-hz = /bits/ 64 <798000000>;
++			opp-microvolt = <1075000>;
++			opp-microvolt-L0 = <1075000>;
++			opp-microvolt-L1 = <1050000>;
++		};
++		opp-840000000 {
++			opp-hz = /bits/ 64 <840000000>;
++			opp-microvolt = <1075000>;
++			opp-microvolt-L0 = <1075000>;
++			opp-microvolt-L1 = <1050000>;
++		};
++		opp-924000000 {
++			opp-hz = /bits/ 64 <924000000>;
++			opp-microvolt = <1100000>;
++			opp-microvolt-L0 = <1100000>;
++			opp-microvolt-L1 = <1075000>;
++		};
++		opp-1056000000 {
++			opp-hz = /bits/ 64 <1056000000>;
++			opp-microvolt = <1175000>;
++			opp-microvolt-L0 = <1175000>;
++			opp-microvolt-L1 = <1150000>;
++		};
++	};
++
+ 	gic: interrupt-controller@ff811000 {
+ 		compatible = "arm,gic-400";
+ 		#interrupt-cells = <3>;

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

@@ -0,0 +1,175 @@
+diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile
+index bc3297efa9d4e..4875f01b43617 100644
+--- a/package/boot/uboot-rockchip/Makefile
++++ b/package/boot/uboot-rockchip/Makefile
+@@ -196,6 +196,17 @@ define U-Boot/opc-h68k-rk3568
+   DDR:=rk3568_ddr_1560MHz_v1.13.bin
+ endef
+ 
++define U-Boot/nlnet-xgp-rk3568
++  BUILD_SUBTARGET:=armv8
++  NAME:=NLnet XGP Board
++  BUILD_DEVICES:= \
++    nlnet_xgp
++  DEPENDS:=+PACKAGE_u-boot-nlnet-xgp-rk3568:arm-trusted-firmware-rk3568
++  PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip-vendor
++  ATF:=rk3568_bl31_v1.43.elf
++  DDR:=rk3568_ddr_1560MHz_v1.18.bin
++endef
++
+ define U-Boot/photonicat-rk3568
+   BUILD_SUBTARGET:=armv8
+   NAME:=Ariaboard Photonicat
+@@ -255,6 +266,7 @@ endef
+ UBOOT_TARGETS := \
+   mrkaio-m68s-rk3568 \
+   opc-h68k-rk3568 \
++  nlnet-xgp-rk3568 \
+   photonicat-rk3568 \
+   radxa-e25-rk3568 \
+   rock-3a-rk3568 \
+diff --git a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
+index 8fed56a0027b9..95410bca3a518 100755
+--- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
++++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
+@@ -17,6 +17,7 @@
+ 	friendlyarm,nanopi-r2s|\
+ 	friendlyarm,nanopi-r4s|\
+ 	friendlyarm,nanopi-r4se|\
++	nlnet,xgp|\
+ 	rocktech,mpc1903|\
+ 	sharevdi,h3399pc|\
+ 	sharevdi,guangmiao-g4c|\
+@@ -88,6 +89,7 @@
+ 	hinlink,opc-h66k|\
+ 	hinlink,opc-h68k|\
+ 	hinlink,opc-h69k|\
++	nlnet,xgp|\
+ 	rocktech,mpc1903|\
+ 	sharevdi,h3399pc)
+ 		wan_mac=$(macaddr_generate_from_mmc_cid mmcblk0)
+diff --git a/target/linux/rockchip/image/armv8.mk b/target/linux/rockchip/image/armv8.mk
+index 88f40f98f45db..c8fe96f74d37e 100644
+--- a/target/linux/rockchip/image/armv8.mk
++++ b/target/linux/rockchip/image/armv8.mk
+@@ -81,6 +80,17 @@ $(call Device/fastrhino_common)
+ endef
+ TARGET_DEVICES += fastrhino_r68s
+ 
++define Device/nlnet_xgp
++  DEVICE_VENDOR := NLnet
++  DEVICE_MODEL := XiGuaPi
++  SOC := rk3568
++  UBOOT_DEVICE_NAME := nlnet-xgp-rk3568
++  IMAGE/sysupgrade.img.gz := boot-combined | boot-script nlnet-xgp | pine64-img | gzip | append-metadata
++  DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-mt7921e wpad-openssl
++  DEVICE_DTS = rockchip/rk3568-xgp rockchip/rk3568-xgp-v3
++endef
++TARGET_DEVICES += nlnet_xgp
++
+ define Device/friendlyarm_nanopi-neo3
+   DEVICE_VENDOR := FriendlyARM
+   DEVICE_MODEL := NanoPi NEO3
+diff --git a/target/linux/rockchip/patches-5.15/210-rockchip-rk356x-add-support-for-new-boards.patch b/target/linux/rockchip/patches-5.15/210-rockchip-rk356x-add-support-for-new-boards.patch
+index 2f9a26979dc4b..f66423793c78d 100644
+--- a/target/linux/rockchip/patches-5.15/210-rockchip-rk356x-add-support-for-new-boards.patch
++++ b/target/linux/rockchip/patches-5.15/210-rockchip-rk356x-add-support-for-new-boards.patch
+@@ -1,6 +1,6 @@
+ --- a/arch/arm64/boot/dts/rockchip/Makefile
+ +++ b/arch/arm64/boot/dts/rockchip/Makefile
+-@@ -59,3 +59,19 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sa
++@@ -59,3 +59,20 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sa
+  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sapphire-excavator.dtb
+  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399pro-rock-pi-n10.dtb
+  dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3568-evb1-v10.dtb
+@@ -20,3 +20,4 @@
+ +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
+
+--- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
++++ b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
+@@ -36,6 +36,9 @@ hinlink,opc-h68k|\
+ hinlink,opc-h69k)
+ 	ucidef_set_led_netdev "wan" "WAN" "blue:net" "eth0"
+ 	;;
++nlnet,xgp)
++	ucidef_set_led_netdev "wan" "WAN" "blue:sys" "eth0"
++	;;
+ esac
+ 
+ board_config_flush
+diff --git a/target/linux/rockchip/image/Makefile b/target/linux/rockchip/image/Makefile
+index a2b711a4367cb..b2c53fe0f97e4 100644
+--- 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}
+

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

@@ -0,0 +1,69 @@
+--- a/target/linux/rockchip/image/armv8.mk
++++ b/target/linux/rockchip/image/armv8.mk
+@@ -91,6 +91,16 @@
+ endef
+ TARGET_DEVICES += friendlyarm_nanopi-r2c
+ 
++define Device/friendlyarm_nanopi-r2c-plus
++  DEVICE_VENDOR := FriendlyARM
++  DEVICE_MODEL := NanoPi R2C Plus
++  SOC := rk3328
++  UBOOT_DEVICE_NAME := nanopi-r2c-plus-rk3328
++  IMAGE/sysupgrade.img.gz := boot-common | boot-script nanopi-r2s | pine64-bin | gzip | append-metadata
++  DEVICE_PACKAGES := kmod-usb-net-rtl8152
++endef
++TARGET_DEVICES += friendlyarm_nanopi-r2c-plus
++
+ define Device/friendlyarm_nanopi-r2s
+   DEVICE_VENDOR := FriendlyARM
+   DEVICE_MODEL := NanoPi R2S
+
+--- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
++++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
+@@ -14,6 +14,7 @@
+ 	ezpro,mrkaio-m68s-plus|\
+ 	hinlink,opc-h66k|\
+ 	friendlyarm,nanopi-r2c|\
++	friendlyarm,nanopi-r2c-plus|\
+ 	friendlyarm,nanopi-r2s|\
+ 	friendlyarm,nanopi-r4s|\
+ 	friendlyarm,nanopi-r4se|\
+@@ -100,6 +101,7 @@
+ 		wan_mac=$(nanopi_r4s_get_mac wan)
+ 		lan_mac=$(nanopi_r4s_get_mac lan)
+ 		;;
++	friendlyarm,nanopi-r2c-plus|\
+ 	friendlyarm,nanopi-r5c|\
+ 	friendlyarm,nanopi-r5s|\
+ 	sharevdi,guangmiao-g4c|\
+
+--- a/package/boot/uboot-rockchip/Makefile
++++ b/package/boot/uboot-rockchip/Makefile
+@@ -35,6 +35,17 @@
+   USE_RKBIN:=1
+ endef
+ 
++define U-Boot/nanopi-r2c-plus-rk3328
++  BUILD_SUBTARGET:=armv8
++  NAME:=NanoPi R2C Plus
++  BUILD_DEVICES:= \
++    friendlyarm_nanopi-r2c-plus
++  DEPENDS:=+PACKAGE_u-boot-nanopi-r2c-plus-rk3328:arm-trusted-firmware-rk3328
++  PKG_BUILD_DEPENDS:=arm-trusted-firmware-rockchip-vendor
++  ATF:=rk322xh_bl31_v1.49.elf
++  USE_RKBIN:=1
++endef
++
+ define U-Boot/nanopi-r2s-rk3328
+   BUILD_SUBTARGET:=armv8
+   NAME:=NanoPi R2S
+@@ -344,6 +355,7 @@
+   dilusense-dlfr100-rk3399 \
+   xiaobao-nas-v1-rk3399 \
+   nanopi-r2c-rk3328 \
++  nanopi-r2c-plus-rk3328 \
+   nanopi-r2s-rk3328 \
+   orangepi-r1-plus-rk3328 \
+   orangepi-r1-plus-lts-rk3328
+
+

+ 212 - 0
devices/rockchip_armv8/patches/99-more.patch

@@ -0,0 +1,212 @@
+--- a/target/linux/rockchip/image/armv8.mk
++++ b/target/linux/rockchip/image/armv8.mk
+@@ -141,6 +141,52 @@ define Device/friendlyarm_nanopi-r5s
+ endef
+ TARGET_DEVICES += friendlyarm_nanopi-r5s
+ 
++define Device/friendlyarm_nanopi-m4
++  DEVICE_VENDOR := FriendlyARM
++  DEVICE_MODEL := NanoPi M4
++  SOC := rk3328
++  DEVICE_PACKAGES := -luci-app-gpsysupgrade
++  DEVICE_DTS = rockchip/rk3328-nanopi-r2s
++endef
++TARGET_DEVICES += friendlyarm_nanopi-m4
++
++define Device/friendlyarm_nanopi-neo4
++  DEVICE_VENDOR := FriendlyARM
++  DEVICE_MODEL := NanoPi NEO4
++  SOC := rk3328
++  DEVICE_PACKAGES := -luci-app-gpsysupgrade
++  DEVICE_DTS = rockchip/rk3328-nanopi-r2s
++endef
++TARGET_DEVICES += friendlyarm_nanopi-neo4
++
++define Device/friendlyarm_nanopc-t4
++  DEVICE_VENDOR := FriendlyARM
++  DEVICE_MODEL := NanoPC T4
++  SOC := rk3328
++  DEVICE_PACKAGES := -luci-app-gpsysupgrade
++  DEVICE_DTS = rockchip/rk3328-nanopi-r2s
++endef
++TARGET_DEVICES += friendlyarm_nanopc-t4
++
++define Device/friendlyarm_nanopc-t6
++  DEVICE_VENDOR := FriendlyARM
++  DEVICE_MODEL := NanoPC T6
++  SOC := rk3328
++  DEVICE_PACKAGES := -luci-app-gpsysupgrade
++  DEVICE_DTS = rockchip/rk3328-nanopi-r2s
++endef
++TARGET_DEVICES += friendlyarm_nanopc-t6
++
++define Device/friendlyarm_nanopi-r2s-plus
++  DEVICE_VENDOR := FriendlyARM
++  DEVICE_MODEL := NanoPi R2S Plus
++  SOC := rk3328
++  DEVICE_PACKAGES := -luci-app-gpsysupgrade
++  DEVICE_DTS = rockchip/rk3328-nanopi-r2s
++  DEVICE_PACKAGES := kmod-usb-net-rtl8152
++endef
++TARGET_DEVICES += friendlyarm_nanopi-r2s-plus
++
+ define Device/firefly_station-p2
+   DEVICE_VENDOR := Firefly
+   DEVICE_MODEL := Station P2
+
+--- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
++++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
+@@ -23,8 +23,16 @@
+ 	sharevdi,h3399pc|\
+ 	sharevdi,guangmiao-g4c|\
+ 	xunlong,orangepi-r1-plus|\
+-	xunlong,orangepi-r1-plus-lts)
++	xunlong,orangepi-r1-plus-lts|\
++	friendlyarm,orangepi-r2s-plus|\
++	friendlyarm,nanopc-t6)
+ 		ucidef_set_interfaces_lan_wan 'eth1' 'eth0'
++		;;
++	friendlyarm,nanopc-t4 | \
++	friendlyarm,nanopi-m4 | \
++	friendlyarm,nanopi-neo4 | \
++	som-rk3399 | cm3588)
++		ucidef_set_interfaces_lan_wan 'wlan0' 'eth0'
+ 		;;
+ 	fastrhino,r66s|\
+ 	firefly,rk3568-roc-pc|\
+@@ -48,10 +56,10 @@
+ 	esac
+ }
+ 
+-nanopi_r4s_get_mac()
++nanopi_get_mac()
+ {
+ 	local interface=$1
+-	local eeprom_path="/sys/bus/i2c/devices/2-0051/eeprom"
++	local eeprom_path="/sys/bus/i2c/devices/$2/eeprom"
+ 	local address
+ 
+ 	if [ -f "$eeprom_path" ]; then
+@@ -98,8 +106,12 @@
+ 		;;
+ 	friendlyarm,nanopi-r4s|\
+ 	friendlyarm,nanopi-r4se)
+-		wan_mac=$(nanopi_r4s_get_mac wan)
+-		lan_mac=$(nanopi_r4s_get_mac lan)
++		wan_mac=$(nanopi_get_mac wan 2-0051)
++		lan_mac=$(nanopi_get_mac lan 2-0051)
++		;;
++	nanopi-r6s|nanopi-r6c|nanopc-t6)
++		wan_mac=$(nanopi_get_mac wan 6-0053)
++		lan_mac=$(nanopi_get_mac lan 6-0053)
+ 		;;
+ 	friendlyarm,nanopi-r2c-plus|\
+ 	friendlyarm,nanopi-r5c|\
+ 
+-nanopi_r4s_get_mac()
++nanopi_get_mac()
+ {
+ 	local interface=$1
+-	local eeprom_path="/sys/bus/i2c/devices/2-0051/eeprom"
++	local eeprom_path="/sys/bus/i2c/devices/$2/eeprom"
+ 	local address
+ 
+ 	if [ -f "$eeprom_path" ]; then
+@@ -94,8 +99,12 @@ rockchip_setup_macs()
+ 		;;
+ 	friendlyarm,nanopi-r4s|\
+ 	friendlyarm,nanopi-r4se)
+-		wan_mac=$(nanopi_r4s_get_mac wan)
+-		lan_mac=$(nanopi_r4s_get_mac lan)
++		wan_mac=$(nanopi_get_mac wan 2-0051)
++		lan_mac=$(nanopi_get_mac lan 2-0051)
++		;;
++	friendlyarm,nanopi-r6s|friendlyarm,nanopi-r6c|friendlyarm,nanopc-t6)
++		wan_mac=$(nanopi_get_mac wan 6-0053)
++		lan_mac=$(nanopi_get_mac lan 6-0053)
+ 		;;
+ 	friendlyarm,nanopi-r5c|\
+ 	friendlyarm,nanopi-r5s|\
+
+--- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
++++ b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
+@@ -9,8 +9,8 @@ boardname="${board##*,}"
+ board_config_update
+ 
+ case $board in
+-friendlyarm,nanopi-r2c|\
+-friendlyarm,nanopi-r2s|\
++friendlyarm,nanopi-r2c*|\
++friendlyarm,nanopi-r2s*|\
+ xunlong,orangepi-r1-plus|\
+ xunlong,orangepi-r1-plus-lts)
+ 	ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
+
+--- a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity
++++ b/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity
+@@ -34,8 +34,8 @@ firefly,rk3568-roc-pc)
+ 	set_interface_core 2 "eth0"
+ 	set_interface_core 4 "eth1"
+ 	;;
+-friendlyarm,nanopi-r2c|\
+-friendlyarm,nanopi-r2s|\
++friendlyarm,nanopi-r2c*|\
++friendlyarm,nanopi-r2s*|\
+ seewo,sv21-rk3568|\
+ xunlong,orangepi-r1-plus|\
+ xunlong,orangepi-r1-plus-lts)
+@@ -53,5 +53,19 @@ friendlyarm,nanopi-r5s)
+ 	set_interface_core 2 "eth1"
+ 	set_interface_core 4 "eth2"
+ 	;;
++friendlyarm,nanopc-t6)
++	set_interface_core 8 "eth0-0"
++	set_interface_core 8 "eth0-16"
++	set_interface_core 8 "eth0-18"
++	echo fe > /sys/class/net/eth0/queues/rx-0/rps_cpus
++	set_interface_core 4 "eth1-0"
++	set_interface_core 4 "eth1-16"
++	set_interface_core 4 "eth1-18"
++	echo fe > /sys/class/net/eth1/queues/rx-0/rps_cpus
++	seconds="0"
++	set_interface_core 40 "xhci-hcd:usb5"
++	set_interface_core 40 "xhci-hcd:usb7"
++	set_interface_rps "fe" "wlan0"
++	;;
+ esac
+ 
+
+--- a/target/linux/rockchip/image/Makefile
++++ b/target/linux/rockchip/image/Makefile
+@@ -79,4 +79,31 @@ endif
+ 
+ include $(SUBTARGET).mk
+ 
++define Image/Build
++	if [[ "$(PROFILE_SANITIZED)" == "friendlyarm_nanopc-t6" ]]; then \
++		export IMG_PREFIX="$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))"; \
++		export BIN_DIR=$(BIN_DIR); \
++		export TOPDIR=$(TOPDIR); \
++		export MORE=$(MORE); \
++		cd /data/packit/friendlywrt23-rk3588; \
++		. ~/packit/packit_nanopi.sh; \
++	fi
++	if [[ "$(PROFILE_SANITIZED)" == "friendlyarm_nanopi-m4" || "$(PROFILE_SANITIZED)" == "friendlyarm_nanopc-t4" || "$(PROFILE_SANITIZED)" == "friendlyarm_nanopi-neo4" ]]; then \
++		export IMG_PREFIX="$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))"; \
++		export BIN_DIR=$(BIN_DIR); \
++		export TOPDIR=$(TOPDIR); \
++		export MORE=$(MORE); \
++		cd /data/packit/friendlywrt23-rk3399; \
++		. ~/packit/packit_nanopi.sh; \
++	fi
++	if [[ "$(PROFILE_SANITIZED)" == "friendlyarm_nanopi-r2s-plus" ]]; then \
++		export IMG_PREFIX="$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))"; \
++		export BIN_DIR=$(BIN_DIR); \
++		export TOPDIR=$(TOPDIR); \
++		export MORE=$(MORE); \
++		cd /data/packit/friendlywrt23-rk3328; \
++		. ~/packit/packit_nanopi.sh; \
++	fi
++endef
++
+ $(eval $(call BuildImage))

+ 0 - 19
devices/rockchip_armv8/patches/fix.patch

@@ -54,22 +54,3 @@ index 57d5b0f8d9be..73d9f52caf99 100644
  +CONFIG_SYSRESET=y
  +CONFIG_USB=y
  +CONFIG_USB_XHCI_HCD=y
-
---- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
-+++ b/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
-@@ -9,13 +9,13 @@ boardname="${board##*,}"
- board_config_update
- 
- case $board in
--friendlyarm,nanopi-r2c|\
--friendlyarm,nanopi-r2s|\
- xunlong,orangepi-r1-plus|\
- xunlong,orangepi-r1-plus-lts)
- 	ucidef_set_led_netdev "wan" "WAN" "$boardname:green:wan" "eth0"
- 	ucidef_set_led_netdev "lan" "LAN" "$boardname:green:lan" "eth1"
- 	;;
-+friendlyarm,nanopi-r2c|\
-+friendlyarm,nanopi-r2s|\
- friendlyarm,nanopi-r4s|\
- friendlyarm,nanopi-r4se|\
- sharevdi,guangmiao-g4c)

+ 0 - 147
devices/rockchip_armv8/patches/r6s.patch.b

@@ -1,147 +0,0 @@
---- a/target/linux/rockchip/image/armv8.mk
-+++ b/target/linux/rockchip/image/armv8.mk
-@@ -52,4 +52,31 @@
- TARGET_DEVICES += friendlyarm_nanopi-r2s
- 
-+define Device/friendlyarm_nanopi-r6c
-+  DEVICE_VENDOR := FriendlyARM
-+  DEVICE_MODEL := NanoPi R6C
-+  SOC := rk3328
-+  DEVICE_PACKAGES := -luci-app-gpsysupgrade
-+  DEVICE_DTS = rockchip/rk3328-nanopi-r2s
-+endef
-+TARGET_DEVICES += friendlyarm_nanopi-r6c
-+
-+define Device/friendlyarm_nanopi-r6s
-+  DEVICE_VENDOR := FriendlyARM
-+  DEVICE_MODEL := NanoPi R6S
-+  SOC := rk3328
-+  DEVICE_PACKAGES := -luci-app-gpsysupgrade
-+  DEVICE_DTS = rockchip/rk3328-nanopi-r2s
-+endef
-+TARGET_DEVICES += friendlyarm_nanopi-r6s
-+
-+define Device/friendlyarm_nanopc-t6
-+  DEVICE_VENDOR := FriendlyARM
-+  DEVICE_MODEL := NanoPC T6
-+  SOC := rk3328
-+  DEVICE_PACKAGES := -luci-app-gpsysupgrade
-+  DEVICE_DTS = rockchip/rk3328-nanopi-r2s
-+endef
-+TARGET_DEVICES += friendlyarm_nanopc-t6
-+
- define Device/friendlyarm_nanopi-r4s
-   DEVICE_VENDOR := FriendlyARM
-
---- a/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
-+++ b/target/linux/rockchip/armv8/base-files/etc/board.d/02_network
-@@ -21,9 +21,14 @@ rockchip_setup_interfaces()
- 	sharevdi,h3399pc|\
- 	sharevdi,guangmiao-g4c|\
- 	xunlong,orangepi-r1-plus|\
--	xunlong,orangepi-r1-plus-lts)
-+	xunlong,orangepi-r1-plus-lts|\
-+	friendlyarm,nanopc-t6|\
-+	friendlyarm,nanopi-r6c)
- 		ucidef_set_interfaces_lan_wan 'eth1' 'eth0'
- 		;;
-+	friendlyarm,nanopi-r6s)
-+		ucidef_set_interfaces_lan_wan "eth1 eth0" "eth2"
-+		;;
- 	fastrhino,r66s|\
- 	firefly,rk3568-roc-pc|\
- 	friendlyarm,nanopi-r5c|\
-@@ -45,10 +50,10 @@ rockchip_setup_interfaces()
- 	esac
- }
- 
--nanopi_r4s_get_mac()
-+nanopi_get_mac()
- {
- 	local interface=$1
--	local eeprom_path="/sys/bus/i2c/devices/2-0051/eeprom"
-+	local eeprom_path="/sys/bus/i2c/devices/$2/eeprom"
- 	local address
- 
- 	if [ -f "$eeprom_path" ]; then
-@@ -94,8 +99,12 @@ rockchip_setup_macs()
- 		;;
- 	friendlyarm,nanopi-r4s|\
- 	friendlyarm,nanopi-r4se)
--		wan_mac=$(nanopi_r4s_get_mac wan)
--		lan_mac=$(nanopi_r4s_get_mac lan)
-+		wan_mac=$(nanopi_get_mac wan 2-0051)
-+		lan_mac=$(nanopi_get_mac lan 2-0051)
-+		;;
-+	friendlyarm,nanopi-r6s|friendlyarm,nanopi-r6c|friendlyarm,nanopc-t6)
-+		wan_mac=$(nanopi_get_mac wan 6-0053)
-+		lan_mac=$(nanopi_get_mac lan 6-0053)
- 		;;
- 	friendlyarm,nanopi-r5c|\
- 	friendlyarm,nanopi-r5s|\
-
---- a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
-+++ a/target/linux/rockchip/armv8/base-files/etc/board.d/01_leds
-@@ -36,6 +36,15 @@ hinlink,opc-h68k|\
- hinlink,opc-h69k)
- 	ucidef_set_led_netdev "wan" "WAN" "blue:net" "eth0"
- 	;;
-+friendlyarm,nanopi-r6s)
-+	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth2"
-+	ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "eth1"
-+	ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "eth0"
-+	;;
-+friendlyarm,nanopi-r6c)
-+	ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth0"
-+	ucidef_set_led_netdev "lan1" "LAN1" "green:lan" "eth1"
-+	;;
- esac
- 
- board_config_flush
-
---- a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity
-+++ a/target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity
-@@ -52,5 +52,25 @@ friendlyarm,nanopi-r5s)
- 	set_interface_core 2 "eth1"
- 	set_interface_core 4 "eth2"
- 	;;
-+friendlyarm,nanopi-r6s)
-+	set_interface_core 2 "eth0"
-+	echo 3e > /sys/class/net/eth0/queues/rx-0/rps_cpus
-+	set_interface_core 10 "eth1-0"
-+	set_interface_core 20 "eth1-16"
-+	set_interface_core 20 "eth1-18"
-+	echo fe > /sys/class/net/eth1/queues/rx-0/rps_cpus
-+	set_interface_core 40 "eth2-0"
-+	set_interface_core 80 "eth2-16"
-+	set_interface_core 80 "eth2-18"
-+	echo fe > /sys/class/net/eth2/queues/rx-0/rps_cpus
-+	;;
-+friendlyarm,nanopi-r6c)
-+	set_interface_core 40 "eth0"
-+	echo fe > /sys/class/net/eth0/queues/rx-0/rps_cpus
-+	set_interface_core 10 "eth1-0"
-+	set_interface_core 20 "eth1-16"
-+	set_interface_core 20 "eth1-18"
-+	echo fe > /sys/class/net/eth1/queues/rx-0/rps_cpus
-+	;;
- esac
-
---- a/target/linux/rockchip/image/Makefile
-+++ b/target/linux/rockchip/image/Makefile
-@@ -79,4 +79,15 @@ endif
- 
- include $(SUBTARGET).mk
- 
-+define Image/Build
-+	if [[ "$(PROFILE_SANITIZED)" == "friendlyarm_nanopc-t6" ]]; then \
-+		export IMG_PREFIX="$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))"; \
-+		export BIN_DIR=$(BIN_DIR); \
-+		export TOPDIR=$(TOPDIR); \
-+		export MORE=$(MORE); \
-+		cd /data/packit/friendlywrt22-rk3588; \
-+		. ~/packit/packit_nanopi.sh; \
-+	fi
-+endef
-+
- $(eval $(call BuildImage))

+ 18 - 0
devices/rockchip_rk3588_bsp/.config

@@ -3,6 +3,19 @@ CONFIG_TARGET_rockchip=y
 CONFIG_TARGET_rockchip_rk3588_bsp=y
 CONFIG_TARGET_MULTI_PROFILE=y
 
+CONFIG_TARGET_KERNEL_PARTSIZE=32
+
+# daed
+CONFIG_DEVEL=y
+CONFIG_BPF_TOOLCHAIN_HOST=y
+# CONFIG_BPF_TOOLCHAIN_NONE is not set
+CONFIG_KERNEL_BPF_EVENTS=y
+CONFIG_KERNEL_CGROUP_BPF=y
+CONFIG_KERNEL_DEBUG_INFO=y
+CONFIG_KERNEL_DEBUG_INFO_BTF=y
+# CONFIG_KERNEL_DEBUG_INFO_REDUCED is not set
+CONFIG_KERNEL_XDP_SOCKETS=y
+
 CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_friendlyelec_nanopi-r6c=y
 CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_friendlyelec_nanopi-r6c-plus=y
 CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_friendlyelec_nanopi-r6s=y
@@ -10,6 +23,11 @@ CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_friendlyelec_nanopc-t6=y
 CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_xunlong_orangepi-5=y
 CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_xunlong_orangepi-5-plus=y
 CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_rockchip_bpi-r2-pro=y
+CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_firefly_roc-rk3328-cc=y
+CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_pine64_quartz64-a=y
+CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_radxa_rock-3a=y
+CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_pine64_rockpro64=y
+CONFIG_TARGET_DEVICE_rockchip_rk3588_bsp_DEVICE_radxa_rock-pi-4=y
 
 CONFIG_PACKAGE_kmod-rtl8821cu=m
 CONFIG_PACKAGE_kmod-rtl88x2bu=m

+ 3 - 1
devices/rockchip_rk3588_bsp/diy.sh

@@ -9,13 +9,15 @@ sed -i -e 's,kmod-r8168,kmod-r8169,g' target/linux/rockchip/image/armv8.mk
 
 sed -i 's/DEFAULT_PACKAGES +=/DEFAULT_PACKAGES += fdisk lsblk kmod-drm-rockchip/' target/linux/rockchip/Makefile
 
+rm -rf package/network/utils/xdp-tools package/devel/kselftests-bpf
+
 echo '
 CONFIG_SENSORS_PWM_FAN=y
 ' >> ./target/linux/rockchip/armv8/config-6.1
 
 sed -i "/KernelPackage,ptp/d" package/kernel/linux/modules/other.mk
 
-rm -rf feeds/kiddin9/{quectel_MHI,shortcut-fe,quectel_Gobinet,rtl88*}
+rm -rf feeds/kiddin9/{quectel_MHI,shortcut-fe,quectel_Gobinet,rtl88*} devices/common/patches/kernel_version.patch devices/common/patches/rootfstargz.patch
 
 sed -i "/friendlyelec/d" package/feeds/kiddin9/base-files/files/lib/preinit/02_sysinfo
 

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

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

+ 81 - 0
devices/rockchip_rk3588_bsp/patches/rootfstargz.patch

@@ -0,0 +1,81 @@
+--- a/include/image.mk
++++ b/include/image.mk
+@@ -300,6 +300,44 @@ ifdef CONFIG_TARGET_ROOTFS_TARGZ
+   endef
+ endif
+ 
++define Device/Build/targz
++  $$(_TARGET): $(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \
++	  $(BUILD_DIR)/json_info_files/$$(ROOTFSTZ).json, \
++	  $(BIN_DIR)/$$(ROOTFSTZ))
++
++  $(call Device/Export,$(BUILD_DIR)/json_info_files/$$(ROOTFSTZ).json,$(1))
++
++  $(BUILD_DIR)/json_info_files/$$(ROOTFSTZ).json: $(BIN_DIR)/$$(ROOTFSTZ)
++	@mkdir -p $$(shell dirname $$@)
++	DEVICE_ID="$(1)" \
++	SOURCE_DATE_EPOCH=$(SOURCE_DATE_EPOCH) \
++	FILE_NAME="$$(notdir $$^)" \
++	FILE_DIR="$(BIN_DIR)" \
++	FILE_TYPE="rootfs" \
++	FILE_FILESYSTEM="rootfs" \
++	DEVICE_IMG_PREFIX="$$(DEVICE_IMG_PREFIX)" \
++	DEVICE_VENDOR="$$(DEVICE_VENDOR)" \
++	DEVICE_MODEL="$$(DEVICE_MODEL)" \
++	DEVICE_VARIANT="$$(DEVICE_VARIANT)" \
++	DEVICE_ALT0_VENDOR="$$(DEVICE_ALT0_VENDOR)" \
++	DEVICE_ALT0_MODEL="$$(DEVICE_ALT0_MODEL)" \
++	DEVICE_ALT0_VARIANT="$$(DEVICE_ALT0_VARIANT)" \
++	DEVICE_ALT1_VENDOR="$$(DEVICE_ALT1_VENDOR)" \
++	DEVICE_ALT1_MODEL="$$(DEVICE_ALT1_MODEL)" \
++	DEVICE_ALT1_VARIANT="$$(DEVICE_ALT1_VARIANT)" \
++	DEVICE_ALT2_VENDOR="$$(DEVICE_ALT2_VENDOR)" \
++	DEVICE_ALT2_MODEL="$$(DEVICE_ALT2_MODEL)" \
++	DEVICE_ALT2_VARIANT="$$(DEVICE_ALT2_VARIANT)" \
++	DEVICE_TITLE="$$(DEVICE_TITLE)" \
++	DEVICE_PACKAGES="$$(DEVICE_PACKAGES)" \
++	TARGET="$(BOARD)" \
++	SUBTARGET="$(if $(SUBTARGET),$(SUBTARGET),generic)" \
++	VERSION_NUMBER="$(VERSION_NUMBER)" \
++	VERSION_CODE="$(VERSION_CODE)" \
++	SUPPORTED_DEVICES="$$(SUPPORTED_DEVICES)" \
++	$(TOPDIR)/scripts/json_add_image_info.py $$@
++endef
++
+ ifdef CONFIG_TARGET_ROOTFS_CPIOGZ
+   define Image/Build/cpiogz
+ 	( cd $(TARGET_DIR); find . | $(STAGING_DIR_HOST)/bin/cpio -o -H newc -R 0:0 | gzip -9n >$(BIN_DIR)/$(IMG_ROOTFS).cpio.gz )
+@@ -367,6 +405,7 @@ define Device/Init
+   DEVICE_IMG_PREFIX := $(IMG_PREFIX)-$(1)
+   DEVICE_IMG_NAME = $$(DEVICE_IMG_PREFIX)-$$(1)-$$(2)
+   IMAGE_SIZE :=
+   NAND_SIZE :=
++  ROOTFSTZ = $$(DEVICE_IMG_PREFIX)-rootfs.tar.gz
+   KERNEL_PREFIX = $$(DEVICE_IMG_PREFIX)
+   KERNEL_SUFFIX := -kernel.bin
+@@ -568,7 +607,7 @@ define Device/Build/kernel
+ endef
+ 
+ define Device/Build/image
+-  GZ_SUFFIX := $(if $(filter %dtb %gz,$(2)),,$(if $(and $(findstring ext4,$(1)),$(CONFIG_TARGET_IMAGES_GZIP)),.gz))
++  GZ_SUFFIX := $(if $(filter %dtb %gz,$(2)),,$(if $(and $(findstring ext4,$(1)),$(findstring img,$(2)),$(CONFIG_TARGET_IMAGES_GZIP)),.gz))
+   $$(_TARGET): $(if $(CONFIG_JSON_OVERVIEW_IMAGE_INFO), \
+ 	  $(BUILD_DIR)/json_info_files/$(call DEVICE_IMG_NAME,$(1),$(2)).json, \
+ 	  $(BIN_DIR)/$(call DEVICE_IMG_NAME,$(1),$(2))$$(GZ_SUFFIX))
+@@ -606,6 +645,7 @@ define Device/Build/image
+ 	FILE_TYPE=$(word 1,$(subst ., ,$(2))) \
+ 	FILE_FILESYSTEM="$(1)" \
+ 	DEVICE_IMG_PREFIX="$(DEVICE_IMG_PREFIX)" \
++	KERNEL_INITRAMFS_IMAGE="$(subst $(IMG_PREFIX_EXTRA),,$(KERNEL_INITRAMFS_IMAGE))" \
+ 	DEVICE_VENDOR="$(DEVICE_VENDOR)" \
+ 	DEVICE_MODEL="$(DEVICE_MODEL)" \
+ 	DEVICE_VARIANT="$(DEVICE_VARIANT)" \
+@@ -678,6 +718,8 @@ define Device/Build
+   $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Device/Build/initramfs,$(1)))
+   $(call Device/Build/kernel,$(1))
+ 
++  $(if $(CONFIG_TARGET_ROOTFS_TARGZ),$(call Device/Build/targz,$(PROFILE_SANITIZED)))
++
+   $$(eval $$(foreach compile,$$(COMPILE), \
+     $$(call Device/Build/compile,$$(compile),$(1))))
+ 

+ 11 - 0
devices/x86_64/.config

@@ -8,6 +8,17 @@ CONFIG_GRUB_IMAGES=y
 CONFIG_GRUB_EFI_IMAGES=y
 CONFIG_VMDK_IMAGES=n
 
+# daed
+CONFIG_DEVEL=y
+CONFIG_BPF_TOOLCHAIN_HOST=y
+# CONFIG_BPF_TOOLCHAIN_NONE is not set
+CONFIG_KERNEL_BPF_EVENTS=y
+CONFIG_KERNEL_CGROUP_BPF=y
+CONFIG_KERNEL_DEBUG_INFO=y
+CONFIG_KERNEL_DEBUG_INFO_BTF=y
+# CONFIG_KERNEL_DEBUG_INFO_REDUCED is not set
+CONFIG_KERNEL_XDP_SOCKETS=y
+
 # 其他需要安装的软件包:
 CONFIG_PACKAGE_luci-ssl=n # uhttpd服务
 CONFIG_PACKAGE_luci-ssl-nginx=y # nginx

+ 2 - 4
devices/x86_64/diy.sh

@@ -2,11 +2,9 @@
 
 SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
-svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/x86/files target/linux/x86/files
-rm -rf target/linux/x86/files/.svn
+git_clone_path master https://github.com/coolsnowwolf/lede target/linux/x86/files
 
-svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/x86/patches-5.15 target/linux/x86/patches-5.15
-rm -rf target/linux/x86/patches-5.15/.svn
+git_clone_path master https://github.com/coolsnowwolf/lede target/linux/x86/patches-5.15
 
 curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/package/kernel/linux/modules/video.mk -o package/kernel/linux/modules/video.mk
 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

+ 11 - 0
devices/x86_generic/.config

@@ -8,6 +8,17 @@ CONFIG_GRUB_IMAGES=y
 CONFIG_GRUB_EFI_IMAGES=y
 CONFIG_VMDK_IMAGES=n
 
+# daed
+CONFIG_DEVEL=y
+CONFIG_BPF_TOOLCHAIN_HOST=y
+# CONFIG_BPF_TOOLCHAIN_NONE is not set
+CONFIG_KERNEL_BPF_EVENTS=y
+CONFIG_KERNEL_CGROUP_BPF=y
+CONFIG_KERNEL_DEBUG_INFO=y
+CONFIG_KERNEL_DEBUG_INFO_BTF=y
+# CONFIG_KERNEL_DEBUG_INFO_REDUCED is not set
+CONFIG_KERNEL_XDP_SOCKETS=y
+
 # 其他需要安装的软件包:
 CONFIG_PACKAGE_luci-ssl=n # uhttpd服务
 CONFIG_PACKAGE_luci-ssl-nginx=y # nginx

+ 2 - 4
devices/x86_generic/diy.sh

@@ -2,11 +2,9 @@
 
 SHELL_FOLDER=$(dirname $(readlink -f "$0"))
 
-svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/x86/files target/linux/x86/files
-rm -rf target/linux/x86/files/.svn
+git_clone_path master https://github.com/coolsnowwolf/lede target/linux/x86/files
 
-svn co https://github.com/coolsnowwolf/lede/trunk/target/linux/x86/patches-5.15 target/linux/x86/patches-5.15
-rm -rf target/linux/x86/patches-5.15/.svn
+git_clone_path master https://github.com/coolsnowwolf/lede target/linux/x86/patches-5.15
 
 curl -sfL https://raw.githubusercontent.com/coolsnowwolf/lede/master/package/kernel/linux/modules/video.mk -o package/kernel/linux/modules/video.mk