├── .gitattributes ├── .github └── workflows │ ├── build-X86-64.yml │ ├── build-allwinner.yml │ ├── build-mt7621.yml │ ├── build-mtk_filogic.yml │ ├── build-rockchip.yml │ ├── master-X86-64.yml │ ├── master-mtk_filogic.yml │ └── master-rockchip.yml ├── LICENSE ├── README.md ├── configs ├── Packages-5G.txt ├── Packages-IPTV.txt ├── Packages-L.txt ├── Packages-Minimum.txt ├── Packages-x86.txt ├── Packages.txt ├── allwinner.txt ├── filogic.txt ├── ramips-mt7621.txt ├── rk3568.txt ├── rockchip.txt └── storage.txt ├── doc ├── IFS.png ├── argon.png └── argon2.png ├── files └── etc │ └── config │ └── smartdns ├── patchs ├── master │ ├── target │ │ └── 9999-add-missing-parameters-for-LTS.patch │ └── uboot │ │ └── rk3328-orangepi-r1-plus-lts-u-boot.dtsi ├── openwrt21 │ ├── target │ │ ├── 993-rockchip-rk3328-add-missing-parameters-for.patch │ │ ├── 994-add-missing-parameters-for-R2s.patch │ │ ├── 995-add-USB3-for-rk3328.patch │ │ ├── 996-usb-dwc3-add-a-quirk-xhci_slow_suspend_quirk.patch │ │ ├── 997-usb-dwc3-add-dis_u3_autosuspend_quirk.patch │ │ └── 998-general-add-dwc3-xhci-usb-trb-quirk.patch │ └── uboot │ │ ├── 202-rockchip-rk3328-Add-support-for-OrangePi-R1-Plus-LTS.patch │ │ └── 9999-add-missing-parameters-for-LTS.patch ├── openwrt23 │ ├── target │ │ └── 9999-add-missing-parameters-for-LTS.patch │ └── uboot │ │ └── rk3328-orangepi-r1-plus-lts-u-boot.dtsi └── usb3 │ └── phy-rockchip-inno-usb3.c └── scripts ├── O21-SNAPSHOT └── diy.sh ├── O23-SNAPSHOT └── diy.sh ├── environment.sh ├── free_disk_space.sh ├── init-settings.sh ├── install-5G.sh ├── master └── diy.sh ├── packages.sh ├── preset-clash-core-amd64.sh ├── preset-clash-core-arm64-L.sh └── preset-clash-core-arm64.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.github/workflows/build-X86-64.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019-2020 P3TERX 3 | # 4 | # This is free software, licensed under the MIT License. 5 | # See /LICENSE for more information. 6 | # 7 | # https://github.com/P3TERX/Actions-OpenWrt 8 | # Description: Build OpenWrt using GitHub Actions 9 | # 10 | 11 | name: build-X86-64 12 | 13 | permissions: write-all 14 | #开启写权限,防止无法上传到release 15 | 16 | on: 17 | repository_dispatch: 18 | workflow_dispatch: 19 | schedule: 20 | - cron: 0 20 * * 4 21 | # 分,时,日,月,周。每周五 20时执行一次 (UTC时间) 22 | 23 | env: 24 | FREE_DISK_SH: scripts/free_disk_space.sh 25 | ENV_SH: scripts/environment.sh 26 | REPO_URL: https://github.com/immortalwrt/immortalwrt 27 | REPO_BRANCH: openwrt-24.10 28 | # 修改 REPO_BRANCH 来达到更改编译版本 29 | CONFIG_FILE: configs/Packages-x86.txt 30 | SETTINGS_SH: scripts/init-settings.sh 31 | PACKAGES_SH: scripts/packages.sh 32 | CLASH_CORE_SH: scripts/preset-clash-core-amd64.sh 33 | UPLOAD_BIN_DIR: false 34 | UPLOAD_FIRMWARE: false 35 | UPLOAD_RELEASE: true 36 | TZ: Asia/Shanghai 37 | 38 | jobs: 39 | build: 40 | runs-on: ubuntu-24.04 41 | 42 | steps: 43 | - name: 检查 44 | uses: actions/checkout@main 45 | 46 | - name: 初始化环境 47 | env: 48 | DEBIAN_FRONTEND: noninteractive 49 | run: | 50 | chmod +x $FREE_DISK_SH && $FREE_DISK_SH 51 | sudo -E apt-get -qq update -y 52 | sudo -E apt-get -qq full-upgrade -y 53 | chmod +x $ENV_SH && $ENV_SH 54 | sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc 55 | sudo timedatectl set-timezone "$TZ" 56 | docker image prune -a -f 57 | docker container prune -f 58 | sudo mkdir -p /workdir 59 | sudo chown $USER:$GROUPS /workdir 60 | 61 | - name: 检查空间使用情况1 62 | if: (!cancelled()) 63 | run: df -hT 64 | 65 | - name: 克隆源码 66 | working-directory: /workdir 67 | run: | 68 | git clone $REPO_URL --depth 1 -b $REPO_BRANCH openwrt 69 | ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt 70 | 71 | - name: 设置 VERSION 环境变量 72 | run: echo "VERSION=${REPO_BRANCH#*-}" >> $GITHUB_ENV 73 | 74 | - name: 开启缓存 75 | uses: klever1988/cachewrtbuild@main 76 | with: 77 | ccache: 'true' 78 | mixkey: '${{ env.VERSION }}_X86-64' 79 | prefix: ${{ github.workspace }}/openwrt 80 | 81 | - name: 安装 feeds 82 | run: | 83 | cd openwrt 84 | ./scripts/feeds update -a 85 | ./scripts/feeds install -a 86 | 87 | - name: 导入补丁和配置 & 执行脚本 88 | run: | 89 | [ -d files ] && mv files openwrt/files || echo "files not found" 90 | [ -f $CONFIG_FILE ] && cat $CONFIG_FILE >> openwrt/.config 91 | cd openwrt 92 | chmod +x $GITHUB_WORKSPACE/$SETTINGS_SH && $GITHUB_WORKSPACE/$SETTINGS_SH 93 | chmod +x $GITHUB_WORKSPACE/$PACKAGES_SH && $GITHUB_WORKSPACE/$PACKAGES_SH 94 | chmod +x $GITHUB_WORKSPACE/$CLASH_CORE_SH && $GITHUB_WORKSPACE/$CLASH_CORE_SH 95 | 96 | - name: 下载文件 97 | run: | 98 | cd openwrt 99 | make defconfig 100 | make download -j8 V=10 101 | find dl -size -1024c -exec ls -l {} \; 102 | find dl -size -1024c -exec rm -f {} \; 103 | 104 | - name: 空间使用情况2 105 | if: (!cancelled()) 106 | run: df -hT 107 | 108 | - name: 编译工具链 109 | id: mtools 110 | run: | 111 | cd openwrt 112 | make defconfig 113 | echo -e "$(($(nproc)+1)) thread compile" 114 | make tools/compile -j$(($(nproc)+1)) || make tools/compile -j1 V=s 115 | make toolchain/compile -j$(($(nproc)+1)) || make toolchain/compile -j1 V=s 116 | echo "status=success" >> $GITHUB_OUTPUT 117 | 118 | - name: 空间使用情况3_1 119 | if: (!cancelled()) 120 | run: df -hT 121 | 122 | - name: 清除工具链编译中间产物... 123 | if: steps.mtools.outputs.status == 'success' && !cancelled() 124 | run: | 125 | cd openwrt 126 | rm -rf dl/* 127 | rm -rf build_dir/host/* 128 | rm -rf build_dir/toolchain-* 129 | 130 | - name: 空间使用情况3_2 131 | if: (!cancelled()) 132 | run: df -hT 133 | 134 | - name: 编译内核 135 | id: mkernel 136 | if: steps.mtools.outputs.status == 'success' && !cancelled() 137 | run: | 138 | cd openwrt 139 | echo -e "$(($(nproc)+1)) thread compile" 140 | make target/linux/compile -j$(($(nproc)+1)) || make target/linux/compile -j1 V=s 141 | echo "status=success" >> $GITHUB_OUTPUT 142 | 143 | - name: 空间使用情况4 144 | if: (!cancelled()) 145 | run: df -hT 146 | 147 | - name: 编译插件 148 | id: mpackage 149 | if: steps.mkernel.outputs.status == 'success' && !cancelled() 150 | run: | 151 | cd openwrt 152 | echo -e "$(($(nproc)+1)) thread compile" 153 | make package/compile -j$(($(nproc)+1)) || make package/compile -j1 V=s 154 | make package/index 155 | make package/install -j$(nproc) || make package/install -j1 V=s 156 | echo "status=success" >> $GITHUB_OUTPUT 157 | 158 | - name: 空间使用情况5 159 | if: (!cancelled()) 160 | run: df -hT 161 | 162 | - name: 清除插件编译文件 163 | id: cpackage 164 | if: steps.mpackage.outputs.status == 'success' && !cancelled() 165 | run: | 166 | cd openwrt 167 | rm -rf build_dir/target-*/host 168 | echo "status=success" >> $GITHUB_OUTPUT 169 | 170 | - name: 空间使用情况6 171 | if: (!cancelled()) 172 | run: df -hT 173 | 174 | - name: 编译固件 175 | id: compile 176 | if: steps.cpackage.outputs.status == 'success' && !cancelled() 177 | run: | 178 | cd openwrt 179 | echo -e "$(($(nproc)+1)) thread compile" 180 | make target/install -j$(nproc) || make target/install -j1 V=s 181 | make json_overview_image_info 182 | make checksum 183 | echo "status=success" >> $GITHUB_OUTPUT 184 | 185 | - name: 空间使用情况7 186 | if: (!cancelled()) 187 | run: df -hT 188 | 189 | - name: 上传 bin 目录 190 | uses: actions/upload-artifact@main 191 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true' 192 | with: 193 | name: OpenWrt_bin${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 194 | path: openwrt/bin 195 | 196 | - name: 整理文件 197 | id: organize 198 | if: steps.compile.outputs.status == 'success' && !cancelled() 199 | run: | 200 | cd openwrt/bin/targets/*/* 201 | rm -rf *.bin 202 | rm -rf *.buildinfo 203 | rm -rf *.json 204 | rm -rf *.manifest 205 | rm -rf packages 206 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 207 | echo "status=success" >> $GITHUB_OUTPUT 208 | 209 | - name: 上传固件目录 210 | uses: actions/upload-artifact@main 211 | if: env.UPLOAD_FIRMWARE == 'true' && steps.organize.outputs.status == 'success' && !cancelled() 212 | with: 213 | name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 214 | path: ${{ env.FIRMWARE }} 215 | 216 | - name: 生成发布标签 217 | id: tag 218 | if: env.UPLOAD_RELEASE == 'true' && steps.compile.outputs.status == 'success' && !cancelled() 219 | run: | 220 | VERSION1="${REPO_BRANCH#*-}" 221 | echo -e "🎉 X86-64 平台\n✅ ${VERSION1} 源码\n❗️ ip地址 : 192.168.8.1" >> release.txt 222 | echo "release_tag=$(date +"%Y.%m.%d-${VERSION1}_X86-64")" >> $GITHUB_OUTPUT 223 | echo "status=success" >> $GITHUB_OUTPUT 224 | 225 | - name: 上传固件到发布 226 | uses: softprops/action-gh-release@v2.0.4 227 | if: steps.tag.outputs.status == 'success' && !cancelled() 228 | env: 229 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 230 | with: 231 | tag_name: ${{ steps.tag.outputs.release_tag }} 232 | body_path: release.txt 233 | files: ${{ env.FIRMWARE }}/* 234 | 235 | - name: 删除以前发布的固件 236 | uses: dev-drprasad/delete-older-releases@v0.3.3 237 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_RELEASE == 'true' && !cancelled() 238 | with: 239 | keep_latest: 15 240 | delete_tags: true 241 | env: 242 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 243 | 244 | - name: 删除以前的工作流程 245 | uses: Mattraks/delete-workflow-runs@v2 246 | with: 247 | token: ${{ secrets.GITHUB_TOKEN }} 248 | repository: ${{ github.repository }} 249 | retain_days: 1 250 | keep_minimum_runs: 3 251 | -------------------------------------------------------------------------------- /.github/workflows/build-allwinner.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019-2020 P3TERX 3 | # 4 | # This is free software, licensed under the MIT License. 5 | # See /LICENSE for more information. 6 | # 7 | # https://github.com/P3TERX/Actions-OpenWrt 8 | # Description: Build OpenWrt using GitHub Actions 9 | # 10 | 11 | name: build-allwinner 12 | 13 | permissions: write-all 14 | #开启写权限,防止无法上传到release 15 | 16 | on: 17 | repository_dispatch: 18 | workflow_dispatch: 19 | schedule: 20 | - cron: 0 20 * * 0 21 | # 分,时,日,月,周。每周一 20时执行一次 (UTC时间) 22 | 23 | env: 24 | FREE_DISK_SH: scripts/free_disk_space.sh 25 | ENV_SH: scripts/environment.sh 26 | REPO_URL: https://github.com/immortalwrt/immortalwrt 27 | REPO_BRANCH: openwrt-24.10 28 | # 修改 REPO_BRANCH 来达到更改编译版本 29 | PLATFORM_FILE: configs/allwinner.txt 30 | CONFIG_FILE: configs/Packages.txt 31 | SETTINGS_SH: scripts/init-settings.sh 32 | PACKAGES_SH: scripts/packages.sh 33 | CLASH_CORE_SH: scripts/preset-clash-core-arm64-L.sh 34 | UPLOAD_BIN_DIR: false 35 | UPLOAD_FIRMWARE: false 36 | UPLOAD_RELEASE: true 37 | TZ: Asia/Shanghai 38 | 39 | jobs: 40 | build: 41 | runs-on: ubuntu-24.04 42 | 43 | steps: 44 | - name: 检查 45 | uses: actions/checkout@main 46 | 47 | - name: 初始化环境 48 | env: 49 | DEBIAN_FRONTEND: noninteractive 50 | run: | 51 | chmod +x $FREE_DISK_SH && $FREE_DISK_SH 52 | sudo -E apt-get -qq update -y 53 | sudo -E apt-get -qq full-upgrade -y 54 | chmod +x $ENV_SH && $ENV_SH 55 | sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc 56 | sudo timedatectl set-timezone "$TZ" 57 | docker image prune -a -f 58 | docker container prune -f 59 | sudo mkdir -p /workdir 60 | sudo chown $USER:$GROUPS /workdir 61 | 62 | - name: 检查空间使用情况1 63 | if: (!cancelled()) 64 | run: df -hT 65 | 66 | - name: 克隆源码 67 | working-directory: /workdir 68 | run: | 69 | git clone $REPO_URL --depth 1 -b $REPO_BRANCH openwrt 70 | ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt 71 | 72 | - name: 设置 VERSION 环境变量 73 | run: echo "VERSION=${REPO_BRANCH#*-}" >> $GITHUB_ENV 74 | 75 | - name: 开启缓存 76 | uses: klever1988/cachewrtbuild@main 77 | with: 78 | ccache: 'true' 79 | mixkey: '${{ env.VERSION }}-allwinner' 80 | prefix: ${{ github.workspace }}/openwrt 81 | 82 | - name: 安装 feeds 83 | run: | 84 | cd openwrt 85 | ./scripts/feeds update -a 86 | ./scripts/feeds install -a 87 | 88 | - name: 导入补丁和配置 & 执行脚本 89 | run: | 90 | [ -d files ] && mv files openwrt/files || echo "files not found" 91 | [ -f $PLATFORM_FILE ] && cat $PLATFORM_FILE >> openwrt/.config 92 | [ -f $CONFIG_FILE ] && cat $CONFIG_FILE >> openwrt/.config 93 | cd openwrt 94 | chmod +x $GITHUB_WORKSPACE/$SETTINGS_SH && $GITHUB_WORKSPACE/$SETTINGS_SH 95 | chmod +x $GITHUB_WORKSPACE/$PACKAGES_SH && $GITHUB_WORKSPACE/$PACKAGES_SH 96 | chmod +x $GITHUB_WORKSPACE/$CLASH_CORE_SH && $GITHUB_WORKSPACE/$CLASH_CORE_SH 97 | 98 | - name: 下载文件 99 | run: | 100 | cd openwrt 101 | make defconfig 102 | make download -j8 V=10 103 | find dl -size -1024c -exec ls -l {} \; 104 | find dl -size -1024c -exec rm -f {} \; 105 | 106 | - name: 空间使用情况2 107 | if: (!cancelled()) 108 | run: df -hT 109 | 110 | - name: 编译工具链 111 | id: mtools 112 | run: | 113 | cd openwrt 114 | make defconfig 115 | echo -e "$(($(nproc)+1)) thread compile" 116 | make tools/compile -j$(($(nproc)+1)) || make tools/compile -j1 V=s 117 | make toolchain/compile -j$(($(nproc)+1)) || make toolchain/compile -j1 V=s 118 | echo "status=success" >> $GITHUB_OUTPUT 119 | 120 | - name: 空间使用情况3_1 121 | if: (!cancelled()) 122 | run: df -hT 123 | 124 | - name: 清除工具链编译中间产物... 125 | if: steps.mtools.outputs.status == 'success' && !cancelled() 126 | run: | 127 | cd openwrt 128 | rm -rf dl/* 129 | rm -rf build_dir/host/* 130 | rm -rf build_dir/toolchain-* 131 | 132 | - name: 空间使用情况3_2 133 | if: (!cancelled()) 134 | run: df -hT 135 | 136 | - name: 编译内核 137 | id: mkernel 138 | if: steps.mtools.outputs.status == 'success' && !cancelled() 139 | run: | 140 | cd openwrt 141 | echo -e "$(($(nproc)+1)) thread compile" 142 | make target/linux/compile -j$(($(nproc)+1)) || make target/linux/compile -j1 V=s 143 | echo "status=success" >> $GITHUB_OUTPUT 144 | 145 | - name: 空间使用情况4 146 | if: (!cancelled()) 147 | run: df -hT 148 | 149 | - name: 编译插件 150 | id: mpackage 151 | if: steps.mkernel.outputs.status == 'success' && !cancelled() 152 | run: | 153 | cd openwrt 154 | echo -e "$(($(nproc)+1)) thread compile" 155 | make package/compile -j$(($(nproc)+1)) || make package/compile -j1 V=s 156 | make package/index 157 | make package/install -j$(nproc) || make package/install -j1 V=s 158 | echo "status=success" >> $GITHUB_OUTPUT 159 | 160 | - name: 空间使用情况5 161 | if: (!cancelled()) 162 | run: df -hT 163 | 164 | - name: 清除插件编译文件 165 | id: cpackage 166 | if: steps.mpackage.outputs.status == 'success' && !cancelled() 167 | run: | 168 | cd openwrt 169 | rm -rf build_dir/target-*/host 170 | echo "status=success" >> $GITHUB_OUTPUT 171 | 172 | - name: 空间使用情况6 173 | if: (!cancelled()) 174 | run: df -hT 175 | 176 | - name: 编译固件 177 | id: compile 178 | if: steps.cpackage.outputs.status == 'success' && !cancelled() 179 | run: | 180 | cd openwrt 181 | echo -e "$(($(nproc)+1)) thread compile" 182 | make target/install -j$(nproc) || make target/install -j1 V=s 183 | make json_overview_image_info 184 | make checksum 185 | echo "status=success" >> $GITHUB_OUTPUT 186 | 187 | - name: 空间使用情况7 188 | if: (!cancelled()) 189 | run: df -hT 190 | 191 | - name: 上传 bin 目录 192 | uses: actions/upload-artifact@main 193 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true' 194 | with: 195 | name: OpenWrt_bin${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 196 | path: openwrt/bin 197 | 198 | - name: 整理文件 199 | id: organize 200 | if: steps.compile.outputs.status == 'success' && !cancelled() 201 | run: | 202 | cd openwrt/bin/targets/*/* 203 | rm -rf *.buildinfo 204 | rm -rf *.json 205 | rm -rf *.manifest 206 | rm -rf packages 207 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 208 | echo "status=success" >> $GITHUB_OUTPUT 209 | 210 | - name: 上传固件目录 211 | uses: actions/upload-artifact@main 212 | if: env.UPLOAD_FIRMWARE == 'true' && steps.organize.outputs.status == 'success' && !cancelled() 213 | with: 214 | name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 215 | path: ${{ env.FIRMWARE }} 216 | 217 | - name: 生成发布标签 218 | id: tag 219 | if: env.UPLOAD_RELEASE == 'true' && steps.compile.outputs.status == 'success' && !cancelled() 220 | run: | 221 | VERSION1="${REPO_BRANCH#*-}" 222 | echo -e "🎉 Allwinner平台\n✅ ${VERSION1} 源码\n❗️ ip地址 : 192.168.8.1" >> release.txt 223 | echo "release_tag=$(date +"%Y.%m.%d-${VERSION1}_allwinner")" >> $GITHUB_OUTPUT 224 | echo "status=success" >> $GITHUB_OUTPUT 225 | 226 | - name: 上传固件到发布 227 | uses: softprops/action-gh-release@v2.0.4 228 | if: steps.tag.outputs.status == 'success' && !cancelled() 229 | env: 230 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 231 | with: 232 | tag_name: ${{ steps.tag.outputs.release_tag }} 233 | body_path: release.txt 234 | files: ${{ env.FIRMWARE }}/* 235 | 236 | - name: 删除以前发布的固件 237 | uses: dev-drprasad/delete-older-releases@v0.3.3 238 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_RELEASE == 'true' && !cancelled() 239 | with: 240 | keep_latest: 15 241 | delete_tags: true 242 | env: 243 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 244 | 245 | - name: 删除以前的工作流程 246 | uses: Mattraks/delete-workflow-runs@v2 247 | with: 248 | token: ${{ secrets.GITHUB_TOKEN }} 249 | repository: ${{ github.repository }} 250 | retain_days: 1 251 | keep_minimum_runs: 3 252 | -------------------------------------------------------------------------------- /.github/workflows/build-mt7621.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019-2020 P3TERX 3 | # 4 | # This is free software, licensed under the MIT License. 5 | # See /LICENSE for more information. 6 | # 7 | # https://github.com/P3TERX/Actions-OpenWrt 8 | # Description: Build OpenWrt using GitHub Actions 9 | # 10 | 11 | name: build-ramips-mt7621 12 | 13 | permissions: write-all 14 | #开启写权限,防止无法上传到release 15 | 16 | on: 17 | repository_dispatch: 18 | workflow_dispatch: 19 | schedule: 20 | - cron: 0 20 * * 1 21 | # 分,时,日,月,周。每周 二 20时执行一次 (UTC时间) 22 | 23 | env: 24 | FREE_DISK_SH: scripts/free_disk_space.sh 25 | ENV_SH: scripts/environment.sh 26 | REPO_URL: https://github.com/immortalwrt/immortalwrt 27 | REPO_BRANCH: openwrt-24.10 28 | # 修改 REPO_BRANCH 来达到更改编译版本 29 | PLATFORM_FILE: configs/ramips-mt7621.txt 30 | CONFIG_FILE: configs/Packages-Minimum.txt 31 | SETTINGS_SH: scripts/init-settings.sh 32 | PACKAGES_SH: scripts/packages.sh 33 | UPLOAD_BIN_DIR: false 34 | UPLOAD_FIRMWARE: false 35 | UPLOAD_RELEASE: true 36 | TZ: Asia/Shanghai 37 | 38 | jobs: 39 | build: 40 | runs-on: ubuntu-24.04 41 | 42 | steps: 43 | - name: 检查 44 | uses: actions/checkout@main 45 | 46 | - name: 初始化环境 47 | env: 48 | DEBIAN_FRONTEND: noninteractive 49 | run: | 50 | chmod +x $FREE_DISK_SH && $FREE_DISK_SH 51 | sudo -E apt-get -qq update -y 52 | sudo -E apt-get -qq full-upgrade -y 53 | chmod +x $ENV_SH && $ENV_SH 54 | sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc 55 | sudo timedatectl set-timezone "$TZ" 56 | docker image prune -a -f 57 | docker container prune -f 58 | sudo mkdir -p /workdir 59 | sudo chown $USER:$GROUPS /workdir 60 | 61 | - name: 检查空间使用情况1 62 | if: (!cancelled()) 63 | run: df -hT 64 | 65 | - name: 克隆源码 66 | working-directory: /workdir 67 | run: | 68 | git clone $REPO_URL --depth 1 -b $REPO_BRANCH openwrt 69 | ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt 70 | 71 | - name: 设置 VERSION 环境变量 72 | run: echo "VERSION=${REPO_BRANCH#*-}" >> $GITHUB_ENV 73 | 74 | - name: 开启缓存 75 | uses: klever1988/cachewrtbuild@main 76 | with: 77 | ccache: 'true' 78 | mixkey: '${{ env.VERSION }}-ramips' 79 | prefix: ${{ github.workspace }}/openwrt 80 | 81 | - name: 安装 feeds 82 | run: | 83 | cd openwrt 84 | ./scripts/feeds update -a 85 | ./scripts/feeds install -a 86 | 87 | - name: 导入补丁和配置 & 执行脚本 88 | run: | 89 | [ -d files ] && mv files openwrt/files || echo "files not found" 90 | [ -f $PLATFORM_FILE ] && cat $PLATFORM_FILE >> openwrt/.config 91 | [ -f $CONFIG_FILE ] && cat $CONFIG_FILE >> openwrt/.config 92 | cd openwrt 93 | chmod +x $GITHUB_WORKSPACE/$SETTINGS_SH && $GITHUB_WORKSPACE/$SETTINGS_SH 94 | chmod +x $GITHUB_WORKSPACE/$PACKAGES_SH && $GITHUB_WORKSPACE/$PACKAGES_SH 95 | 96 | - name: 下载文件 97 | run: | 98 | cd openwrt 99 | make defconfig 100 | make download -j8 V=10 101 | find dl -size -1024c -exec ls -l {} \; 102 | find dl -size -1024c -exec rm -f {} \; 103 | 104 | - name: 空间使用情况2 105 | if: (!cancelled()) 106 | run: df -hT 107 | 108 | - name: 编译工具链 109 | id: mtools 110 | run: | 111 | cd openwrt 112 | make defconfig 113 | echo -e "$(($(nproc)+1)) thread compile" 114 | make tools/compile -j$(($(nproc)+1)) || make tools/compile -j1 V=s 115 | make toolchain/compile -j$(($(nproc)+1)) || make toolchain/compile -j1 V=s 116 | echo "status=success" >> $GITHUB_OUTPUT 117 | 118 | - name: 空间使用情况3_1 119 | if: (!cancelled()) 120 | run: df -hT 121 | 122 | - name: 清除工具链编译中间产物... 123 | if: steps.mtools.outputs.status == 'success' && !cancelled() 124 | run: | 125 | cd openwrt 126 | rm -rf dl/* 127 | rm -rf build_dir/host/* 128 | rm -rf build_dir/toolchain-* 129 | 130 | - name: 空间使用情况3_2 131 | if: (!cancelled()) 132 | run: df -hT 133 | 134 | - name: 编译内核 135 | id: mkernel 136 | if: steps.mtools.outputs.status == 'success' && !cancelled() 137 | run: | 138 | cd openwrt 139 | echo -e "$(($(nproc)+1)) thread compile" 140 | make target/linux/compile -j$(($(nproc)+1)) || make target/linux/compile -j1 V=s 141 | echo "status=success" >> $GITHUB_OUTPUT 142 | 143 | - name: 空间使用情况4 144 | if: (!cancelled()) 145 | run: df -hT 146 | 147 | - name: 编译插件 148 | id: mpackage 149 | if: steps.mkernel.outputs.status == 'success' && !cancelled() 150 | run: | 151 | cd openwrt 152 | echo -e "$(($(nproc)+1)) thread compile" 153 | make package/compile -j$(($(nproc)+1)) || make package/compile -j1 V=s 154 | make package/index 155 | make package/install -j$(nproc) || make package/install -j1 V=s 156 | echo "status=success" >> $GITHUB_OUTPUT 157 | 158 | - name: 空间使用情况5 159 | if: (!cancelled()) 160 | run: df -hT 161 | 162 | - name: 清除插件编译文件 163 | id: cpackage 164 | if: steps.mpackage.outputs.status == 'success' && !cancelled() 165 | run: | 166 | cd openwrt 167 | rm -rf build_dir/target-*/host 168 | echo "status=success" >> $GITHUB_OUTPUT 169 | 170 | - name: 空间使用情况6 171 | if: (!cancelled()) 172 | run: df -hT 173 | 174 | - name: 编译固件 175 | id: compile 176 | if: steps.cpackage.outputs.status == 'success' && !cancelled() 177 | run: | 178 | cd openwrt 179 | echo -e "$(($(nproc)+1)) thread compile" 180 | make target/install -j$(nproc) || make target/install -j1 V=s 181 | make json_overview_image_info 182 | make checksum 183 | echo "status=success" >> $GITHUB_OUTPUT 184 | 185 | - name: 空间使用情况7 186 | if: (!cancelled()) 187 | run: df -hT 188 | 189 | - name: 上传 bin 目录 190 | uses: actions/upload-artifact@main 191 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true' 192 | with: 193 | name: OpenWrt_bin${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 194 | path: openwrt/bin 195 | 196 | - name: 整理文件 197 | id: organize 198 | if: steps.compile.outputs.status == 'success' && !cancelled() 199 | run: | 200 | cd openwrt/bin/targets/*/* 201 | rm -rf *.buildinfo 202 | rm -rf *.json 203 | rm -rf *.manifest 204 | rm -rf packages 205 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 206 | echo "status=success" >> $GITHUB_OUTPUT 207 | 208 | - name: 上传固件目录 209 | uses: actions/upload-artifact@main 210 | if: env.UPLOAD_FIRMWARE == 'true' && steps.organize.outputs.status == 'success' && !cancelled() 211 | with: 212 | name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 213 | path: ${{ env.FIRMWARE }} 214 | 215 | - name: 生成发布标签 216 | id: tag 217 | if: env.UPLOAD_RELEASE == 'true' && steps.compile.outputs.status == 'success' && !cancelled() 218 | run: | 219 | VERSION1="${REPO_BRANCH#*-}" 220 | echo -e "🎉 ramips mt7621平台\n✅ ${VERSION1} 源码\n❗️ ip地址 : 192.168.8.1" >> release.txt 221 | echo "release_tag=$(date +"%Y.%m.%d-${VERSION1}_mt7621")" >> $GITHUB_OUTPUT 222 | echo "status=success" >> $GITHUB_OUTPUT 223 | 224 | - name: 上传固件到发布 225 | uses: softprops/action-gh-release@v2.0.4 226 | if: steps.tag.outputs.status == 'success' && !cancelled() 227 | env: 228 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 229 | with: 230 | tag_name: ${{ steps.tag.outputs.release_tag }} 231 | body_path: release.txt 232 | files: ${{ env.FIRMWARE }}/* 233 | 234 | - name: 删除以前发布的固件 235 | uses: dev-drprasad/delete-older-releases@v0.3.3 236 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_RELEASE == 'true' && !cancelled() 237 | with: 238 | keep_latest: 15 239 | delete_tags: true 240 | env: 241 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 242 | 243 | - name: 删除以前的工作流程 244 | uses: Mattraks/delete-workflow-runs@v2 245 | with: 246 | token: ${{ secrets.GITHUB_TOKEN }} 247 | repository: ${{ github.repository }} 248 | retain_days: 1 249 | keep_minimum_runs: 3 250 | -------------------------------------------------------------------------------- /.github/workflows/build-mtk_filogic.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019-2020 P3TERX 3 | # 4 | # This is free software, licensed under the MIT License. 5 | # See /LICENSE for more information. 6 | # 7 | # https://github.com/P3TERX/Actions-OpenWrt 8 | # Description: Build OpenWrt using GitHub Actions 9 | # 10 | 11 | name: build-mtkfilogic 12 | 13 | permissions: write-all 14 | #开启写权限,防止无法上传到release 15 | 16 | on: 17 | repository_dispatch: 18 | workflow_dispatch: 19 | schedule: 20 | - cron: 0 20 * * 3 21 | # 分,时,日,月,周。每周 四 20时执行一次 (UTC时间) 22 | 23 | env: 24 | FREE_DISK_SH: scripts/free_disk_space.sh 25 | ENV_SH: scripts/environment.sh 26 | REPO_URL: https://github.com/immortalwrt/immortalwrt 27 | REPO_BRANCH: openwrt-24.10 28 | # 修改 REPO_BRANCH 来达到更改编译版本 29 | PLATFORM_FILE: configs/filogic.txt 30 | CONFIG_FILE: configs/Packages-L.txt 31 | SETTINGS_SH: scripts/init-settings.sh 32 | PACKAGES_SH: scripts/packages.sh 33 | CLASH_CORE_SH: scripts/preset-clash-core-arm64-L.sh 34 | UPLOAD_BIN_DIR: false 35 | UPLOAD_FIRMWARE: false 36 | UPLOAD_RELEASE: true 37 | TZ: Asia/Shanghai 38 | 39 | jobs: 40 | build: 41 | runs-on: ubuntu-24.04 42 | 43 | steps: 44 | - name: 检查 45 | uses: actions/checkout@main 46 | 47 | - name: 初始化环境 48 | env: 49 | DEBIAN_FRONTEND: noninteractive 50 | run: | 51 | chmod +x $FREE_DISK_SH && $FREE_DISK_SH 52 | sudo -E apt-get -qq update -y 53 | sudo -E apt-get -qq full-upgrade -y 54 | chmod +x $ENV_SH && $ENV_SH 55 | sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc 56 | sudo timedatectl set-timezone "$TZ" 57 | docker image prune -a -f 58 | docker container prune -f 59 | sudo mkdir -p /workdir 60 | sudo chown $USER:$GROUPS /workdir 61 | 62 | - name: 检查空间使用情况1 63 | if: (!cancelled()) 64 | run: df -hT 65 | 66 | - name: 克隆源码 67 | working-directory: /workdir 68 | run: | 69 | git clone $REPO_URL --depth 1 -b $REPO_BRANCH openwrt 70 | ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt 71 | 72 | - name: 设置 VERSION 环境变量 73 | run: echo "VERSION=${REPO_BRANCH#*-}" >> $GITHUB_ENV 74 | 75 | - name: 开启缓存 76 | uses: klever1988/cachewrtbuild@main 77 | with: 78 | ccache: 'true' 79 | mixkey: '${{ env.VERSION }}-filogic' 80 | prefix: ${{ github.workspace }}/openwrt 81 | 82 | - name: 安装 feeds 83 | run: | 84 | cd openwrt 85 | ./scripts/feeds update -a 86 | ./scripts/feeds install -a 87 | 88 | - name: 导入补丁和配置 & 执行脚本 89 | run: | 90 | [ -d files ] && mv files openwrt/files || echo "files not found" 91 | [ -f $PLATFORM_FILE ] && cat $PLATFORM_FILE >> openwrt/.config 92 | [ -f $CONFIG_FILE ] && cat $CONFIG_FILE >> openwrt/.config 93 | cd openwrt 94 | chmod +x $GITHUB_WORKSPACE/$SETTINGS_SH && $GITHUB_WORKSPACE/$SETTINGS_SH 95 | chmod +x $GITHUB_WORKSPACE/$PACKAGES_SH && $GITHUB_WORKSPACE/$PACKAGES_SH 96 | chmod +x $GITHUB_WORKSPACE/$CLASH_CORE_SH && $GITHUB_WORKSPACE/$CLASH_CORE_SH 97 | 98 | - name: 下载文件 99 | run: | 100 | cd openwrt 101 | make defconfig 102 | make download -j8 V=10 103 | find dl -size -1024c -exec ls -l {} \; 104 | find dl -size -1024c -exec rm -f {} \; 105 | 106 | - name: 空间使用情况2 107 | if: (!cancelled()) 108 | run: df -hT 109 | 110 | - name: 编译工具链 111 | id: mtools 112 | run: | 113 | cd openwrt 114 | make defconfig 115 | echo -e "$(($(nproc)+1)) thread compile" 116 | make tools/compile -j$(($(nproc)+1)) || make tools/compile -j1 V=s 117 | make toolchain/compile -j$(($(nproc)+1)) || make toolchain/compile -j1 V=s 118 | echo "status=success" >> $GITHUB_OUTPUT 119 | 120 | - name: 空间使用情况3_1 121 | if: (!cancelled()) 122 | run: df -hT 123 | 124 | - name: 清除工具链编译中间产物... 125 | if: steps.mtools.outputs.status == 'success' && !cancelled() 126 | run: | 127 | cd openwrt 128 | rm -rf dl/* 129 | rm -rf build_dir/toolchain-* 130 | 131 | - name: 空间使用情况3_2 132 | if: (!cancelled()) 133 | run: df -hT 134 | 135 | - name: 编译内核 136 | id: mkernel 137 | if: steps.mtools.outputs.status == 'success' && !cancelled() 138 | run: | 139 | cd openwrt 140 | echo -e "$(($(nproc)+1)) thread compile" 141 | make target/linux/compile -j$(($(nproc)+1)) || make target/linux/compile -j1 V=s 142 | echo "status=success" >> $GITHUB_OUTPUT 143 | 144 | - name: 空间使用情况4 145 | if: (!cancelled()) 146 | run: df -hT 147 | 148 | - name: 编译插件 149 | id: mpackage 150 | if: steps.mkernel.outputs.status == 'success' && !cancelled() 151 | run: | 152 | cd openwrt 153 | echo -e "$(($(nproc)+1)) thread compile" 154 | make package/compile -j$(($(nproc)+1)) || make package/compile -j1 V=s 155 | make package/index 156 | make package/install -j$(nproc) || make package/install -j1 V=s 157 | echo "status=success" >> $GITHUB_OUTPUT 158 | 159 | - name: 空间使用情况5 160 | if: (!cancelled()) 161 | run: df -hT 162 | 163 | - name: 清除插件编译文件 164 | id: cpackage 165 | if: steps.mpackage.outputs.status == 'success' && !cancelled() 166 | run: | 167 | cd openwrt 168 | rm -rf build_dir/target-*/host 169 | echo "status=success" >> $GITHUB_OUTPUT 170 | 171 | - name: 空间使用情况6 172 | if: (!cancelled()) 173 | run: df -hT 174 | 175 | - name: 编译固件 176 | id: compile 177 | if: steps.cpackage.outputs.status == 'success' && !cancelled() 178 | run: | 179 | cd openwrt 180 | echo -e "$(($(nproc)+1)) thread compile" 181 | make target/install -j$(nproc) || make target/install -j1 V=s 182 | make json_overview_image_info 183 | make checksum 184 | echo "status=success" >> $GITHUB_OUTPUT 185 | 186 | - name: 空间使用情况7 187 | if: (!cancelled()) 188 | run: df -hT 189 | 190 | - name: 上传 bin 目录 191 | uses: actions/upload-artifact@main 192 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true' 193 | with: 194 | name: OpenWrt_bin${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 195 | path: openwrt/bin 196 | 197 | - name: 整理文件 198 | id: organize 199 | if: steps.compile.outputs.status == 'success' && !cancelled() 200 | run: | 201 | cd openwrt/bin/targets/*/* 202 | rm -rf *.buildinfo 203 | rm -rf *.json 204 | rm -rf *.manifest 205 | rm -rf packages 206 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 207 | echo "status=success" >> $GITHUB_OUTPUT 208 | 209 | - name: 上传固件目录 210 | uses: actions/upload-artifact@main 211 | if: env.UPLOAD_FIRMWARE == 'true' && steps.organize.outputs.status == 'success' && !cancelled() 212 | with: 213 | name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 214 | path: ${{ env.FIRMWARE }} 215 | 216 | - name: 生成发布标签 217 | id: tag 218 | if: env.UPLOAD_RELEASE == 'true' && steps.compile.outputs.status == 'success' && !cancelled() 219 | run: | 220 | VERSION1="${REPO_BRANCH#*-}" 221 | echo -e "🎉 MTK filogic平台\n✅ ${VERSION1} 源码\n❗️ ip地址 : 192.168.8.1" >> release.txt 222 | echo "release_tag=$(date +"%Y.%m.%d-${VERSION1}_filogic")" >> $GITHUB_OUTPUT 223 | echo "status=success" >> $GITHUB_OUTPUT 224 | 225 | - name: 上传固件到发布 226 | uses: softprops/action-gh-release@v2.0.4 227 | if: steps.tag.outputs.status == 'success' && !cancelled() 228 | env: 229 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 230 | with: 231 | tag_name: ${{ steps.tag.outputs.release_tag }} 232 | body_path: release.txt 233 | files: ${{ env.FIRMWARE }}/* 234 | 235 | - name: 删除以前发布的固件 236 | uses: dev-drprasad/delete-older-releases@v0.3.3 237 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_RELEASE == 'true' && !cancelled() 238 | with: 239 | keep_latest: 15 240 | delete_tags: true 241 | env: 242 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 243 | 244 | - name: 删除以前的工作流程 245 | uses: Mattraks/delete-workflow-runs@v2 246 | with: 247 | token: ${{ secrets.GITHUB_TOKEN }} 248 | repository: ${{ github.repository }} 249 | retain_days: 1 250 | keep_minimum_runs: 3 251 | -------------------------------------------------------------------------------- /.github/workflows/build-rockchip.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019-2020 P3TERX 3 | # 4 | # This is free software, licensed under the MIT License. 5 | # See /LICENSE for more information. 6 | # 7 | # https://github.com/P3TERX/Actions-OpenWrt 8 | # Description: Build OpenWrt using GitHub Actions 9 | # 10 | 11 | name: build-rockchip 12 | 13 | permissions: write-all 14 | #开启写权限,防止无法上传到release 15 | 16 | on: 17 | repository_dispatch: 18 | workflow_dispatch: 19 | schedule: 20 | - cron: 0 20 * * 2 21 | # 分,时,日,月,周。每周 三 20时执行一次 (UTC时间) 22 | 23 | env: 24 | FREE_DISK_SH: scripts/free_disk_space.sh 25 | ENV_SH: scripts/environment.sh 26 | REPO_URL: https://github.com/immortalwrt/immortalwrt 27 | REPO_BRANCH: openwrt-24.10 28 | # 修改 REPO_BRANCH 来达到更改编译版本 29 | PLATFORM_FILE: configs/rockchip.txt 30 | CONFIG_FILE: configs/Packages.txt 31 | SETTINGS_SH: scripts/init-settings.sh 32 | PACKAGES_SH: scripts/packages.sh 33 | CLASH_CORE_SH: scripts/preset-clash-core-arm64-L.sh 34 | UPLOAD_BIN_DIR: false 35 | UPLOAD_FIRMWARE: false 36 | UPLOAD_RELEASE: true 37 | TZ: Asia/Shanghai 38 | 39 | jobs: 40 | build: 41 | runs-on: ubuntu-24.04 42 | 43 | steps: 44 | - name: 检查 45 | uses: actions/checkout@main 46 | 47 | - name: 初始化环境 48 | env: 49 | DEBIAN_FRONTEND: noninteractive 50 | run: | 51 | chmod +x $FREE_DISK_SH && $FREE_DISK_SH 52 | sudo -E apt-get -qq update -y 53 | sudo -E apt-get -qq full-upgrade -y 54 | chmod +x $ENV_SH && $ENV_SH 55 | sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc 56 | sudo timedatectl set-timezone "$TZ" 57 | docker image prune -a -f 58 | docker container prune -f 59 | sudo mkdir -p /workdir 60 | sudo chown $USER:$GROUPS /workdir 61 | 62 | - name: 检查空间使用情况1 63 | if: (!cancelled()) 64 | run: df -hT 65 | 66 | - name: 克隆源码 67 | working-directory: /workdir 68 | run: | 69 | git clone $REPO_URL --depth 1 -b $REPO_BRANCH openwrt 70 | ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt 71 | 72 | - name: 设置 VERSION 环境变量 73 | run: echo "VERSION=${REPO_BRANCH#*-}" >> $GITHUB_ENV 74 | 75 | - name: 开启缓存 76 | uses: klever1988/cachewrtbuild@main 77 | with: 78 | ccache: 'true' 79 | mixkey: '${{ env.VERSION }}-rockchip' 80 | prefix: ${{ github.workspace }}/openwrt 81 | 82 | - name: 安装 feeds 83 | run: | 84 | cd openwrt 85 | ./scripts/feeds update -a 86 | ./scripts/feeds install -a 87 | 88 | - name: 导入补丁和配置 & 执行脚本 89 | run: | 90 | [ -d files ] && mv files openwrt/files || echo "files not found" 91 | [ -f $PLATFORM_FILE ] && cat $PLATFORM_FILE >> openwrt/.config 92 | [ -f $CONFIG_FILE ] && cat $CONFIG_FILE >> openwrt/.config 93 | cd openwrt 94 | chmod +x $GITHUB_WORKSPACE/$SETTINGS_SH && $GITHUB_WORKSPACE/$SETTINGS_SH 95 | chmod +x $GITHUB_WORKSPACE/$PACKAGES_SH && $GITHUB_WORKSPACE/$PACKAGES_SH 96 | chmod +x $GITHUB_WORKSPACE/$CLASH_CORE_SH && $GITHUB_WORKSPACE/$CLASH_CORE_SH 97 | 98 | - name: 下载文件 99 | run: | 100 | cd openwrt 101 | make defconfig 102 | make download -j8 V=10 103 | find dl -size -1024c -exec ls -l {} \; 104 | find dl -size -1024c -exec rm -f {} \; 105 | 106 | - name: 空间使用情况2 107 | if: (!cancelled()) 108 | run: df -hT 109 | 110 | - name: 编译工具链 111 | id: mtools 112 | run: | 113 | cd openwrt 114 | make defconfig 115 | echo -e "$(($(nproc)+1)) thread compile" 116 | make tools/compile -j$(($(nproc)+1)) || make tools/compile -j1 V=s 117 | make toolchain/compile -j$(($(nproc)+1)) || make toolchain/compile -j1 V=s 118 | echo "status=success" >> $GITHUB_OUTPUT 119 | 120 | - name: 空间使用情况3_1 121 | if: (!cancelled()) 122 | run: df -hT 123 | 124 | - name: 清除工具链编译中间产物... 125 | if: steps.mtools.outputs.status == 'success' && !cancelled() 126 | run: | 127 | cd openwrt 128 | rm -rf dl/* 129 | rm -rf build_dir/host/* 130 | rm -rf build_dir/toolchain-* 131 | 132 | - name: 空间使用情况3_2 133 | if: (!cancelled()) 134 | run: df -hT 135 | 136 | - name: 编译内核 137 | id: mkernel 138 | if: steps.mtools.outputs.status == 'success' && !cancelled() 139 | run: | 140 | cd openwrt 141 | echo -e "$(($(nproc)+1)) thread compile" 142 | make target/linux/compile -j$(($(nproc)+1)) || make target/linux/compile -j1 V=s 143 | echo "status=success" >> $GITHUB_OUTPUT 144 | 145 | - name: 空间使用情况4 146 | if: (!cancelled()) 147 | run: df -hT 148 | 149 | - name: 编译插件 150 | id: mpackage 151 | if: steps.mkernel.outputs.status == 'success' && !cancelled() 152 | run: | 153 | cd openwrt 154 | echo -e "$(($(nproc)+1)) thread compile" 155 | make package/compile -j$(($(nproc)+1)) || make package/compile -j1 V=s 156 | make package/index 157 | make package/install -j$(nproc) || make package/install -j1 V=s 158 | echo "status=success" >> $GITHUB_OUTPUT 159 | 160 | - name: 空间使用情况5 161 | if: (!cancelled()) 162 | run: df -hT 163 | 164 | - name: 清除插件编译文件 165 | id: cpackage 166 | if: steps.mpackage.outputs.status == 'success' && !cancelled() 167 | run: | 168 | cd openwrt 169 | rm -rf build_dir/target-*/host 170 | echo "status=success" >> $GITHUB_OUTPUT 171 | 172 | - name: 空间使用情况6 173 | if: (!cancelled()) 174 | run: df -hT 175 | 176 | - name: 编译固件 177 | id: compile 178 | if: steps.cpackage.outputs.status == 'success' && !cancelled() 179 | run: | 180 | cd openwrt 181 | echo -e "$(($(nproc)+1)) thread compile" 182 | make target/install -j$(nproc) || make target/install -j1 V=s 183 | make json_overview_image_info 184 | make checksum 185 | echo "status=success" >> $GITHUB_OUTPUT 186 | 187 | - name: 空间使用情况7 188 | if: (!cancelled()) 189 | run: df -hT 190 | 191 | - name: 上传 bin 目录 192 | uses: actions/upload-artifact@main 193 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true' 194 | with: 195 | name: OpenWrt_bin${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 196 | path: openwrt/bin 197 | 198 | - name: 整理文件 199 | id: organize 200 | if: steps.compile.outputs.status == 'success' && !cancelled() 201 | run: | 202 | cd openwrt/bin/targets/*/* 203 | rm -rf *.bin 204 | rm -rf *.buildinfo 205 | rm -rf *.json 206 | rm -rf *.manifest 207 | rm -rf packages 208 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 209 | echo "status=success" >> $GITHUB_OUTPUT 210 | 211 | - name: 上传固件目录 212 | uses: actions/upload-artifact@main 213 | if: env.UPLOAD_FIRMWARE == 'true' && steps.organize.outputs.status == 'success' && !cancelled() 214 | with: 215 | name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 216 | path: ${{ env.FIRMWARE }} 217 | 218 | - name: 生成发布标签 219 | id: tag 220 | if: env.UPLOAD_RELEASE == 'true' && steps.compile.outputs.status == 'success' && !cancelled() 221 | run: | 222 | VERSION1="${REPO_BRANCH#*-}" 223 | echo -e "🎉 Rockchip平台\n✅ ${VERSION1} 源码\n❗️ ip地址 : 192.168.8.1" >> release.txt 224 | echo "release_tag=$(date +"%Y.%m.%d-${VERSION1}_rockchip")" >> $GITHUB_OUTPUT 225 | echo "status=success" >> $GITHUB_OUTPUT 226 | 227 | - name: 上传固件到发布 228 | uses: softprops/action-gh-release@v2.0.4 229 | if: steps.tag.outputs.status == 'success' && !cancelled() 230 | env: 231 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 232 | with: 233 | tag_name: ${{ steps.tag.outputs.release_tag }} 234 | body_path: release.txt 235 | files: ${{ env.FIRMWARE }}/* 236 | 237 | - name: 删除以前发布的固件 238 | uses: dev-drprasad/delete-older-releases@v0.3.3 239 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_RELEASE == 'true' && !cancelled() 240 | with: 241 | keep_latest: 15 242 | delete_tags: true 243 | env: 244 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 245 | 246 | - name: 删除以前的工作流程 247 | uses: Mattraks/delete-workflow-runs@v2 248 | with: 249 | token: ${{ secrets.GITHUB_TOKEN }} 250 | repository: ${{ github.repository }} 251 | retain_days: 1 252 | keep_minimum_runs: 3 253 | -------------------------------------------------------------------------------- /.github/workflows/master-X86-64.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019-2020 P3TERX 3 | # 4 | # This is free software, licensed under the MIT License. 5 | # See /LICENSE for more information. 6 | # 7 | # https://github.com/P3TERX/Actions-OpenWrt 8 | # Description: Build OpenWrt using GitHub Actions 9 | # 10 | 11 | name: master-X86 12 | 13 | permissions: write-all 14 | #开启写权限,防止无法上传到release 15 | 16 | on: 17 | repository_dispatch: 18 | workflow_dispatch: 19 | # schedule: 20 | # - cron: 0 22 * * 4 21 | # 分,时,日,月,周。每周五 22时执行一次 (UTC时间) 22 | 23 | env: 24 | FREE_DISK_SH: scripts/free_disk_space.sh 25 | ENV_SH: scripts/environment.sh 26 | REPO_URL: https://github.com/immortalwrt/immortalwrt 27 | REPO_BRANCH: master 28 | # 修改 REPO_BRANCH 来达到更改编译版本 29 | CONFIG_FILE: configs/Packages-x86.txt 30 | SETTINGS_SH: scripts/init-settings.sh 31 | PACKAGES_SH: scripts/packages.sh 32 | CLASH_CORE_SH: scripts/preset-clash-core-amd64.sh 33 | UPLOAD_BIN_DIR: false 34 | UPLOAD_FIRMWARE: false 35 | UPLOAD_RELEASE: true 36 | TZ: Asia/Shanghai 37 | 38 | jobs: 39 | build: 40 | runs-on: ubuntu-24.04 41 | 42 | steps: 43 | - name: 检查 44 | uses: actions/checkout@main 45 | 46 | - name: 初始化环境 47 | env: 48 | DEBIAN_FRONTEND: noninteractive 49 | run: | 50 | chmod +x $FREE_DISK_SH && $FREE_DISK_SH 51 | sudo -E apt-get -qq update -y 52 | sudo -E apt-get -qq full-upgrade -y 53 | chmod +x $ENV_SH && $ENV_SH 54 | sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc 55 | sudo timedatectl set-timezone "$TZ" 56 | docker image prune -a -f 57 | docker container prune -f 58 | sudo mkdir -p /workdir 59 | sudo chown $USER:$GROUPS /workdir 60 | 61 | - name: 检查空间使用情况1 62 | if: (!cancelled()) 63 | run: df -hT 64 | 65 | - name: 克隆源码 66 | working-directory: /workdir 67 | run: | 68 | git clone $REPO_URL --depth 1 -b $REPO_BRANCH openwrt 69 | ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt 70 | 71 | # - name: 设置 VERSION 环境变量 72 | # run: echo "VERSION=${REPO_BRANCH}" >> $GITHUB_ENV 73 | 74 | # - name: 开启缓存 75 | # uses: klever1988/cachewrtbuild@main 76 | # with: 77 | # ccache: 'true' 78 | # mixkey: '${{ env.VERSION }}_X86-64' 79 | # prefix: ${{ github.workspace }}/openwrt 80 | 81 | - name: 安装 feeds 82 | run: | 83 | cd openwrt 84 | ./scripts/feeds update -a 85 | ./scripts/feeds install -a 86 | 87 | - name: 导入补丁和配置 & 执行脚本 88 | run: | 89 | [ -d files ] && mv files openwrt/files || echo "files not found" 90 | [ -f $CONFIG_FILE ] && cat $CONFIG_FILE >> openwrt/.config 91 | cd openwrt 92 | chmod +x $GITHUB_WORKSPACE/$SETTINGS_SH && $GITHUB_WORKSPACE/$SETTINGS_SH 93 | chmod +x $GITHUB_WORKSPACE/$PACKAGES_SH && $GITHUB_WORKSPACE/$PACKAGES_SH 94 | chmod +x $GITHUB_WORKSPACE/$CLASH_CORE_SH && $GITHUB_WORKSPACE/$CLASH_CORE_SH 95 | 96 | - name: 下载文件 97 | run: | 98 | cd openwrt 99 | make defconfig 100 | make download -j8 V=10 101 | find dl -size -1024c -exec ls -l {} \; 102 | find dl -size -1024c -exec rm -f {} \; 103 | 104 | - name: 空间使用情况2 105 | if: (!cancelled()) 106 | run: df -hT 107 | 108 | - name: 编译工具链 109 | id: mtools 110 | run: | 111 | cd openwrt 112 | make defconfig 113 | echo -e "$(($(nproc)+1)) thread compile" 114 | make tools/compile -j$(($(nproc)+1)) || make tools/compile -j1 V=s 115 | make toolchain/compile -j$(($(nproc)+1)) || make toolchain/compile -j1 V=s 116 | echo "status=success" >> $GITHUB_OUTPUT 117 | 118 | - name: 空间使用情况3_1 119 | if: (!cancelled()) 120 | run: df -hT 121 | 122 | - name: 清除工具链编译中间产物... 123 | if: steps.mtools.outputs.status == 'success' && !cancelled() 124 | run: | 125 | cd openwrt 126 | rm -rf dl/* 127 | rm -rf build_dir/host/* 128 | rm -rf build_dir/toolchain-* 129 | 130 | - name: 空间使用情况3_2 131 | if: (!cancelled()) 132 | run: df -hT 133 | 134 | - name: 编译内核 135 | id: mkernel 136 | if: steps.mtools.outputs.status == 'success' && !cancelled() 137 | run: | 138 | cd openwrt 139 | echo -e "$(($(nproc)+1)) thread compile" 140 | make target/linux/compile -j$(($(nproc)+1)) || make target/linux/compile -j1 V=s 141 | echo "status=success" >> $GITHUB_OUTPUT 142 | 143 | - name: 空间使用情况4 144 | if: (!cancelled()) 145 | run: df -hT 146 | 147 | - name: 编译插件 148 | id: mpackage 149 | if: steps.mkernel.outputs.status == 'success' && !cancelled() 150 | run: | 151 | cd openwrt 152 | echo -e "$(($(nproc)+1)) thread compile" 153 | make package/compile -j$(($(nproc)+1)) || make package/compile -j1 V=s 154 | make package/index 155 | make package/install -j$(nproc) || make package/install -j1 V=s 156 | echo "status=success" >> $GITHUB_OUTPUT 157 | 158 | - name: 空间使用情况5 159 | if: (!cancelled()) 160 | run: df -hT 161 | 162 | - name: 清除插件编译文件 163 | id: cpackage 164 | if: steps.mpackage.outputs.status == 'success' && !cancelled() 165 | run: | 166 | cd openwrt 167 | rm -rf build_dir/target-*/host 168 | echo "status=success" >> $GITHUB_OUTPUT 169 | 170 | - name: 空间使用情况6 171 | if: (!cancelled()) 172 | run: df -hT 173 | 174 | - name: 编译固件 175 | id: compile 176 | if: steps.cpackage.outputs.status == 'success' && !cancelled() 177 | run: | 178 | cd openwrt 179 | echo -e "$(($(nproc)+1)) thread compile" 180 | make target/install -j$(nproc) || make target/install -j1 V=s 181 | make json_overview_image_info 182 | make checksum 183 | echo "status=success" >> $GITHUB_OUTPUT 184 | 185 | - name: 空间使用情况7 186 | if: (!cancelled()) 187 | run: df -hT 188 | 189 | - name: 上传 bin 目录 190 | uses: actions/upload-artifact@main 191 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true' 192 | with: 193 | name: OpenWrt_bin${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 194 | path: openwrt/bin 195 | 196 | - name: 整理文件 197 | id: organize 198 | if: steps.compile.outputs.status == 'success' && !cancelled() 199 | run: | 200 | cd openwrt/bin/targets/*/* 201 | rm -rf *.bin 202 | rm -rf *.buildinfo 203 | rm -rf *.json 204 | rm -rf *.manifest 205 | rm -rf packages 206 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 207 | echo "status=success" >> $GITHUB_OUTPUT 208 | 209 | - name: 上传固件目录 210 | uses: actions/upload-artifact@main 211 | if: env.UPLOAD_FIRMWARE == 'true' && steps.organize.outputs.status == 'success' && !cancelled() 212 | with: 213 | name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 214 | path: ${{ env.FIRMWARE }} 215 | 216 | - name: 生成发布标签 217 | id: tag 218 | if: env.UPLOAD_RELEASE == 'true' && steps.compile.outputs.status == 'success' && !cancelled() 219 | run: | 220 | VERSION1="${REPO_BRANCH}" 221 | echo -e "🎉 X86-64 平台\n✅ ${VERSION1} 源码\n❗️ ip地址 : 192.168.8.1" >> release.txt 222 | echo "release_tag=$(date +"%Y.%m.%d-${VERSION1}_X86-64")" >> $GITHUB_OUTPUT 223 | echo "status=success" >> $GITHUB_OUTPUT 224 | 225 | - name: 上传固件到发布 226 | uses: softprops/action-gh-release@v2.0.4 227 | if: steps.tag.outputs.status == 'success' && !cancelled() 228 | env: 229 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 230 | with: 231 | tag_name: ${{ steps.tag.outputs.release_tag }} 232 | body_path: release.txt 233 | files: ${{ env.FIRMWARE }}/* 234 | 235 | - name: 删除以前发布的固件 236 | uses: dev-drprasad/delete-older-releases@v0.3.3 237 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_RELEASE == 'true' && !cancelled() 238 | with: 239 | keep_latest: 15 240 | delete_tags: true 241 | env: 242 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 243 | 244 | - name: 删除以前的工作流程 245 | uses: Mattraks/delete-workflow-runs@v2 246 | with: 247 | token: ${{ secrets.GITHUB_TOKEN }} 248 | repository: ${{ github.repository }} 249 | retain_days: 1 250 | keep_minimum_runs: 3 251 | -------------------------------------------------------------------------------- /.github/workflows/master-mtk_filogic.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019-2020 P3TERX 3 | # 4 | # This is free software, licensed under the MIT License. 5 | # See /LICENSE for more information. 6 | # 7 | # https://github.com/P3TERX/Actions-OpenWrt 8 | # Description: Build OpenWrt using GitHub Actions 9 | # 10 | 11 | name: master-mtkfilogic 12 | 13 | permissions: write-all 14 | #开启写权限,防止无法上传到release 15 | 16 | on: 17 | repository_dispatch: 18 | workflow_dispatch: 19 | # schedule: 20 | # - cron: 0 22 * * 3 21 | # 分,时,日,月,周。每周 四 22时执行一次 (UTC时间) 22 | 23 | env: 24 | FREE_DISK_SH: scripts/free_disk_space.sh 25 | ENV_SH: scripts/environment.sh 26 | REPO_URL: https://github.com/immortalwrt/immortalwrt 27 | REPO_BRANCH: master 28 | # 修改 REPO_BRANCH 来达到更改编译版本 29 | PLATFORM_FILE: configs/filogic.txt 30 | CONFIG_FILE: configs/Packages-L.txt 31 | SETTINGS_SH: scripts/init-settings.sh 32 | PACKAGES_SH: scripts/packages.sh 33 | CLASH_CORE_SH: scripts/preset-clash-core-arm64-L.sh 34 | UPLOAD_BIN_DIR: false 35 | UPLOAD_FIRMWARE: false 36 | UPLOAD_RELEASE: true 37 | TZ: Asia/Shanghai 38 | 39 | jobs: 40 | build: 41 | runs-on: ubuntu-24.04 42 | 43 | steps: 44 | - name: 检查 45 | uses: actions/checkout@main 46 | 47 | - name: 初始化环境 48 | env: 49 | DEBIAN_FRONTEND: noninteractive 50 | run: | 51 | chmod +x $FREE_DISK_SH && $FREE_DISK_SH 52 | sudo -E apt-get -qq update -y 53 | sudo -E apt-get -qq full-upgrade -y 54 | chmod +x $ENV_SH && $ENV_SH 55 | sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc 56 | sudo timedatectl set-timezone "$TZ" 57 | docker image prune -a -f 58 | docker container prune -f 59 | sudo mkdir -p /workdir 60 | sudo chown $USER:$GROUPS /workdir 61 | 62 | - name: 检查空间使用情况1 63 | if: (!cancelled()) 64 | run: df -hT 65 | 66 | - name: 克隆源码 67 | working-directory: /workdir 68 | run: | 69 | git clone $REPO_URL --depth 1 -b $REPO_BRANCH openwrt 70 | ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt 71 | 72 | # - name: 设置 VERSION 环境变量 73 | # run: echo "VERSION=${REPO_BRANCH}" >> $GITHUB_ENV 74 | 75 | # - name: 开启缓存 76 | # uses: klever1988/cachewrtbuild@main 77 | # with: 78 | # ccache: 'true' 79 | # mixkey: 'master-filogic' 80 | # prefix: ${{ github.workspace }}/openwrt 81 | 82 | - name: 安装 feeds 83 | run: | 84 | cd openwrt 85 | ./scripts/feeds update -a 86 | ./scripts/feeds install -a 87 | 88 | - name: 导入补丁和配置 & 执行脚本 89 | run: | 90 | [ -d files ] && mv files openwrt/files || echo "files not found" 91 | [ -f $PLATFORM_FILE ] && cat $PLATFORM_FILE >> openwrt/.config 92 | [ -f $CONFIG_FILE ] && cat $CONFIG_FILE >> openwrt/.config 93 | cd openwrt 94 | chmod +x $GITHUB_WORKSPACE/$SETTINGS_SH && $GITHUB_WORKSPACE/$SETTINGS_SH 95 | chmod +x $GITHUB_WORKSPACE/$PACKAGES_SH && $GITHUB_WORKSPACE/$PACKAGES_SH 96 | chmod +x $GITHUB_WORKSPACE/$CLASH_CORE_SH && $GITHUB_WORKSPACE/$CLASH_CORE_SH 97 | 98 | - name: 下载文件 99 | run: | 100 | cd openwrt 101 | make defconfig 102 | make download -j8 V=10 103 | find dl -size -1024c -exec ls -l {} \; 104 | find dl -size -1024c -exec rm -f {} \; 105 | 106 | - name: 空间使用情况2 107 | if: (!cancelled()) 108 | run: df -hT 109 | 110 | - name: 编译工具链 111 | id: mtools 112 | run: | 113 | cd openwrt 114 | make defconfig 115 | echo -e "$(($(nproc)+1)) thread compile" 116 | make tools/compile -j$(($(nproc)+1)) || make tools/compile -j1 V=s 117 | make toolchain/compile -j$(($(nproc)+1)) || make toolchain/compile -j1 V=s 118 | echo "status=success" >> $GITHUB_OUTPUT 119 | 120 | - name: 空间使用情况3_1 121 | if: (!cancelled()) 122 | run: df -hT 123 | 124 | - name: 清除工具链编译中间产物... 125 | if: steps.mtools.outputs.status == 'success' && !cancelled() 126 | run: | 127 | cd openwrt 128 | rm -rf dl/* 129 | rm -rf build_dir/toolchain-* 130 | 131 | - name: 空间使用情况3_2 132 | if: (!cancelled()) 133 | run: df -hT 134 | 135 | - name: 编译内核 136 | id: mkernel 137 | if: steps.mtools.outputs.status == 'success' && !cancelled() 138 | run: | 139 | cd openwrt 140 | echo -e "$(($(nproc)+1)) thread compile" 141 | make target/linux/compile -j$(($(nproc)+1)) || make target/linux/compile -j1 V=s 142 | echo "status=success" >> $GITHUB_OUTPUT 143 | 144 | - name: 空间使用情况4 145 | if: (!cancelled()) 146 | run: df -hT 147 | 148 | - name: 编译插件 149 | id: mpackage 150 | if: steps.mkernel.outputs.status == 'success' && !cancelled() 151 | run: | 152 | cd openwrt 153 | echo -e "$(($(nproc)+1)) thread compile" 154 | make package/compile -j$(($(nproc)+1)) || make package/compile -j1 V=s 155 | make package/index 156 | make package/install -j$(nproc) || make package/install -j1 V=s 157 | echo "status=success" >> $GITHUB_OUTPUT 158 | 159 | - name: 空间使用情况5 160 | if: (!cancelled()) 161 | run: df -hT 162 | 163 | - name: 清除插件编译文件 164 | id: cpackage 165 | if: steps.mpackage.outputs.status == 'success' && !cancelled() 166 | run: | 167 | cd openwrt 168 | rm -rf build_dir/target-*/host 169 | echo "status=success" >> $GITHUB_OUTPUT 170 | 171 | - name: 空间使用情况6 172 | if: (!cancelled()) 173 | run: df -hT 174 | 175 | - name: 编译固件 176 | id: compile 177 | if: steps.cpackage.outputs.status == 'success' && !cancelled() 178 | run: | 179 | cd openwrt 180 | echo -e "$(($(nproc)+1)) thread compile" 181 | make target/install -j$(nproc) || make target/install -j1 V=s 182 | make json_overview_image_info 183 | make checksum 184 | echo "status=success" >> $GITHUB_OUTPUT 185 | 186 | - name: 空间使用情况7 187 | if: (!cancelled()) 188 | run: df -hT 189 | 190 | - name: 上传 bin 目录 191 | uses: actions/upload-artifact@main 192 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true' 193 | with: 194 | name: OpenWrt_bin${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 195 | path: openwrt/bin 196 | 197 | - name: 整理文件 198 | id: organize 199 | if: steps.compile.outputs.status == 'success' && !cancelled() 200 | run: | 201 | cd openwrt/bin/targets/*/* 202 | rm -rf *.buildinfo 203 | rm -rf *.json 204 | rm -rf *.manifest 205 | rm -rf packages 206 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 207 | echo "status=success" >> $GITHUB_OUTPUT 208 | 209 | - name: 上传固件目录 210 | uses: actions/upload-artifact@main 211 | if: env.UPLOAD_FIRMWARE == 'true' && steps.organize.outputs.status == 'success' && !cancelled() 212 | with: 213 | name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 214 | path: ${{ env.FIRMWARE }} 215 | 216 | - name: 生成发布标签 217 | id: tag 218 | if: env.UPLOAD_RELEASE == 'true' && steps.compile.outputs.status == 'success' && !cancelled() 219 | run: | 220 | VERSION1="${REPO_BRANCH}" 221 | echo -e "🎉 MTK filogic平台\n✅ ${VERSION1} 源码\n❗️ ip地址 : 192.168.8.1" >> release.txt 222 | echo "release_tag=$(date +"%Y.%m.%d-${VERSION1}_filogic")" >> $GITHUB_OUTPUT 223 | echo "status=success" >> $GITHUB_OUTPUT 224 | 225 | - name: 上传固件到发布 226 | uses: softprops/action-gh-release@v2.0.4 227 | if: steps.tag.outputs.status == 'success' && !cancelled() 228 | env: 229 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 230 | with: 231 | tag_name: ${{ steps.tag.outputs.release_tag }} 232 | body_path: release.txt 233 | files: ${{ env.FIRMWARE }}/* 234 | 235 | - name: 删除以前发布的固件 236 | uses: dev-drprasad/delete-older-releases@v0.3.3 237 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_RELEASE == 'true' && !cancelled() 238 | with: 239 | keep_latest: 15 240 | delete_tags: true 241 | env: 242 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 243 | 244 | - name: 删除以前的工作流程 245 | uses: Mattraks/delete-workflow-runs@v2 246 | with: 247 | token: ${{ secrets.GITHUB_TOKEN }} 248 | repository: ${{ github.repository }} 249 | retain_days: 1 250 | keep_minimum_runs: 3 251 | -------------------------------------------------------------------------------- /.github/workflows/master-rockchip.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2019-2020 P3TERX 3 | # 4 | # This is free software, licensed under the MIT License. 5 | # See /LICENSE for more information. 6 | # 7 | # https://github.com/P3TERX/Actions-OpenWrt 8 | # Description: Build OpenWrt using GitHub Actions 9 | # 10 | 11 | name: master-rockchip 12 | 13 | permissions: write-all 14 | #开启写权限,防止无法上传到release 15 | 16 | on: 17 | repository_dispatch: 18 | workflow_dispatch: 19 | # schedule: 20 | # - cron: 0 22 * * 2 21 | # 分,时,日,月,星期。每周 三 22时执行一次 (UTC时间) 22 | 23 | env: 24 | FREE_DISK_SH: scripts/free_disk_space.sh 25 | ENV_SH: scripts/environment.sh 26 | REPO_URL: https://github.com/immortalwrt/immortalwrt 27 | REPO_BRANCH: master 28 | # 修改 REPO_BRANCH 来达到更改编译版本 29 | PLATFORM_FILE: configs/rockchip.txt 30 | CONFIG_FILE: configs/Packages.txt 31 | SETTINGS_SH: scripts/init-settings.sh 32 | PACKAGES_SH: scripts/packages.sh 33 | CLASH_CORE_SH: scripts/preset-clash-core-arm64-L.sh 34 | UPLOAD_BIN_DIR: false 35 | UPLOAD_FIRMWARE: false 36 | UPLOAD_RELEASE: true 37 | TZ: Asia/Shanghai 38 | 39 | jobs: 40 | build: 41 | runs-on: ubuntu-24.04 42 | 43 | steps: 44 | - name: 检查 45 | uses: actions/checkout@main 46 | 47 | - name: 初始化环境 48 | env: 49 | DEBIAN_FRONTEND: noninteractive 50 | run: | 51 | chmod +x $FREE_DISK_SH && $FREE_DISK_SH 52 | sudo -E apt-get -qq update -y 53 | sudo -E apt-get -qq full-upgrade -y 54 | chmod +x $ENV_SH && $ENV_SH 55 | sudo rm -rf /etc/apt/sources.list.d/* /usr/share/dotnet /usr/local/lib/android /opt/ghc 56 | sudo timedatectl set-timezone "$TZ" 57 | docker image prune -a -f 58 | docker container prune -f 59 | sudo mkdir -p /workdir 60 | sudo chown $USER:$GROUPS /workdir 61 | 62 | - name: 检查空间使用情况1 63 | if: (!cancelled()) 64 | run: df -hT 65 | 66 | - name: 克隆源码 67 | working-directory: /workdir 68 | run: | 69 | git clone $REPO_URL --depth 1 -b $REPO_BRANCH openwrt 70 | ln -sf /workdir/openwrt $GITHUB_WORKSPACE/openwrt 71 | 72 | - name: 设置 VERSION 环境变量 73 | run: echo "VERSION=${REPO_BRANCH}" >> $GITHUB_ENV 74 | 75 | - name: 开启缓存 76 | uses: klever1988/cachewrtbuild@main 77 | with: 78 | ccache: 'true' 79 | mixkey: '${{ env.VERSION }}-rockchip' 80 | prefix: ${{ github.workspace }}/openwrt 81 | 82 | - name: 安装 feeds 83 | run: | 84 | cd openwrt 85 | ./scripts/feeds update -a 86 | ./scripts/feeds install -a 87 | 88 | - name: 导入补丁和配置 & 执行脚本 89 | run: | 90 | [ -d files ] && mv files openwrt/files || echo "files not found" 91 | [ -f $PLATFORM_FILE ] && cat $PLATFORM_FILE >> openwrt/.config 92 | [ -f $CONFIG_FILE ] && cat $CONFIG_FILE >> openwrt/.config 93 | cd openwrt 94 | chmod +x $GITHUB_WORKSPACE/$SETTINGS_SH && $GITHUB_WORKSPACE/$SETTINGS_SH 95 | chmod +x $GITHUB_WORKSPACE/$PACKAGES_SH && $GITHUB_WORKSPACE/$PACKAGES_SH 96 | chmod +x $GITHUB_WORKSPACE/$CLASH_CORE_SH && $GITHUB_WORKSPACE/$CLASH_CORE_SH 97 | 98 | - name: 下载文件 99 | run: | 100 | cd openwrt 101 | make defconfig 102 | make download -j8 V=10 103 | find dl -size -1024c -exec ls -l {} \; 104 | find dl -size -1024c -exec rm -f {} \; 105 | 106 | - name: 空间使用情况2 107 | if: (!cancelled()) 108 | run: df -hT 109 | 110 | - name: 编译工具链 111 | id: mtools 112 | run: | 113 | cd openwrt 114 | make defconfig 115 | echo -e "$(($(nproc)+1)) thread compile" 116 | make tools/compile -j$(($(nproc)+1)) || make tools/compile -j1 V=s 117 | make toolchain/compile -j$(($(nproc)+1)) || make toolchain/compile -j1 V=s 118 | echo "status=success" >> $GITHUB_OUTPUT 119 | 120 | - name: 空间使用情况3_1 121 | if: (!cancelled()) 122 | run: df -hT 123 | 124 | - name: 清除工具链编译中间产物... 125 | if: steps.mtools.outputs.status == 'success' && !cancelled() 126 | run: | 127 | cd openwrt 128 | rm -rf dl/* 129 | rm -rf build_dir/host/* 130 | rm -rf build_dir/toolchain-* 131 | 132 | - name: 空间使用情况3_2 133 | if: (!cancelled()) 134 | run: df -hT 135 | 136 | - name: 编译内核 137 | id: mkernel 138 | if: steps.mtools.outputs.status == 'success' && !cancelled() 139 | run: | 140 | cd openwrt 141 | echo -e "$(($(nproc)+1)) thread compile" 142 | make target/linux/compile -j$(($(nproc)+1)) || make target/linux/compile -j1 V=s 143 | echo "status=success" >> $GITHUB_OUTPUT 144 | 145 | - name: 空间使用情况4 146 | if: (!cancelled()) 147 | run: df -hT 148 | 149 | - name: 编译插件 150 | id: mpackage 151 | if: steps.mkernel.outputs.status == 'success' && !cancelled() 152 | run: | 153 | cd openwrt 154 | echo -e "$(($(nproc)+1)) thread compile" 155 | make package/compile -j$(($(nproc)+1)) || make package/compile -j1 V=s 156 | make package/index 157 | make package/install -j$(nproc) || make package/install -j1 V=s 158 | echo "status=success" >> $GITHUB_OUTPUT 159 | 160 | - name: 空间使用情况5 161 | if: (!cancelled()) 162 | run: df -hT 163 | 164 | - name: 清除插件编译文件 165 | id: cpackage 166 | if: steps.mpackage.outputs.status == 'success' && !cancelled() 167 | run: | 168 | cd openwrt 169 | rm -rf build_dir/target-*/host 170 | echo "status=success" >> $GITHUB_OUTPUT 171 | 172 | - name: 空间使用情况6 173 | if: (!cancelled()) 174 | run: df -hT 175 | 176 | - name: 编译固件 177 | id: compile 178 | if: steps.cpackage.outputs.status == 'success' && !cancelled() 179 | run: | 180 | cd openwrt 181 | echo -e "$(($(nproc)+1)) thread compile" 182 | make target/install -j$(nproc) || make target/install -j1 V=s 183 | make json_overview_image_info 184 | make checksum 185 | echo "status=success" >> $GITHUB_OUTPUT 186 | 187 | - name: 空间使用情况7 188 | if: (!cancelled()) 189 | run: df -hT 190 | 191 | - name: 上传 bin 目录 192 | uses: actions/upload-artifact@main 193 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_BIN_DIR == 'true' 194 | with: 195 | name: OpenWrt_bin${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 196 | path: openwrt/bin 197 | 198 | - name: 整理文件 199 | id: organize 200 | if: steps.compile.outputs.status == 'success' && !cancelled() 201 | run: | 202 | cd openwrt/bin/targets/*/* 203 | rm -rf *.bin 204 | rm -rf *.buildinfo 205 | rm -rf *.json 206 | rm -rf *.manifest 207 | rm -rf packages 208 | echo "FIRMWARE=$PWD" >> $GITHUB_ENV 209 | echo "status=success" >> $GITHUB_OUTPUT 210 | 211 | - name: 上传固件目录 212 | uses: actions/upload-artifact@main 213 | if: env.UPLOAD_FIRMWARE == 'true' && steps.organize.outputs.status == 'success' && !cancelled() 214 | with: 215 | name: OpenWrt_firmware${{ env.DEVICE_NAME }}${{ env.FILE_DATE }} 216 | path: ${{ env.FIRMWARE }} 217 | 218 | - name: 生成发布标签 219 | id: tag 220 | if: env.UPLOAD_RELEASE == 'true' && steps.compile.outputs.status == 'success' && !cancelled() 221 | run: | 222 | VERSION1="${REPO_BRANCH}" 223 | echo -e "🎉 Rockchip平台\n✅ ${VERSION1} 源码\n❗️ ip地址 : 192.168.8.1" >> release.txt 224 | echo "release_tag=$(date +"%Y.%m.%d-${VERSION1}_rockchip")" >> $GITHUB_OUTPUT 225 | echo "status=success" >> $GITHUB_OUTPUT 226 | 227 | - name: 上传固件到发布 228 | uses: softprops/action-gh-release@v2.0.4 229 | if: steps.tag.outputs.status == 'success' && !cancelled() 230 | env: 231 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 232 | with: 233 | tag_name: ${{ steps.tag.outputs.release_tag }} 234 | body_path: release.txt 235 | files: ${{ env.FIRMWARE }}/* 236 | 237 | - name: 删除以前发布的固件 238 | uses: dev-drprasad/delete-older-releases@v0.3.3 239 | if: steps.compile.outputs.status == 'success' && env.UPLOAD_RELEASE == 'true' && !cancelled() 240 | with: 241 | keep_latest: 15 242 | delete_tags: true 243 | env: 244 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 245 | 246 | - name: 删除以前的工作流程 247 | uses: Mattraks/delete-workflow-runs@v2 248 | with: 249 | token: ${{ secrets.GITHUB_TOKEN }} 250 | repository: ${{ github.repository }} 251 | retain_days: 1 252 | keep_minimum_runs: 3 253 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019-2020 P3TERX 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **编译顺序,周一 Allwinner、周二 mt7621、周三 Rockchip、周四 mtk_filogic、周五 X86-64** 2 | ## ip地址:192.168.8.1
3 | 默认开启smartdns解析,本地端口1053,外地端口6553(可以自己看看里面的解析服务器)
4 | ![argon2](doc/argon2.png)
5 | 6 | ## 如何使用呢?
7 | 8 | **X86** 平台:应该不用教了吧,写在U盘也行,硬盘也行。
9 | 10 | **Allwinner、Rockchip** 平台:能插内存卡的可以写内存卡,emmc的就自己找官方工具写入
11 | 12 | **mt7621** 应该也不难,先刷好不死然后刷 -factory.bin 后面再刷 -squashfs-sysupgrade.bin 就可以
13 | 14 | **MTK-filogic** 平台最麻烦
15 | 先科普一下(*建议参考其他教程刷!需要按顺序刷入!*)
16 | **-gpt.bin** 有些存储空间比较大的机型会有这个文件,不多(*有的话第一次也要刷* )
17 | **-preloader.bin** 是 **bl2** (op官方需要..所以第一次刷必须!)
18 | **-bl31-uboot.fip** 是 **uboot** (不刷你也刷不了这个固件!)*后续想刷回lede的固件可以用ttl先把这个刷了,Uboot就改它需要的文件名..就是 -fip.bin 文件改 -bl31-uboot.fip文件..*
19 | **-recovery.itb** 这是uboot自动识别刷入的 第一个初始固件(这里推荐使用天灵大佬的初始固件,下面网址),刷了以后开机进去的时候会提示让你刷 -squashfs-sysupgrade.itb 结尾的固件(这个就可以刷本仓库编译出来带 squashfs 的固件)
20 | 21 | [ImortalWrt Firmware Selector](https://firmware-selector.immortalwrt.org/) 22 | 这是天灵大佬的自动生成固件网站
23 | 24 | 例如我的设备CMCC RAX3000M nand版本 25 | ![IFS](doc/IFS.png) 26 | 如果你本来是有192.168.1.1后台的uboot了(能刷lede固件的)如何切换到这个固件呢?
27 | 192.168.1.1/uboot.html
28 | 192.168.1.1/bl2.html
29 | 根据上面提示自己领悟..完毕。
30 |
31 | **English** | [中文](https://p3terx.com/archives/build-openwrt-with-github-actions.html) 32 | 33 | # Actions-OpenWrt 34 | 35 | [![LICENSE](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square&label=LICENSE)](https://github.com/P3TERX/Actions-OpenWrt/blob/master/LICENSE) 36 | ![GitHub Stars](https://img.shields.io/github/stars/P3TERX/Actions-OpenWrt.svg?style=flat-square&label=Stars&logo=github) 37 | ![GitHub Forks](https://img.shields.io/github/forks/P3TERX/Actions-OpenWrt.svg?style=flat-square&label=Forks&logo=github) 38 | 39 | A template for building OpenWrt with GitHub Actions 40 | 41 | ## Usage 42 | 43 | - Click the [Use this template](https://github.com/P3TERX/Actions-OpenWrt/generate) button to create a new repository. 44 | - Generate `.config` files using [Lean's OpenWrt](https://github.com/coolsnowwolf/lede) source code. ( You can change it through environment variables in the workflow file. ) 45 | - Push `.config` file to the GitHub repository. 46 | - Select `Build OpenWrt` on the Actions page. 47 | - Click the `Run workflow` button. 48 | - When the build is complete, click the `Artifacts` button in the upper right corner of the Actions page to download the binaries. 49 | 50 | ## Tips 51 | 52 | - It may take a long time to create a `.config` file and build the OpenWrt firmware. Thus, before create repository to build your own firmware, you may check out if others have already built it which meet your needs by simply [search `Actions-Openwrt` in GitHub](https://github.com/search?q=Actions-openwrt). 53 | - Add some meta info of your built firmware (such as firmware architecture and installed packages) to your repository introduction, this will save others' time. 54 | 55 | ## Credits 56 | 57 | - [Microsoft Azure](https://azure.microsoft.com) 58 | - [GitHub Actions](https://github.com/features/actions) 59 | - [OpenWrt](https://github.com/openwrt/openwrt) 60 | - [Lean's OpenWrt](https://github.com/coolsnowwolf/lede) 61 | - [tmate](https://github.com/tmate-io/tmate) 62 | - [mxschmitt/action-tmate](https://github.com/mxschmitt/action-tmate) 63 | - [csexton/debugger-action](https://github.com/csexton/debugger-action) 64 | - [Cowtransfer](https://cowtransfer.com) 65 | - [WeTransfer](https://wetransfer.com/) 66 | - [Mikubill/transfer](https://github.com/Mikubill/transfer) 67 | - [softprops/action-gh-release](https://github.com/softprops/action-gh-release) 68 | - [ActionsRML/delete-workflow-runs](https://github.com/ActionsRML/delete-workflow-runs) 69 | - [dev-drprasad/delete-older-releases](https://github.com/dev-drprasad/delete-older-releases) 70 | - [peter-evans/repository-dispatch](https://github.com/peter-evans/repository-dispatch) 71 | 72 | ## License 73 | 74 | [MIT](https://github.com/P3TERX/Actions-OpenWrt/blob/main/LICENSE) © [**P3TERX**](https://p3terx.com) 75 | -------------------------------------------------------------------------------- /configs/Packages-5G.txt: -------------------------------------------------------------------------------- 1 | CONFIG_PACKAGE_luci-app-qmodem_with_lua_index_page=y 2 | CONFIG_PACKAGE_luci-app-qmodem=y 3 | CONFIG_PACKAGE_luci-app-qmodem_ADD_LUA_LUCI_HOMEPAGE=y 4 | CONFIG_PACKAGE_luci-app-qmodem_INCLUDE_ADD_PCI_SUPPORT=y 5 | CONFIG_PACKAGE_luci-app-qmodem_USE_TOM_CUSTOMIZED_QUECTEL_CM=y 6 | CONFIG_PACKAGE_luci-app-qmodem_USING_QWRT_QUECTEL_CM_5G=y 7 | # CONFIG_PACKAGE_luci-app-qmodem_USING_NORMAL_QUECTEL_CM is not set 8 | # CONFIG_PACKAGE_luci-app-qmodem-hc is not set 9 | # CONFIG_PACKAGE_luci-app-qmodem-mwan is not set 10 | CONFIG_PACKAGE_luci-app-qmodem-sms=y 11 | CONFIG_PACKAGE_luci-app-qmodem-ttl=y 12 | CONFIG_PACKAGE_luci-i18n-qmodem-sms-zh-cn=y 13 | CONFIG_PACKAGE_luci-i18n-qmodem-zh-cn=y 14 | CONFIG_PACKAGE_kmod-mhi-bus=y 15 | CONFIG_PACKAGE_kmod-mhi-pci-generic=y 16 | 17 | 18 | # 5G模组信号插件 19 | # CONFIG_PACKAGE_ext-rooter-basic=y 20 | 21 | # 5G模组短信插件 22 | CONFIG_PACKAGE_luci-app-sms-tool=y 23 | 24 | # 5G模组信息插件 25 | # CONFIG_PACKAGE_luci-app-3ginfo-lite=y 26 | # CONFIG_PACKAGE_luci-app-3ginfo=y 27 | 28 | # 5G模组信息插件+AT工具 29 | # CONFIG_PACKAGE_luci-app-cpe=y 30 | # CONFIG_PACKAGE_sendat=y 31 | CONFIG_PACKAGE_sms-tool=y 32 | #CONFIG_PACKAGE_luci-app-modem=y 33 | 34 | # QMI拨号工具(移远,广和通) 35 | # CONFIG_PACKAGE_quectel-CM-5G=y 36 | # CONFIG_PACKAGE_fibocom-dial=y 37 | 38 | # QMI拨号软件 39 | # CONFIG_PACKAGE_kmod-qmi_wwan_f=y 40 | # CONFIG_PACKAGE_luci-app-hypermodem=y 41 | 42 | # Gobinet拨号软件 43 | # CONFIG_PACKAGE_kmod-gobinet=y 44 | # CONFIG_PACKAGE_luci-app-gobinetmodem=y 45 | 46 | # 串口调试工具 47 | CONFIG_PACKAGE_minicom=y 48 | 49 | # 脚本拨号工具依赖 50 | CONFIG_PACKAGE_procps-ng=y 51 | CONFIG_PACKAGE_procps-ng-ps=y 52 | -------------------------------------------------------------------------------- /configs/Packages-IPTV.txt: -------------------------------------------------------------------------------- 1 | # 启用 IGMP 代理支持(用于转发组播流到 LAN) 2 | CONFIG_PACKAGE_igmpproxy=y 3 | 4 | # 内核模块:支持 IGMP Proxy 所需的 netfilter 组件 5 | CONFIG_PACKAGE_kmod-igmp-proxy=y 6 | 7 | # UDP 转 HTTP 单播服务,便于不支持组播的设备观看 IPTV 8 | CONFIG_PACKAGE_udpxy=y 9 | 10 | # udpxy 的 LuCI Web 前端管理界面 11 | CONFIG_PACKAGE_luci-app-udpxy=y 12 | 13 | # 可选:替代 igmpproxy 的多播代理(某些运营商更兼容) 14 | # CONFIG_PACKAGE_mcproxy is not set 15 | 16 | # 支持 RTSP 协议 NAT 穿透(如电信移动的 IPTV 点播服务) 17 | CONFIG_PACKAGE_kmod-ipt-nathelper-rtsp=y 18 | 19 | # VLAN 支持工具,用于配置运营商指定的 IPTV VLAN(如 VLAN 835) 20 | CONFIG_PACKAGE_vlan-utils=y 21 | 22 | # 桥接工具包,适用于特殊组网需求 23 | CONFIG_PACKAGE_bridge-utils=y 24 | 25 | # 调试工具:用于抓包分析 IPTV 流量(如 IGMP、UDP) 26 | CONFIG_PACKAGE_tcpdump=y 27 | 28 | # 完整版 ip 命令,支持策略路由与路由表管理 29 | CONFIG_PACKAGE_ip-full=y 30 | 31 | # IPTables 的连接跟踪扩展模块,用于高级路由和流量打标 32 | CONFIG_PACKAGE_iptables-mod-conntrack-extra=y 33 | 34 | # 多拨多 WAN 支持插件,可设置 IPTV 专属线路策略 35 | CONFIG_PACKAGE_luci-app-mwan3=y 36 | 37 | # LuCI 图形界面支持(如果需要 Web 配置) 38 | CONFIG_PACKAGE_luci=y 39 | 40 | # LuCI 支持系统配置 41 | CONFIG_PACKAGE_luci-mod-admin-full=y 42 | CONFIG_PACKAGE_luci-base=y 43 | CONFIG_PACKAGE_luci-theme-bootstrap=y 44 | 45 | -------------------------------------------------------------------------------- /configs/Packages-L.txt: -------------------------------------------------------------------------------- 1 | CONFIG_PACKAGE_default-settings-chn=y 2 | 3 | #kmod 4 | CONFIG_PACKAGE_kmod-usb-net-rndis=y 5 | 6 | #themes 7 | CONFIG_PACKAGE_luci-theme-argon=y 8 | 9 | #luci 10 | CONFIG_PACKAGE_luci=y 11 | CONFIG_PACKAGE_luci-app-adblock=y 12 | CONFIG_PACKAGE_luci-app-adguardhome=y 13 | # CONFIG_PACKAGE_luci-app-adguardhome_INCLUDE_binary is not set 14 | CONFIG_PACKAGE_luci-app-autoreboot=y 15 | CONFIG_PACKAGE_luci-app-argon-config=y 16 | CONFIG_PACKAGE_luci-app-ddns=y 17 | CONFIG_PACKAGE_luci-app-diskman=y 18 | CONFIG_PACKAGE_luci-app-hd-idle=y 19 | CONFIG_PACKAGE_luci-app-homeproxy=y 20 | CONFIG_PACKAGE_luci-app-mosdns=y 21 | CONFIG_PACKAGE_luci-app-openclash=y 22 | CONFIG_PACKAGE_luci-app-passwall=y 23 | CONFIG_PACKAGE_luci-app-passwall2=y 24 | CONFIG_PACKAGE_luci-app-samba4=y 25 | CONFIG_PACKAGE_luci-app-smartdns=y 26 | CONFIG_PACKAGE_luci-app-ttyd=y 27 | CONFIG_PACKAGE_luci-app-usb-printer=y 28 | CONFIG_PACKAGE_luci-app-vlmcsd=y 29 | CONFIG_PACKAGE_luci-app-wechatpush=y 30 | 31 | 32 | # Configuration 33 | # 34 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Haproxy is not set 35 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Hysteria is not set 36 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_NaiveProxy is not set 37 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Client is not set 38 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Server is not set 39 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Client is not set 40 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Server is not set 41 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ShadowsocksR_Libev_Client is not set 42 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ShadowsocksR_Libev_Server is not set 43 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Simple_Obfs is not set 44 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_SingBox=y 45 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Trojan_Plus is not set 46 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_tuic_client is not set 47 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray_Geodata is not set 48 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray_Plugin is not set 49 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Xray_Plugin is not set 50 | # end of Configuration 51 | 52 | # Configuration 53 | # 54 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_Haproxy is not set 55 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_Hysteria is not set 56 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_NaiveProxy is not set 57 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_Shadowsocks_Libev_Client is not set 58 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_Shadowsocks_Libev_Server is not set 59 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_Shadowsocks_Rust_Client is not set 60 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_Shadowsocks_Rust_Server is not set 61 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_ShadowsocksR_Libev_Client is not set 62 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_ShadowsocksR_Libev_Server is not set 63 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_Simple_Obfs is not set 64 | CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_SingBox=y 65 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_tuic_client is not set 66 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_V2ray_Plugin is not set 67 | # end of Configuration 68 | 69 | -------------------------------------------------------------------------------- /configs/Packages-Minimum.txt: -------------------------------------------------------------------------------- 1 | CONFIG_PACKAGE_default-settings-chn=y 2 | 3 | #kmod 4 | CONFIG_PACKAGE_kmod-usb-net-rndis=y 5 | 6 | #themes 7 | CONFIG_PACKAGE_luci-theme-argon=y 8 | 9 | #luci 10 | CONFIG_PACKAGE_luci=y 11 | CONFIG_PACKAGE_luci-app-autoreboot=y 12 | CONFIG_PACKAGE_luci-app-argon-config=y 13 | CONFIG_PACKAGE_luci-app-homeproxy=y 14 | CONFIG_PACKAGE_luci-app-passwall=y 15 | CONFIG_PACKAGE_luci-app-passwall2=y 16 | CONFIG_PACKAGE_luci-app-smartdns=y 17 | CONFIG_PACKAGE_luci-app-ttyd=y 18 | CONFIG_PACKAGE_luci-app-usb-printer=y 19 | CONFIG_PACKAGE_luci-app-vlmcsd=y 20 | -------------------------------------------------------------------------------- /configs/Packages-x86.txt: -------------------------------------------------------------------------------- 1 | #rootfs 2 | CONFIG_TARGET_ROOTFS_PARTSIZE=500 3 | # CONFIG_TARGET_ROOTFS_EXT4FS is not set 4 | 5 | #kmod 6 | CONFIG_PACKAGE_kmod-usb-net-rndis=y 7 | 8 | #themes 9 | CONFIG_PACKAGE_luci-theme-argon=y 10 | 11 | #luci 12 | CONFIG_PACKAGE_luci=y 13 | CONFIG_PACKAGE_luci-app-adblock=y 14 | CONFIG_PACKAGE_luci-app-adguardhome=y 15 | # CONFIG_PACKAGE_luci-app-adguardhome_INCLUDE_binary is not set 16 | CONFIG_PACKAGE_luci-app-autoreboot=y 17 | CONFIG_PACKAGE_luci-app-alist=y 18 | CONFIG_PACKAGE_luci-app-argon-config=y 19 | CONFIG_PACKAGE_luci-app-arpbind=y 20 | CONFIG_PACKAGE_luci-app-cpufreq=y 21 | CONFIG_PACKAGE_luci-app-ddns-go=y 22 | CONFIG_PACKAGE_luci-app-ddns=y 23 | CONFIG_PACKAGE_luci-app-diskman=y 24 | CONFIG_PACKAGE_luci-app-diskman_INCLUDE_btrfs_progs=y 25 | CONFIG_PACKAGE_luci-app-diskman_INCLUDE_lsblk=y 26 | CONFIG_PACKAGE_luci-app-hd-idle=y 27 | CONFIG_PACKAGE_luci-app-homeproxy=y 28 | CONFIG_PACKAGE_luci-app-lucky=y 29 | CONFIG_PACKAGE_luci-app-minidlna=y 30 | CONFIG_PACKAGE_luci-app-mosdns=y 31 | CONFIG_PACKAGE_luci-app-netdata=y 32 | CONFIG_PACKAGE_luci-app-nlbwmon=y 33 | CONFIG_PACKAGE_luci-app-nikki=y 34 | CONFIG_PACKAGE_luci-app-openclash=y 35 | CONFIG_PACKAGE_luci-app-passwall=y 36 | CONFIG_PACKAGE_luci-app-passwall2=y 37 | CONFIG_PACKAGE_luci-app-pushbot=y 38 | CONFIG_PACKAGE_luci-app-ramfree=y 39 | CONFIG_PACKAGE_luci-app-samba4=y 40 | CONFIG_PACKAGE_luci-app-smartdns=y 41 | CONFIG_PACKAGE_luci-app-transmission=y 42 | CONFIG_PACKAGE_luci-app-ttyd=y 43 | CONFIG_PACKAGE_luci-app-unblockneteasemusic=y 44 | CONFIG_PACKAGE_luci-app-upnp=y 45 | CONFIG_PACKAGE_luci-app-usb-printer=y 46 | # CONFIG_PACKAGE_luci-app-vsftpd is not set 47 | CONFIG_PACKAGE_luci-app-vlmcsd=y 48 | CONFIG_PACKAGE_luci-app-vnstat2=y 49 | CONFIG_PACKAGE_luci-app-wechatpush=y 50 | CONFIG_PACKAGE_luci-app-wol=y 51 | CONFIG_PACKAGE_luci-app-zerotier=y 52 | 53 | 54 | # Configuration 55 | # 56 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Haproxy is not set 57 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Hysteria is not set 58 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_NaiveProxy is not set 59 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Client is not set 60 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Libev_Server is not set 61 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Client is not set 62 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Shadowsocks_Rust_Server is not set 63 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ShadowsocksR_Libev_Client is not set 64 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_ShadowsocksR_Libev_Server is not set 65 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Simple_Obfs is not set 66 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_SingBox=y 67 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Trojan_Plus is not set 68 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_tuic_client is not set 69 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray_Geodata is not set 70 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_V2ray_Plugin is not set 71 | CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Xray=y 72 | # CONFIG_PACKAGE_luci-app-passwall_INCLUDE_Xray_Plugin is not set 73 | # end of Configuration 74 | 75 | # Configuration 76 | # 77 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_Haproxy is not set 78 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_Hysteria is not set 79 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_NaiveProxy is not set 80 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_Shadowsocks_Libev_Client is not set 81 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_Shadowsocks_Libev_Server is not set 82 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_Shadowsocks_Rust_Client is not set 83 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_Shadowsocks_Rust_Server is not set 84 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_ShadowsocksR_Libev_Client is not set 85 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_ShadowsocksR_Libev_Server is not set 86 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_Simple_Obfs is not set 87 | CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_SingBox=y 88 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_tuic_client is not set 89 | # CONFIG_PACKAGE_luci-app-passwall2_INCLUDE_V2ray_Plugin is not set 90 | # end of Configuration 91 | 92 | 93 | -------------------------------------------------------------------------------- /configs/Packages.txt: -------------------------------------------------------------------------------- 1 | CONFIG_PACKAGE_default-settings-chn=y 2 | 3 | #kmod 4 | CONFIG_PACKAGE_kmod-usb-net-rndis=y 5 | 6 | #themes 7 | CONFIG_PACKAGE_luci-theme-argon=y 8 | 9 | #luci 10 | CONFIG_PACKAGE_luci=y 11 | CONFIG_PACKAGE_luci-app-adblock=y 12 | CONFIG_PACKAGE_luci-app-adguardhome=y 13 | # CONFIG_PACKAGE_luci-app-adguardhome_INCLUDE_binary is not set 14 | CONFIG_PACKAGE_luci-app-autoreboot=y 15 | CONFIG_PACKAGE_luci-app-alist=y 16 | CONFIG_PACKAGE_luci-app-argon-config=y 17 | CONFIG_PACKAGE_luci-app-arpbind=y 18 | CONFIG_PACKAGE_luci-app-cpufreq=y 19 | CONFIG_PACKAGE_luci-app-ddns-go=y 20 | CONFIG_PACKAGE_luci-app-ddns=y 21 | CONFIG_PACKAGE_luci-app-diskman=y 22 | CONFIG_PACKAGE_luci-app-diskman_INCLUDE_btrfs_progs=y 23 | CONFIG_PACKAGE_luci-app-diskman_INCLUDE_lsblk=y 24 | CONFIG_PACKAGE_luci-app-hd-idle=y 25 | CONFIG_PACKAGE_luci-app-homeproxy=y 26 | CONFIG_PACKAGE_luci-app-lucky=y 27 | CONFIG_PACKAGE_luci-app-minidlna=y 28 | CONFIG_PACKAGE_luci-app-mosdns=y 29 | CONFIG_PACKAGE_luci-app-nlbwmon=y 30 | CONFIG_PACKAGE_luci-app-nikki=y 31 | CONFIG_PACKAGE_luci-app-openclash=y 32 | CONFIG_PACKAGE_luci-app-passwall=y 33 | CONFIG_PACKAGE_luci-app-passwall2=y 34 | CONFIG_PACKAGE_luci-app-pushbot=y 35 | CONFIG_PACKAGE_luci-app-ramfree=y 36 | CONFIG_PACKAGE_luci-app-samba4=y 37 | CONFIG_PACKAGE_luci-app-smartdns=y 38 | CONFIG_PACKAGE_luci-app-ttyd=y 39 | CONFIG_PACKAGE_luci-app-upnp=y 40 | CONFIG_PACKAGE_luci-app-usb-printer=y 41 | # CONFIG_PACKAGE_luci-app-vsftpd is not set 42 | CONFIG_PACKAGE_luci-app-vlmcsd=y 43 | CONFIG_PACKAGE_luci-app-vnstat2=y 44 | CONFIG_PACKAGE_luci-app-wechatpush=y 45 | CONFIG_PACKAGE_luci-app-wol=y 46 | CONFIG_PACKAGE_luci-app-zerotier=y 47 | 48 | -------------------------------------------------------------------------------- /configs/allwinner.txt: -------------------------------------------------------------------------------- 1 | CONFIG_TARGET_sunxi=y 2 | CONFIG_TARGET_sunxi_cortexa53=y 3 | CONFIG_TARGET_MULTI_PROFILE=y 4 | CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_xunlong_orangepi-zero2=y 5 | CONFIG_TARGET_DEVICE_sunxi_cortexa53_DEVICE_xunlong_orangepi-zero3=y 6 | 7 | #rootfs 8 | # CONFIG_TARGET_ROOTFS_EXT4FS is not set 9 | CONFIG_TARGET_ROOTFS_PARTSIZE=300 10 | 11 | #luci 12 | CONFIG_PACKAGE_luci-app-cpufreq=y 13 | -------------------------------------------------------------------------------- /configs/filogic.txt: -------------------------------------------------------------------------------- 1 | CONFIG_TARGET_mediatek=y 2 | CONFIG_TARGET_mediatek_filogic=y 3 | CONFIG_TARGET_MULTI_PROFILE=y 4 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_abt_asr3000-ubootmod=y 5 | # CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_bananapi_bpi-r3 is not set 6 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_bananapi_bpi-r3-mini=y 7 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cetron_ct3003-ubootmod=y 8 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cmcc_a10-ubootmod=y 9 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cmcc_rax3000m=y 10 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cmcc_rax3000m-emmc-ubootmod=y 11 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cmcc_rax3000m-nand-ubootmod=y 12 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_cudy_wr3000-v1=y 13 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_glinet_gl-mt3000=y 14 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_h3c_magic-nx30-pro-nmbm=y 15 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_imou_lc-hx3001=y 16 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_jcg_q30=y 17 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_jcg_q30-ubootmod=y 18 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_livinet_zr-3020-common=y 19 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_nokia_ea0326gmp=y 20 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_qihoo_360t7=y 21 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_qihoo_360t7-ubootmod=y 22 | CONFIG_TARGET_DEVICE_mediatek_filogic_DEVICE_xiaomi_mi-router-wr30u-ubootmod=y 23 | 24 | 25 | #rootfs 26 | CONFIG_TARGET_ROOTFS_PARTSIZE=96 27 | 28 | #luci 29 | CONFIG_PACKAGE_luci-app-cpufreq=y 30 | -------------------------------------------------------------------------------- /configs/ramips-mt7621.txt: -------------------------------------------------------------------------------- 1 | CONFIG_TARGET_ramips=y 2 | CONFIG_TARGET_ramips_mt7621=y 3 | CONFIG_TARGET_MULTI_PROFILE=y 4 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_asus_rt-ax53u=y 5 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_asus_rt-ax54=y 6 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_cudy_m1300-v2=y 7 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_hiwifi_hc5962=y 8 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_jcg_q20=y 9 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_jdcloud_re-cp-02=y 10 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_ruijie_rg-ew1200g-pro-v1.1=y 11 | CONFIG_TARGET_DEVICE_ramips_mt7621_DEVICE_xiaomi_mi-router-cr660x=y 12 | 13 | -------------------------------------------------------------------------------- /configs/rk3568.txt: -------------------------------------------------------------------------------- 1 | CONFIG_TARGET_rockchip=y 2 | CONFIG_TARGET_rockchip_armv8=y 3 | CONFIG_TARGET_MULTI_PROFILE=y 4 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_ariaboard_photonicat=y 5 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_ezpro_mrkaio-m68s=y 6 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_firefly_roc-rk3568-pc=y 7 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r5c=y 8 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r5s=y 9 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_lunzn_fastrhino-r66s=y 10 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_lunzn_fastrhino-r68s=y 11 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_radxa_cm3-io=y 12 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_radxa_rock-3a=y 13 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_sinovoip_bpi-r2-pro=y 14 | 15 | #rootfs 16 | # CONFIG_TARGET_ROOTFS_EXT4FS is not set 17 | CONFIG_TARGET_ROOTFS_PARTSIZE=300 18 | 19 | #luci 20 | CONFIG_PACKAGE_luci-app-cpufreq=y 21 | -------------------------------------------------------------------------------- /configs/rockchip.txt: -------------------------------------------------------------------------------- 1 | CONFIG_TARGET_rockchip=y 2 | CONFIG_TARGET_rockchip_armv8=y 3 | CONFIG_TARGET_MULTI_PROFILE=y 4 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_ariaboard_photonicat=y 5 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_ezpro_mrkaio-m68s=y 6 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r2c=y 7 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r2c-plus=y 8 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r2s=y 9 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r3s=y 10 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_friendlyarm_nanopi-r5c=y 11 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_lunzn_fastrhino-r66s=y 12 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_radxa_rock-pi-e=y 13 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_xunlong_orangepi-r1-plus=y 14 | CONFIG_TARGET_DEVICE_rockchip_armv8_DEVICE_xunlong_orangepi-r1-plus-lts=y 15 | 16 | #rootfs 17 | # CONFIG_TARGET_ROOTFS_EXT4FS is not set 18 | CONFIG_TARGET_ROOTFS_PARTSIZE=300 19 | 20 | #luci 21 | CONFIG_PACKAGE_luci-app-cpufreq=y 22 | -------------------------------------------------------------------------------- /configs/storage.txt: -------------------------------------------------------------------------------- 1 | CONFIG_PACKAGE_exfat-fsck=y 2 | # exFAT 文件系统的文件检查工具 (fsck.exfat) 3 | 4 | CONFIG_PACKAGE_exfat-mkfs=y 5 | # exFAT 文件系统的格式化工具 (mkfs.exfat) 6 | 7 | CONFIG_PACKAGE_kmod-ata-ahci=y 8 | # AHCI (高级主机控制器接口) 驱动,支持 SATA 硬盘 9 | 10 | CONFIG_PACKAGE_kmod-ata-core=y 11 | # ATA (IDE/SATA) 控制器的核心驱动 12 | 13 | CONFIG_PACKAGE_kmod-fs-ext4=y 14 | # EXT4 文件系统支持 (常用于 Linux 分区) 15 | 16 | CONFIG_PACKAGE_kmod-fs-ntfs=y 17 | # 旧版 NTFS 文件系统支持 (只读模式) 18 | 19 | CONFIG_PACKAGE_kmod-fs-ntfs3=y 20 | # 新版 NTFS3 驱动 (支持 NTFS 读写,推荐使用) 21 | 22 | CONFIG_PACKAGE_kmod-fs-vfat=y 23 | # FAT32 (VFAT) 文件系统支持 (用于 U 盘和部分存储设备) 24 | 25 | CONFIG_PACKAGE_kmod-fuse=y 26 | # FUSE (用户空间文件系统) 支持,允许用户模式文件系统 (如 NTFS-3G) 27 | 28 | CONFIG_PACKAGE_kmod-nvme=y 29 | # NVMe (非易失性存储) 硬盘支持,适用于 SSD 30 | 31 | CONFIG_PACKAGE_kmod-scsi-core=y 32 | # SCSI 设备的核心支持 (适用于部分存储设备) 33 | 34 | CONFIG_PACKAGE_kmod-usb-ehci=y 35 | # USB 2.0 EHCI (增强型主机控制器接口) 支持,提高 USB 设备性能 36 | 37 | CONFIG_PACKAGE_kmod-usb-ohci=y 38 | # USB 1.1 OHCI (开放式主机控制器接口) 支持,兼容旧版 USB 设备 39 | 40 | CONFIG_PACKAGE_kmod-usb-storage=y 41 | # USB 存储设备 (U 盘、移动硬盘等) 支持 42 | 43 | CONFIG_PACKAGE_kmod-usb-storage-extras=y 44 | # USB 存储的额外驱动,支持更多类型的 USB 存储设备 45 | 46 | CONFIG_PACKAGE_kmod-usb-storage-uas=y 47 | # USB 附加 SCSI (UAS) 支持,提升 USB 3.0 设备的性能 48 | 49 | CONFIG_PACKAGE_kmod-usb-uhci=y 50 | # USB 1.1 UHCI (通用主机控制器接口) 支持,兼容旧版 USB 设备 51 | 52 | CONFIG_PACKAGE_kmod-usb2=y 53 | # USB 2.0 通用支持,确保 USB 2.0 设备可以正常使用 54 | -------------------------------------------------------------------------------- /doc/IFS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaoBinin/Actions-immortalwrt/09cd3f7e02f53ab0dbf5718929d25402ec918af6/doc/IFS.png -------------------------------------------------------------------------------- /doc/argon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaoBinin/Actions-immortalwrt/09cd3f7e02f53ab0dbf5718929d25402ec918af6/doc/argon.png -------------------------------------------------------------------------------- /doc/argon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/XiaoBinin/Actions-immortalwrt/09cd3f7e02f53ab0dbf5718929d25402ec918af6/doc/argon2.png -------------------------------------------------------------------------------- /files/etc/config/smartdns: -------------------------------------------------------------------------------- 1 | 2 | config smartdns 3 | option server_name 'smartdns' 4 | option auto_set_dnsmasq '1' 5 | option tcp_server '0' 6 | option ipv6_server '1' 7 | option bind_device '1' 8 | option dualstack_ip_selection '0' 9 | option serve_expired '1' 10 | option cache_persist '1' 11 | option resolve_local_hostnames '1' 12 | option force_https_soa '0' 13 | option rr_ttl_min '3600' 14 | option seconddns_port '6553' 15 | option seconddns_tcp_server '0' 16 | option seconddns_enabled '1' 17 | option seconddns_force_aaaa_soa '1' 18 | option enabled '1' 19 | option port '1053' 20 | option seconddns_server_group 'oceans' 21 | option tls_server '0' 22 | option doh_server '0' 23 | option cache_size '100000' 24 | option seconddns_no_dualstack_selection '1' 25 | option log_output_mode 'file' 26 | option prefetch_domain '1' 27 | option seconddns_no_rule_addr '1' 28 | option seconddns_no_rule_nameserver '1' 29 | option seconddns_no_rule_ipset '1' 30 | option seconddns_no_rule_soa '1' 31 | option old_port '1053' 32 | option old_enabled '1' 33 | option old_auto_set_dnsmasq '1' 34 | 35 | config domain-rule 36 | 37 | config client-rule 38 | option enabled '0' 39 | option dualstack_ip_selection '1' 40 | option force_https_soa '1' 41 | 42 | config ip-rule 43 | 44 | config server 45 | option enabled '1' 46 | option name 'AdGuard-EU' 47 | option ip '94.140.14.140/dns-query' 48 | option type 'https' 49 | option server_group 'oceans' 50 | option exclude_default_group '1' 51 | 52 | config server 53 | option enabled '1' 54 | option name 'OpenDNS-US' 55 | option ip '146.112.41.4/dns-query' 56 | option type 'https' 57 | option server_group 'oceans' 58 | option exclude_default_group '1' 59 | 60 | config server 61 | option enabled '0' 62 | option name 'Yandex-RU' 63 | option ip '77.88.8.1' 64 | option type 'tcp' 65 | option server_group 'oceans' 66 | option exclude_default_group '1' 67 | 68 | config server 69 | option enabled '0' 70 | option ip '1.1.1.1/dns-query' 71 | option type 'https' 72 | option server_group 'oceans' 73 | option exclude_default_group '1' 74 | option name 'Cloudflare-US' 75 | 76 | config server 77 | option enabled '0' 78 | option name 'Google-US' 79 | option ip '8.8.4.4/dns-query' 80 | option type 'https' 81 | option server_group 'oceans' 82 | option exclude_default_group '1' 83 | 84 | config server 85 | option enabled '0' 86 | option name 'BebasDNS-IDN' 87 | option ip 'dns.bebasid.com/unfiltered' 88 | option type 'https' 89 | option server_group 'oceans' 90 | option exclude_default_group '1' 91 | 92 | config server 93 | option enabled '0' 94 | option name 'Quad9-US' 95 | option ip '9.9.9.10/dns-query' 96 | option type 'https' 97 | option server_group 'oceans' 98 | option exclude_default_group '1' 99 | 100 | config server 101 | option enabled '1' 102 | option name 'v.recipes-IDN' 103 | option ip 'v.recipes/dns-query' 104 | option type 'https' 105 | option server_group 'oceans' 106 | option exclude_default_group '1' 107 | 108 | config server 109 | option enabled '0' 110 | option name 'IIJ-JP' 111 | option ip 'public.dns.iij.jp/dns-query' 112 | option type 'https' 113 | option server_group 'oceans' 114 | option exclude_default_group '1' 115 | 116 | config server 117 | option enabled '1' 118 | option name 'Ali DNS-CN' 119 | option ip '223.5.5.5/dns-query' 120 | option type 'https' 121 | 122 | config server 123 | option enabled '0' 124 | option name 'DNSPod Public DNS-CN' 125 | option ip 'dns.pub/dns-query' 126 | option type 'https' 127 | 128 | config server 129 | option enabled '0' 130 | option name '360 Secure DNS-CN' 131 | option ip '39.156.84.71/dns-query' 132 | option type 'https' 133 | 134 | config server 135 | option name 'ByteDance DNS-CN' 136 | option ip '180.184.1.1' 137 | option type 'udp' 138 | option enabled '0' 139 | 140 | -------------------------------------------------------------------------------- /patchs/master/target/9999-add-missing-parameters-for-LTS.patch: -------------------------------------------------------------------------------- 1 | Index: b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts 2 | =================================================================== 3 | --- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts 4 | +++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts 5 | @@ -162,6 +162,7 @@ 6 | rx_delay = <0x18>; 7 | snps,aal; 8 | tx_delay = <0x24>; 9 | + handle_cpu_id = <1>; 10 | status = "okay"; 11 | 12 | mdio { 13 | @@ -183,10 +184,16 @@ 14 | }; 15 | 16 | &i2c0 { 17 | + clock-frequency = <200000>; 18 | + i2c-scl-rising-time-ns = <150>; 19 | + i2c-scl-falling-time-ns = <30>; 20 | status = "okay"; 21 | }; 22 | 23 | &i2c1 { 24 | + clock-frequency = <400000>; 25 | + i2c-scl-rising-time-ns = <160>; 26 | + i2c-scl-falling-time-ns = <30>; 27 | status = "okay"; 28 | 29 | rk805: pmic@18 { 30 | @@ -369,6 +376,7 @@ 31 | 32 | &sdmmc { 33 | bus-width = <4>; 34 | + cap-mmc-highspeed; 35 | cap-sd-highspeed; 36 | disable-wp; 37 | pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>; 38 | @@ -412,6 +420,7 @@ 39 | &usbdrd3 { 40 | dr_mode = "host"; 41 | status = "okay"; 42 | + handle_cpu_id = <2>; 43 | #address-cells = <1>; 44 | #size-cells = <0>; 45 | 46 | @@ -419,7 +428,7 @@ 47 | rtl8153: usb-eth@2 { 48 | compatible = "realtek,rtl8153"; 49 | reg = <2>; 50 | - 51 | + local-mac-address = [00 00 00 00 00 00]; 52 | realtek,led-data = <0x87>; 53 | }; 54 | }; 55 | @@ -431,3 +440,16 @@ 56 | &usb_host0_ohci { 57 | status = "okay"; 58 | }; 59 | + 60 | +&u3phy { 61 | + vbus-supply = <&vdd_5v>; 62 | + status = "okay"; 63 | +}; 64 | + 65 | +&u3phy_utmi { 66 | + status = "okay"; 67 | +}; 68 | + 69 | +&u3phy_pipe { 70 | + status = "okay"; 71 | +}; 72 | Index: b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts 73 | =================================================================== 74 | --- a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts 75 | +++ b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts 76 | @@ -129,6 +129,7 @@ 77 | snps,aal; 78 | rx_delay = <0x18>; 79 | tx_delay = <0x24>; 80 | + handle_cpu_id = <1>; 81 | status = "okay"; 82 | 83 | mdio { 84 | @@ -148,6 +149,9 @@ 85 | }; 86 | 87 | &i2c1 { 88 | + clock-frequency = <400000>; 89 | + i2c-scl-rising-time-ns = <160>; 90 | + i2c-scl-falling-time-ns = <30>; 91 | status = "okay"; 92 | 93 | rk805: pmic@18 { 94 | @@ -318,6 +322,7 @@ 95 | 96 | &sdmmc { 97 | bus-width = <4>; 98 | + cap-mmc-highspeed; 99 | cap-sd-highspeed; 100 | disable-wp; 101 | pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>; 102 | @@ -327,7 +332,7 @@ 103 | }; 104 | 105 | &spi0 { 106 | - status = "okay"; 107 | + status = "disabled"; 108 | 109 | flash@0 { 110 | compatible = "jedec,spi-nor"; 111 | @@ -366,6 +371,7 @@ 112 | &usbdrd3 { 113 | dr_mode = "host"; 114 | status = "okay"; 115 | + handle_cpu_id = <2>; 116 | #address-cells = <1>; 117 | #size-cells = <0>; 118 | 119 | @@ -385,3 +391,16 @@ 120 | &usb_host0_ohci { 121 | status = "okay"; 122 | }; 123 | + 124 | +&u3phy { 125 | + vbus-supply = <&vcc_sys>; 126 | + status = "okay"; 127 | +}; 128 | + 129 | +&u3phy_utmi { 130 | + status = "okay"; 131 | +}; 132 | + 133 | +&u3phy_pipe { 134 | + status = "okay"; 135 | +}; 136 | Index: b/arch/arm64/boot/dts/rockchip/rk3328.dtsi 137 | =================================================================== 138 | --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi 139 | +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi 140 | @@ -112,38 +112,38 @@ 141 | 142 | opp-408000000 { 143 | opp-hz = /bits/ 64 <408000000>; 144 | - opp-microvolt = <950000>; 145 | + opp-microvolt = <950000 950000 1350000>; 146 | clock-latency-ns = <40000>; 147 | opp-suspend; 148 | }; 149 | opp-600000000 { 150 | opp-hz = /bits/ 64 <600000000>; 151 | - opp-microvolt = <950000>; 152 | + opp-microvolt = <950000 950000 1350000>; 153 | clock-latency-ns = <40000>; 154 | }; 155 | opp-816000000 { 156 | opp-hz = /bits/ 64 <816000000>; 157 | - opp-microvolt = <1000000>; 158 | + opp-microvolt = <1000000 1050000 1350000>; 159 | clock-latency-ns = <40000>; 160 | }; 161 | opp-1008000000 { 162 | opp-hz = /bits/ 64 <1008000000>; 163 | - opp-microvolt = <1100000>; 164 | + opp-microvolt = <1100000 1150000 1350000>; 165 | clock-latency-ns = <40000>; 166 | }; 167 | opp-1200000000 { 168 | opp-hz = /bits/ 64 <1200000000>; 169 | - opp-microvolt = <1225000>; 170 | + opp-microvolt = <1225000 1275000 1350000>; 171 | clock-latency-ns = <40000>; 172 | }; 173 | opp-1296000000 { 174 | opp-hz = /bits/ 64 <1296000000>; 175 | - opp-microvolt = <1300000>; 176 | + opp-microvolt = <1300000 1350000 1400000>; 177 | clock-latency-ns = <40000>; 178 | }; 179 | opp-1392000000 { 180 | opp-hz = /bits/ 64 <1392000000>; 181 | - opp-microvolt = <1350000>; 182 | + opp-microvolt = <1350000 1400000 1450000>; 183 | clock-latency-ns = <40000>; 184 | }; 185 | opp-1512000000 { 186 | @@ -151,11 +151,6 @@ 187 | opp-microvolt = <1450000>; 188 | clock-latency-ns = <40000>; 189 | }; 190 | - opp-1608000000 { 191 | - opp-hz = /bits/ 64 <1608000000>; 192 | - opp-microvolt = <1450000>; 193 | - clock-latency-ns = <40000>; 194 | - }; 195 | }; 196 | 197 | analog_sound: analog-sound { 198 | @@ -889,6 +884,47 @@ 199 | }; 200 | }; 201 | 202 | + usb3phy_grf: syscon@ff460000 { 203 | + compatible = "rockchip,usb3phy-grf", "syscon"; 204 | + reg = <0x0 0xff460000 0x0 0x1000>; 205 | + }; 206 | + 207 | + u3phy: usb3-phy@ff470000 { 208 | + compatible = "rockchip,rk3328-u3phy"; 209 | + reg = <0x0 0xff470000 0x0 0x0>; 210 | + rockchip,u3phygrf = <&usb3phy_grf>; 211 | + rockchip,grf = <&grf>; 212 | + interrupts = ; 213 | + interrupt-names = "linestate"; 214 | + clocks = <&cru PCLK_USB3PHY_OTG>, <&cru PCLK_USB3PHY_PIPE>; 215 | + clock-names = "u3phy-otg", "u3phy-pipe"; 216 | + resets = <&cru SRST_USB3PHY_U2>, 217 | + <&cru SRST_USB3PHY_U3>, 218 | + <&cru SRST_USB3PHY_PIPE>, 219 | + <&cru SRST_USB3OTG_UTMI>, 220 | + <&cru SRST_USB3PHY_OTG_P>, 221 | + <&cru SRST_USB3PHY_PIPE_P>; 222 | + reset-names = "u3phy-u2-por", "u3phy-u3-por", 223 | + "u3phy-pipe-mac", "u3phy-utmi-mac", 224 | + "u3phy-utmi-apb", "u3phy-pipe-apb"; 225 | + #address-cells = <2>; 226 | + #size-cells = <2>; 227 | + ranges; 228 | + status = "disabled"; 229 | + 230 | + u3phy_utmi: utmi@ff470000 { 231 | + reg = <0x0 0xff470000 0x0 0x8000>; 232 | + #phy-cells = <0>; 233 | + status = "disabled"; 234 | + }; 235 | + 236 | + u3phy_pipe: pipe@ff478000 { 237 | + reg = <0x0 0xff478000 0x0 0x8000>; 238 | + #phy-cells = <0>; 239 | + status = "disabled"; 240 | + }; 241 | + }; 242 | + 243 | sdmmc: mmc@ff500000 { 244 | compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc"; 245 | reg = <0x0 0xff500000 0x0 0x4000>; 246 | @@ -1029,6 +1065,8 @@ 247 | clock-names = "ref_clk", "suspend_clk", 248 | "bus_clk"; 249 | dr_mode = "otg"; 250 | + phys = <&u3phy_utmi>, <&u3phy_pipe>; 251 | + phy-names = "usb2-phy", "usb3-phy"; 252 | phy_type = "utmi_wide"; 253 | snps,dis-del-phy-power-chg-quirk; 254 | snps,dis_enblslpm_quirk; 255 | Index: b/drivers/net/phy/motorcomm.c 256 | =================================================================== 257 | --- a/drivers/net/phy/motorcomm.c 258 | +++ b/drivers/net/phy/motorcomm.c 259 | @@ -1525,6 +1525,13 @@ static int yt8531_config_init(struct phy 260 | return ret; 261 | } 262 | 263 | + /* LED0: Unused/Off, LED1: Link, LED2: Activity, 8Hz */ 264 | + ytphy_write_ext(phydev, 0xa00b, 0xe004); 265 | + ytphy_write_ext(phydev, 0xa00c, 0); 266 | + ytphy_write_ext(phydev, 0xa00d, 0x2600); 267 | + ytphy_write_ext(phydev, 0xa00e, 0x0070); 268 | + ytphy_write_ext(phydev, 0xa00f, 0x000a); 269 | + 270 | return 0; 271 | } 272 | 273 | Index: b/drivers/phy/rockchip/Kconfig 274 | =================================================================== 275 | --- a/drivers/phy/rockchip/Kconfig 276 | +++ b/drivers/phy/rockchip/Kconfig 277 | @@ -48,6 +48,15 @@ config PHY_ROCKCHIP_INNO_USB2 278 | help 279 | Support for Rockchip USB2.0 PHY with Innosilicon IP block. 280 | 281 | +config PHY_ROCKCHIP_INNO_USB3 282 | + tristate "Rockchip INNO USB 3.0 PHY Driver" 283 | + default y if ARCH_ROCKCHIP 284 | + depends on OF 285 | + select GENERIC_PHY 286 | + select USB_PHY 287 | + help 288 | + Support for Rockchip USB 3.0 PHY with Innosilicon IP block. 289 | + 290 | config PHY_ROCKCHIP_INNO_CSIDPHY 291 | tristate "Rockchip Innosilicon MIPI CSI PHY driver" 292 | depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OF 293 | Index: b/drivers/phy/rockchip/Makefile 294 | =================================================================== 295 | --- a/drivers/phy/rockchip/Makefile 296 | +++ b/drivers/phy/rockchip/Makefile 297 | @@ -6,6 +6,7 @@ obj-$(CONFIG_PHY_ROCKCHIP_INNO_CSIDPHY) 298 | obj-$(CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY) += phy-rockchip-inno-dsidphy.o 299 | obj-$(CONFIG_PHY_ROCKCHIP_INNO_HDMI) += phy-rockchip-inno-hdmi.o 300 | obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB2) += phy-rockchip-inno-usb2.o 301 | +obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB3) += phy-rockchip-inno-usb3.o 302 | obj-$(CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY) += phy-rockchip-naneng-combphy.o 303 | obj-$(CONFIG_PHY_ROCKCHIP_PCIE) += phy-rockchip-pcie.o 304 | obj-$(CONFIG_PHY_ROCKCHIP_SNPS_PCIE3) += phy-rockchip-snps-pcie3.o 305 | -------------------------------------------------------------------------------- /patchs/master/uboot/rk3328-orangepi-r1-plus-lts-u-boot.dtsi: -------------------------------------------------------------------------------- 1 | #include "rk3328-u-boot.dtsi" 2 | #include "rk3328-sdram-lpddr3-666.dtsi" 3 | / { 4 | chosen { 5 | u-boot,spl-boot-order = "same-as-spl", &sdmmc, &emmc; 6 | }; 7 | }; 8 | 9 | &gpio0 { 10 | u-boot,dm-spl; 11 | }; 12 | 13 | &pinctrl { 14 | u-boot,dm-spl; 15 | }; 16 | 17 | &sdmmc0m1_pin { 18 | u-boot,dm-spl; 19 | }; 20 | 21 | &pcfg_pull_up_4ma { 22 | u-boot,dm-spl; 23 | }; 24 | 25 | /* Need this and all the pinctrl/gpio stuff above to set pinmux */ 26 | &vcc_sd { 27 | u-boot,dm-spl; 28 | }; 29 | 30 | &gmac2io { 31 | snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; 32 | snps,reset-active-low; 33 | snps,reset-delays-us = <0 15000 50000>; 34 | }; 35 | -------------------------------------------------------------------------------- /patchs/openwrt21/target/993-rockchip-rk3328-add-missing-parameters-for.patch: -------------------------------------------------------------------------------- 1 | Index: b/arch/arm64/boot/dts/rockchip/rk3328.dtsi 2 | =================================================================== 3 | --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi 4 | +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi 5 | @@ -109,50 +109,61 @@ 6 | compatible = "operating-points-v2"; 7 | opp-shared; 8 | 9 | + rockchip,leakage-voltage-sel = < 10 | + 1 10 0 11 | + 11 254 1 12 | + >; 13 | + nvmem-cells = <&cpu_leakage>; 14 | + nvmem-cell-names = "cpu_leakage"; 15 | + 16 | opp-408000000 { 17 | opp-hz = /bits/ 64 <408000000>; 18 | - opp-microvolt = <950000>; 19 | + opp-microvolt = <950000 950000 1350000>; 20 | + opp-microvolt-L0 = <950000 950000 1350000>; 21 | + opp-microvolt-L1 = <950000 950000 1350000>; 22 | clock-latency-ns = <40000>; 23 | opp-suspend; 24 | }; 25 | opp-600000000 { 26 | opp-hz = /bits/ 64 <600000000>; 27 | - opp-microvolt = <950000>; 28 | + opp-microvolt = <950000 950000 1350000>; 29 | + opp-microvolt-L0 = <950000 950000 1350000>; 30 | + opp-microvolt-L1 = <950000 950000 1350000>; 31 | clock-latency-ns = <40000>; 32 | }; 33 | opp-816000000 { 34 | opp-hz = /bits/ 64 <816000000>; 35 | - opp-microvolt = <1000000>; 36 | + opp-microvolt = <1050000 1050000 1350000>; 37 | + opp-microvolt-L0 = <1050000 1050000 1350000>; 38 | + opp-microvolt-L1 = <1000000 1000000 1350000>; 39 | clock-latency-ns = <40000>; 40 | }; 41 | opp-1008000000 { 42 | opp-hz = /bits/ 64 <1008000000>; 43 | - opp-microvolt = <1100000>; 44 | + opp-microvolt = <1150000 1150000 1350000>; 45 | + opp-microvolt-L0 = <1150000 1150000 1350000>; 46 | + opp-microvolt-L1 = <1100000 1100000 1350000>; 47 | clock-latency-ns = <40000>; 48 | }; 49 | opp-1200000000 { 50 | opp-hz = /bits/ 64 <1200000000>; 51 | - opp-microvolt = <1225000>; 52 | + opp-microvolt = <1275000 1275000 1350000>; 53 | + opp-microvolt-L0 = <1275000 1275000 1350000>; 54 | + opp-microvolt-L1 = <1225000 1225000 1350000>; 55 | clock-latency-ns = <40000>; 56 | }; 57 | opp-1296000000 { 58 | opp-hz = /bits/ 64 <1296000000>; 59 | - opp-microvolt = <1300000>; 60 | + opp-microvolt = <1350000 1350000 1350000>; 61 | + opp-microvolt-L0 = <1350000 1350000 1350000>; 62 | + opp-microvolt-L1 = <1300000 1300000 1350000>; 63 | clock-latency-ns = <40000>; 64 | }; 65 | opp-1392000000 { 66 | opp-hz = /bits/ 64 <1392000000>; 67 | - opp-microvolt = <1350000>; 68 | - clock-latency-ns = <40000>; 69 | - }; 70 | - opp-1512000000 { 71 | - opp-hz = /bits/ 64 <1512000000>; 72 | - opp-microvolt = <1450000>; 73 | - clock-latency-ns = <40000>; 74 | - }; 75 | - opp-1608000000 { 76 | - opp-hz = /bits/ 64 <1608000000>; 77 | - opp-microvolt = <1450000>; 78 | + opp-microvolt = <1400000 1400000 1450000>; 79 | + opp-microvolt-L0 = <1400000 1400000 1450000>; 80 | + opp-microvolt-L1 = <1380000 1380000 1450000>; 81 | clock-latency-ns = <40000>; 82 | }; 83 | }; 84 | @@ -325,7 +336,7 @@ 85 | }; 86 | }; 87 | 88 | - reboot-mode { 89 | + reboot_mode: reboot-mode { 90 | compatible = "syscon-reboot-mode"; 91 | offset = <0x5c8>; 92 | mode-normal = ; 93 | @@ -598,7 +609,7 @@ 94 | 95 | gpu: gpu@ff300000 { 96 | compatible = "rockchip,rk3328-mali", "arm,mali-450"; 97 | - reg = <0x0 0xff300000 0x0 0x30000>; 98 | + reg = <0x0 0xff300000 0x0 0x40000>; 99 | interrupts = , 100 | , 101 | , 102 | @@ -787,7 +798,7 @@ 103 | <&cru ACLK_BUS_PRE>, <&cru HCLK_BUS_PRE>, 104 | <&cru PCLK_BUS_PRE>, <&cru ACLK_PERI_PRE>, 105 | <&cru HCLK_PERI>, <&cru PCLK_PERI>, 106 | - <&cru SCLK_RTC32K>; 107 | + <&cru SCLK_RTC32K>, <&cru SCLK_USB3OTG_SUSPEND>; 108 | assigned-clock-parents = 109 | <&cru HDMIPHY>, <&cru PLL_APLL>, 110 | <&cru PLL_GPLL>, <&xin24m>, 111 | @@ -808,7 +819,7 @@ 112 | <150000000>, <75000000>, 113 | <75000000>, <150000000>, 114 | <75000000>, <75000000>, 115 | - <32768>; 116 | + <32768>, <32768>; 117 | }; 118 | 119 | usb2phy_grf: syscon@ff450000 { 120 | @@ -848,6 +859,47 @@ 121 | }; 122 | }; 123 | 124 | + usb3phy_grf: syscon@ff460000 { 125 | + compatible = "rockchip,usb3phy-grf", "syscon"; 126 | + reg = <0x0 0xff460000 0x0 0x1000>; 127 | + }; 128 | + 129 | + u3phy: usb3-phy@ff470000 { 130 | + compatible = "rockchip,rk3328-u3phy"; 131 | + reg = <0x0 0xff470000 0x0 0x0>; 132 | + rockchip,u3phygrf = <&usb3phy_grf>; 133 | + rockchip,grf = <&grf>; 134 | + interrupts = ; 135 | + interrupt-names = "linestate"; 136 | + clocks = <&cru PCLK_USB3PHY_OTG>, <&cru PCLK_USB3PHY_PIPE>; 137 | + clock-names = "u3phy-otg", "u3phy-pipe"; 138 | + resets = <&cru SRST_USB3PHY_U2>, 139 | + <&cru SRST_USB3PHY_U3>, 140 | + <&cru SRST_USB3PHY_PIPE>, 141 | + <&cru SRST_USB3OTG_UTMI>, 142 | + <&cru SRST_USB3PHY_OTG_P>, 143 | + <&cru SRST_USB3PHY_PIPE_P>; 144 | + reset-names = "u3phy-u2-por", "u3phy-u3-por", 145 | + "u3phy-pipe-mac", "u3phy-utmi-mac", 146 | + "u3phy-utmi-apb", "u3phy-pipe-apb"; 147 | + #address-cells = <2>; 148 | + #size-cells = <2>; 149 | + ranges; 150 | + status = "disabled"; 151 | + 152 | + u3phy_utmi: utmi@ff470000 { 153 | + reg = <0x0 0xff470000 0x0 0x8000>; 154 | + #phy-cells = <0>; 155 | + status = "disabled"; 156 | + }; 157 | + 158 | + u3phy_pipe: pipe@ff478000 { 159 | + reg = <0x0 0xff478000 0x0 0x8000>; 160 | + #phy-cells = <0>; 161 | + status = "disabled"; 162 | + }; 163 | + }; 164 | + 165 | sdmmc: dwmmc@ff500000 { 166 | compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc"; 167 | reg = <0x0 0xff500000 0x0 0x4000>; 168 | @@ -997,10 +1049,13 @@ 169 | reg = <0x0 0xff600000 0x0 0x100000>; 170 | interrupts = ; 171 | dr_mode = "otg"; 172 | + phys = <&u3phy_utmi>, <&u3phy_pipe>; 173 | + phy-names = "usb2-phy", "usb3-phy"; 174 | phy_type = "utmi_wide"; 175 | snps,dis_enblslpm_quirk; 176 | snps,dis-u2-freeclk-exists-quirk; 177 | snps,dis_u2_susphy_quirk; 178 | + snps,dis-u3-autosuspend-quirk; 179 | snps,dis_u3_susphy_quirk; 180 | snps,dis-del-phy-power-chg-quirk; 181 | snps,dis-tx-ipgap-linecheck-quirk; 182 | -------------------------------------------------------------------------------- /patchs/openwrt21/target/994-add-missing-parameters-for-R2s.patch: -------------------------------------------------------------------------------- 1 | Index: b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts 2 | =================================================================== 3 | --- a/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts 4 | +++ b/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s.dts 5 | @@ -216,6 +216,7 @@ 6 | rx_delay = <0x18>; 7 | snps,aal; 8 | tx_delay = <0x24>; 9 | + handle_cpu_id = <1>; 10 | status = "okay"; 11 | 12 | mdio { 13 | @@ -237,10 +238,16 @@ 14 | }; 15 | 16 | &i2c0 { 17 | + clock-frequency = <200000>; 18 | + i2c-scl-rising-time-ns = <150>; 19 | + i2c-scl-falling-time-ns = <30>; 20 | status = "okay"; 21 | }; 22 | 23 | &i2c1 { 24 | + clock-frequency = <400000>; 25 | + i2c-scl-rising-time-ns = <160>; 26 | + i2c-scl-falling-time-ns = <30>; 27 | status = "okay"; 28 | 29 | rk805: pmic@18 { 30 | @@ -423,8 +430,10 @@ 31 | 32 | &sdmmc { 33 | bus-width = <4>; 34 | + cap-mmc-highspeed; 35 | cap-sd-highspeed; 36 | disable-wp; 37 | + max-frequency = <150000000>; 38 | pinctrl-0 = <&sdmmc0_clk>, <&sdmmc0_cmd>, <&sdmmc0_dectn>, <&sdmmc0_bus4>; 39 | pinctrl-names = "default"; 40 | sd-uhs-sdr12; 41 | @@ -478,11 +487,30 @@ 42 | &usbdrd_dwc3 { 43 | dr_mode = "host"; 44 | status = "okay"; 45 | + handle_cpu_id = <2>; 46 | + #address-cells = <1>; 47 | + #size-cells = <0>; 48 | + 49 | + snps,xhci-slow-suspend-quirk; 50 | + snps,xhci-trb-ent-quirk; 51 | 52 | usb_eth: usb-eth@2 { 53 | compatible = "realtek,rtl8153"; 54 | reg = <2>; 55 | - 56 | + local-mac-address = [00 00 00 00 00 00]; 57 | realtek,led-data = <0x87>; 58 | }; 59 | }; 60 | + 61 | +&u3phy { 62 | + vbus-supply = <&vdd_5v>; 63 | + status = "okay"; 64 | +}; 65 | + 66 | +&u3phy_utmi { 67 | + status = "okay"; 68 | +}; 69 | + 70 | +&u3phy_pipe { 71 | + status = "okay"; 72 | +}; 73 | Index: b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts 74 | =================================================================== 75 | --- a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts 76 | +++ b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus.dts 77 | @@ -12,7 +12,7 @@ 78 | 79 | &spi0 { 80 | max-freq = <48000000>; 81 | - status = "okay"; 82 | + status = "disabled"; 83 | 84 | flash@0 { 85 | compatible = "jedec,spi-nor"; 86 | Index: b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts 87 | =================================================================== 88 | --- a/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts 89 | +++ b/arch/arm64/boot/dts/rockchip/rk3328-orangepi-r1-plus-lts.dts 90 | @@ -14,13 +14,13 @@ 91 | }; 92 | 93 | &dmc_opp_table { 94 | - opp-798000000 { 95 | + opp-786000000 { 96 | status = "disabled"; 97 | }; 98 | - opp-840000000 { 99 | + opp-798000000 { 100 | status = "disabled"; 101 | }; 102 | - opp-924000000 { 103 | + opp-840000000 { 104 | status = "disabled"; 105 | }; 106 | opp-1056000000 { 107 | @@ -44,6 +44,7 @@ 108 | pinctrl-names = "default"; 109 | reset-assert-us = <15000>; 110 | reset-deassert-us = <50000>; 111 | + keep-clkout-on; 112 | reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; 113 | }; 114 | }; 115 | -------------------------------------------------------------------------------- /patchs/openwrt21/target/995-add-USB3-for-rk3328.patch: -------------------------------------------------------------------------------- 1 | Index: b/Documentation/devicetree/bindings/soc/rockchip/grf.txt 2 | =================================================================== 3 | --- a/Documentation/devicetree/bindings/soc/rockchip/grf.txt 4 | +++ b/Documentation/devicetree/bindings/soc/rockchip/grf.txt 5 | @@ -31,6 +31,8 @@ Required Properties: 6 | - "rockchip,rk3288-sgrf", "syscon": for rk3288 7 | - compatible: USB2PHYGRF should be one of the followings 8 | - "rockchip,rk3328-usb2phy-grf", "syscon": for rk3328 9 | +- compatible: USB3PHYGRF should be one of the following: 10 | + - "rockchip,u3phy-grf", "syscon" 11 | - compatible: USBGRF should be one of the following 12 | - "rockchip,rv1108-usbgrf", "syscon": for rv1108 13 | - reg: physical base address of the controller and length of memory mapped 14 | Index: b/drivers/phy/rockchip/Kconfig 15 | =================================================================== 16 | --- a/drivers/phy/rockchip/Kconfig 17 | +++ b/drivers/phy/rockchip/Kconfig 18 | @@ -35,6 +35,15 @@ config PHY_ROCKCHIP_INNO_USB2 19 | help 20 | Support for Rockchip USB2.0 PHY with Innosilicon IP block. 21 | 22 | +config PHY_ROCKCHIP_INNO_USB3 23 | + tristate "Rockchip INNO USB 3.0 PHY Driver" 24 | + default y if ARCH_ROCKCHIP 25 | + depends on OF 26 | + select GENERIC_PHY 27 | + select USB_PHY 28 | + help 29 | + Support for Rockchip USB 3.0 PHY with Innosilicon IP block. 30 | + 31 | config PHY_ROCKCHIP_PCIE 32 | tristate "Rockchip PCIe PHY Driver" 33 | depends on (ARCH_ROCKCHIP && OF) || COMPILE_TEST 34 | Index: b/drivers/phy/rockchip/Makefile 35 | =================================================================== 36 | --- a/drivers/phy/rockchip/Makefile 37 | +++ b/drivers/phy/rockchip/Makefile 38 | @@ -3,6 +3,7 @@ obj-$(CONFIG_PHY_ROCKCHIP_DP) += phy-ro 39 | obj-$(CONFIG_PHY_ROCKCHIP_EMMC) += phy-rockchip-emmc.o 40 | obj-$(CONFIG_PHY_ROCKCHIP_INNO_HDMI) += phy-rockchip-inno-hdmi.o 41 | obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB2) += phy-rockchip-inno-usb2.o 42 | +obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB3) += phy-rockchip-inno-usb3.o 43 | obj-$(CONFIG_PHY_ROCKCHIP_PCIE) += phy-rockchip-pcie.o 44 | obj-$(CONFIG_PHY_ROCKCHIP_TYPEC) += phy-rockchip-typec.o 45 | obj-$(CONFIG_PHY_ROCKCHIP_USB) += phy-rockchip-usb.o 46 | -------------------------------------------------------------------------------- /patchs/openwrt21/target/996-usb-dwc3-add-a-quirk-xhci_slow_suspend_quirk.patch: -------------------------------------------------------------------------------- 1 | Index: b/Documentation/devicetree/bindings/usb/dwc3.txt 2 | =================================================================== 3 | --- a/Documentation/devicetree/bindings/usb/dwc3.txt 4 | +++ b/Documentation/devicetree/bindings/usb/dwc3.txt 5 | @@ -79,6 +79,9 @@ Optional properties: 6 | park mode are disabled. 7 | - snps,dis_metastability_quirk: when set, disable metastability workaround. 8 | CAUTION: use only if you are absolutely sure of it. 9 | + - snps,xhci-slow-suspend-quirk: when set, need an extraordinary delay to wait 10 | + for xHC enter the Halted state (i.e. HCH in the USBSTS 11 | + register is '1'). 12 | - snps,is-utmi-l1-suspend: true when DWC3 asserts output signal 13 | utmi_l1_suspend_n, false when asserts utmi_sleep_n 14 | - snps,hird-threshold: HIRD threshold 15 | Index: b/drivers/usb/dwc3/core.c 16 | =================================================================== 17 | --- a/drivers/usb/dwc3/core.c 18 | +++ b/drivers/usb/dwc3/core.c 19 | @@ -1318,6 +1318,8 @@ static void dwc3_get_properties(struct d 20 | "snps,dis-u2-freeclk-exists-quirk"); 21 | dwc->dis_del_phy_power_chg_quirk = device_property_read_bool(dev, 22 | "snps,dis-del-phy-power-chg-quirk"); 23 | + dwc->xhci_slow_suspend_quirk = device_property_read_bool(dev, 24 | + "snps,xhci-slow-suspend-quirk"); 25 | dwc->dis_tx_ipgap_linecheck_quirk = device_property_read_bool(dev, 26 | "snps,dis-tx-ipgap-linecheck-quirk"); 27 | dwc->parkmode_disable_ss_quirk = device_property_read_bool(dev, 28 | Index: b/drivers/usb/dwc3/core.h 29 | =================================================================== 30 | --- a/drivers/usb/dwc3/core.h 31 | +++ b/drivers/usb/dwc3/core.h 32 | @@ -1034,6 +1034,9 @@ struct dwc3_scratchpad_array { 33 | * provide a free-running PHY clock. 34 | * @dis_del_phy_power_chg_quirk: set if we disable delay phy power 35 | * change quirk. 36 | + * @xhci_slow_suspend_quirk: set if need an extraordinary delay to wait 37 | + * for xHC enter the Halted state after the Run/Stop 38 | + * (R/S) bit is cleared to '0'. 39 | * @dis_tx_ipgap_linecheck_quirk: set if we disable u2mac linestate 40 | * check during HS transmit. 41 | * @parkmode_disable_ss_quirk: set if we need to disable all SuperSpeed 42 | @@ -1230,6 +1233,7 @@ struct dwc3 { 43 | unsigned dis_rxdet_inp3_quirk:1; 44 | unsigned dis_u2_freeclk_exists_quirk:1; 45 | unsigned dis_del_phy_power_chg_quirk:1; 46 | + unsigned xhci_slow_suspend_quirk:1; 47 | unsigned dis_tx_ipgap_linecheck_quirk:1; 48 | unsigned parkmode_disable_ss_quirk:1; 49 | 50 | Index: b/drivers/usb/dwc3/host.c 51 | =================================================================== 52 | --- a/drivers/usb/dwc3/host.c 53 | +++ b/drivers/usb/dwc3/host.c 54 | @@ -93,6 +93,9 @@ int dwc3_host_init(struct dwc3 *dwc) 55 | if (dwc->usb2_lpm_disable) 56 | props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb2-lpm-disable"); 57 | 58 | + if (dwc->xhci_slow_suspend_quirk) 59 | + props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-slow-suspend"); 60 | + 61 | /** 62 | * WORKAROUND: dwc3 revisions <=3.00a have a limitation 63 | * where Port Disable command doesn't work. 64 | Index: b/drivers/usb/host/xhci-plat.c 65 | =================================================================== 66 | --- a/drivers/usb/host/xhci-plat.c 67 | +++ b/drivers/usb/host/xhci-plat.c 68 | @@ -301,6 +301,9 @@ static int xhci_plat_probe(struct platfo 69 | if (device_property_read_bool(tmpdev, "quirk-broken-port-ped")) 70 | xhci->quirks |= XHCI_BROKEN_PORT_PED; 71 | 72 | + if (device_property_read_bool(tmpdev, "xhci-slow-suspend")) 73 | + xhci->quirks |= XHCI_SLOW_SUSPEND; 74 | + 75 | device_property_read_u32(tmpdev, "imod-interval-ns", 76 | &xhci->imod_interval); 77 | } 78 | -------------------------------------------------------------------------------- /patchs/openwrt21/target/997-usb-dwc3-add-dis_u3_autosuspend_quirk.patch: -------------------------------------------------------------------------------- 1 | Index: b/Documentation/devicetree/bindings/usb/dwc3.txt 2 | =================================================================== 3 | --- a/Documentation/devicetree/bindings/usb/dwc3.txt 4 | +++ b/Documentation/devicetree/bindings/usb/dwc3.txt 5 | @@ -60,6 +60,8 @@ Optional properties: 6 | - snps,tx_de_emphasis_quirk: when set core will set Tx de-emphasis value. 7 | - snps,tx_de_emphasis: the value driven to the PHY is controlled by the 8 | LTSSM during USB3 Compliance mode. 9 | + - snps,dis-u3-autosuspend-quirk: when set USB core driver will disable 10 | + USB3 autosuspend function. 11 | - snps,dis_u3_susphy_quirk: when set core will disable USB3 suspend phy. 12 | - snps,dis_u2_susphy_quirk: when set core will disable USB2 suspend phy. 13 | - snps,dis_enblslpm_quirk: when set clears the enblslpm in GUSB2PHYCFG, 14 | Index: b/drivers/usb/dwc3/core.c 15 | =================================================================== 16 | --- a/drivers/usb/dwc3/core.c 17 | +++ b/drivers/usb/dwc3/core.c 18 | @@ -1302,6 +1302,8 @@ static void dwc3_get_properties(struct d 19 | "snps,lfps_filter_quirk"); 20 | dwc->rx_detect_poll_quirk = device_property_read_bool(dev, 21 | "snps,rx_detect_poll_quirk"); 22 | + dwc->dis_u3_autosuspend_quirk = device_property_read_bool(dev, 23 | + "snps,dis-u3-autosuspend-quirk"); 24 | dwc->dis_u3_susphy_quirk = device_property_read_bool(dev, 25 | "snps,dis_u3_susphy_quirk"); 26 | dwc->dis_u2_susphy_quirk = device_property_read_bool(dev, 27 | Index: b/drivers/usb/dwc3/core.h 28 | =================================================================== 29 | --- a/drivers/usb/dwc3/core.h 30 | +++ b/drivers/usb/dwc3/core.h 31 | @@ -1022,6 +1022,7 @@ struct dwc3_scratchpad_array { 32 | * @del_phy_power_chg_quirk: set if we enable delay phy power change quirk 33 | * @lfps_filter_quirk: set if we enable LFPS filter quirk 34 | * @rx_detect_poll_quirk: set if we enable rx_detect to polling lfps quirk 35 | + * @dis_u3_autosuspend_quirk: set if the we disable usb3 autosuspend 36 | * @dis_u3_susphy_quirk: set if we disable usb3 suspend phy 37 | * @dis_u2_susphy_quirk: set if we disable usb2 suspend phy 38 | * @dis_enblslpm_quirk: set if we clear enblslpm in GUSB2PHYCFG, 39 | @@ -1225,6 +1226,7 @@ struct dwc3 { 40 | unsigned del_phy_power_chg_quirk:1; 41 | unsigned lfps_filter_quirk:1; 42 | unsigned rx_detect_poll_quirk:1; 43 | + unsigned dis_u3_autosuspend_quirk:1; 44 | unsigned dis_u3_susphy_quirk:1; 45 | unsigned dis_u2_susphy_quirk:1; 46 | unsigned dis_enblslpm_quirk:1; 47 | Index: b/drivers/usb/dwc3/host.c 48 | =================================================================== 49 | --- a/drivers/usb/dwc3/host.c 50 | +++ b/drivers/usb/dwc3/host.c 51 | @@ -43,7 +43,7 @@ out: 52 | 53 | int dwc3_host_init(struct dwc3 *dwc) 54 | { 55 | - struct property_entry props[4]; 56 | + struct property_entry props[5]; 57 | struct platform_device *xhci; 58 | int ret, irq; 59 | struct resource *res; 60 | @@ -87,6 +87,9 @@ int dwc3_host_init(struct dwc3 *dwc) 61 | 62 | memset(props, 0, sizeof(struct property_entry) * ARRAY_SIZE(props)); 63 | 64 | + if (dwc->dis_u3_autosuspend_quirk) 65 | + props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb3-dis-autosuspend"); 66 | + 67 | if (dwc->usb3_lpm_capable) 68 | props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb3-lpm-capable"); 69 | 70 | Index: b/Documentation/devicetree/bindings/usb/usb-xhci.txt 71 | =================================================================== 72 | --- a/Documentation/devicetree/bindings/usb/usb-xhci.txt 73 | +++ b/Documentation/devicetree/bindings/usb/usb-xhci.txt 74 | @@ -39,6 +39,7 @@ Optional properties: 75 | second one 76 | - usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM 77 | - usb3-lpm-capable: determines if platform is USB3 LPM capable 78 | + - usb3-dis-autosuspend: determines if the xHC supports USB3 autosuspend capable 79 | - quirk-broken-port-ped: set if the controller has broken port disable mechanism 80 | - imod-interval-ns: default interrupt moderation interval is 5000ns 81 | - phys : see usb-hcd.yaml in the current directory 82 | Index: b/drivers/usb/core/hub.c 83 | =================================================================== 84 | --- a/drivers/usb/core/hub.c 85 | +++ b/drivers/usb/core/hub.c 86 | @@ -1831,7 +1831,8 @@ static int hub_probe(struct usb_interfac 87 | * bus_resume methods. 88 | */ 89 | if (hdev->parent) { /* normal device */ 90 | - usb_enable_autosuspend(hdev); 91 | + if (!(hdev->parent->quirks & USB_QUIRK_AUTO_SUSPEND)) 92 | + usb_enable_autosuspend(hdev); 93 | } else { /* root hub */ 94 | const struct hc_driver *drv = bus_to_hcd(hdev->bus)->driver; 95 | 96 | @@ -5437,7 +5438,24 @@ static void port_event(struct usb_hub *h 97 | } else { 98 | usb_unlock_port(port_dev); 99 | usb_lock_device(udev); 100 | - usb_reset_device(udev); 101 | + 102 | + /** 103 | + * Some special SoCs (e.g. rk322xh) USB3 PHY lose the 104 | + * ability to detect a disconnection when USB3 device 105 | + * plug out, fortunately, it can detect port link state 106 | + * change here, so we can do soft disconnect according 107 | + * to the PLC here. 108 | + * 109 | + * And we only need to do the soft disconnect for root 110 | + * hub. In addition, we just reuse the autosuspend quirk 111 | + * but not add a new quirk for this issue. Because this 112 | + * issue always occurs with autosuspend problem. 113 | + */ 114 | + if (!hub->hdev->parent && (hdev->quirks & 115 | + USB_QUIRK_AUTO_SUSPEND)) 116 | + usb_remove_device(udev); 117 | + else 118 | + usb_reset_device(udev); 119 | usb_unlock_device(udev); 120 | usb_lock_port(port_dev); 121 | connect_change = 0; 122 | Index: b/drivers/usb/host/xhci-plat.c 123 | =================================================================== 124 | --- a/drivers/usb/host/xhci-plat.c 125 | +++ b/drivers/usb/host/xhci-plat.c 126 | @@ -304,6 +304,9 @@ static int xhci_plat_probe(struct platfo 127 | if (device_property_read_bool(tmpdev, "xhci-slow-suspend")) 128 | xhci->quirks |= XHCI_SLOW_SUSPEND; 129 | 130 | + if (device_property_read_bool(tmpdev, "usb3-dis-autosuspend")) 131 | + xhci->quirks |= XHCI_DIS_AUTOSUSPEND; 132 | + 133 | device_property_read_u32(tmpdev, "imod-interval-ns", 134 | &xhci->imod_interval); 135 | } 136 | Index: b/drivers/usb/host/xhci.c 137 | =================================================================== 138 | --- a/drivers/usb/host/xhci.c 139 | +++ b/drivers/usb/host/xhci.c 140 | @@ -17,6 +17,7 @@ 141 | #include 142 | #include 143 | #include 144 | +#include 145 | 146 | #include "xhci.h" 147 | #include "xhci-trace.h" 148 | @@ -5260,6 +5261,9 @@ int xhci_gen_setup(struct usb_hcd *hcd, 149 | /* xHCI private pointer was set in xhci_pci_probe for the second 150 | * registered roothub. 151 | */ 152 | + if (xhci->quirks & XHCI_DIS_AUTOSUSPEND) 153 | + xhci->shared_hcd->self.root_hub->quirks |= 154 | + USB_QUIRK_AUTO_SUSPEND; 155 | return 0; 156 | } 157 | 158 | Index: b/drivers/usb/host/xhci.h 159 | =================================================================== 160 | --- a/drivers/usb/host/xhci.h 161 | +++ b/drivers/usb/host/xhci.h 162 | @@ -1884,6 +1884,7 @@ struct xhci_hcd { 163 | #define XHCI_SKIP_PHY_INIT BIT_ULL(37) 164 | #define XHCI_DISABLE_SPARSE BIT_ULL(38) 165 | #define XHCI_NO_SOFT_RETRY BIT_ULL(40) 166 | +#define XHCI_DIS_AUTOSUSPEND BIT_ULL(41) 167 | 168 | unsigned int num_active_eps; 169 | unsigned int limit_active_eps; 170 | Index: b/include/linux/usb/quirks.h 171 | =================================================================== 172 | --- a/include/linux/usb/quirks.h 173 | +++ b/include/linux/usb/quirks.h 174 | @@ -72,4 +72,7 @@ 175 | /* device has blacklisted endpoints */ 176 | #define USB_QUIRK_ENDPOINT_BLACKLIST BIT(15) 177 | 178 | +/* device can't support auto suspend function */ 179 | +#define USB_QUIRK_AUTO_SUSPEND BIT(16) 180 | + 181 | #endif /* __LINUX_USB_QUIRKS_H */ 182 | -------------------------------------------------------------------------------- /patchs/openwrt21/target/998-general-add-dwc3-xhci-usb-trb-quirk.patch: -------------------------------------------------------------------------------- 1 | Index: b/drivers/usb/dwc3/core.c 2 | =================================================================== 3 | --- a/drivers/usb/dwc3/core.c 4 | +++ b/drivers/usb/dwc3/core.c 5 | @@ -1324,6 +1324,8 @@ static void dwc3_get_properties(struct d 6 | "snps,xhci-slow-suspend-quirk"); 7 | dwc->dis_tx_ipgap_linecheck_quirk = device_property_read_bool(dev, 8 | "snps,dis-tx-ipgap-linecheck-quirk"); 9 | + dwc->xhci_trb_ent_quirk = device_property_read_bool(dev, 10 | + "snps,xhci-trb-ent-quirk"); 11 | dwc->parkmode_disable_ss_quirk = device_property_read_bool(dev, 12 | "snps,parkmode-disable-ss-quirk"); 13 | 14 | Index: b/drivers/usb/dwc3/core.h 15 | =================================================================== 16 | --- a/drivers/usb/dwc3/core.h 17 | +++ b/drivers/usb/dwc3/core.h 18 | @@ -1040,6 +1040,9 @@ struct dwc3_scratchpad_array { 19 | * (R/S) bit is cleared to '0'. 20 | * @dis_tx_ipgap_linecheck_quirk: set if we disable u2mac linestate 21 | * check during HS transmit. 22 | + * @xhci_trb_ent_quirk: set if need to enable the Evaluate Next TRB(ENT) 23 | + flag in the TRB data structure to force xHC to 24 | + pre-fetch the next TRB of a TD. 25 | * @parkmode_disable_ss_quirk: set if we need to disable all SuperSpeed 26 | * instances in park mode. 27 | * @tx_de_emphasis_quirk: set if we enable Tx de-emphasis quirk 28 | @@ -1237,6 +1240,7 @@ struct dwc3 { 29 | unsigned dis_del_phy_power_chg_quirk:1; 30 | unsigned xhci_slow_suspend_quirk:1; 31 | unsigned dis_tx_ipgap_linecheck_quirk:1; 32 | + unsigned xhci_trb_ent_quirk:1; 33 | unsigned parkmode_disable_ss_quirk:1; 34 | 35 | unsigned tx_de_emphasis_quirk:1; 36 | Index: b/drivers/usb/dwc3/host.c 37 | =================================================================== 38 | --- a/drivers/usb/dwc3/host.c 39 | +++ b/drivers/usb/dwc3/host.c 40 | @@ -43,7 +43,7 @@ out: 41 | 42 | int dwc3_host_init(struct dwc3 *dwc) 43 | { 44 | - struct property_entry props[5]; 45 | + struct property_entry props[6]; 46 | struct platform_device *xhci; 47 | int ret, irq; 48 | struct resource *res; 49 | @@ -93,6 +93,9 @@ int dwc3_host_init(struct dwc3 *dwc) 50 | if (dwc->usb3_lpm_capable) 51 | props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb3-lpm-capable"); 52 | 53 | + if (dwc->xhci_trb_ent_quirk) 54 | + props[prop_idx++] = PROPERTY_ENTRY_BOOL("xhci-trb-ent-quirk"); 55 | + 56 | if (dwc->usb2_lpm_disable) 57 | props[prop_idx++] = PROPERTY_ENTRY_BOOL("usb2-lpm-disable"); 58 | 59 | Index: b/drivers/usb/host/xhci-plat.c 60 | =================================================================== 61 | --- a/drivers/usb/host/xhci-plat.c 62 | +++ b/drivers/usb/host/xhci-plat.c 63 | @@ -307,6 +307,9 @@ static int xhci_plat_probe(struct platfo 64 | if (device_property_read_bool(tmpdev, "usb3-dis-autosuspend")) 65 | xhci->quirks |= XHCI_DIS_AUTOSUSPEND; 66 | 67 | + if (device_property_read_bool(tmpdev, "xhci-trb-ent-quirk")) 68 | + xhci->quirks |= XHCI_TRB_ENT_QUIRK; 69 | + 70 | device_property_read_u32(tmpdev, "imod-interval-ns", 71 | &xhci->imod_interval); 72 | } 73 | Index: b/drivers/usb/host/xhci-ring.c 74 | =================================================================== 75 | --- a/drivers/usb/host/xhci-ring.c 76 | +++ b/drivers/usb/host/xhci-ring.c 77 | @@ -3361,6 +3361,7 @@ int xhci_queue_bulk_tx(struct xhci_hcd * 78 | bool more_trbs_coming = true; 79 | bool need_zero_pkt = false; 80 | bool first_trb = true; 81 | + bool en_trb_ent = true; 82 | unsigned int num_trbs; 83 | unsigned int start_cycle, num_sgs = 0; 84 | unsigned int enqd_len, block_len, trb_buff_len, full_len; 85 | @@ -3397,6 +3398,13 @@ int xhci_queue_bulk_tx(struct xhci_hcd * 86 | if (urb->transfer_flags & URB_ZERO_PACKET && urb_priv->num_tds > 1) 87 | need_zero_pkt = true; 88 | 89 | + /* 90 | + * Don't enable the ENT flag in the TRB if 91 | + * the EP support bulk streaming protocol. 92 | + */ 93 | + if (urb->stream_id) 94 | + en_trb_ent = false; 95 | + 96 | td = &urb_priv->td[0]; 97 | 98 | /* 99 | @@ -3425,6 +3433,13 @@ int xhci_queue_bulk_tx(struct xhci_hcd * 100 | first_trb = false; 101 | if (start_cycle == 0) 102 | field |= TRB_CYCLE; 103 | + /* 104 | + * Don't enable the ENT flag in the TRB if the 105 | + * transfer length of the first TRB isn't an 106 | + * integer multiple of the EP maxpacket. 107 | + */ 108 | + if (trb_buff_len % usb_endpoint_maxp(&urb->ep->desc)) 109 | + en_trb_ent = false; 110 | } else 111 | field |= ring->cycle_state; 112 | 113 | @@ -3433,6 +3448,8 @@ int xhci_queue_bulk_tx(struct xhci_hcd * 114 | */ 115 | if (enqd_len + trb_buff_len < full_len) { 116 | field |= TRB_CHAIN; 117 | + if (xhci->quirks & XHCI_TRB_ENT_QUIRK && en_trb_ent) 118 | + field |= TRB_ENT; 119 | if (trb_is_link(ring->enqueue + 1)) { 120 | if (xhci_align_td(xhci, urb, enqd_len, 121 | &trb_buff_len, 122 | Index: b/drivers/usb/host/xhci.h 123 | =================================================================== 124 | --- a/drivers/usb/host/xhci.h 125 | +++ b/drivers/usb/host/xhci.h 126 | @@ -1519,7 +1519,11 @@ static inline const char *xhci_trb_type_ 127 | #define TRB_SEGMENT_SIZE (TRBS_PER_SEGMENT*16) 128 | #define TRB_SEGMENT_SHIFT (ilog2(TRB_SEGMENT_SIZE)) 129 | /* TRB buffer pointers can't cross 64KB boundaries */ 130 | +#ifdef CONFIG_ARCH_ROCKCHIP 131 | +#define TRB_MAX_BUFF_SHIFT 12 132 | +#else 133 | #define TRB_MAX_BUFF_SHIFT 16 134 | +#endif 135 | #define TRB_MAX_BUFF_SIZE (1 << TRB_MAX_BUFF_SHIFT) 136 | /* How much data is left before the 64KB boundary? */ 137 | #define TRB_BUFF_LEN_UP_TO_BOUNDARY(addr) (TRB_MAX_BUFF_SIZE - \ 138 | @@ -1885,6 +1889,7 @@ struct xhci_hcd { 139 | #define XHCI_DISABLE_SPARSE BIT_ULL(38) 140 | #define XHCI_NO_SOFT_RETRY BIT_ULL(40) 141 | #define XHCI_DIS_AUTOSUSPEND BIT_ULL(41) 142 | +#define XHCI_TRB_ENT_QUIRK BIT_ULL(63) 143 | 144 | unsigned int num_active_eps; 145 | unsigned int limit_active_eps; 146 | -------------------------------------------------------------------------------- /patchs/openwrt21/uboot/202-rockchip-rk3328-Add-support-for-OrangePi-R1-Plus-LTS.patch: -------------------------------------------------------------------------------- 1 | --- a/arch/arm/dts/Makefile 2 | +++ b/arch/arm/dts/Makefile 3 | @@ -111,6 +111,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3328) += \ 4 | rk3328-nanopi-r2c.dtb \ 5 | rk3328-nanopi-r2s.dtb \ 6 | rk3328-orangepi-r1-plus.dtb \ 7 | + rk3328-orangepi-r1-plus-lts.dtb \ 8 | rk3328-roc-cc.dtb \ 9 | rk3328-rock64.dtb \ 10 | rk3328-rock-pi-e.dtb 11 | --- /dev/null 12 | +++ b/arch/arm/dts/rk3328-orangepi-r1-plus-lts-u-boot.dtsi 13 | @@ -0,0 +1,34 @@ 14 | +#include "rk3328-u-boot.dtsi" 15 | +#include "rk3328-sdram-lpddr3-666.dtsi" 16 | +/ { 17 | + chosen { 18 | + u-boot,spl-boot-order = "same-as-spl", &sdmmc, &emmc; 19 | + }; 20 | +}; 21 | + 22 | +&gpio0 { 23 | + u-boot,dm-spl; 24 | +}; 25 | + 26 | +&pinctrl { 27 | + u-boot,dm-spl; 28 | +}; 29 | + 30 | +&sdmmc0m1_gpio { 31 | + u-boot,dm-spl; 32 | +}; 33 | + 34 | +&pcfg_pull_up_4ma { 35 | + u-boot,dm-spl; 36 | +}; 37 | + 38 | +/* Need this and all the pinctrl/gpio stuff above to set pinmux */ 39 | +&vcc_sd { 40 | + u-boot,dm-spl; 41 | +}; 42 | + 43 | +&gmac2io { 44 | + snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; 45 | + snps,reset-active-low; 46 | + snps,reset-delays-us = <0 15000 50000>; 47 | +}; 48 | --- a/board/rockchip/evb_rk3328/MAINTAINERS 49 | +++ b/board/rockchip/evb_rk3328/MAINTAINERS 50 | @@ -19,6 +19,13 @@ F: configs/orangepi-r1-plus-rk3328_ 51 | F: arch/arm/dts/rk3328-orangepi-r1-plus-u-boot.dtsi 52 | F: arch/arm/dts/rk3328-orangepi-r1-plus.dts 53 | 54 | +ORANGEPI-R1-PLUS-LTS-RK3328 55 | +M: Shenzhen Xunlong Software CO.,Limited 56 | +S: Maintained 57 | +F: configs/orangepi-r1-plus-lts-rk3328_defconfig 58 | +F: arch/arm/dts/rk3328-orangepi-r1-plus-lts-u-boot.dtsi 59 | +F: arch/arm/dts/rk3328-orangepi-r1-plus-lts.dts 60 | + 61 | ROC-RK3328-CC 62 | M: Loic Devulder 63 | M: Chen-Yu Tsai 64 | --- /dev/null 65 | +++ b/arch/arm/dts/rk3328-orangepi-r1-plus-lts.dts 66 | @@ -0,0 +1,47 @@ 67 | +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) 68 | +/* 69 | + * Copyright (c) 2016 Xunlong Software. Co., Ltd. 70 | + * (http://www.orangepi.org) 71 | + * 72 | + * Copyright (c) 2021 Tianling Shen 73 | + */ 74 | + 75 | +#include "rk3328-orangepi-r1-plus.dts" 76 | + 77 | +/ { 78 | + model = "Xunlong Orange Pi R1 Plus LTS"; 79 | + compatible = "xunlong,orangepi-r1-plus-lts", "rockchip,rk3328"; 80 | +}; 81 | + 82 | +&gmac2io { 83 | + phy-handle = <&yt8531c>; 84 | + tx_delay = <0x19>; 85 | + rx_delay = <0x05>; 86 | + 87 | + mdio { 88 | + /delete-node/ ethernet-phy@1; 89 | + 90 | + yt8531c: ethernet-phy@0 { 91 | + compatible = "ethernet-phy-id4f51.e91b", 92 | + "ethernet-phy-ieee802.3-c22"; 93 | + reg = <0>; 94 | + pinctrl-0 = <ð_phy_reset_pin>; 95 | + pinctrl-names = "default"; 96 | + reset-assert-us = <15000>; 97 | + reset-deassert-us = <50000>; 98 | + reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; 99 | + }; 100 | + }; 101 | +}; 102 | + 103 | +&lan_led { 104 | + label = "orangepi-r1-plus-lts:green:lan"; 105 | +}; 106 | + 107 | +&sys_led { 108 | + label = "orangepi-r1-plus-lts:red:sys"; 109 | +}; 110 | + 111 | +&wan_led { 112 | + label = "orangepi-r1-plus-lts:green:wan"; 113 | +}; 114 | --- /dev/null 115 | +++ b/configs/orangepi-r1-plus-lts-rk3328_defconfig 116 | @@ -0,0 +1,100 @@ 117 | +CONFIG_ARM=y 118 | +CONFIG_ARCH_ROCKCHIP=y 119 | +CONFIG_SYS_TEXT_BASE=0x00200000 120 | +CONFIG_SPL_GPIO_SUPPORT=y 121 | +CONFIG_ENV_OFFSET=0x3F8000 122 | +CONFIG_ROCKCHIP_RK3328=y 123 | +CONFIG_TPL_ROCKCHIP_COMMON_BOARD=y 124 | +CONFIG_TPL_LIBCOMMON_SUPPORT=y 125 | +CONFIG_TPL_LIBGENERIC_SUPPORT=y 126 | +CONFIG_SPL_DRIVERS_MISC_SUPPORT=y 127 | +CONFIG_SPL_STACK_R_ADDR=0x600000 128 | +CONFIG_NR_DRAM_BANKS=1 129 | +CONFIG_DEBUG_UART_BASE=0xFF130000 130 | +CONFIG_DEBUG_UART_CLOCK=24000000 131 | +CONFIG_SYSINFO=y 132 | +CONFIG_DEBUG_UART=y 133 | +CONFIG_TPL_SYS_MALLOC_F_LEN=0x800 134 | +# CONFIG_ANDROID_BOOT_IMAGE is not set 135 | +CONFIG_FIT=y 136 | +CONFIG_FIT_VERBOSE=y 137 | +CONFIG_SPL_LOAD_FIT=y 138 | +CONFIG_DEFAULT_FDT_FILE="rockchip/rk3328-orangepi-r1-plus-lts.dtb" 139 | +CONFIG_MISC_INIT_R=y 140 | +# CONFIG_DISPLAY_CPUINFO is not set 141 | +CONFIG_DISPLAY_BOARDINFO_LATE=y 142 | +# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set 143 | +CONFIG_TPL_SYS_MALLOC_SIMPLE=y 144 | +CONFIG_SPL_STACK_R=y 145 | +CONFIG_SPL_I2C_SUPPORT=y 146 | +CONFIG_SPL_POWER_SUPPORT=y 147 | +CONFIG_SPL_ATF=y 148 | +CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y 149 | +CONFIG_CMD_BOOTZ=y 150 | +CONFIG_CMD_GPT=y 151 | +CONFIG_CMD_MMC=y 152 | +CONFIG_CMD_USB=y 153 | +# CONFIG_CMD_SETEXPR is not set 154 | +CONFIG_CMD_TIME=y 155 | +CONFIG_SPL_OF_CONTROL=y 156 | +CONFIG_TPL_OF_CONTROL=y 157 | +CONFIG_DEFAULT_DEVICE_TREE="rk3328-orangepi-r1-plus-lts" 158 | +CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" 159 | +CONFIG_TPL_OF_PLATDATA=y 160 | +CONFIG_ENV_IS_IN_MMC=y 161 | +CONFIG_SYS_RELOC_GD_ENV_ADDR=y 162 | +CONFIG_NET_RANDOM_ETHADDR=y 163 | +CONFIG_TPL_DM=y 164 | +CONFIG_REGMAP=y 165 | +CONFIG_SPL_REGMAP=y 166 | +CONFIG_TPL_REGMAP=y 167 | +CONFIG_SYSCON=y 168 | +CONFIG_SPL_SYSCON=y 169 | +CONFIG_TPL_SYSCON=y 170 | +CONFIG_CLK=y 171 | +CONFIG_SPL_CLK=y 172 | +CONFIG_FASTBOOT_BUF_ADDR=0x800800 173 | +CONFIG_FASTBOOT_CMD_OEM_FORMAT=y 174 | +CONFIG_ROCKCHIP_GPIO=y 175 | +CONFIG_SYS_I2C_ROCKCHIP=y 176 | +CONFIG_MISC=y 177 | +CONFIG_MMC_DW=y 178 | +CONFIG_MMC_DW_ROCKCHIP=y 179 | +CONFIG_SF_DEFAULT_SPEED=20000000 180 | +CONFIG_DM_ETH=y 181 | +CONFIG_ETH_DESIGNWARE=y 182 | +CONFIG_GMAC_ROCKCHIP=y 183 | +CONFIG_PHY_ROCKCHIP_INNO_USB2=y 184 | +CONFIG_PINCTRL=y 185 | +CONFIG_SPL_PINCTRL=y 186 | +CONFIG_DM_PMIC=y 187 | +CONFIG_PMIC_RK8XX=y 188 | +CONFIG_SPL_DM_REGULATOR=y 189 | +CONFIG_REGULATOR_PWM=y 190 | +CONFIG_DM_REGULATOR_FIXED=y 191 | +CONFIG_SPL_DM_REGULATOR_FIXED=y 192 | +CONFIG_REGULATOR_RK8XX=y 193 | +CONFIG_PWM_ROCKCHIP=y 194 | +CONFIG_RAM=y 195 | +CONFIG_SPL_RAM=y 196 | +CONFIG_TPL_RAM=y 197 | +CONFIG_DM_RESET=y 198 | +CONFIG_BAUDRATE=1500000 199 | +CONFIG_DEBUG_UART_SHIFT=2 200 | +CONFIG_SYSRESET=y 201 | +# CONFIG_TPL_SYSRESET is not set 202 | +CONFIG_USB=y 203 | +CONFIG_USB_XHCI_HCD=y 204 | +CONFIG_USB_EHCI_HCD=y 205 | +CONFIG_USB_EHCI_GENERIC=y 206 | +CONFIG_USB_OHCI_HCD=y 207 | +CONFIG_USB_OHCI_GENERIC=y 208 | +CONFIG_USB_DWC2=y 209 | +CONFIG_USB_DWC3=y 210 | +# CONFIG_USB_DWC3_GADGET is not set 211 | +CONFIG_USB_DWC3_GENERIC=y 212 | +CONFIG_USB_GADGET=y 213 | +CONFIG_USB_GADGET_DWC2_OTG=y 214 | +CONFIG_SPL_TINY_MEMSET=y 215 | +CONFIG_TPL_TINY_MEMSET=y 216 | +CONFIG_ERRNO_STR=y 217 | -------------------------------------------------------------------------------- /patchs/openwrt21/uboot/9999-add-missing-parameters-for-LTS.patch: -------------------------------------------------------------------------------- 1 | Index: b/arch/arm/dts/rk3328-orangepi-r1-plus-lts-u-boot.dtsi 2 | =================================================================== 3 | --- a/arch/arm/dts/rk3328-orangepi-r1-plus-lts-u-boot.dtsi 4 | +++ b/arch/arm/dts/rk3328-orangepi-r1-plus-lts-u-boot.dtsi 5 | @@ -1 +1,34 @@ 6 | -#include "rk3328-orangepi-r1-plus-u-boot.dtsi" 7 | +#include "rk3328-u-boot.dtsi" 8 | +#include "rk3328-sdram-lpddr3-666.dtsi" 9 | +/ { 10 | + chosen { 11 | + u-boot,spl-boot-order = "same-as-spl", &sdmmc, &emmc; 12 | + }; 13 | +}; 14 | + 15 | +&gpio0 { 16 | + u-boot,dm-spl; 17 | +}; 18 | + 19 | +&pinctrl { 20 | + u-boot,dm-spl; 21 | +}; 22 | + 23 | +&sdmmc0m1_gpio { 24 | + u-boot,dm-spl; 25 | +}; 26 | + 27 | +&pcfg_pull_up_4ma { 28 | + u-boot,dm-spl; 29 | +}; 30 | + 31 | +/* Need this and all the pinctrl/gpio stuff above to set pinmux */ 32 | +&vcc_sd { 33 | + u-boot,dm-spl; 34 | +}; 35 | + 36 | +&gmac2io { 37 | + snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; 38 | + snps,reset-active-low; 39 | + snps,reset-delays-us = <0 15000 50000>; 40 | +}; 41 | Index: b/arch/arm/dts/rk3328-orangepi-r1-plus.dts 42 | =================================================================== 43 | --- a/arch/arm/dts/rk3328-orangepi-r1-plus.dts 44 | +++ b/arch/arm/dts/rk3328-orangepi-r1-plus.dts 45 | @@ -11,7 +11,7 @@ 46 | }; 47 | 48 | &spi0 { 49 | - status = "okay"; 50 | + status = "disabled"; 51 | 52 | flash@0 { 53 | compatible = "jedec,spi-nor"; 54 | Index: b/board/rockchip/evb_rk3328/MAINTAINERS 55 | =================================================================== 56 | --- a/board/rockchip/evb_rk3328/MAINTAINERS 57 | +++ b/board/rockchip/evb_rk3328/MAINTAINERS 58 | @@ -19,6 +19,13 @@ F: configs/orangepi-r1-plus-rk3328_ 59 | F: arch/arm/dts/rk3328-orangepi-r1-plus-u-boot.dtsi 60 | F: arch/arm/dts/rk3328-orangepi-r1-plus.dts 61 | 62 | +ORANGEPI-R1-PLUS-LTS-RK3328 63 | +M: Shenzhen Xunlong Software CO.,Limited 64 | +S: Maintained 65 | +F: configs/orangepi-r1-plus-lts-rk3328_defconfig 66 | +F: arch/arm/dts/rk3328-orangepi-r1-plus-lts-u-boot.dtsi 67 | +F: arch/arm/dts/rk3328-orangepi-r1-plus-lts.dts 68 | + 69 | ROC-RK3328-CC 70 | M: Loic Devulder 71 | M: Chen-Yu Tsai 72 | -------------------------------------------------------------------------------- /patchs/openwrt23/target/9999-add-missing-parameters-for-LTS.patch: -------------------------------------------------------------------------------- 1 | Index: b/arch/arm64/boot/dts/rockchip/rk3328.dtsi 2 | =================================================================== 3 | --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi 4 | +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi 5 | @@ -112,38 +112,38 @@ 6 | 7 | opp-408000000 { 8 | opp-hz = /bits/ 64 <408000000>; 9 | - opp-microvolt = <950000>; 10 | + opp-microvolt = <950000 950000 1350000>; 11 | clock-latency-ns = <40000>; 12 | opp-suspend; 13 | }; 14 | opp-600000000 { 15 | opp-hz = /bits/ 64 <600000000>; 16 | - opp-microvolt = <950000>; 17 | + opp-microvolt = <950000 950000 1350000>; 18 | clock-latency-ns = <40000>; 19 | }; 20 | opp-816000000 { 21 | opp-hz = /bits/ 64 <816000000>; 22 | - opp-microvolt = <1000000>; 23 | + opp-microvolt = <1000000 1050000 1350000>; 24 | clock-latency-ns = <40000>; 25 | }; 26 | opp-1008000000 { 27 | opp-hz = /bits/ 64 <1008000000>; 28 | - opp-microvolt = <1100000>; 29 | + opp-microvolt = <1100000 1150000 1350000>; 30 | clock-latency-ns = <40000>; 31 | }; 32 | opp-1200000000 { 33 | opp-hz = /bits/ 64 <1200000000>; 34 | - opp-microvolt = <1225000>; 35 | + opp-microvolt = <1225000 1275000 1350000>; 36 | clock-latency-ns = <40000>; 37 | }; 38 | opp-1296000000 { 39 | opp-hz = /bits/ 64 <1296000000>; 40 | - opp-microvolt = <1300000>; 41 | + opp-microvolt = <1300000 1350000 1400000>; 42 | clock-latency-ns = <40000>; 43 | }; 44 | opp-1392000000 { 45 | opp-hz = /bits/ 64 <1392000000>; 46 | - opp-microvolt = <1350000>; 47 | + opp-microvolt = <1350000 1400000 1450000>; 48 | clock-latency-ns = <40000>; 49 | }; 50 | opp-1512000000 { 51 | @@ -151,11 +151,6 @@ 52 | opp-microvolt = <1450000>; 53 | clock-latency-ns = <40000>; 54 | }; 55 | - opp-1608000000 { 56 | - opp-hz = /bits/ 64 <1608000000>; 57 | - opp-microvolt = <1450000>; 58 | - clock-latency-ns = <40000>; 59 | - }; 60 | }; 61 | 62 | analog_sound: analog-sound { 63 | @@ -876,6 +871,47 @@ 64 | }; 65 | }; 66 | 67 | + usb3phy_grf: syscon@ff460000 { 68 | + compatible = "rockchip,usb3phy-grf", "syscon"; 69 | + reg = <0x0 0xff460000 0x0 0x1000>; 70 | + }; 71 | + 72 | + u3phy: usb3-phy@ff470000 { 73 | + compatible = "rockchip,rk3328-u3phy"; 74 | + reg = <0x0 0xff470000 0x0 0x0>; 75 | + rockchip,u3phygrf = <&usb3phy_grf>; 76 | + rockchip,grf = <&grf>; 77 | + interrupts = ; 78 | + interrupt-names = "linestate"; 79 | + clocks = <&cru PCLK_USB3PHY_OTG>, <&cru PCLK_USB3PHY_PIPE>; 80 | + clock-names = "u3phy-otg", "u3phy-pipe"; 81 | + resets = <&cru SRST_USB3PHY_U2>, 82 | + <&cru SRST_USB3PHY_U3>, 83 | + <&cru SRST_USB3PHY_PIPE>, 84 | + <&cru SRST_USB3OTG_UTMI>, 85 | + <&cru SRST_USB3PHY_OTG_P>, 86 | + <&cru SRST_USB3PHY_PIPE_P>; 87 | + reset-names = "u3phy-u2-por", "u3phy-u3-por", 88 | + "u3phy-pipe-mac", "u3phy-utmi-mac", 89 | + "u3phy-utmi-apb", "u3phy-pipe-apb"; 90 | + #address-cells = <2>; 91 | + #size-cells = <2>; 92 | + ranges; 93 | + status = "disabled"; 94 | + 95 | + u3phy_utmi: utmi@ff470000 { 96 | + reg = <0x0 0xff470000 0x0 0x8000>; 97 | + #phy-cells = <0>; 98 | + status = "disabled"; 99 | + }; 100 | + 101 | + u3phy_pipe: pipe@ff478000 { 102 | + reg = <0x0 0xff478000 0x0 0x8000>; 103 | + #phy-cells = <0>; 104 | + status = "disabled"; 105 | + }; 106 | + }; 107 | + 108 | sdmmc: mmc@ff500000 { 109 | compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc"; 110 | reg = <0x0 0xff500000 0x0 0x4000>; 111 | @@ -1016,6 +1052,8 @@ 112 | clock-names = "ref_clk", "suspend_clk", 113 | "bus_clk"; 114 | dr_mode = "otg"; 115 | + phys = <&u3phy_utmi>, <&u3phy_pipe>; 116 | + phy-names = "usb2-phy", "usb3-phy"; 117 | phy_type = "utmi_wide"; 118 | snps,dis-del-phy-power-chg-quirk; 119 | snps,dis_enblslpm_quirk; 120 | @@ -1023,6 +1061,7 @@ 121 | snps,dis-u2-freeclk-exists-quirk; 122 | snps,dis_u2_susphy_quirk; 123 | snps,dis_u3_susphy_quirk; 124 | + snps,xhci-trb-ent-quirk; 125 | status = "disabled"; 126 | }; 127 | 128 | Index: b/drivers/phy/rockchip/Kconfig 129 | =================================================================== 130 | --- a/drivers/phy/rockchip/Kconfig 131 | +++ b/drivers/phy/rockchip/Kconfig 132 | @@ -48,6 +48,15 @@ config PHY_ROCKCHIP_INNO_USB2 133 | help 134 | Support for Rockchip USB2.0 PHY with Innosilicon IP block. 135 | 136 | +config PHY_ROCKCHIP_INNO_USB3 137 | + tristate "Rockchip INNO USB 3.0 PHY Driver" 138 | + default y if ARCH_ROCKCHIP 139 | + depends on OF 140 | + select GENERIC_PHY 141 | + select USB_PHY 142 | + help 143 | + Support for Rockchip USB 3.0 PHY with Innosilicon IP block. 144 | + 145 | config PHY_ROCKCHIP_INNO_CSIDPHY 146 | tristate "Rockchip Innosilicon MIPI CSI PHY driver" 147 | depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OF 148 | Index: b/drivers/phy/rockchip/Makefile 149 | =================================================================== 150 | --- a/drivers/phy/rockchip/Makefile 151 | +++ b/drivers/phy/rockchip/Makefile 152 | @@ -6,6 +6,7 @@ obj-$(CONFIG_PHY_ROCKCHIP_INNO_CSIDPHY) 153 | obj-$(CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY) += phy-rockchip-inno-dsidphy.o 154 | obj-$(CONFIG_PHY_ROCKCHIP_INNO_HDMI) += phy-rockchip-inno-hdmi.o 155 | obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB2) += phy-rockchip-inno-usb2.o 156 | +obj-$(CONFIG_PHY_ROCKCHIP_INNO_USB3) += phy-rockchip-inno-usb3.o 157 | obj-$(CONFIG_PHY_ROCKCHIP_NANENG_COMBO_PHY) += phy-rockchip-naneng-combphy.o 158 | obj-$(CONFIG_PHY_ROCKCHIP_PCIE) += phy-rockchip-pcie.o 159 | obj-$(CONFIG_PHY_ROCKCHIP_SNPS_PCIE3) += phy-rockchip-snps-pcie3.o 160 | -------------------------------------------------------------------------------- /patchs/openwrt23/uboot/rk3328-orangepi-r1-plus-lts-u-boot.dtsi: -------------------------------------------------------------------------------- 1 | #include "rk3328-u-boot.dtsi" 2 | #include "rk3328-sdram-lpddr3-666.dtsi" 3 | / { 4 | chosen { 5 | u-boot,spl-boot-order = "same-as-spl", &sdmmc, &emmc; 6 | }; 7 | }; 8 | 9 | &gpio0 { 10 | u-boot,dm-spl; 11 | }; 12 | 13 | &pinctrl { 14 | u-boot,dm-spl; 15 | }; 16 | 17 | &sdmmc0m1_pin { 18 | u-boot,dm-spl; 19 | }; 20 | 21 | &pcfg_pull_up_4ma { 22 | u-boot,dm-spl; 23 | }; 24 | 25 | /* Need this and all the pinctrl/gpio stuff above to set pinmux */ 26 | &vcc_sd { 27 | u-boot,dm-spl; 28 | }; 29 | 30 | &gmac2io { 31 | snps,reset-gpio = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>; 32 | snps,reset-active-low; 33 | snps,reset-delays-us = <0 15000 50000>; 34 | }; 35 | -------------------------------------------------------------------------------- /patchs/usb3/phy-rockchip-inno-usb3.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Rockchip USB 3.0 PHY with Innosilicon IP block driver 3 | * 4 | * Copyright (C) 2016 Fuzhou Rockchip Electronics Co., Ltd 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | */ 16 | 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #define U3PHY_PORT_NUM 2 38 | #define U3PHY_MAX_CLKS 4 39 | #define BIT_WRITEABLE_SHIFT 16 40 | #define SCHEDULE_DELAY (60 * HZ) 41 | 42 | #define U3PHY_APB_RST BIT(0) 43 | #define U3PHY_POR_RST BIT(1) 44 | #define U3PHY_MAC_RST BIT(2) 45 | 46 | struct rockchip_u3phy; 47 | struct rockchip_u3phy_port; 48 | 49 | enum rockchip_u3phy_type { 50 | U3PHY_TYPE_PIPE, 51 | U3PHY_TYPE_UTMI, 52 | }; 53 | 54 | enum rockchip_u3phy_pipe_pwr { 55 | PIPE_PWR_P0 = 0, 56 | PIPE_PWR_P1 = 1, 57 | PIPE_PWR_P2 = 2, 58 | PIPE_PWR_P3 = 3, 59 | PIPE_PWR_MAX = 4, 60 | }; 61 | 62 | enum rockchip_u3phy_rest_req { 63 | U3_POR_RSTN = 0, 64 | U2_POR_RSTN = 1, 65 | PIPE_MAC_RSTN = 2, 66 | UTMI_MAC_RSTN = 3, 67 | PIPE_APB_RSTN = 4, 68 | UTMI_APB_RSTN = 5, 69 | U3PHY_RESET_MAX = 6, 70 | }; 71 | 72 | enum rockchip_u3phy_utmi_state { 73 | PHY_UTMI_HS_ONLINE = 0, 74 | PHY_UTMI_DISCONNECT = 1, 75 | PHY_UTMI_CONNECT = 2, 76 | PHY_UTMI_FS_LS_ONLINE = 4, 77 | }; 78 | 79 | /* 80 | * @rvalue: reset value 81 | * @dvalue: desired value 82 | */ 83 | struct u3phy_reg { 84 | unsigned int offset; 85 | unsigned int bitend; 86 | unsigned int bitstart; 87 | unsigned int rvalue; 88 | unsigned int dvalue; 89 | }; 90 | 91 | struct rockchip_u3phy_grfcfg { 92 | struct u3phy_reg um_suspend; 93 | struct u3phy_reg ls_det_en; 94 | struct u3phy_reg ls_det_st; 95 | struct u3phy_reg um_ls; 96 | struct u3phy_reg um_hstdct; 97 | struct u3phy_reg u2_only_ctrl; 98 | struct u3phy_reg u3_disable; 99 | struct u3phy_reg pp_pwr_st; 100 | struct u3phy_reg pp_pwr_en[PIPE_PWR_MAX]; 101 | }; 102 | 103 | /** 104 | * struct rockchip_u3phy_apbcfg: usb3-phy apb configuration. 105 | * @u2_pre_emp: usb2-phy pre-emphasis tuning. 106 | * @u2_pre_emp_sth: usb2-phy pre-emphasis strength tuning. 107 | * @u2_odt_tuning: usb2-phy odt 45ohm tuning. 108 | */ 109 | struct rockchip_u3phy_apbcfg { 110 | unsigned int u2_pre_emp; 111 | unsigned int u2_pre_emp_sth; 112 | unsigned int u2_odt_tuning; 113 | }; 114 | 115 | struct rockchip_u3phy_cfg { 116 | unsigned int reg; 117 | const struct rockchip_u3phy_grfcfg grfcfg; 118 | 119 | int (*phy_pipe_power)(struct rockchip_u3phy *, 120 | struct rockchip_u3phy_port *, 121 | bool on); 122 | int (*phy_tuning)(struct rockchip_u3phy *, 123 | struct rockchip_u3phy_port *, 124 | struct device_node *); 125 | }; 126 | 127 | struct rockchip_u3phy_port { 128 | struct phy *phy; 129 | void __iomem *base; 130 | unsigned int index; 131 | unsigned char type; 132 | bool suspended; 133 | bool refclk_25m_quirk; 134 | struct mutex mutex; /* mutex for updating register */ 135 | struct delayed_work um_sm_work; 136 | }; 137 | 138 | struct rockchip_u3phy { 139 | struct device *dev; 140 | struct regmap *u3phy_grf; 141 | struct regmap *grf; 142 | int um_ls_irq; 143 | struct clk *clks[U3PHY_MAX_CLKS]; 144 | struct regulator *vbus; 145 | struct reset_control *rsts[U3PHY_RESET_MAX]; 146 | struct rockchip_u3phy_apbcfg apbcfg; 147 | const struct rockchip_u3phy_cfg *cfgs; 148 | struct rockchip_u3phy_port ports[U3PHY_PORT_NUM]; 149 | struct usb_phy usb_phy; 150 | bool vbus_enabled; 151 | }; 152 | 153 | static inline int param_write(void __iomem *base, 154 | const struct u3phy_reg *reg, bool desired) 155 | { 156 | unsigned int val, mask; 157 | unsigned int tmp = desired ? reg->dvalue : reg->rvalue; 158 | int ret = 0; 159 | 160 | mask = GENMASK(reg->bitend, reg->bitstart); 161 | val = (tmp << reg->bitstart) | (mask << BIT_WRITEABLE_SHIFT); 162 | ret = regmap_write(base, reg->offset, val); 163 | 164 | return ret; 165 | } 166 | 167 | static inline bool param_exped(void __iomem *base, 168 | const struct u3phy_reg *reg, 169 | unsigned int value) 170 | { 171 | int ret; 172 | unsigned int tmp, orig; 173 | unsigned int mask = GENMASK(reg->bitend, reg->bitstart); 174 | 175 | ret = regmap_read(base, reg->offset, &orig); 176 | if (ret) 177 | return false; 178 | 179 | tmp = (orig & mask) >> reg->bitstart; 180 | return tmp == value; 181 | } 182 | 183 | static int rockchip_set_vbus_power(struct rockchip_u3phy *u3phy, bool en) 184 | { 185 | int ret = 0; 186 | 187 | if (!u3phy->vbus) 188 | return 0; 189 | 190 | if (en && !u3phy->vbus_enabled) { 191 | ret = regulator_enable(u3phy->vbus); 192 | if (ret) 193 | dev_err(u3phy->dev, 194 | "Failed to enable VBUS supply\n"); 195 | } else if (!en && u3phy->vbus_enabled) { 196 | ret = regulator_disable(u3phy->vbus); 197 | } 198 | 199 | if (ret == 0) 200 | u3phy->vbus_enabled = en; 201 | 202 | return ret; 203 | } 204 | 205 | static int rockchip_u3phy_usb2_only_show(struct seq_file *s, void *unused) 206 | { 207 | struct rockchip_u3phy *u3phy = s->private; 208 | 209 | if (param_exped(u3phy->u3phy_grf, &u3phy->cfgs->grfcfg.u2_only_ctrl, 1)) 210 | dev_info(u3phy->dev, "u2\n"); 211 | else 212 | dev_info(u3phy->dev, "u3\n"); 213 | 214 | return 0; 215 | } 216 | 217 | static int rockchip_u3phy_usb2_only_open(struct inode *inode, 218 | struct file *file) 219 | { 220 | return single_open(file, rockchip_u3phy_usb2_only_show, 221 | inode->i_private); 222 | } 223 | 224 | static ssize_t rockchip_u3phy_usb2_only_write(struct file *file, 225 | const char __user *ubuf, 226 | size_t count, loff_t *ppos) 227 | { 228 | struct seq_file *s = file->private_data; 229 | struct rockchip_u3phy *u3phy = s->private; 230 | struct rockchip_u3phy_port *u3phy_port; 231 | char buf[32]; 232 | u8 index; 233 | 234 | if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) 235 | return -EFAULT; 236 | 237 | if (!strncmp(buf, "u3", 2) && 238 | param_exped(u3phy->u3phy_grf, 239 | &u3phy->cfgs->grfcfg.u2_only_ctrl, 1)) { 240 | dev_info(u3phy->dev, "Set usb3.0 and usb2.0 mode successfully\n"); 241 | 242 | rockchip_set_vbus_power(u3phy, false); 243 | 244 | param_write(u3phy->grf, 245 | &u3phy->cfgs->grfcfg.u3_disable, false); 246 | param_write(u3phy->u3phy_grf, 247 | &u3phy->cfgs->grfcfg.u2_only_ctrl, false); 248 | 249 | for (index = 0; index < U3PHY_PORT_NUM; index++) { 250 | u3phy_port = &u3phy->ports[index]; 251 | /* enable u3 rx termimation */ 252 | if (u3phy_port->type == U3PHY_TYPE_PIPE) 253 | writel(0x30, u3phy_port->base + 0xd8); 254 | } 255 | 256 | atomic_notifier_call_chain(&u3phy->usb_phy.notifier, 0, NULL); 257 | 258 | rockchip_set_vbus_power(u3phy, true); 259 | } else if (!strncmp(buf, "u2", 2) && 260 | param_exped(u3phy->u3phy_grf, 261 | &u3phy->cfgs->grfcfg.u2_only_ctrl, 0)) { 262 | dev_info(u3phy->dev, "Set usb2.0 only mode successfully\n"); 263 | 264 | rockchip_set_vbus_power(u3phy, false); 265 | 266 | param_write(u3phy->grf, 267 | &u3phy->cfgs->grfcfg.u3_disable, true); 268 | param_write(u3phy->u3phy_grf, 269 | &u3phy->cfgs->grfcfg.u2_only_ctrl, true); 270 | 271 | for (index = 0; index < U3PHY_PORT_NUM; index++) { 272 | u3phy_port = &u3phy->ports[index]; 273 | /* disable u3 rx termimation */ 274 | if (u3phy_port->type == U3PHY_TYPE_PIPE) 275 | writel(0x20, u3phy_port->base + 0xd8); 276 | } 277 | 278 | atomic_notifier_call_chain(&u3phy->usb_phy.notifier, 0, NULL); 279 | 280 | rockchip_set_vbus_power(u3phy, true); 281 | } else { 282 | dev_info(u3phy->dev, "Same or illegal mode\n"); 283 | } 284 | 285 | return count; 286 | } 287 | 288 | static const struct file_operations rockchip_u3phy_usb2_only_fops = { 289 | .open = rockchip_u3phy_usb2_only_open, 290 | .write = rockchip_u3phy_usb2_only_write, 291 | .read = seq_read, 292 | .llseek = seq_lseek, 293 | .release = single_release, 294 | }; 295 | 296 | static void rockchip_u3phy_debugfs_init(struct rockchip_u3phy *u3phy) 297 | { 298 | struct dentry *root; 299 | 300 | root = debugfs_create_dir(dev_name(u3phy->dev), NULL); 301 | debugfs_create_file("u3phy_mode", 0644, root, 302 | u3phy, &rockchip_u3phy_usb2_only_fops); 303 | } 304 | 305 | static const char *get_rest_name(enum rockchip_u3phy_rest_req rst) 306 | { 307 | switch (rst) { 308 | case U2_POR_RSTN: 309 | return "u3phy-u2-por"; 310 | case U3_POR_RSTN: 311 | return "u3phy-u3-por"; 312 | case PIPE_MAC_RSTN: 313 | return "u3phy-pipe-mac"; 314 | case UTMI_MAC_RSTN: 315 | return "u3phy-utmi-mac"; 316 | case UTMI_APB_RSTN: 317 | return "u3phy-utmi-apb"; 318 | case PIPE_APB_RSTN: 319 | return "u3phy-pipe-apb"; 320 | default: 321 | return "invalid"; 322 | } 323 | } 324 | 325 | static void rockchip_u3phy_rest_deassert(struct rockchip_u3phy *u3phy, 326 | unsigned int flag) 327 | { 328 | int rst; 329 | 330 | if (flag & U3PHY_APB_RST) { 331 | dev_dbg(u3phy->dev, "deassert APB bus interface reset\n"); 332 | for (rst = PIPE_APB_RSTN; rst <= UTMI_APB_RSTN; rst++) { 333 | if (u3phy->rsts[rst]) 334 | reset_control_deassert(u3phy->rsts[rst]); 335 | } 336 | } 337 | 338 | if (flag & U3PHY_POR_RST) { 339 | usleep_range(12, 15); 340 | dev_dbg(u3phy->dev, "deassert u2 and u3 phy power on reset\n"); 341 | for (rst = U3_POR_RSTN; rst <= U2_POR_RSTN; rst++) { 342 | if (u3phy->rsts[rst]) 343 | reset_control_deassert(u3phy->rsts[rst]); 344 | } 345 | } 346 | 347 | if (flag & U3PHY_MAC_RST) { 348 | usleep_range(1200, 1500); 349 | dev_dbg(u3phy->dev, "deassert pipe and utmi MAC reset\n"); 350 | for (rst = PIPE_MAC_RSTN; rst <= UTMI_MAC_RSTN; rst++) 351 | if (u3phy->rsts[rst]) 352 | reset_control_deassert(u3phy->rsts[rst]); 353 | } 354 | } 355 | 356 | static void rockchip_u3phy_rest_assert(struct rockchip_u3phy *u3phy) 357 | { 358 | int rst; 359 | 360 | dev_dbg(u3phy->dev, "assert u3phy reset\n"); 361 | for (rst = 0; rst < U3PHY_RESET_MAX; rst++) 362 | if (u3phy->rsts[rst]) 363 | reset_control_assert(u3phy->rsts[rst]); 364 | } 365 | 366 | static int rockchip_u3phy_clk_enable(struct rockchip_u3phy *u3phy) 367 | { 368 | int ret, clk; 369 | 370 | for (clk = 0; clk < U3PHY_MAX_CLKS && u3phy->clks[clk]; clk++) { 371 | ret = clk_prepare_enable(u3phy->clks[clk]); 372 | if (ret) 373 | goto err_disable_clks; 374 | } 375 | return 0; 376 | 377 | err_disable_clks: 378 | while (--clk >= 0) 379 | clk_disable_unprepare(u3phy->clks[clk]); 380 | return ret; 381 | } 382 | 383 | static void rockchip_u3phy_clk_disable(struct rockchip_u3phy *u3phy) 384 | { 385 | int clk; 386 | 387 | for (clk = U3PHY_MAX_CLKS - 1; clk >= 0; clk--) 388 | if (u3phy->clks[clk]) 389 | clk_disable_unprepare(u3phy->clks[clk]); 390 | } 391 | 392 | static int rockchip_u3phy_init(struct phy *phy) 393 | { 394 | return 0; 395 | } 396 | 397 | static int rockchip_u3phy_exit(struct phy *phy) 398 | { 399 | return 0; 400 | } 401 | 402 | static int rockchip_u3phy_power_on(struct phy *phy) 403 | { 404 | struct rockchip_u3phy_port *u3phy_port = phy_get_drvdata(phy); 405 | struct rockchip_u3phy *u3phy = dev_get_drvdata(phy->dev.parent); 406 | int ret; 407 | 408 | dev_info(&u3phy_port->phy->dev, "u3phy %s power on\n", 409 | (u3phy_port->type == U3PHY_TYPE_UTMI) ? "u2" : "u3"); 410 | 411 | if (!u3phy_port->suspended) 412 | return 0; 413 | 414 | ret = rockchip_u3phy_clk_enable(u3phy); 415 | if (ret) 416 | return ret; 417 | 418 | if (u3phy_port->type == U3PHY_TYPE_UTMI) { 419 | param_write(u3phy->u3phy_grf, 420 | &u3phy->cfgs->grfcfg.um_suspend, false); 421 | } else { 422 | /* current in p2 ? */ 423 | if (param_exped(u3phy->u3phy_grf, 424 | &u3phy->cfgs->grfcfg.pp_pwr_st, PIPE_PWR_P2)) 425 | goto done; 426 | 427 | if (u3phy->cfgs->phy_pipe_power) { 428 | dev_dbg(u3phy->dev, "do pipe power up\n"); 429 | u3phy->cfgs->phy_pipe_power(u3phy, u3phy_port, true); 430 | } 431 | 432 | /* exit to p0 */ 433 | param_write(u3phy->u3phy_grf, 434 | &u3phy->cfgs->grfcfg.pp_pwr_en[PIPE_PWR_P0], true); 435 | usleep_range(90, 100); 436 | 437 | /* enter to p2 from p0 */ 438 | param_write(u3phy->u3phy_grf, 439 | &u3phy->cfgs->grfcfg.pp_pwr_en[PIPE_PWR_P2], 440 | false); 441 | udelay(3); 442 | } 443 | 444 | done: 445 | rockchip_set_vbus_power(u3phy, true); 446 | u3phy_port->suspended = false; 447 | return 0; 448 | } 449 | 450 | static int rockchip_u3phy_power_off(struct phy *phy) 451 | { 452 | struct rockchip_u3phy_port *u3phy_port = phy_get_drvdata(phy); 453 | struct rockchip_u3phy *u3phy = dev_get_drvdata(phy->dev.parent); 454 | 455 | dev_info(&u3phy_port->phy->dev, "u3phy %s power off\n", 456 | (u3phy_port->type == U3PHY_TYPE_UTMI) ? "u2" : "u3"); 457 | 458 | if (u3phy_port->suspended) 459 | return 0; 460 | 461 | if (u3phy_port->type == U3PHY_TYPE_UTMI) { 462 | param_write(u3phy->u3phy_grf, 463 | &u3phy->cfgs->grfcfg.um_suspend, true); 464 | } else { 465 | /* current in p3 ? */ 466 | if (param_exped(u3phy->u3phy_grf, 467 | &u3phy->cfgs->grfcfg.pp_pwr_st, PIPE_PWR_P3)) 468 | goto done; 469 | 470 | /* exit to p0 */ 471 | param_write(u3phy->u3phy_grf, 472 | &u3phy->cfgs->grfcfg.pp_pwr_en[PIPE_PWR_P0], true); 473 | udelay(2); 474 | 475 | /* enter to p3 from p0 */ 476 | param_write(u3phy->u3phy_grf, 477 | &u3phy->cfgs->grfcfg.pp_pwr_en[PIPE_PWR_P3], true); 478 | udelay(6); 479 | 480 | if (u3phy->cfgs->phy_pipe_power) { 481 | dev_dbg(u3phy->dev, "do pipe power down\n"); 482 | u3phy->cfgs->phy_pipe_power(u3phy, u3phy_port, false); 483 | } 484 | } 485 | 486 | done: 487 | rockchip_u3phy_clk_disable(u3phy); 488 | u3phy_port->suspended = true; 489 | return 0; 490 | } 491 | 492 | static __maybe_unused 493 | struct phy *rockchip_u3phy_xlate(struct device *dev, 494 | struct of_phandle_args *args) 495 | { 496 | struct rockchip_u3phy *u3phy = dev_get_drvdata(dev); 497 | struct rockchip_u3phy_port *u3phy_port = NULL; 498 | struct device_node *phy_np = args->np; 499 | int index; 500 | 501 | if (args->args_count != 1) { 502 | dev_err(dev, "invalid number of cells in 'phy' property\n"); 503 | return ERR_PTR(-EINVAL); 504 | } 505 | 506 | for (index = 0; index < U3PHY_PORT_NUM; index++) { 507 | if (phy_np == u3phy->ports[index].phy->dev.of_node) { 508 | u3phy_port = &u3phy->ports[index]; 509 | break; 510 | } 511 | } 512 | 513 | if (!u3phy_port) { 514 | dev_err(dev, "failed to find appropriate phy\n"); 515 | return ERR_PTR(-EINVAL); 516 | } 517 | 518 | return u3phy_port->phy; 519 | } 520 | 521 | static struct phy_ops rockchip_u3phy_ops = { 522 | .init = rockchip_u3phy_init, 523 | .exit = rockchip_u3phy_exit, 524 | .power_on = rockchip_u3phy_power_on, 525 | .power_off = rockchip_u3phy_power_off, 526 | .owner = THIS_MODULE, 527 | }; 528 | 529 | /* 530 | * The function manage host-phy port state and suspend/resume phy port 531 | * to save power automatically. 532 | * 533 | * we rely on utmi_linestate and utmi_hostdisconnect to identify whether 534 | * devices is disconnect or not. Besides, we do not need care it is FS/LS 535 | * disconnected or HS disconnected, actually, we just only need get the 536 | * device is disconnected at last through rearm the delayed work, 537 | * to suspend the phy port in _PHY_STATE_DISCONNECT_ case. 538 | */ 539 | static void rockchip_u3phy_um_sm_work(struct work_struct *work) 540 | { 541 | struct rockchip_u3phy_port *u3phy_port = 542 | container_of(work, struct rockchip_u3phy_port, um_sm_work.work); 543 | struct rockchip_u3phy *u3phy = 544 | dev_get_drvdata(u3phy_port->phy->dev.parent); 545 | unsigned int sh = u3phy->cfgs->grfcfg.um_hstdct.bitend - 546 | u3phy->cfgs->grfcfg.um_hstdct.bitstart + 1; 547 | unsigned int ul, uhd, state; 548 | unsigned int ul_mask, uhd_mask; 549 | int ret; 550 | 551 | mutex_lock(&u3phy_port->mutex); 552 | 553 | ret = regmap_read(u3phy->u3phy_grf, 554 | u3phy->cfgs->grfcfg.um_ls.offset, &ul); 555 | if (ret < 0) 556 | goto next_schedule; 557 | 558 | ret = regmap_read(u3phy->u3phy_grf, 559 | u3phy->cfgs->grfcfg.um_hstdct.offset, &uhd); 560 | if (ret < 0) 561 | goto next_schedule; 562 | 563 | uhd_mask = GENMASK(u3phy->cfgs->grfcfg.um_hstdct.bitend, 564 | u3phy->cfgs->grfcfg.um_hstdct.bitstart); 565 | ul_mask = GENMASK(u3phy->cfgs->grfcfg.um_ls.bitend, 566 | u3phy->cfgs->grfcfg.um_ls.bitstart); 567 | 568 | /* stitch on um_ls and um_hstdct as phy state */ 569 | state = ((uhd & uhd_mask) >> u3phy->cfgs->grfcfg.um_hstdct.bitstart) | 570 | (((ul & ul_mask) >> u3phy->cfgs->grfcfg.um_ls.bitstart) << sh); 571 | 572 | switch (state) { 573 | case PHY_UTMI_HS_ONLINE: 574 | dev_dbg(&u3phy_port->phy->dev, "HS online\n"); 575 | break; 576 | case PHY_UTMI_FS_LS_ONLINE: 577 | /* 578 | * For FS/LS device, the online state share with connect state 579 | * from um_ls and um_hstdct register, so we distinguish 580 | * them via suspended flag. 581 | * 582 | * Plus, there are two cases, one is D- Line pull-up, and D+ 583 | * line pull-down, the state is 4; another is D+ line pull-up, 584 | * and D- line pull-down, the state is 2. 585 | */ 586 | if (!u3phy_port->suspended) { 587 | /* D- line pull-up, D+ line pull-down */ 588 | dev_dbg(&u3phy_port->phy->dev, "FS/LS online\n"); 589 | break; 590 | } 591 | /* fall through */ 592 | case PHY_UTMI_CONNECT: 593 | if (u3phy_port->suspended) { 594 | dev_dbg(&u3phy_port->phy->dev, "Connected\n"); 595 | rockchip_u3phy_power_on(u3phy_port->phy); 596 | u3phy_port->suspended = false; 597 | } else { 598 | /* D+ line pull-up, D- line pull-down */ 599 | dev_dbg(&u3phy_port->phy->dev, "FS/LS online\n"); 600 | } 601 | break; 602 | case PHY_UTMI_DISCONNECT: 603 | if (!u3phy_port->suspended) { 604 | dev_dbg(&u3phy_port->phy->dev, "Disconnected\n"); 605 | rockchip_u3phy_power_off(u3phy_port->phy); 606 | u3phy_port->suspended = true; 607 | } 608 | 609 | /* 610 | * activate the linestate detection to get the next device 611 | * plug-in irq. 612 | */ 613 | param_write(u3phy->u3phy_grf, 614 | &u3phy->cfgs->grfcfg.ls_det_st, true); 615 | param_write(u3phy->u3phy_grf, 616 | &u3phy->cfgs->grfcfg.ls_det_en, true); 617 | 618 | /* 619 | * we don't need to rearm the delayed work when the phy port 620 | * is suspended. 621 | */ 622 | mutex_unlock(&u3phy_port->mutex); 623 | return; 624 | default: 625 | dev_dbg(&u3phy_port->phy->dev, "unknown phy state\n"); 626 | break; 627 | } 628 | 629 | next_schedule: 630 | mutex_unlock(&u3phy_port->mutex); 631 | schedule_delayed_work(&u3phy_port->um_sm_work, SCHEDULE_DELAY); 632 | } 633 | 634 | static irqreturn_t rockchip_u3phy_um_ls_irq(int irq, void *data) 635 | { 636 | struct rockchip_u3phy_port *u3phy_port = data; 637 | struct rockchip_u3phy *u3phy = 638 | dev_get_drvdata(u3phy_port->phy->dev.parent); 639 | 640 | if (!param_exped(u3phy->u3phy_grf, 641 | &u3phy->cfgs->grfcfg.ls_det_st, 642 | u3phy->cfgs->grfcfg.ls_det_st.dvalue)) 643 | return IRQ_NONE; 644 | 645 | dev_dbg(u3phy->dev, "utmi linestate interrupt\n"); 646 | mutex_lock(&u3phy_port->mutex); 647 | 648 | /* disable linestate detect irq and clear its status */ 649 | param_write(u3phy->u3phy_grf, &u3phy->cfgs->grfcfg.ls_det_en, false); 650 | param_write(u3phy->u3phy_grf, &u3phy->cfgs->grfcfg.ls_det_st, true); 651 | 652 | mutex_unlock(&u3phy_port->mutex); 653 | 654 | /* 655 | * In this case for host phy, a new device is plugged in, meanwhile, 656 | * if the phy port is suspended, we need rearm the work to resume it 657 | * and mange its states; otherwise, we just return irq handled. 658 | */ 659 | if (u3phy_port->suspended) { 660 | dev_dbg(u3phy->dev, "schedule utmi sm work\n"); 661 | rockchip_u3phy_um_sm_work(&u3phy_port->um_sm_work.work); 662 | } 663 | 664 | return IRQ_HANDLED; 665 | } 666 | 667 | static int rockchip_u3phy_parse_dt(struct rockchip_u3phy *u3phy, 668 | struct platform_device *pdev) 669 | 670 | { 671 | struct device *dev = &pdev->dev; 672 | struct device_node *np = dev->of_node; 673 | int ret, i, clk; 674 | 675 | u3phy->um_ls_irq = platform_get_irq_byname(pdev, "linestate"); 676 | if (u3phy->um_ls_irq < 0) { 677 | dev_err(dev, "get utmi linestate irq failed\n"); 678 | return -ENXIO; 679 | } 680 | 681 | /* Get Vbus regulators */ 682 | u3phy->vbus = devm_regulator_get_optional(dev, "vbus"); 683 | if (IS_ERR(u3phy->vbus)) { 684 | ret = PTR_ERR(u3phy->vbus); 685 | if (ret == -EPROBE_DEFER) 686 | return ret; 687 | 688 | dev_warn(dev, "Failed to get VBUS supply regulator\n"); 689 | u3phy->vbus = NULL; 690 | } 691 | 692 | for (clk = 0; clk < U3PHY_MAX_CLKS; clk++) { 693 | u3phy->clks[clk] = of_clk_get(np, clk); 694 | if (IS_ERR(u3phy->clks[clk])) { 695 | ret = PTR_ERR(u3phy->clks[clk]); 696 | if (ret == -EPROBE_DEFER) 697 | goto err_put_clks; 698 | u3phy->clks[clk] = NULL; 699 | break; 700 | } 701 | } 702 | 703 | for (i = 0; i < U3PHY_RESET_MAX; i++) { 704 | u3phy->rsts[i] = devm_reset_control_get(dev, get_rest_name(i)); 705 | if (IS_ERR(u3phy->rsts[i])) { 706 | dev_info(dev, "no %s reset control specified\n", 707 | get_rest_name(i)); 708 | u3phy->rsts[i] = NULL; 709 | } 710 | } 711 | 712 | return 0; 713 | 714 | err_put_clks: 715 | while (--clk >= 0) 716 | clk_put(u3phy->clks[clk]); 717 | return ret; 718 | } 719 | 720 | static int rockchip_u3phy_port_init(struct rockchip_u3phy *u3phy, 721 | struct rockchip_u3phy_port *u3phy_port, 722 | struct device_node *child_np) 723 | { 724 | struct resource res; 725 | struct phy *phy; 726 | int ret; 727 | 728 | dev_dbg(u3phy->dev, "u3phy port initialize\n"); 729 | 730 | mutex_init(&u3phy_port->mutex); 731 | u3phy_port->suspended = true; /* initial status */ 732 | 733 | phy = devm_phy_create(u3phy->dev, child_np, &rockchip_u3phy_ops); 734 | if (IS_ERR(phy)) { 735 | dev_err(u3phy->dev, "failed to create phy\n"); 736 | return PTR_ERR(phy); 737 | } 738 | 739 | u3phy_port->phy = phy; 740 | 741 | ret = of_address_to_resource(child_np, 0, &res); 742 | if (ret) { 743 | dev_err(u3phy->dev, "failed to get address resource(np-%s)\n", 744 | child_np->name); 745 | return ret; 746 | } 747 | 748 | u3phy_port->base = devm_ioremap_resource(&u3phy_port->phy->dev, &res); 749 | if (IS_ERR(u3phy_port->base)) { 750 | dev_err(u3phy->dev, "failed to remap phy regs\n"); 751 | return PTR_ERR(u3phy_port->base); 752 | } 753 | 754 | if (!of_node_cmp(child_np->name, "pipe")) { 755 | u3phy_port->type = U3PHY_TYPE_PIPE; 756 | u3phy_port->refclk_25m_quirk = 757 | of_property_read_bool(child_np, 758 | "rockchip,refclk-25m-quirk"); 759 | } else { 760 | u3phy_port->type = U3PHY_TYPE_UTMI; 761 | INIT_DELAYED_WORK(&u3phy_port->um_sm_work, 762 | rockchip_u3phy_um_sm_work); 763 | 764 | ret = devm_request_threaded_irq(u3phy->dev, u3phy->um_ls_irq, 765 | NULL, rockchip_u3phy_um_ls_irq, 766 | IRQF_ONESHOT, "rockchip_u3phy", 767 | u3phy_port); 768 | if (ret) { 769 | dev_err(u3phy->dev, "failed to request utmi linestate irq handle\n"); 770 | return ret; 771 | } 772 | } 773 | 774 | if (u3phy->cfgs->phy_tuning) { 775 | dev_dbg(u3phy->dev, "do u3phy tuning\n"); 776 | ret = u3phy->cfgs->phy_tuning(u3phy, u3phy_port, child_np); 777 | if (ret) 778 | return ret; 779 | } 780 | 781 | phy_set_drvdata(u3phy_port->phy, u3phy_port); 782 | return 0; 783 | } 784 | 785 | static int rockchip_u3phy_on_init(struct usb_phy *usb_phy) 786 | { 787 | struct rockchip_u3phy *u3phy = 788 | container_of(usb_phy, struct rockchip_u3phy, usb_phy); 789 | 790 | rockchip_u3phy_rest_deassert(u3phy, U3PHY_POR_RST | U3PHY_MAC_RST); 791 | return 0; 792 | } 793 | 794 | static void rockchip_u3phy_on_shutdown(struct usb_phy *usb_phy) 795 | { 796 | struct rockchip_u3phy *u3phy = 797 | container_of(usb_phy, struct rockchip_u3phy, usb_phy); 798 | int rst; 799 | 800 | for (rst = 0; rst < U3PHY_RESET_MAX; rst++) 801 | if (u3phy->rsts[rst] && rst != UTMI_APB_RSTN && 802 | rst != PIPE_APB_RSTN) 803 | reset_control_assert(u3phy->rsts[rst]); 804 | udelay(1); 805 | } 806 | 807 | static int rockchip_u3phy_on_disconnect(struct usb_phy *usb_phy, 808 | enum usb_device_speed speed) 809 | { 810 | struct rockchip_u3phy *u3phy = 811 | container_of(usb_phy, struct rockchip_u3phy, usb_phy); 812 | 813 | dev_info(u3phy->dev, "%s device has disconnected\n", 814 | (speed == USB_SPEED_SUPER) ? "U3" : "UW/U2/U1.1/U1"); 815 | 816 | if (speed == USB_SPEED_SUPER) 817 | atomic_notifier_call_chain(&usb_phy->notifier, 0, NULL); 818 | 819 | return 0; 820 | } 821 | 822 | static int rockchip_u3phy_probe(struct platform_device *pdev) 823 | { 824 | struct device *dev = &pdev->dev; 825 | struct device_node *np = dev->of_node; 826 | struct device_node *child_np; 827 | struct phy_provider *provider; 828 | struct rockchip_u3phy *u3phy; 829 | const struct rockchip_u3phy_cfg *phy_cfgs; 830 | const struct of_device_id *match; 831 | unsigned int reg[2]; 832 | int index, ret; 833 | 834 | match = of_match_device(dev->driver->of_match_table, dev); 835 | if (!match || !match->data) { 836 | dev_err(dev, "phy-cfgs are not assigned!\n"); 837 | return -EINVAL; 838 | } 839 | 840 | u3phy = devm_kzalloc(dev, sizeof(*u3phy), GFP_KERNEL); 841 | if (!u3phy) 842 | return -ENOMEM; 843 | 844 | u3phy->u3phy_grf = 845 | syscon_regmap_lookup_by_phandle(np, "rockchip,u3phygrf"); 846 | if (IS_ERR(u3phy->u3phy_grf)) 847 | return PTR_ERR(u3phy->u3phy_grf); 848 | 849 | u3phy->grf = 850 | syscon_regmap_lookup_by_phandle(np, "rockchip,grf"); 851 | if (IS_ERR(u3phy->grf)) { 852 | dev_err(dev, "Missing rockchip,grf property\n"); 853 | return PTR_ERR(u3phy->grf); 854 | } 855 | 856 | if (of_property_read_u32_array(np, "reg", reg, 2)) { 857 | dev_err(dev, "the reg property is not assigned in %s node\n", 858 | np->name); 859 | return -EINVAL; 860 | } 861 | 862 | u3phy->dev = dev; 863 | u3phy->vbus_enabled = false; 864 | phy_cfgs = match->data; 865 | platform_set_drvdata(pdev, u3phy); 866 | 867 | /* find out a proper config which can be matched with dt. */ 868 | index = 0; 869 | while (phy_cfgs[index].reg) { 870 | if (phy_cfgs[index].reg == reg[1]) { 871 | u3phy->cfgs = &phy_cfgs[index]; 872 | break; 873 | } 874 | 875 | ++index; 876 | } 877 | 878 | if (!u3phy->cfgs) { 879 | dev_err(dev, "no phy-cfgs can be matched with %s node\n", 880 | np->name); 881 | return -EINVAL; 882 | } 883 | 884 | ret = rockchip_u3phy_parse_dt(u3phy, pdev); 885 | if (ret) { 886 | dev_err(dev, "parse dt failed, ret(%d)\n", ret); 887 | return ret; 888 | } 889 | 890 | ret = rockchip_u3phy_clk_enable(u3phy); 891 | if (ret) { 892 | dev_err(dev, "clk enable failed, ret(%d)\n", ret); 893 | return ret; 894 | } 895 | 896 | rockchip_u3phy_rest_assert(u3phy); 897 | rockchip_u3phy_rest_deassert(u3phy, U3PHY_APB_RST | U3PHY_POR_RST); 898 | 899 | index = 0; 900 | for_each_available_child_of_node(np, child_np) { 901 | struct rockchip_u3phy_port *u3phy_port = &u3phy->ports[index]; 902 | 903 | u3phy_port->index = index; 904 | ret = rockchip_u3phy_port_init(u3phy, u3phy_port, child_np); 905 | if (ret) { 906 | dev_err(dev, "u3phy port init failed,ret(%d)\n", ret); 907 | goto put_child; 908 | } 909 | 910 | /* to prevent out of boundary */ 911 | if (++index >= U3PHY_PORT_NUM) 912 | break; 913 | } 914 | 915 | provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); 916 | if (IS_ERR(provider)) { 917 | ret = PTR_ERR(provider); 918 | goto put_child; 919 | } 920 | 921 | rockchip_u3phy_rest_deassert(u3phy, U3PHY_MAC_RST); 922 | rockchip_u3phy_clk_disable(u3phy); 923 | 924 | u3phy->usb_phy.dev = dev; 925 | u3phy->usb_phy.init = rockchip_u3phy_on_init; 926 | u3phy->usb_phy.shutdown = rockchip_u3phy_on_shutdown; 927 | u3phy->usb_phy.notify_disconnect = rockchip_u3phy_on_disconnect; 928 | usb_add_phy(&u3phy->usb_phy, USB_PHY_TYPE_USB3); 929 | ATOMIC_INIT_NOTIFIER_HEAD(&u3phy->usb_phy.notifier); 930 | 931 | rockchip_u3phy_debugfs_init(u3phy); 932 | 933 | dev_info(dev, "Rockchip u3phy initialized successfully\n"); 934 | return 0; 935 | 936 | put_child: 937 | of_node_put(child_np); 938 | return ret; 939 | } 940 | 941 | static int rk3328_u3phy_pipe_power(struct rockchip_u3phy *u3phy, 942 | struct rockchip_u3phy_port *u3phy_port, 943 | bool on) 944 | { 945 | unsigned int reg; 946 | 947 | if (on) { 948 | reg = readl(u3phy_port->base + 0x1a8); 949 | reg &= ~BIT(4); /* ldo power up */ 950 | writel(reg, u3phy_port->base + 0x1a8); 951 | 952 | reg = readl(u3phy_port->base + 0x044); 953 | reg &= ~BIT(4); /* bg power on */ 954 | writel(reg, u3phy_port->base + 0x044); 955 | 956 | reg = readl(u3phy_port->base + 0x150); 957 | reg |= BIT(6); /* tx bias enable */ 958 | writel(reg, u3phy_port->base + 0x150); 959 | 960 | reg = readl(u3phy_port->base + 0x080); 961 | reg &= ~BIT(2); /* tx cm power up */ 962 | writel(reg, u3phy_port->base + 0x080); 963 | 964 | reg = readl(u3phy_port->base + 0x0c0); 965 | /* tx obs enable and rx cm enable */ 966 | reg |= (BIT(3) | BIT(4)); 967 | writel(reg, u3phy_port->base + 0x0c0); 968 | 969 | udelay(1); 970 | } else { 971 | reg = readl(u3phy_port->base + 0x1a8); 972 | reg |= BIT(4); /* ldo power down */ 973 | writel(reg, u3phy_port->base + 0x1a8); 974 | 975 | reg = readl(u3phy_port->base + 0x044); 976 | reg |= BIT(4); /* bg power down */ 977 | writel(reg, u3phy_port->base + 0x044); 978 | 979 | reg = readl(u3phy_port->base + 0x150); 980 | reg &= ~BIT(6); /* tx bias disable */ 981 | writel(reg, u3phy_port->base + 0x150); 982 | 983 | reg = readl(u3phy_port->base + 0x080); 984 | reg |= BIT(2); /* tx cm power down */ 985 | writel(reg, u3phy_port->base + 0x080); 986 | 987 | reg = readl(u3phy_port->base + 0x0c0); 988 | /* tx obs disable and rx cm disable */ 989 | reg &= ~(BIT(3) | BIT(4)); 990 | writel(reg, u3phy_port->base + 0x0c0); 991 | } 992 | 993 | return 0; 994 | } 995 | 996 | static int rk3328_u3phy_tuning(struct rockchip_u3phy *u3phy, 997 | struct rockchip_u3phy_port *u3phy_port, 998 | struct device_node *child_np) 999 | { 1000 | if (u3phy_port->type == U3PHY_TYPE_UTMI) { 1001 | /* 1002 | * For rk3328 SoC, pre-emphasis and pre-emphasis strength must 1003 | * be written as one fixed value as below. 1004 | * 1005 | * Dissimilarly, the odt 45ohm value should be flexibly tuninged 1006 | * for the different boards to adjust HS eye height, so its 1007 | * value can be assigned in DT in code design. 1008 | */ 1009 | 1010 | /* {bits[2:0]=111}: always enable pre-emphasis */ 1011 | u3phy->apbcfg.u2_pre_emp = 0x0f; 1012 | 1013 | /* {bits[5:3]=000}: pre-emphasis strength as the weakest */ 1014 | u3phy->apbcfg.u2_pre_emp_sth = 0x41; 1015 | 1016 | /* {bits[4:0]=10101}: odt 45ohm tuning */ 1017 | u3phy->apbcfg.u2_odt_tuning = 0xb5; 1018 | /* optional override of the odt 45ohm tuning */ 1019 | of_property_read_u32(child_np, "rockchip,odt-val-tuning", 1020 | &u3phy->apbcfg.u2_odt_tuning); 1021 | 1022 | writel(u3phy->apbcfg.u2_pre_emp, u3phy_port->base + 0x030); 1023 | writel(u3phy->apbcfg.u2_pre_emp_sth, u3phy_port->base + 0x040); 1024 | writel(u3phy->apbcfg.u2_odt_tuning, u3phy_port->base + 0x11c); 1025 | } else if (u3phy_port->type == U3PHY_TYPE_PIPE) { 1026 | if (u3phy_port->refclk_25m_quirk) { 1027 | dev_dbg(u3phy->dev, "switch to 25m refclk\n"); 1028 | /* ref clk switch to 25M */ 1029 | writel(0x64, u3phy_port->base + 0x11c); 1030 | writel(0x64, u3phy_port->base + 0x028); 1031 | writel(0x01, u3phy_port->base + 0x020); 1032 | writel(0x21, u3phy_port->base + 0x030); 1033 | writel(0x06, u3phy_port->base + 0x108); 1034 | writel(0x00, u3phy_port->base + 0x118); 1035 | } else { 1036 | /* configure for 24M ref clk */ 1037 | writel(0x80, u3phy_port->base + 0x10c); 1038 | writel(0x01, u3phy_port->base + 0x118); 1039 | writel(0x38, u3phy_port->base + 0x11c); 1040 | writel(0x83, u3phy_port->base + 0x020); 1041 | writel(0x02, u3phy_port->base + 0x108); 1042 | } 1043 | 1044 | /* Enable SSC */ 1045 | udelay(3); 1046 | writel(0x08, u3phy_port->base + 0x000); 1047 | writel(0x0c, u3phy_port->base + 0x120); 1048 | 1049 | /* Tuning Rx for compliance RJTL test */ 1050 | writel(0x70, u3phy_port->base + 0x150); 1051 | writel(0x12, u3phy_port->base + 0x0c8); 1052 | writel(0x05, u3phy_port->base + 0x148); 1053 | writel(0x08, u3phy_port->base + 0x068); 1054 | writel(0xf0, u3phy_port->base + 0x1c4); 1055 | writel(0xff, u3phy_port->base + 0x070); 1056 | writel(0x0f, u3phy_port->base + 0x06c); 1057 | writel(0xe0, u3phy_port->base + 0x060); 1058 | 1059 | /* 1060 | * Tuning Tx to increase the bias current 1061 | * used in TX driver and RX EQ, it can 1062 | * also increase the voltage of LFPS. 1063 | */ 1064 | writel(0x08, u3phy_port->base + 0x180); 1065 | } else { 1066 | dev_err(u3phy->dev, "invalid u3phy port type\n"); 1067 | return -EINVAL; 1068 | } 1069 | 1070 | return 0; 1071 | } 1072 | 1073 | static const struct rockchip_u3phy_cfg rk3328_u3phy_cfgs[] = { 1074 | { 1075 | .reg = 0xff470000, 1076 | .grfcfg = { 1077 | .um_suspend = { 0x0004, 15, 0, 0x1452, 0x15d1 }, 1078 | .u2_only_ctrl = { 0x0020, 15, 15, 0, 1 }, 1079 | .um_ls = { 0x0030, 5, 4, 0, 1 }, 1080 | .um_hstdct = { 0x0030, 7, 7, 0, 1 }, 1081 | .ls_det_en = { 0x0040, 0, 0, 0, 1 }, 1082 | .ls_det_st = { 0x0044, 0, 0, 0, 1 }, 1083 | .pp_pwr_st = { 0x0034, 14, 13, 0, 0}, 1084 | .pp_pwr_en = { {0x0020, 14, 0, 0x0014, 0x0005}, 1085 | {0x0020, 14, 0, 0x0014, 0x000d}, 1086 | {0x0020, 14, 0, 0x0014, 0x0015}, 1087 | {0x0020, 14, 0, 0x0014, 0x001d} }, 1088 | .u3_disable = { 0x04c4, 15, 0, 0x1100, 0x101}, 1089 | }, 1090 | .phy_pipe_power = rk3328_u3phy_pipe_power, 1091 | .phy_tuning = rk3328_u3phy_tuning, 1092 | }, 1093 | { /* sentinel */ } 1094 | }; 1095 | 1096 | static const struct of_device_id rockchip_u3phy_dt_match[] = { 1097 | { .compatible = "rockchip,rk3328-u3phy", .data = &rk3328_u3phy_cfgs }, 1098 | {} 1099 | }; 1100 | MODULE_DEVICE_TABLE(of, rockchip_u3phy_dt_match); 1101 | 1102 | static struct platform_driver rockchip_u3phy_driver = { 1103 | .probe = rockchip_u3phy_probe, 1104 | .driver = { 1105 | .name = "rockchip-u3phy", 1106 | .of_match_table = rockchip_u3phy_dt_match, 1107 | }, 1108 | }; 1109 | module_platform_driver(rockchip_u3phy_driver); 1110 | 1111 | MODULE_AUTHOR("Frank Wang "); 1112 | MODULE_AUTHOR("William Wu "); 1113 | MODULE_DESCRIPTION("Rockchip USB 3.0 PHY driver"); 1114 | MODULE_LICENSE("GPL v2"); 1115 | -------------------------------------------------------------------------------- /scripts/O21-SNAPSHOT/diy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #创建所需文件夹 4 | mkdir -p target/linux/rockchip/files/drivers/phy/rockchip 5 | 6 | #删除原来的uboot.patch 7 | rm -rf package/boot/uboot-rockchip/patches/202-rockchip-rk3328-Add-support-for-OrangePi-R1-Plus-LTS.patch 8 | 9 | #更改r8152默认驱动 10 | #sed -i 's/kmod-usb-net-rtl8152/kmod-usb-net-rtl8152-vendor/g' target/linux/rockchip/image/armv8.mk 11 | 12 | #添加内核配置 13 | sed -i '$a CONFIG_PHY_ROCKCHIP_INNO_USB3=y' target/linux/rockchip/armv8/config-5.4 14 | 15 | -------------------------------------------------------------------------------- /scripts/O23-SNAPSHOT/diy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #删除feeds自带插件 4 | rm -rf ./feeds/packages/net/mosdns 5 | rm -rf ./feeds/packages/net/v2ray-geodata 6 | rm -rf ./feeds/packages/net/chinadns-ng 7 | 8 | #删除自带u-boot.dts 9 | rm -rf package/boot/uboot-rockchip/src/arch/arm/dts/rk3328-orangepi-r1-plus-lts-u-boot.dtsi 10 | 11 | #更改默认地址为192.168.8.1 12 | sed -i 's/192.168.1.1/192.168.8.1/g' package/base-files/files/bin/config_generate 13 | 14 | #更改r8152默认驱动 15 | #sed -i 's/kmod-usb-net-rtl8152/kmod-usb-net-rtl8152-vendor/g' target/linux/rockchip/image/armv8.mk 16 | 17 | #添加内核配置 18 | sed -i '$a CONFIG_PHY_ROCKCHIP_INNO_USB3=y' target/linux/rockchip/armv8/config-5.15 19 | 20 | #克隆passwall环境插件 21 | git clone https://github.com/xiaorouji/openwrt-passwall-packages.git package/pwpage 22 | 23 | #克隆的源码放在small文件夹 24 | mkdir package/small 25 | pushd package/small 26 | 27 | #克隆源码 28 | #adguardhome 29 | git clone -b main --depth 1 https://github.com/XiaoBinin/luci-app-adguardhome.git 30 | #passwall2 31 | git clone -b main --depth 1 https://github.com/xiaorouji/openwrt-passwall2.git 32 | #mosdns 33 | git clone -b v5 --depth 1 https://github.com/sbwml/luci-app-mosdns.git 34 | #v2ray-geodata 35 | git clone https://github.com/sbwml/v2ray-geodata 36 | #lucky 37 | git clone -b main --depth 1 https://github.com/sirpdboy/luci-app-lucky.git 38 | 39 | popd 40 | -------------------------------------------------------------------------------- /scripts/environment.sh: -------------------------------------------------------------------------------- 1 | sudo apt install -y ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential \ 2 | bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib \ 3 | git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libfuse-dev libglib2.0-dev libgmp3-dev \ 4 | libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libpython3-dev libreadline-dev \ 5 | libssl-dev libtool lrzsz mkisofs msmtp ninja-build p7zip p7zip-full patch pkgconf python3 \ 6 | python3-pyelftools python3-setuptools qemu-utils rsync scons squashfs-tools subversion swig texinfo \ 7 | uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev 8 | -------------------------------------------------------------------------------- /scripts/free_disk_space.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | 18 | # 19 | # The Azure provided machines typically have the following disk allocation: 20 | # Total space: 85GB 21 | # Allocated: 67 GB 22 | # Free: 17 GB 23 | # This script frees up 28 GB of disk space by deleting unneeded packages and 24 | # large directories. 25 | # The Flink end to end tests download and generate more than 17 GB of files, 26 | # causing unpredictable behavior and build failures. 27 | # 28 | echo "==============================================================================" 29 | echo "Freeing up disk space on CI system" 30 | echo "==============================================================================" 31 | 32 | echo "Listing 100 largest packages" 33 | dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100 34 | df -h 35 | echo "Removing large packages" 36 | sudo apt-get remove -y '^dotnet-.*' 37 | sudo apt-get remove -y '^llvm-.*' 38 | sudo apt-get remove -y 'php.*' 39 | sudo apt-get remove -y '^mongodb-.*' 40 | sudo apt-get remove -y '^mysql-.*' 41 | sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel 42 | sudo apt-get autoremove -y 43 | sudo apt-get clean 44 | df -h 45 | echo "Removing large directories" 46 | 47 | sudo rm -rf /usr/share/dotnet/ 48 | sudo rm -rf /usr/local/graalvm/ 49 | sudo rm -rf /usr/local/.ghcup/ 50 | sudo rm -rf /usr/local/share/powershell 51 | sudo rm -rf /usr/local/share/chromium 52 | sudo rm -rf /usr/local/lib/android 53 | sudo rm -rf /usr/local/lib/node_modules 54 | df -h 55 | -------------------------------------------------------------------------------- /scripts/init-settings.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #更改默认地址为192.168.8.1 4 | sed -i 's/192.168.1.1/192.168.8.1/g' package/base-files/files/bin/config_generate 5 | 6 | # 给config下的文件增加权限 7 | chmod 644 files/etc/config/* 8 | 9 | 10 | echo "init-settings executed successfully!" 11 | -------------------------------------------------------------------------------- /scripts/install-5G.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "=======================================" 4 | echo "[*] 开始安装 5G 模块支持..." 5 | echo "=======================================" 6 | 7 | # 1. 克隆 5G Modem 支持库 8 | echo >> feeds.conf.default 9 | echo 'src-git modem https://github.com/FUjr/modem_feeds.git;main' >> feeds.conf.default 10 | ./scripts/feeds update modem 11 | ./scripts/feeds install -a -p modem 12 | 13 | if [ -d "package/Modem-Support" ]; then 14 | echo "⚠️ 目录 package/Modem-Support 已存在,删除旧版本..." 15 | rm -rf package/Modem-Support 16 | fi 17 | 18 | git clone --depth=1 https://github.com/Siriling/5G-Modem-Support package/Modem-Support 19 | if [ $? -ne 0 ]; then 20 | echo "❌ Git 克隆失败!请检查网络连接或仓库地址" 21 | exit 1 22 | fi 23 | rm -rf package/Modem-Support/rooter/0optionalapps/bwallocate 24 | rm -rf package/Modem-Support/rooter/0optionalapps/ext-rspeedtest 25 | rm -rf package/Modem-Support/rooter/0optionalapps/ext-speedtest 26 | 27 | # 2. 创建目标目录(使用 -p 防止目录已存在时报错) 28 | mkdir -p package/network/utils/quectel-CM-5G 29 | mkdir -p package/network/utils/sms-tool 30 | 31 | # 3. 移动文件,检查目录是否存在再执行 32 | if [ -d "package/Modem-Support/quectel_cm_5G" ]; then 33 | mv -f package/Modem-Support/quectel_cm_5G/* package/network/utils/quectel-CM-5G 34 | else 35 | echo "⚠️ 警告:quectel_cm_5G 目录不存在,跳过移动" 36 | fi 37 | 38 | if [ -d "package/Modem-Support/sms-tool" ]; then 39 | mv -f package/Modem-Support/sms-tool/* package/network/utils/sms-tool 40 | else 41 | echo "⚠️ 警告:sms-tool 目录不存在,跳过移动" 42 | fi 43 | 44 | echo "=======================================" 45 | echo "✅ 5G 模块支持安装完成!" 46 | echo "=======================================" 47 | exit 0 48 | -------------------------------------------------------------------------------- /scripts/master/diy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #删除feeds自带插件 4 | rm -rf ./feeds/packages/net/mosdns 5 | rm -rf ./feeds/packages/net/v2ray-geodata 6 | rm -rf ./feeds/packages/net/chinadns-ng 7 | 8 | #删除自带u-boot.dts 9 | rm -rf package/boot/uboot-rockchip/src/arch/arm/dts/rk3328-orangepi-r1-plus-lts-u-boot.dtsi 10 | 11 | #更改默认地址为192.168.8.1 12 | sed -i 's/192.168.1.1/192.168.8.1/g' package/base-files/files/bin/config_generate 13 | 14 | #更改r8152默认驱动 15 | #sed -i 's/kmod-usb-net-rtl8152/kmod-usb-net-rtl8152-vendor/g' target/linux/rockchip/image/armv8.mk 16 | 17 | #添加内核配置 18 | sed -i '$a CONFIG_PHY_ROCKCHIP_INNO_USB3=y' target/linux/rockchip/armv8/config-6.1 19 | 20 | #克隆passwall环境插件 21 | git clone https://github.com/xiaorouji/openwrt-passwall-packages.git package/pwpage 22 | 23 | #克隆的源码放在small文件夹 24 | mkdir package/small 25 | pushd package/small 26 | 27 | #克隆源码 28 | #adguardhome 29 | git clone -b main --depth 1 https://github.com/XiaoBinin/luci-app-adguardhome.git 30 | #passwall2 31 | git clone -b main --depth 1 https://github.com/xiaorouji/openwrt-passwall2.git 32 | #mosdns 33 | git clone -b v5 --depth 1 https://github.com/sbwml/luci-app-mosdns.git 34 | #lucky 35 | git clone -b main --depth 1 https://github.com/sirpdboy/luci-app-lucky.git 36 | 37 | popd 38 | -------------------------------------------------------------------------------- /scripts/packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #删除feeds中的插件 4 | # rm -rf ./feeds/packages/net/v2ray-geodata 5 | rm -rf ./feeds/packages/net/{geoview,shadowsocks-libev,chinadns-ng,mosdns} 6 | rm -rf ./feeds/luci/applications/luci-app-mosdns 7 | 8 | #克隆依赖插件 9 | git clone https://github.com/xiaorouji/openwrt-passwall-packages.git package/pwpage 10 | 11 | 12 | #克隆的源码放在small文件夹 13 | mkdir package/small 14 | pushd package/small 15 | 16 | 17 | #adguardhome 18 | git clone -b 2024.09.05 --depth 1 https://github.com/XiaoBinin/luci-app-adguardhome.git 19 | #lucky 20 | git clone -b main --depth 1 https://github.com/gdy666/luci-app-lucky.git 21 | # #smartdns 22 | # git clone -b lede --depth 1 https://github.com/pymumu/luci-app-smartdns.git 23 | # git clone -b master --depth 1 https://github.com/pymumu/smartdns.git 24 | # #ssrp 25 | # git clone -b master --depth 1 https://github.com/fw876/helloworld.git 26 | # #passwall 27 | # git clone -b main --depth 1 https://github.com/xiaorouji/openwrt-passwall.git 28 | #passwall2 29 | git clone -b main --depth 1 https://github.com/xiaorouji/openwrt-passwall2.git 30 | # #mosdns 31 | git clone -b v5 --depth 1 https://github.com/sbwml/luci-app-mosdns.git 32 | # #openclash 33 | # git clone -b master --depth 1 https://github.com/vernesong/OpenClash.git 34 | # OpenWrt-nikki 35 | git clone --depth 1 https://github.com/nikkinikki-org/OpenWrt-nikki.git 36 | 37 | popd 38 | 39 | echo "packages executed successfully!" 40 | -------------------------------------------------------------------------------- /scripts/preset-clash-core-amd64.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #================================================= 3 | # File name: preset-clash-core.sh 4 | # Usage: | example: 5 | # System Required: Linux 6 | # Version: 1.0 7 | # Lisence: MIT 8 | # Author: SuLingGG 9 | # Blog: https://mlapp.cn 10 | # 参考网址:https://github.com/zzcabc/OpenWrt_Action/blob/11208c3d5160128d22d14318772ec48f1918deb9/script/immortalwrt/diy2.sh 11 | #================================================= 12 | 13 | 14 | # 预置openclash内核 15 | mkdir -p files/etc/openclash/core 16 | 17 | 18 | # openclash 的 dev内核 19 | # CLASH_DEV_URL="https://github.com/vernesong/OpenClash/raw/core/master/dev/clash-linux-amd64.tar.gz" 20 | 21 | # openclash 的 TUN内核 22 | # CLASH_TUN_VERSION=$(curl -sL https://github.com/vernesong/OpenClash/raw/core/master/core_version | head -n 2 | tail -n 1) 23 | # CLASH_TUN_URL="https://github.com/vernesong/OpenClash/raw/core/master/premium/clash-linux-amd64-$CLASH_TUN_VERSION.gz" 24 | # openclash 的 Meta内核版本 25 | # CLASH_META_URL="https://github.com/vernesong/OpenClash/raw/core/master/meta/clash-linux-amd64.tar.gz" 26 | 27 | # d大 的 dev内核 28 | # CLASH_DEV_URL=$(curl -sL https://api.github.com/repos/Dreamacro/clash/releases/latest | grep /clash-linux-amd64 | awk -F '"' '{print $4}' | head -n 1) 29 | 30 | # d大 的 premium内核 31 | # CLASH_TUN_URL=$(curl -sL https://api.github.com/repos/Dreamacro/clash/releases/tags/premium | grep /clash-linux-amd64-2 | awk -F '"' '{print $4}' | head -n 1) 32 | 33 | # Meta内核版本 34 | CLASH_META_URL=$(curl -sL https://api.github.com/repos/MetaCubeX/Clash.Meta/releases/tags/Prerelease-Alpha | grep -o '"browser_download_url": *"[^"]*mihomo-linux-amd64-compatible-alpha-[^"]*\.gz"' | awk -F '"' '{print $4}' | head -n 1) 35 | 36 | # CLASH_DEV_URL="https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/dev/clash-linux-arm64.tar.gz" 37 | # CLASH_TUN_URL=$(curl -fsSL https://api.github.com/repos/vernesong/OpenClash/contents/core-lateset/premium | grep download_url | grep $1 | awk -F '"' '{print $4}') 38 | # CLASH_META_URL="https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/meta/clash-linux-${1}.tar.gz" 39 | 40 | 41 | # 给内核解压 42 | # wget -qO- $CLASH_DEV_URL | tar xOvz > files/etc/openclash/core/clash 43 | # wget -qO- $CLASH_TUN_URL | gunzip -c > files/etc/openclash/core/clash_tun 44 | # wget -qO- $CLASH_META_URL | tar xOvz > files/etc/openclash/core/clash_meta 45 | 46 | # wget -qO- $CLASH_DEV_URL | gunzip -c > files/etc/openclash/core/clash 47 | # wget -qO- $CLASH_TUN_URL | gunzip -c > files/etc/openclash/core/clash_tun 48 | wget -qO- $CLASH_META_URL | gunzip -c > files/etc/openclash/core/clash_meta 49 | 50 | # 给内核权限 51 | chmod +x files/etc/openclash/core/clash* 52 | 53 | 54 | # 下载mihomo core需要的文件? 55 | # GeoIP.dat 56 | GEOIP_URL=https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat 57 | # GeoSite.dat 58 | GEOSITE_URL=https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat 59 | # Country.mmdb 60 | COUNTRY_FULL_URL=https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country.mmdb 61 | 62 | wget -qO- $GEOIP_URL > files/etc/openclash/GeoIP.dat 63 | wget -qO- $GEOSITE_URL > files/etc/openclash/GeoSite.dat 64 | wget -qO- $COUNTRY_FULL_URL > files/etc/openclash/Country.mmdb 65 | 66 | echo "preset-clash-core executed successfully!" 67 | -------------------------------------------------------------------------------- /scripts/preset-clash-core-arm64-L.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #================================================= 3 | # File name: preset-clash-core.sh 4 | # Usage: | example: 5 | # System Required: Linux 6 | # Version: 1.0 7 | # Lisence: MIT 8 | # Author: SuLingGG 9 | # Blog: https://mlapp.cn 10 | # 参考网址:https://github.com/zzcabc/OpenWrt_Action/blob/11208c3d5160128d22d14318772ec48f1918deb9/script/immortalwrt/diy2.sh 11 | #================================================= 12 | 13 | 14 | # 预置openclash内核 15 | mkdir -p files/etc/openclash/core 16 | 17 | 18 | # openclash 的 Meta内核版本 19 | # CLASH_META_URL="https://github.com/vernesong/OpenClash/raw/core/master/meta/clash-linux-amd64.tar.gz" 20 | 21 | # Meta内核版本 22 | CLASH_META_URL=$(curl -sL https://api.github.com/repos/MetaCubeX/Clash.Meta/releases/tags/Prerelease-Alpha | grep -o '"browser_download_url": *"[^"]*mihomo-linux-arm64-alpha-[^"]*\.gz"' | awk -F '"' '{print $4}' | head -n 1) 23 | 24 | # 给内核解压 25 | wget -qO- $CLASH_META_URL | gunzip -c > files/etc/openclash/core/clash_meta 26 | 27 | # 给内核权限 28 | chmod +x files/etc/openclash/core/clash* 29 | 30 | 31 | # 下载mihomo core需要的文件? 32 | # GeoIP.dat 33 | GEOIP_URL=https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat 34 | # GeoSite.dat 35 | GEOSITE_URL=https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat 36 | # Country.mmdb 37 | COUNTRY_FULL_URL=https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country.mmdb 38 | 39 | wget -qO- $GEOIP_URL > files/etc/openclash/GeoIP.dat 40 | wget -qO- $GEOSITE_URL > files/etc/openclash/GeoSite.dat 41 | wget -qO- $COUNTRY_FULL_URL > files/etc/openclash/Country.mmdb 42 | 43 | echo "preset-clash-core-L executed successfully!" 44 | -------------------------------------------------------------------------------- /scripts/preset-clash-core-arm64.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #================================================= 3 | # File name: preset-clash-core.sh 4 | # Usage: | example: 5 | # System Required: Linux 6 | # Version: 1.0 7 | # Lisence: MIT 8 | # Author: SuLingGG 9 | # Blog: https://mlapp.cn 10 | # 参考网址:https://github.com/zzcabc/OpenWrt_Action/blob/11208c3d5160128d22d14318772ec48f1918deb9/script/immortalwrt/diy2.sh 11 | #================================================= 12 | 13 | 14 | # 预置openclash内核 15 | mkdir -p files/etc/openclash/core 16 | 17 | 18 | # openclash 的 dev内核 19 | CLASH_DEV_URL="https://github.com/vernesong/OpenClash/raw/core/master/dev/clash-linux-arm64.tar.gz" 20 | 21 | # openclash 的 TUN内核 22 | CLASH_TUN_VERSION=$(curl -sL https://github.com/vernesong/OpenClash/raw/core/master/core_version | head -n 2 | tail -n 1) 23 | CLASH_TUN_URL="https://github.com/vernesong/OpenClash/raw/core/master/premium/clash-linux-arm64-$CLASH_TUN_VERSION.gz" 24 | # openclash 的 Meta内核版本 25 | # CLASH_META_URL="https://github.com/vernesong/OpenClash/raw/core/master/meta/clash-linux-amd64.tar.gz" 26 | 27 | # d大 的 dev内核 28 | # CLASH_DEV_URL=$(curl -sL https://api.github.com/repos/Dreamacro/clash/releases/latest | grep /clash-linux-amd64 | awk -F '"' '{print $4}' | head -n 1) 29 | 30 | # d大 的 premium内核 31 | # CLASH_TUN_URL=$(curl -sL https://api.github.com/repos/Dreamacro/clash/releases/tags/premium | grep /clash-linux-amd64-2 | awk -F '"' '{print $4}' | head -n 1) 32 | 33 | # Meta内核版本 34 | CLASH_META_URL=$(curl -sL https://api.github.com/repos/MetaCubeX/Clash.Meta/releases/tags/Prerelease-Alpha | grep -o '"browser_download_url": *"[^"]*mihomo-linux-arm64-alpha-[^"]*\.gz"' | awk -F '"' '{print $4}' | head -n 1) 35 | 36 | # CLASH_DEV_URL="https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/dev/clash-linux-arm64.tar.gz" 37 | # CLASH_TUN_URL=$(curl -fsSL https://api.github.com/repos/vernesong/OpenClash/contents/core-lateset/premium | grep download_url | grep $1 | awk -F '"' '{print $4}') 38 | # CLASH_META_URL="https://raw.githubusercontent.com/vernesong/OpenClash/master/core-lateset/meta/clash-linux-${1}.tar.gz" 39 | 40 | 41 | # 给内核解压 42 | wget -qO- $CLASH_DEV_URL | tar xOvz > files/etc/openclash/core/clash 43 | wget -qO- $CLASH_TUN_URL | gunzip -c > files/etc/openclash/core/clash_tun 44 | # wget -qO- $CLASH_META_URL | tar xOvz > files/etc/openclash/core/clash_meta 45 | 46 | # wget -qO- $CLASH_DEV_URL | gunzip -c > files/etc/openclash/core/clash 47 | # wget -qO- $CLASH_TUN_URL | gunzip -c > files/etc/openclash/core/clash_tun 48 | wget -qO- $CLASH_META_URL | gunzip -c > files/etc/openclash/core/clash_meta 49 | 50 | # 给内核权限 51 | chmod +x files/etc/openclash/core/clash* 52 | 53 | 54 | # meta 要GeoIP.dat 和 GeoSite.dat 55 | # GEOIP_URL="https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat" 56 | # GEOSITE_URL="https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat" 57 | 58 | GEOIP_URL=https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat 59 | GEOSITE_URL=https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat 60 | 61 | wget -qO- $GEOIP_URL > files/etc/openclash/GeoIP.dat 62 | wget -qO- $GEOSITE_URL > files/etc/openclash/GeoSite.dat 63 | 64 | 65 | # Country.mmdb 66 | # COUNTRY_LITE_URL=https://raw.githubusercontent.com/alecthw/mmdb_china_ip_list/release/lite/Country.mmdb 67 | # COUNTRY_FULL_URL=https://raw.githubusercontent.com/alecthw/mmdb_china_ip_list/release/Country.mmdb 68 | 69 | COUNTRY_FULL_URL=https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country.mmdb 70 | 71 | # wget -qO- $COUNTRY_LITE_URL > files/etc/openclash/Country.mmdb 72 | wget -qO- $COUNTRY_FULL_URL > files/etc/openclash/Country.mmdb 73 | 74 | echo "preset-clash-core executed successfully!" 75 | --------------------------------------------------------------------------------