├── .github └── workflows │ ├── Build-Armbian-Kernel-Debs.yml │ ├── Build-Armbian.yml │ ├── Build-Kernel-LinuxFamily-PR.yml │ ├── Build-Kernel-LinuxFamily.yml │ ├── test.yml │ └── test1.yml ├── LICENSE ├── README.md ├── patch ├── 5C │ ├── diyfan.patch │ ├── fix-CPU-information.patch │ └── reopen_disabled_nodes.patch ├── JP │ ├── dt │ │ └── rk3566-jp-tvbox.dts │ └── rk3566-jp-tvbox.dts ├── N1 │ ├── fix-n1-1.patch │ ├── fix-n1-2.patch │ └── u-boot.ext ├── T4 │ ├── fix-CPU-information.patch │ └── t4.patch ├── X2 │ ├── dt │ │ └── rk3566-panther-x2.dts │ └── rk3566-panther-x2.dts ├── boards │ ├── aml-s9xx-box.tvb │ ├── jp-tvbox.conf │ ├── panther-x2.csc │ ├── rock-5c.conf │ └── station-m2.csc ├── config │ ├── linux-meson-current.config │ ├── linux-meson64-current.config │ ├── linux-meson64-edge.config │ ├── linux-rk35xx-vendor.config │ ├── linux-rockchip64-current.config │ └── linux-rockchip64-edge.config ├── sbin │ ├── armbian-apt │ ├── armbian-sync │ └── armbian-update └── test │ └── meson64 │ ├── general-fix-Kodi-sysinfo-CPU-information.patch │ ├── general-input-touchscreen-Add-D-WAV-Multitouch.patch │ ├── general-meson64-overlays.patch │ └── jethome-0001-Fix-meson64-add-gpio-irq-patch-from-https-lkml.org-l.patch ├── screenshot └── screenshot.png └── scripts ├── apply_patches.sh ├── rename_to_conf.sh └── sha256.sh /.github/workflows/Build-Armbian-Kernel-Debs.yml: -------------------------------------------------------------------------------- 1 | name: Build Armbian Kernel Debs 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | BOARD: 7 | description: 'Board type' 8 | required: true 9 | default: 'nanopct4' 10 | type: choice 11 | options: 12 | - 'nanopct4' 13 | - 'rock-5c' 14 | - 'panther-x2' 15 | - 'aml-s9xx-box' 16 | - 'radxa-cubie-a5e' 17 | - 'jp-tvbox' 18 | - 'nanopi-r3s' 19 | - 'onecloud' 20 | - 'station-m2' 21 | BRANCH: 22 | description: 'Armbian branch' 23 | default: 'current' 24 | required: true 25 | type: choice 26 | options: 27 | - 'current' 28 | - 'edge' 29 | - 'vendor' 30 | RELEASE: 31 | description: 'Release name' 32 | default: 'bookworm' 33 | required: true 34 | type: choice 35 | options: 36 | - 'bookworm' 37 | - 'trixie' 38 | - 'jammy' 39 | - 'noble' 40 | BUILD_DESKTOP: 41 | description: 'Build desktop environment' 42 | default: 'no' 43 | required: false 44 | type: choice 45 | options: 46 | - 'yes' 47 | - 'no' 48 | BUILD_MINIMAL: 49 | description: 'BUILD MINIMAL environment' 50 | default: 'yes' 51 | required: false 52 | type: choice 53 | options: 54 | - 'yes' 55 | - 'no' 56 | PREFER_DOCKER: 57 | description: 'Use Docker build' 58 | default: 'no' 59 | required: false 60 | type: choice 61 | options: 62 | - 'yes' 63 | - 'no' 64 | DOCKER_ARMBIAN_BASE_IMAGE: 65 | description: 'Docker IMAGE' 66 | default: 'ubuntu:jammy' 67 | required: false 68 | type: choice 69 | options: 70 | - 'ubuntu:jammy' 71 | - 'ubuntu:noble' 72 | - 'debian:bookworm' 73 | 74 | env: 75 | TZ: Asia/Shanghai 76 | 77 | jobs: 78 | Build-Armbian: 79 | runs-on: ubuntu-24.04-arm 80 | steps: 81 | - name: Checkout 82 | uses: actions/checkout@v4 83 | 84 | - name: Initialization environment 85 | id: init 86 | env: 87 | DEBIAN_FRONTEND: noninteractive 88 | run: | 89 | echo "START_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV 90 | docker_images_ids=$(docker images -q) 91 | [ -n "$docker_images_ids" ] && docker rmi $docker_images_ids 92 | docker image prune -a -f 93 | [[ -n "${AGENT_TOOLSDIRECTORY}" ]] && sudo rm -rf "${AGENT_TOOLSDIRECTORY}" 94 | sudo rm -rf /usr/share/dotnet /usr/local/lib/android 2>/dev/null 95 | sudo swapoff -a 96 | sudo rm -f /swapfile /mnt/swapfile 97 | sudo -E apt-get -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* openjdk* mysql* php* mongodb* dotnet* moby* snapd* android* || true 98 | sudo -E apt-get -qq autoremove --purge 99 | sudo -E apt-get -qq clean 100 | sudo -E apt-get clean 101 | sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile} 102 | sudo rm -rf ~/{.cargo,.dotnet,.rustup} 103 | sudo timedatectl set-timezone "${TZ}" 104 | 105 | - name: Create simulated physical disk 106 | id: disk 107 | run: | 108 | mnt_size=$(expr $(df -h /mnt | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 1) 109 | root_size=$(expr $(df -h / | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 4) 110 | sudo truncate -s "${mnt_size}"G /mnt/mnt.img 111 | sudo truncate -s "${root_size}"G /root.img 112 | sudo losetup /dev/loop6 /mnt/mnt.img 113 | sudo losetup /dev/loop7 /root.img 114 | sudo pvcreate /dev/loop6 115 | sudo pvcreate /dev/loop7 116 | sudo vgcreate github /dev/loop6 /dev/loop7 117 | sudo lvcreate -n runner -l 100%FREE github 118 | sudo mkfs.xfs /dev/github/runner 119 | sudo mkdir -p /mnt/workdir 120 | sudo mount /dev/github/runner /mnt/workdir 121 | sudo chown $USER:$GROUPS /mnt/workdir 122 | df -Th 123 | 124 | - name: Download source code 125 | working-directory: /mnt/workdir 126 | run: | 127 | df -hT ${PWD} 128 | git clone -q --single-branch --depth=1 --branch=main https://github.com/armbian/build.git build 129 | ln -sf /mnt/workdir/build ${GITHUB_WORKSPACE}/build 130 | 131 | - name: Apply patches 132 | run: | 133 | cd "${GITHUB_WORKSPACE}/build" 134 | "${GITHUB_WORKSPACE}/scripts/apply_patches.sh" 135 | "${GITHUB_WORKSPACE}/scripts/rename_to_conf.sh" 136 | ls -la 137 | 138 | - name: Compile Armbian [ ${{ inputs.BOARD }} ${{ inputs.BRANCH }} ${{ inputs.RELEASE }} ] 139 | run: | 140 | cd "${GITHUB_WORKSPACE}/build/" 141 | ./compile.sh build BOARD=${{ inputs.BOARD }} BRANCH=${{ inputs.BRANCH }} RELEASE=${{ inputs.RELEASE }} BUILD_MINIMAL=${{ inputs.BUILD_MINIMAL }} BUILD_DESKTOP=${{ inputs.BUILD_DESKTOP }} \ 142 | PREFER_DOCKER=${{ inputs.PREFER_DOCKER }} DOCKER_ARMBIAN_BASE_IMAGE=${{ inputs.DOCKER_ARMBIAN_BASE_IMAGE }} COMPRESS_OUTPUTIMAGE=xz KERNEL_CONFIGURE=no DEB_COMPRESS=xz 143 | 144 | - name: Set current year and month 145 | run: | 146 | echo "CURRENT_YEAR_MONTH=$(date +'%Y.%m')" >> $GITHUB_ENV 147 | 148 | - name: Prepare Image Metadata 149 | run: | 150 | cd "${GITHUB_WORKSPACE}/build/output/images/" 151 | Image_File=$(find . -maxdepth 1 -type f -name 'Armbian_*.img.xz' -printf '%f\n' | head -n 1) 152 | [ -z "$Image_File" ] && { echo "No image files found."; exit 1; } 153 | echo "Image_File: $Image_File" 154 | VERSION=$(echo "$Image_File" | cut -d '_' -f 2) 155 | echo "VERSION=$VERSION" >> $GITHUB_ENV 156 | echo "VERSION: $VERSION" 157 | 158 | - name: Upload Image to Release 159 | if: success() 160 | uses: ncipollo/release-action@main 161 | with: 162 | tag: "Armbian-${{ inputs.RELEASE }}-${{ env.CURRENT_YEAR_MONTH }}" 163 | name: "Armbian-${{ inputs.RELEASE }}-${{ env.CURRENT_YEAR_MONTH }}" 164 | artifacts: "${{ github.workspace }}/build/output/images/*" 165 | allowUpdates: true 166 | removeArtifacts: false 167 | replacesArtifacts: true 168 | token: ${{ secrets.GITHUB_TOKEN }} 169 | body: | 170 | ### Armbian Image Information 171 | - Release: ${{ inputs.RELEASE }} 172 | - Version: ${{ env.VERSION }} 173 | - Username: root 174 | - Password: 1234 175 | draft: false 176 | prerelease: false 177 | 178 | - name: Prepare Debs Metadata 179 | run: | 180 | cd "${GITHUB_WORKSPACE}/build/output/debs/" 181 | [ -d "extra/${{ inputs.RELEASE }}-utils" ] && mv extra/${{ inputs.RELEASE }}-utils/* ./ && rm -rf extra 182 | Kernel_File=$(find . -maxdepth 1 -type f -name 'linux-image-*.deb' -printf '%f\n' | head -n 1) 183 | 184 | if [ -n "$Kernel_File" ]; then 185 | echo "Kernel_File: $Kernel_File" 186 | KERNEL_VERSION=$(echo "$Kernel_File" | cut -d '_' -f 5 | cut -d '-' -f 1) 187 | [[ ! "$KERNEL_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && KERNEL_VERSION="${KERNEL_VERSION}.0" 188 | echo "KERNEL_VERSION=$KERNEL_VERSION" >> $GITHUB_ENV 189 | echo "KERNEL_VERSION: $KERNEL_VERSION" 190 | LINUX_FAMILY=$(echo "$Kernel_File" | cut -d '-' -f 3 | cut -d '_' -f 1) 191 | echo "LINUX_FAMILY=$LINUX_FAMILY" >> $GITHUB_ENV 192 | echo "LINUX_FAMILY: $LINUX_FAMILY" 193 | 194 | else 195 | echo "No matching file found. Available files are:" 196 | ls -1 "${GITHUB_WORKSPACE}/build/output/debs/" 197 | exit 1 198 | fi 199 | 200 | tar -czf "../${{ env.VERSION }}_${{ inputs.BOARD }}_${{ inputs.RELEASE }}_${{ inputs.BRANCH }}.tar.gz" \ 201 | --exclude=linux-dtb* --exclude=linux-headers* --exclude=linux-image* --exclude=linux-libc* * 202 | echo "Compressed matching files to ${{ env.VERSION }}_${{ inputs.BOARD }}_${{ inputs.RELEASE }}_${{ inputs.BRANCH }}.tar.gz" 203 | tar -tzf "../${{ env.VERSION }}_${{ inputs.BOARD }}_${{ inputs.RELEASE }}_${{ inputs.BRANCH }}.tar.gz" || { echo "Failed to create valid tar.gz file"; exit 1; } 204 | 205 | - name: Upload Debs to Release 206 | if: success() 207 | uses: ncipollo/release-action@main 208 | with: 209 | tag: "Armbian-Debs" 210 | name: "Armbian-Debs" 211 | artifacts: "${{ github.workspace }}/build/output/${{ env.VERSION }}_${{ inputs.BOARD }}_${{ inputs.RELEASE }}_${{ inputs.BRANCH }}.tar.gz" 212 | allowUpdates: true 213 | removeArtifacts: false 214 | replacesArtifacts: true 215 | token: ${{ secrets.GITHUB_TOKEN }} 216 | body: | 217 | ### Armbian Debs Packages 218 | - Usage method: After unzipping, install the deb packages in order 219 | - Packages include: armbian-bsp-cli | armbian-firmware | base-files 220 | draft: false 221 | prerelease: false 222 | 223 | - name: Prepare Kernel Metadata 224 | run: | 225 | cd "${GITHUB_WORKSPACE}/build/output/debs/" 226 | matching_files_array=($(ls linux-dtb* linux-headers* linux-image* linux-libc* 2>/dev/null)) 227 | 228 | if [ ${#matching_files_array[@]} -gt 0 ]; then 229 | tar -czf "../kernel-${KERNEL_VERSION}-${LINUX_FAMILY}.tar.gz" "${matching_files_array[@]}" 230 | echo "Compressed matching files to kernel-${KERNEL_VERSION}-${LINUX_FAMILY}.tar.gz" 231 | else 232 | echo "No matching files found for compression." 233 | exit 1 234 | fi 235 | 236 | tar -tzf "../kernel-${KERNEL_VERSION}-${LINUX_FAMILY}.tar.gz" || { echo "Failed to create valid tar.gz file"; exit 1; } 237 | 238 | - name: Upload Kernel to Release 239 | if: success() 240 | uses: ncipollo/release-action@main 241 | with: 242 | tag: "Kernel-${{ env.LINUX_FAMILY }}" 243 | name: "Kernel-${{ env.LINUX_FAMILY }}" 244 | artifacts: "${{ github.workspace }}/build/output/kernel-${{ env.KERNEL_VERSION }}-${{ env.LINUX_FAMILY }}.tar.gz" 245 | allowUpdates: true 246 | removeArtifacts: false 247 | replacesArtifacts: true 248 | token: ${{ secrets.GITHUB_TOKEN }} 249 | body: | 250 | ### Armbian Kernel Packages for ${{ env.LINUX_FAMILY }} 251 | - Usage method: After unzipping, install the deb packages in order 252 | - Packages include: linux-dtb | linux-headers | linux-image | linux-libc-dev 253 | draft: false 254 | prerelease: false 255 | 256 | - name: Prepare SHA256 Metadata 257 | run: | 258 | cd "${GITHUB_WORKSPACE}/build/output/" 259 | sleep 15 && "${GITHUB_WORKSPACE}/scripts/sha256.sh" 260 | ls -la 261 | 262 | - name: Upload SHA256 to Release 263 | if: success() 264 | uses: ncipollo/release-action@main 265 | with: 266 | tag: "Kernel-${{ env.LINUX_FAMILY }}" 267 | name: "Kernel-${{ env.LINUX_FAMILY }}" 268 | artifacts: "${{ github.workspace }}/build/output/sha256.txt" 269 | allowUpdates: true 270 | removeArtifacts: false 271 | replacesArtifacts: true 272 | token: ${{ secrets.GITHUB_TOKEN }} 273 | body: | 274 | ### Armbian Kernel Packages for ${{ env.LINUX_FAMILY }} 275 | - Usage method: After unzipping, install the deb packages in order 276 | - Packages include: linux-dtb | linux-headers | linux-image | linux-libc-dev 277 | draft: false 278 | prerelease: false 279 | 280 | - name: Delete releases and workflows runs 281 | uses: ophub/delete-releases-workflows@main 282 | with: 283 | delete_releases: true 284 | releases_keep_latest: 10 285 | delete_workflows: true 286 | workflows_keep_day: 3 287 | gh_token: ${{ secrets.GITHUB_TOKEN }} 288 | -------------------------------------------------------------------------------- /.github/workflows/Build-Armbian.yml: -------------------------------------------------------------------------------- 1 | name: Build Armbian 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | BOARD: 7 | description: 'Board type' 8 | required: true 9 | default: 'nanopct4' 10 | type: choice 11 | options: 12 | - 'nanopct4' 13 | - 'rock-5c' 14 | - 'panther-x2' 15 | - 'aml-s9xx-box' 16 | - 'radxa-cubie-a5e' 17 | - 'jp-tvbox' 18 | - 'nanopi-r3s' 19 | - 'onecloud' 20 | - 'station-m2' 21 | BRANCH: 22 | description: 'Armbian branch' 23 | default: 'current' 24 | required: true 25 | type: choice 26 | options: 27 | - 'current' 28 | - 'edge' 29 | - 'vendor' 30 | - 'dev' 31 | RELEASE: 32 | description: 'Release name' 33 | default: 'bookworm' 34 | required: true 35 | type: choice 36 | options: 37 | - 'bookworm' 38 | - 'trixie' 39 | - 'jammy' 40 | - 'noble' 41 | BUILD_DESKTOP: 42 | description: 'Build desktop environment' 43 | default: 'no' 44 | required: false 45 | type: choice 46 | options: 47 | - 'yes' 48 | - 'no' 49 | BUILD_MINIMAL: 50 | description: 'BUILD MINIMAL environment' 51 | default: 'yes' 52 | required: false 53 | type: choice 54 | options: 55 | - 'yes' 56 | - 'no' 57 | PREFER_DOCKER: 58 | description: 'Use Docker build' 59 | default: 'no' 60 | required: false 61 | type: choice 62 | options: 63 | - 'yes' 64 | - 'no' 65 | DOCKER_ARMBIAN_BASE_IMAGE: 66 | description: 'Docker IMAGE' 67 | default: 'ubuntu:jammy' 68 | required: false 69 | type: choice 70 | options: 71 | - 'ubuntu:jammy' 72 | - 'ubuntu:noble' 73 | - 'debian:bookworm' 74 | 75 | env: 76 | TZ: Asia/Shanghai 77 | 78 | jobs: 79 | Build-Armbian: 80 | runs-on: ubuntu-24.04-arm 81 | steps: 82 | - name: Checkout 83 | uses: actions/checkout@v4 84 | 85 | - name: Initialization environment 86 | id: init 87 | env: 88 | DEBIAN_FRONTEND: noninteractive 89 | run: | 90 | echo "START_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV 91 | docker_images_ids=$(docker images -q) 92 | [ -n "$docker_images_ids" ] && docker rmi $docker_images_ids 93 | docker image prune -a -f 94 | [[ -n "${AGENT_TOOLSDIRECTORY}" ]] && sudo rm -rf "${AGENT_TOOLSDIRECTORY}" 95 | sudo rm -rf /usr/share/dotnet /usr/local/lib/android 2>/dev/null 96 | sudo swapoff -a 97 | sudo rm -f /swapfile /mnt/swapfile 98 | sudo -E apt-get -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* openjdk* mysql* php* mongodb* dotnet* moby* snapd* android* || true 99 | sudo -E apt-get -qq autoremove --purge 100 | sudo -E apt-get -qq clean 101 | sudo -E apt-get clean 102 | sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile} 103 | sudo rm -rf ~/{.cargo,.dotnet,.rustup} 104 | sudo timedatectl set-timezone "${TZ}" 105 | 106 | - name: Create simulated physical disk 107 | id: disk 108 | run: | 109 | mnt_size=$(expr $(df -h /mnt | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 1) 110 | root_size=$(expr $(df -h / | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 4) 111 | sudo truncate -s "${mnt_size}"G /mnt/mnt.img 112 | sudo truncate -s "${root_size}"G /root.img 113 | sudo losetup /dev/loop6 /mnt/mnt.img 114 | sudo losetup /dev/loop7 /root.img 115 | sudo pvcreate /dev/loop6 116 | sudo pvcreate /dev/loop7 117 | sudo vgcreate github /dev/loop6 /dev/loop7 118 | sudo lvcreate -n runner -l 100%FREE github 119 | sudo mkfs.xfs /dev/github/runner 120 | sudo mkdir -p /mnt/workdir 121 | sudo mount /dev/github/runner /mnt/workdir 122 | sudo chown $USER:$GROUPS /mnt/workdir 123 | df -Th 124 | 125 | - name: Download source code 126 | working-directory: /mnt/workdir 127 | run: | 128 | df -hT ${PWD} 129 | git clone -q --single-branch --depth=1 --branch=main https://github.com/armbian/build.git build 130 | ln -sf /mnt/workdir/build ${GITHUB_WORKSPACE}/build 131 | 132 | - name: Apply patches 133 | run: | 134 | cd "${GITHUB_WORKSPACE}/build" 135 | "${GITHUB_WORKSPACE}/scripts/apply_patches.sh" 136 | "${GITHUB_WORKSPACE}/scripts/rename_to_conf.sh" 137 | ls -la 138 | 139 | - name: Compile Armbian [ ${{ inputs.BOARD }} ${{ inputs.BRANCH }} ${{ inputs.RELEASE }} ] 140 | run: | 141 | cd "${GITHUB_WORKSPACE}/build/" 142 | ./compile.sh build BOARD=${{ inputs.BOARD }} BRANCH=${{ inputs.BRANCH }} RELEASE=${{ inputs.RELEASE }} BUILD_MINIMAL=${{ inputs.BUILD_MINIMAL }} BUILD_DESKTOP=${{ inputs.BUILD_DESKTOP }} \ 143 | PREFER_DOCKER=${{ inputs.PREFER_DOCKER }} DOCKER_ARMBIAN_BASE_IMAGE=${{ inputs.DOCKER_ARMBIAN_BASE_IMAGE }} COMPRESS_OUTPUTIMAGE=xz KERNEL_CONFIGURE=no DEB_COMPRESS=xz 144 | 145 | - name: Set current year and month 146 | run: | 147 | echo "CURRENT_YEAR_MONTH=$(date +'%Y.%m')" >> $GITHUB_ENV 148 | 149 | - name: Prepare Image Metadata 150 | run: | 151 | cd "${GITHUB_WORKSPACE}/build/output/images/" 152 | Image_File=$(find . -maxdepth 1 -type f -name 'Armbian_*.img.xz' -printf '%f\n' | head -n 1) 153 | [ -z "$Image_File" ] && { echo "No image files found."; exit 1; } 154 | echo "Image_File: $Image_File" 155 | VERSION=$(echo "$Image_File" | cut -d '_' -f 2) 156 | echo "VERSION=$VERSION" >> $GITHUB_ENV 157 | echo "VERSION: $VERSION" 158 | 159 | - name: Upload Image to Release 160 | if: success() 161 | uses: ncipollo/release-action@main 162 | with: 163 | tag: "Armbian-${{ inputs.RELEASE }}-${{ env.CURRENT_YEAR_MONTH }}" 164 | name: "Armbian-${{ inputs.RELEASE }}-${{ env.CURRENT_YEAR_MONTH }}" 165 | artifacts: "${{ github.workspace }}/build/output/images/*" 166 | allowUpdates: true 167 | removeArtifacts: false 168 | replacesArtifacts: true 169 | token: ${{ secrets.GITHUB_TOKEN }} 170 | body: | 171 | ### Armbian Image Information 172 | - Release: ${{ inputs.RELEASE }} 173 | - Version: ${{ env.VERSION }} 174 | - Username: root 175 | - Password: 1234 176 | draft: false 177 | prerelease: false 178 | 179 | - name: Delete releases and workflows runs 180 | uses: ophub/delete-releases-workflows@main 181 | with: 182 | delete_releases: true 183 | releases_keep_latest: 10 184 | delete_workflows: true 185 | workflows_keep_day: 3 186 | gh_token: ${{ secrets.GITHUB_TOKEN }} 187 | -------------------------------------------------------------------------------- /.github/workflows/Build-Kernel-LinuxFamily-PR.yml: -------------------------------------------------------------------------------- 1 | name: Build Kernel LinuxFamily PR 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | LinuxFamily: 7 | description: 'Linux Family' 8 | required: true 9 | default: 'rockchip64' 10 | type: choice 11 | options: 12 | - 'rockchip64' 13 | - 'meson64' 14 | - 'rk35xx' 15 | - 'meson' 16 | BRANCH: 17 | description: 'Linux Branch' 18 | default: 'edge' 19 | required: true 20 | type: choice 21 | options: 22 | - 'current' 23 | - 'edge' 24 | - 'vendor' 25 | EXTRAWIFI: 26 | description: 'Several Wifi Drivers' 27 | default: 'no' 28 | required: false 29 | type: choice 30 | options: 31 | - 'yes' 32 | - 'no' 33 | PR: 34 | description: 'Enter the PR number to build' 35 | required: true 36 | type: string 37 | 38 | env: 39 | TZ: Asia/Shanghai 40 | 41 | jobs: 42 | Build-Kernel: 43 | runs-on: ubuntu-24.04-arm 44 | steps: 45 | - name: Check input combination 46 | run: | 47 | echo "START_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV 48 | echo "LinuxFamily: ${{ inputs.LinuxFamily }}" 49 | echo "BRANCH: ${{ inputs.BRANCH }}" 50 | case "${{ inputs.LinuxFamily }}" in 51 | rk35xx) 52 | if [ "${{ inputs.BRANCH }}" != "vendor" ]; then 53 | echo "rk35xx only supports vendor branch." 54 | exit 1 55 | fi 56 | ;; 57 | rockchip64|meson64|meson) 58 | if [ "${{ inputs.BRANCH }}" = "vendor" ]; then 59 | echo "${{ inputs.LinuxFamily }} does not support vendor branch." 60 | exit 1 61 | fi 62 | ;; 63 | *) 64 | echo "Unsupported LinuxFamily: ${{ inputs.LinuxFamily }}" 65 | exit 1 66 | ;; 67 | esac 68 | 69 | - name: Checkout 70 | uses: actions/checkout@v4 71 | 72 | - name: Initialization environment 73 | id: init 74 | env: 75 | DEBIAN_FRONTEND: noninteractive 76 | run: | 77 | docker_images_ids=$(docker images -q) 78 | [ -n "$docker_images_ids" ] && docker rmi $docker_images_ids 79 | docker image prune -a -f 80 | [[ -n "${AGENT_TOOLSDIRECTORY}" ]] && sudo rm -rf "${AGENT_TOOLSDIRECTORY}" 81 | sudo rm -rf /usr/share/dotnet /usr/local/lib/android 2>/dev/null 82 | sudo swapoff -a 83 | sudo rm -f /swapfile /mnt/swapfile 84 | sudo -E apt-get -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* openjdk* mysql* php* mongodb* dotnet* moby* snapd* android* || true 85 | sudo -E apt-get -qq autoremove --purge 86 | sudo -E apt-get -qq clean 87 | sudo -E apt-get clean 88 | sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile} 89 | sudo rm -rf ~/{.cargo,.dotnet,.rustup} 90 | sudo timedatectl set-timezone "${TZ}" 91 | 92 | - name: Create simulated physical disk 93 | id: disk 94 | run: | 95 | mnt_size=$(expr $(df -h /mnt | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 1) 96 | root_size=$(expr $(df -h / | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 4) 97 | sudo truncate -s "${mnt_size}"G /mnt/mnt.img 98 | sudo truncate -s "${root_size}"G /root.img 99 | sudo losetup /dev/loop6 /mnt/mnt.img 100 | sudo losetup /dev/loop7 /root.img 101 | sudo pvcreate /dev/loop6 102 | sudo pvcreate /dev/loop7 103 | sudo vgcreate github /dev/loop6 /dev/loop7 104 | sudo lvcreate -n runner -l 100%FREE github 105 | sudo mkfs.xfs /dev/github/runner 106 | sudo mkdir -p /mnt/workdir 107 | sudo mount /dev/github/runner /mnt/workdir 108 | sudo chown $USER:$GROUPS /mnt/workdir 109 | df -Th 110 | 111 | - name: Download source code 112 | working-directory: /mnt/workdir 113 | run: | 114 | df -hT ${PWD} 115 | git clone -q --branch=main https://github.com/armbian/build build 116 | ln -sf /mnt/workdir/build ${GITHUB_WORKSPACE}/build 117 | cd ${GITHUB_WORKSPACE}/build 118 | git config --global user.name "GitHub Actions" 119 | git config --global user.email "actions@github.com" 120 | git fetch origin pull/${{ inputs.PR }}/head:pr-branch 121 | git merge pr-branch --no-ff --strategy=recursive -X theirs -m "Merge PR #${{ inputs.PR }} into main" 122 | 123 | - name: Apply patches 124 | run: | 125 | cd "${GITHUB_WORKSPACE}/build" 126 | "${GITHUB_WORKSPACE}/scripts/apply_patches.sh" 127 | "${GITHUB_WORKSPACE}/scripts/rename_to_conf.sh" 128 | # sed -i 's|tag:v6\.16-rc[1-7]|tag:v6.16-rc4|' config/sources/mainline-kernel.conf.sh 129 | # sed -i 's|https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git|https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git|' lib/functions/configuration/main-config.sh 130 | # sed -i 's|6\.1-rkr5|6.1-rkr5.1|g' patch/kernel/rk35xx-vendor-6.1/0000.patching_config.yaml 131 | # sed -i 's|v6\.1\.99|v6.1.115|g' patch/kernel/rk35xx-vendor-6.1/0000.patching_config.yaml 132 | # sed -i 's|6\.1-rkr5|6.1-rkr5.1|g' config/sources/families/rk35xx.conf 133 | # sed -i 's|6\.1-rkr5|6.1-rkr5.1|g' config/sources/families/rockchip-rk3588.conf 134 | # cp -f ${GITHUB_WORKSPACE}/patch/test/meson64/general-fix-Kodi-sysinfo-CPU-information.patch patch/kernel/archive/rockchip64-6.16/ 135 | # cp -f ${GITHUB_WORKSPACE}/patch/T4/t4.patch patch/kernel/archive/rockchip64-6.16/ 136 | # cp -f ${GITHUB_WORKSPACE}/patch/N1/fix-n1-1.patch patch/kernel/archive/meson64-6.16/ 137 | # cp -f ${GITHUB_WORKSPACE}/patch/N1/fix-n1-2.patch patch/kernel/archive/meson64-6.16/ 138 | # cp -f ${GITHUB_WORKSPACE}/patch/X2/rk3566-panther-x2.dts patch/kernel/archive/rockchip64-6.16/dt/ 139 | # cp -f ${GITHUB_WORKSPACE}/patch/JP/rk3566-jp-tvbox.dts patch/kernel/archive/rockchip64-6.16/dt/ 140 | ls -la 141 | 142 | - name: Compile Kernel [ ${{ inputs.LinuxFamily }} ${{ inputs.BRANCH }} ${{ inputs.PR }} ] 143 | run: | 144 | cd "${GITHUB_WORKSPACE}/build/" 145 | BoardFamily=${{ inputs.LinuxFamily }} 146 | case "$BoardFamily" in 147 | rockchip64) BoardFamily="nanopct4" ;; 148 | meson64) BoardFamily="aml-s9xx-box" ;; 149 | rk35xx) BoardFamily="rock-5c" ;; 150 | meson) BoardFamily="onecloud" ;; 151 | esac 152 | ./compile.sh kernel BOARD=${BoardFamily} BRANCH=${{ inputs.BRANCH }} EXTRAWIFI=${{ inputs.EXTRAWIFI }} PREFER_DOCKER=no DOCKER_ARMBIAN_BASE_IMAGE=ubuntu:jammy DEB_COMPRESS=xz 153 | 154 | - name: Prepare Kernel Metadata 155 | run: | 156 | cd "${GITHUB_WORKSPACE}/build/output/debs/" 157 | Kernel_File=$(find . -maxdepth 1 -type f -name 'linux-image-*.deb' -printf '%f\n' | head -n 1) 158 | 159 | if [ -n "$Kernel_File" ]; then 160 | echo "Kernel_File: $Kernel_File" 161 | KERNEL_VERSION=$(echo "$Kernel_File" | cut -d '_' -f 5 | cut -d '-' -f 1) 162 | [[ ! "$KERNEL_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && KERNEL_VERSION="${KERNEL_VERSION}.0" 163 | echo "KERNEL_VERSION=$KERNEL_VERSION" >> $GITHUB_ENV 164 | echo "KERNEL_VERSION: $KERNEL_VERSION" 165 | LINUX_FAMILY=$(echo "$Kernel_File" | cut -d '-' -f 3 | cut -d '_' -f 1) 166 | echo "LINUX_FAMILY=$LINUX_FAMILY" >> $GITHUB_ENV 167 | echo "LINUX_FAMILY: $LINUX_FAMILY" 168 | else 169 | echo "No matching file found. Available files are:" 170 | ls -1 "${GITHUB_WORKSPACE}/build/output/debs/" 171 | exit 1 172 | fi 173 | 174 | matching_files_array=($(ls linux-dtb* linux-headers* linux-image* linux-libc* 2>/dev/null)) 175 | 176 | if [ ${#matching_files_array[@]} -gt 0 ]; then 177 | tar -czf "../kernel-${KERNEL_VERSION}-${LINUX_FAMILY}.tar.gz" "${matching_files_array[@]}" 178 | echo "Compressed matching files to kernel-${KERNEL_VERSION}-${LINUX_FAMILY}.tar.gz" 179 | else 180 | echo "No matching files found for compression." 181 | exit 1 182 | fi 183 | 184 | tar -tzf "../kernel-${KERNEL_VERSION}-${LINUX_FAMILY}.tar.gz" || { echo "Failed to create valid tar.gz file"; exit 1; } 185 | 186 | - name: Upload Kernel to Release 187 | if: success() 188 | uses: ncipollo/release-action@main 189 | with: 190 | tag: "Kernel-${{ env.LINUX_FAMILY }}" 191 | name: "Kernel-${{ env.LINUX_FAMILY }}" 192 | artifacts: "${{ github.workspace }}/build/output/kernel-${{ env.KERNEL_VERSION }}-${{ env.LINUX_FAMILY }}.tar.gz" 193 | allowUpdates: true 194 | removeArtifacts: false 195 | replacesArtifacts: true 196 | token: ${{ secrets.GITHUB_TOKEN }} 197 | body: | 198 | ### Armbian Kernel Packages for ${{ env.LINUX_FAMILY }} 199 | - Usage method: After unzipping, install the deb packages in order 200 | - Packages include: linux-dtb | linux-headers | linux-image | linux-libc-dev 201 | draft: false 202 | prerelease: false 203 | 204 | - name: Prepare SHA256 Metadata 205 | run: | 206 | cd "${GITHUB_WORKSPACE}/build/output/" 207 | sleep 15 && "${GITHUB_WORKSPACE}/scripts/sha256.sh" 208 | ls -la 209 | 210 | - name: Upload SHA256 to Release 211 | if: success() 212 | uses: ncipollo/release-action@main 213 | with: 214 | tag: "Kernel-${{ env.LINUX_FAMILY }}" 215 | name: "Kernel-${{ env.LINUX_FAMILY }}" 216 | artifacts: "${{ github.workspace }}/build/output/sha256.txt" 217 | allowUpdates: true 218 | removeArtifacts: false 219 | replacesArtifacts: true 220 | token: ${{ secrets.GITHUB_TOKEN }} 221 | body: | 222 | ### Armbian Kernel Packages for ${{ env.LINUX_FAMILY }} 223 | - Usage method: After unzipping, install the deb packages in order 224 | - Packages include: linux-dtb | linux-headers | linux-image | linux-libc-dev 225 | draft: false 226 | prerelease: false 227 | 228 | - name: Delete releases and workflows runs 229 | uses: ophub/delete-releases-workflows@main 230 | with: 231 | delete_releases: true 232 | releases_keep_latest: 10 233 | delete_workflows: true 234 | workflows_keep_day: 3 235 | gh_token: ${{ secrets.GITHUB_TOKEN }} 236 | 237 | - name: Calculate Workflow Duration 238 | id: duration 239 | run: | 240 | start_time="${{ env.START_TIME }}" 241 | echo "Start time: ${start_time}" 242 | end_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ") 243 | echo "End time: ${end_time}" 244 | duration=$(( $(date -d "$end_time" +%s) - $(date -d "$start_time" +%s) )) 245 | echo "Workflow duration: ${duration} seconds" 246 | echo "DURATION=${duration}" >> $GITHUB_ENV 247 | 248 | - name: Telegram notification 249 | run: | 250 | HOURS=$(( ${{ env.DURATION }} / 3600 )) 251 | MINUTES=$(( (${{ env.DURATION }} % 3600) / 60 )) 252 | SECONDS=$(( ${{ env.DURATION }} % 60 )) 253 | MSG=" 254 | ${{ env.KERNEL_VERSION }}-${{ env.LINUX_FAMILY }} 编译完成! 255 | 耗时: ${HOURS} 时 ${MINUTES} 分 ${SECONDS} 秒 256 | " 257 | echo "Sending message: $MSG" 258 | curl -s "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" -d "chat_id=${{ secrets.TELEGRAM_TO }}&text=${MSG}" 259 | -------------------------------------------------------------------------------- /.github/workflows/Build-Kernel-LinuxFamily.yml: -------------------------------------------------------------------------------- 1 | name: Build Kernel LinuxFamily 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | LinuxFamily: 7 | description: 'Linux Family' 8 | required: true 9 | default: 'rockchip64' 10 | type: choice 11 | options: 12 | - 'rockchip64' 13 | - 'meson64' 14 | - 'rk35xx' 15 | - 'meson' 16 | BRANCH: 17 | description: 'Linux Branch' 18 | default: 'current' 19 | required: true 20 | type: choice 21 | options: 22 | - 'current' 23 | - 'edge' 24 | - 'vendor' 25 | 26 | env: 27 | TZ: Asia/Shanghai 28 | 29 | jobs: 30 | Build-Kernel: 31 | runs-on: ubuntu-24.04-arm 32 | steps: 33 | - name: Check input combination 34 | run: | 35 | echo "START_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV 36 | echo "LinuxFamily: ${{ inputs.LinuxFamily }}" 37 | echo "BRANCH: ${{ inputs.BRANCH }}" 38 | case "${{ inputs.LinuxFamily }}" in 39 | rk35xx) 40 | if [ "${{ inputs.BRANCH }}" != "vendor" ]; then 41 | echo "rk35xx only supports vendor branch." 42 | exit 1 43 | fi 44 | ;; 45 | rockchip64|meson64|meson) 46 | if [ "${{ inputs.BRANCH }}" = "vendor" ]; then 47 | echo "${{ inputs.LinuxFamily }} does not support vendor branch." 48 | exit 1 49 | fi 50 | ;; 51 | *) 52 | echo "Unsupported LinuxFamily: ${{ inputs.LinuxFamily }}" 53 | exit 1 54 | ;; 55 | esac 56 | 57 | - name: Checkout 58 | uses: actions/checkout@v4 59 | 60 | - name: Initialization environment 61 | id: init 62 | env: 63 | DEBIAN_FRONTEND: noninteractive 64 | run: | 65 | docker_images_ids=$(docker images -q) 66 | [ -n "$docker_images_ids" ] && docker rmi $docker_images_ids 67 | docker image prune -a -f 68 | [[ -n "${AGENT_TOOLSDIRECTORY}" ]] && sudo rm -rf "${AGENT_TOOLSDIRECTORY}" 69 | sudo rm -rf /usr/share/dotnet /usr/local/lib/android 2>/dev/null 70 | sudo swapoff -a 71 | sudo rm -f /swapfile /mnt/swapfile 72 | sudo -E apt-get -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* openjdk* mysql* php* mongodb* dotnet* moby* snapd* android* || true 73 | sudo -E apt-get -qq autoremove --purge 74 | sudo -E apt-get -qq clean 75 | sudo -E apt-get clean 76 | sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile} 77 | sudo rm -rf ~/{.cargo,.dotnet,.rustup} 78 | sudo timedatectl set-timezone "${TZ}" 79 | 80 | - name: Create simulated physical disk 81 | id: disk 82 | run: | 83 | mnt_size=$(expr $(df -h /mnt | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 1) 84 | root_size=$(expr $(df -h / | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 4) 85 | sudo truncate -s "${mnt_size}"G /mnt/mnt.img 86 | sudo truncate -s "${root_size}"G /root.img 87 | sudo losetup /dev/loop6 /mnt/mnt.img 88 | sudo losetup /dev/loop7 /root.img 89 | sudo pvcreate /dev/loop6 90 | sudo pvcreate /dev/loop7 91 | sudo vgcreate github /dev/loop6 /dev/loop7 92 | sudo lvcreate -n runner -l 100%FREE github 93 | sudo mkfs.xfs /dev/github/runner 94 | sudo mkdir -p /mnt/workdir 95 | sudo mount /dev/github/runner /mnt/workdir 96 | sudo chown $USER:$GROUPS /mnt/workdir 97 | df -Th 98 | 99 | - name: Download source code 100 | working-directory: /mnt/workdir 101 | run: | 102 | df -hT ${PWD} 103 | git clone -q --single-branch --depth=1 --branch=main https://github.com/armbian/build.git build 104 | ln -sf /mnt/workdir/build ${GITHUB_WORKSPACE}/build 105 | 106 | - name: Apply patches 107 | run: | 108 | cd "${GITHUB_WORKSPACE}/build" 109 | "${GITHUB_WORKSPACE}/scripts/apply_patches.sh" 110 | "${GITHUB_WORKSPACE}/scripts/rename_to_conf.sh" 111 | ls -la 112 | 113 | - name: Compile Kernel [ ${{ inputs.LinuxFamily }} ${{ inputs.BRANCH }} ] 114 | run: | 115 | cd "${GITHUB_WORKSPACE}/build/" 116 | BoardFamily=${{ inputs.LinuxFamily }} 117 | case "$BoardFamily" in 118 | rockchip64) BoardFamily="nanopct4" ;; 119 | meson64) BoardFamily="aml-s9xx-box" ;; 120 | rk35xx) BoardFamily="rock-5c" ;; 121 | meson) BoardFamily="onecloud" ;; 122 | esac 123 | ./compile.sh kernel BOARD=${BoardFamily} BRANCH=${{ inputs.BRANCH }} PREFER_DOCKER=no DOCKER_ARMBIAN_BASE_IMAGE=ubuntu:jammy DEB_COMPRESS=xz 124 | 125 | - name: Prepare Kernel Metadata 126 | run: | 127 | cd "${GITHUB_WORKSPACE}/build/output/debs/" 128 | Kernel_File=$(find . -maxdepth 1 -type f -name 'linux-image-*.deb' -printf '%f\n' | head -n 1) 129 | 130 | if [ -n "$Kernel_File" ]; then 131 | echo "Kernel_File: $Kernel_File" 132 | KERNEL_VERSION=$(echo "$Kernel_File" | cut -d '_' -f 5 | cut -d '-' -f 1) 133 | [[ ! "$KERNEL_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && KERNEL_VERSION="${KERNEL_VERSION}.0" 134 | echo "KERNEL_VERSION=$KERNEL_VERSION" >> $GITHUB_ENV 135 | echo "KERNEL_VERSION: $KERNEL_VERSION" 136 | LINUX_FAMILY=$(echo "$Kernel_File" | cut -d '-' -f 3 | cut -d '_' -f 1) 137 | echo "LINUX_FAMILY=$LINUX_FAMILY" >> $GITHUB_ENV 138 | echo "LINUX_FAMILY: $LINUX_FAMILY" 139 | else 140 | echo "No matching file found. Available files are:" 141 | ls -1 "${GITHUB_WORKSPACE}/build/output/debs/" 142 | exit 1 143 | fi 144 | 145 | matching_files_array=($(ls linux-dtb* linux-headers* linux-image* linux-libc* 2>/dev/null)) 146 | 147 | if [ ${#matching_files_array[@]} -gt 0 ]; then 148 | tar -czf "../kernel-${KERNEL_VERSION}-${LINUX_FAMILY}.tar.gz" "${matching_files_array[@]}" 149 | echo "Compressed matching files to kernel-${KERNEL_VERSION}-${LINUX_FAMILY}.tar.gz" 150 | else 151 | echo "No matching files found for compression." 152 | exit 1 153 | fi 154 | 155 | tar -tzf "../kernel-${KERNEL_VERSION}-${LINUX_FAMILY}.tar.gz" || { echo "Failed to create valid tar.gz file"; exit 1; } 156 | 157 | - name: Upload Kernel to Release 158 | if: success() 159 | uses: ncipollo/release-action@main 160 | with: 161 | tag: "Kernel-${{ env.LINUX_FAMILY }}" 162 | name: "Kernel-${{ env.LINUX_FAMILY }}" 163 | artifacts: "${{ github.workspace }}/build/output/kernel-${{ env.KERNEL_VERSION }}-${{ env.LINUX_FAMILY }}.tar.gz" 164 | allowUpdates: true 165 | removeArtifacts: false 166 | replacesArtifacts: true 167 | token: ${{ secrets.GITHUB_TOKEN }} 168 | body: | 169 | ### Armbian Kernel Packages for ${{ env.LINUX_FAMILY }} 170 | - Usage method: After unzipping, install the deb packages in order 171 | - Packages include: linux-dtb | linux-headers | linux-image | linux-libc-dev 172 | draft: false 173 | prerelease: false 174 | 175 | - name: Prepare SHA256 Metadata 176 | run: | 177 | cd "${GITHUB_WORKSPACE}/build/output/" 178 | sleep 15 && "${GITHUB_WORKSPACE}/scripts/sha256.sh" 179 | ls -la 180 | 181 | - name: Upload SHA256 to Release 182 | if: success() 183 | uses: ncipollo/release-action@main 184 | with: 185 | tag: "Kernel-${{ env.LINUX_FAMILY }}" 186 | name: "Kernel-${{ env.LINUX_FAMILY }}" 187 | artifacts: "${{ github.workspace }}/build/output/sha256.txt" 188 | allowUpdates: true 189 | removeArtifacts: false 190 | replacesArtifacts: true 191 | token: ${{ secrets.GITHUB_TOKEN }} 192 | body: | 193 | ### Armbian Kernel Packages for ${{ env.LINUX_FAMILY }} 194 | - Usage method: After unzipping, install the deb packages in order 195 | - Packages include: linux-dtb | linux-headers | linux-image | linux-libc-dev 196 | draft: false 197 | prerelease: false 198 | 199 | - name: Delete releases and workflows runs 200 | uses: ophub/delete-releases-workflows@main 201 | with: 202 | delete_releases: true 203 | releases_keep_latest: 10 204 | delete_workflows: true 205 | workflows_keep_day: 3 206 | gh_token: ${{ secrets.GITHUB_TOKEN }} 207 | 208 | - name: Calculate Workflow Duration 209 | id: duration 210 | run: | 211 | start_time="${{ env.START_TIME }}" 212 | echo "Start time: ${start_time}" 213 | end_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ") 214 | echo "End time: ${end_time}" 215 | duration=$(( $(date -d "$end_time" +%s) - $(date -d "$start_time" +%s) )) 216 | echo "Workflow duration: ${duration} seconds" 217 | echo "DURATION=${duration}" >> $GITHUB_ENV 218 | 219 | - name: Telegram notification 220 | run: | 221 | HOURS=$(( ${{ env.DURATION }} / 3600 )) 222 | MINUTES=$(( (${{ env.DURATION }} % 3600) / 60 )) 223 | SECONDS=$(( ${{ env.DURATION }} % 60 )) 224 | MSG=" 225 | ${{ env.KERNEL_VERSION }}-${{ env.LINUX_FAMILY }} 编译完成! 226 | 耗时: ${HOURS} 时 ${MINUTES} 分 ${SECONDS} 秒 227 | " 228 | echo "Sending message: $MSG" 229 | curl -s "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" -d "chat_id=${{ secrets.TELEGRAM_TO }}&text=${MSG}" 230 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: meson64 6.16 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | LinuxFamily: 7 | description: 'Linux Family' 8 | required: true 9 | default: 'meson64' 10 | type: choice 11 | options: 12 | - 'meson64' 13 | BRANCH: 14 | description: 'Linux Branch' 15 | default: 'edge' 16 | required: true 17 | type: choice 18 | options: 19 | - 'edge' 20 | EXTRAWIFI: 21 | description: 'Several Wifi Drivers' 22 | default: 'no' 23 | required: false 24 | type: choice 25 | options: 26 | - 'yes' 27 | - 'no' 28 | 29 | env: 30 | TZ: Asia/Shanghai 31 | 32 | jobs: 33 | Build-Kernel: 34 | runs-on: ubuntu-24.04-arm 35 | steps: 36 | - name: Check input combination 37 | run: | 38 | echo "START_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV 39 | echo "LinuxFamily: ${{ inputs.LinuxFamily }}" 40 | echo "BRANCH: ${{ inputs.BRANCH }}" 41 | case "${{ inputs.LinuxFamily }}" in 42 | rk35xx) 43 | if [ "${{ inputs.BRANCH }}" != "vendor" ]; then 44 | echo "rk35xx only supports vendor branch." 45 | exit 1 46 | fi 47 | ;; 48 | rockchip64|meson64|meson) 49 | if [ "${{ inputs.BRANCH }}" = "vendor" ]; then 50 | echo "${{ inputs.LinuxFamily }} does not support vendor branch." 51 | exit 1 52 | fi 53 | ;; 54 | *) 55 | echo "Unsupported LinuxFamily: ${{ inputs.LinuxFamily }}" 56 | exit 1 57 | ;; 58 | esac 59 | 60 | - name: Checkout 61 | uses: actions/checkout@v4 62 | 63 | - name: Initialization environment 64 | id: init 65 | env: 66 | DEBIAN_FRONTEND: noninteractive 67 | run: | 68 | docker_images_ids=$(docker images -q) 69 | [ -n "$docker_images_ids" ] && docker rmi $docker_images_ids 70 | docker image prune -a -f 71 | [[ -n "${AGENT_TOOLSDIRECTORY}" ]] && sudo rm -rf "${AGENT_TOOLSDIRECTORY}" 72 | sudo rm -rf /usr/share/dotnet /usr/local/lib/android 2>/dev/null 73 | sudo swapoff -a 74 | sudo rm -f /swapfile /mnt/swapfile 75 | sudo -E apt-get -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* openjdk* mysql* php* mongodb* dotnet* moby* snapd* android* || true 76 | sudo -E apt-get -qq autoremove --purge 77 | sudo -E apt-get -qq clean 78 | sudo -E apt-get clean 79 | sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile} 80 | sudo rm -rf ~/{.cargo,.dotnet,.rustup} 81 | sudo timedatectl set-timezone "${TZ}" 82 | 83 | - name: Create simulated physical disk 84 | id: disk 85 | run: | 86 | mnt_size=$(expr $(df -h /mnt | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 1) 87 | root_size=$(expr $(df -h / | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 4) 88 | sudo truncate -s "${mnt_size}"G /mnt/mnt.img 89 | sudo truncate -s "${root_size}"G /root.img 90 | sudo losetup /dev/loop6 /mnt/mnt.img 91 | sudo losetup /dev/loop7 /root.img 92 | sudo pvcreate /dev/loop6 93 | sudo pvcreate /dev/loop7 94 | sudo vgcreate github /dev/loop6 /dev/loop7 95 | sudo lvcreate -n runner -l 100%FREE github 96 | sudo mkfs.xfs /dev/github/runner 97 | sudo mkdir -p /mnt/workdir 98 | sudo mount /dev/github/runner /mnt/workdir 99 | sudo chown $USER:$GROUPS /mnt/workdir 100 | df -Th 101 | 102 | - name: Download source code 103 | working-directory: /mnt/workdir 104 | run: | 105 | df -hT ${PWD} 106 | git clone -q --single-branch --depth=1 --branch=main https://github.com/armbian/build.git build 107 | ln -sf /mnt/workdir/build ${GITHUB_WORKSPACE}/build 108 | 109 | - name: Apply patches 110 | run: | 111 | cd "${GITHUB_WORKSPACE}/build" 112 | "${GITHUB_WORKSPACE}/scripts/apply_patches.sh" 113 | "${GITHUB_WORKSPACE}/scripts/rename_to_conf.sh" 114 | sed -i 's|6\.15|6.16|g' config/sources/families/include/meson64_common.inc 115 | sed -i 's|tag:v6\.16-rc[1-7]|tag:v6.16-rc4|' config/sources/mainline-kernel.conf.sh 116 | sed -i 's|https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git|https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git|' lib/functions/configuration/main-config.sh 117 | mv patch/kernel/archive/meson64-6.15 patch/kernel/archive/meson64-6.16 118 | cp -f ${GITHUB_WORKSPACE}/patch/test/meson64/* patch/kernel/archive/meson64-6.16/ 119 | ls -la 120 | 121 | - name: Compile Kernel [ ${{ inputs.LinuxFamily }} ${{ inputs.BRANCH }} ] 122 | run: | 123 | cd "${GITHUB_WORKSPACE}/build/" 124 | BoardFamily=${{ inputs.LinuxFamily }} 125 | case "$BoardFamily" in 126 | rockchip64) BoardFamily="nanopct4" ;; 127 | meson64) BoardFamily="aml-s9xx-box" ;; 128 | rk35xx) BoardFamily="rock-5c" ;; 129 | meson) BoardFamily="onecloud" ;; 130 | esac 131 | ./compile.sh kernel BOARD=${BoardFamily} BRANCH=${{ inputs.BRANCH }} EXTRAWIFI=${{ inputs.EXTRAWIFI }} PREFER_DOCKER=no DOCKER_ARMBIAN_BASE_IMAGE=ubuntu:jammy DEB_COMPRESS=xz 132 | 133 | - name: Prepare Kernel Metadata 134 | run: | 135 | cd "${GITHUB_WORKSPACE}/build/output/debs/" 136 | Kernel_File=$(find . -maxdepth 1 -type f -name 'linux-image-*.deb' -printf '%f\n' | head -n 1) 137 | 138 | if [ -n "$Kernel_File" ]; then 139 | echo "Kernel_File: $Kernel_File" 140 | KERNEL_VERSION=$(echo "$Kernel_File" | cut -d '_' -f 5 | cut -d '-' -f 1) 141 | [[ ! "$KERNEL_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && KERNEL_VERSION="${KERNEL_VERSION}.0" 142 | echo "KERNEL_VERSION=$KERNEL_VERSION" >> $GITHUB_ENV 143 | echo "KERNEL_VERSION: $KERNEL_VERSION" 144 | LINUX_FAMILY=$(echo "$Kernel_File" | cut -d '-' -f 3 | cut -d '_' -f 1) 145 | echo "LINUX_FAMILY=$LINUX_FAMILY" >> $GITHUB_ENV 146 | echo "LINUX_FAMILY: $LINUX_FAMILY" 147 | else 148 | echo "No matching file found. Available files are:" 149 | ls -1 "${GITHUB_WORKSPACE}/build/output/debs/" 150 | exit 1 151 | fi 152 | 153 | matching_files_array=($(ls linux-dtb* linux-headers* linux-image* linux-libc* 2>/dev/null)) 154 | 155 | if [ ${#matching_files_array[@]} -gt 0 ]; then 156 | tar -czf "../kernel-${KERNEL_VERSION}-${LINUX_FAMILY}.tar.gz" "${matching_files_array[@]}" 157 | echo "Compressed matching files to kernel-${KERNEL_VERSION}-${LINUX_FAMILY}.tar.gz" 158 | else 159 | echo "No matching files found for compression." 160 | exit 1 161 | fi 162 | 163 | tar -tzf "../kernel-${KERNEL_VERSION}-${LINUX_FAMILY}.tar.gz" || { echo "Failed to create valid tar.gz file"; exit 1; } 164 | 165 | - name: Upload Kernel to Release 166 | if: success() 167 | uses: ncipollo/release-action@main 168 | with: 169 | tag: "Kernel-${{ env.LINUX_FAMILY }}" 170 | name: "Kernel-${{ env.LINUX_FAMILY }}" 171 | artifacts: "${{ github.workspace }}/build/output/kernel-${{ env.KERNEL_VERSION }}-${{ env.LINUX_FAMILY }}.tar.gz" 172 | allowUpdates: true 173 | removeArtifacts: false 174 | replacesArtifacts: true 175 | token: ${{ secrets.GITHUB_TOKEN }} 176 | body: | 177 | ### Armbian Kernel Packages for ${{ env.LINUX_FAMILY }} 178 | - Usage method: After unzipping, install the deb packages in order 179 | - Packages include: linux-dtb | linux-headers | linux-image | linux-libc-dev 180 | draft: false 181 | prerelease: false 182 | 183 | - name: Prepare SHA256 Metadata 184 | run: | 185 | cd "${GITHUB_WORKSPACE}/build/output/" 186 | sleep 15 && "${GITHUB_WORKSPACE}/scripts/sha256.sh" 187 | ls -la 188 | 189 | - name: Upload SHA256 to Release 190 | if: success() 191 | uses: ncipollo/release-action@main 192 | with: 193 | tag: "Kernel-${{ env.LINUX_FAMILY }}" 194 | name: "Kernel-${{ env.LINUX_FAMILY }}" 195 | artifacts: "${{ github.workspace }}/build/output/sha256.txt" 196 | allowUpdates: true 197 | removeArtifacts: false 198 | replacesArtifacts: true 199 | token: ${{ secrets.GITHUB_TOKEN }} 200 | body: | 201 | ### Armbian Kernel Packages for ${{ env.LINUX_FAMILY }} 202 | - Usage method: After unzipping, install the deb packages in order 203 | - Packages include: linux-dtb | linux-headers | linux-image | linux-libc-dev 204 | draft: false 205 | prerelease: false 206 | 207 | - name: Delete releases and workflows runs 208 | uses: ophub/delete-releases-workflows@main 209 | with: 210 | delete_releases: true 211 | releases_keep_latest: 10 212 | delete_workflows: true 213 | workflows_keep_day: 3 214 | gh_token: ${{ secrets.GITHUB_TOKEN }} 215 | 216 | - name: Calculate Workflow Duration 217 | id: duration 218 | run: | 219 | start_time="${{ env.START_TIME }}" 220 | echo "Start time: ${start_time}" 221 | end_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ") 222 | echo "End time: ${end_time}" 223 | duration=$(( $(date -d "$end_time" +%s) - $(date -d "$start_time" +%s) )) 224 | echo "Workflow duration: ${duration} seconds" 225 | echo "DURATION=${duration}" >> $GITHUB_ENV 226 | 227 | - name: Telegram notification 228 | run: | 229 | HOURS=$(( ${{ env.DURATION }} / 3600 )) 230 | MINUTES=$(( (${{ env.DURATION }} % 3600) / 60 )) 231 | SECONDS=$(( ${{ env.DURATION }} % 60 )) 232 | MSG=" 233 | ${{ env.KERNEL_VERSION }}-${{ env.LINUX_FAMILY }} 编译完成! 234 | 耗时: ${HOURS} 时 ${MINUTES} 分 ${SECONDS} 秒 235 | " 236 | echo "Sending message: $MSG" 237 | curl -s "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" -d "chat_id=${{ secrets.TELEGRAM_TO }}&text=${MSG}" 238 | -------------------------------------------------------------------------------- /.github/workflows/test1.yml: -------------------------------------------------------------------------------- 1 | name: rockchip64 6.15 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | LinuxFamily: 7 | description: 'Linux Family' 8 | required: true 9 | default: 'rockchip64' 10 | type: choice 11 | options: 12 | - 'rockchip64' 13 | BRANCH: 14 | description: 'Linux Branch' 15 | default: 'edge' 16 | required: true 17 | type: choice 18 | options: 19 | - 'edge' 20 | EXTRAWIFI: 21 | description: 'Several Wifi Drivers' 22 | default: 'yes' 23 | required: false 24 | type: choice 25 | options: 26 | - 'yes' 27 | - 'no' 28 | 29 | env: 30 | TZ: Asia/Shanghai 31 | 32 | jobs: 33 | Build-Kernel: 34 | runs-on: ubuntu-24.04-arm 35 | steps: 36 | - name: Check input combination 37 | run: | 38 | echo "START_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV 39 | echo "LinuxFamily: ${{ inputs.LinuxFamily }}" 40 | echo "BRANCH: ${{ inputs.BRANCH }}" 41 | case "${{ inputs.LinuxFamily }}" in 42 | rk35xx) 43 | if [ "${{ inputs.BRANCH }}" != "vendor" ]; then 44 | echo "rk35xx only supports vendor branch." 45 | exit 1 46 | fi 47 | ;; 48 | rockchip64|meson64|meson) 49 | if [ "${{ inputs.BRANCH }}" = "vendor" ]; then 50 | echo "${{ inputs.LinuxFamily }} does not support vendor branch." 51 | exit 1 52 | fi 53 | ;; 54 | *) 55 | echo "Unsupported LinuxFamily: ${{ inputs.LinuxFamily }}" 56 | exit 1 57 | ;; 58 | esac 59 | 60 | - name: Checkout 61 | uses: actions/checkout@v4 62 | 63 | - name: Initialization environment 64 | id: init 65 | env: 66 | DEBIAN_FRONTEND: noninteractive 67 | run: | 68 | docker_images_ids=$(docker images -q) 69 | [ -n "$docker_images_ids" ] && docker rmi $docker_images_ids 70 | docker image prune -a -f 71 | [[ -n "${AGENT_TOOLSDIRECTORY}" ]] && sudo rm -rf "${AGENT_TOOLSDIRECTORY}" 72 | sudo rm -rf /usr/share/dotnet /usr/local/lib/android 2>/dev/null 73 | sudo swapoff -a 74 | sudo rm -f /swapfile /mnt/swapfile 75 | sudo -E apt-get -y purge azure-cli ghc* zulu* llvm* firefox google* dotnet* openjdk* mysql* php* mongodb* dotnet* moby* snapd* android* || true 76 | sudo -E apt-get -qq autoremove --purge 77 | sudo -E apt-get -qq clean 78 | sudo -E apt-get clean 79 | sudo sed -i '/NVM_DIR/d;/skel/d' /root/{.bashrc,.profile} 80 | sudo rm -rf ~/{.cargo,.dotnet,.rustup} 81 | sudo timedatectl set-timezone "${TZ}" 82 | 83 | - name: Create simulated physical disk 84 | id: disk 85 | run: | 86 | mnt_size=$(expr $(df -h /mnt | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 1) 87 | root_size=$(expr $(df -h / | tail -1 | awk '{print $4}' | sed 's/[[:alpha:]]//g' | sed 's/\..*//') - 4) 88 | sudo truncate -s "${mnt_size}"G /mnt/mnt.img 89 | sudo truncate -s "${root_size}"G /root.img 90 | sudo losetup /dev/loop6 /mnt/mnt.img 91 | sudo losetup /dev/loop7 /root.img 92 | sudo pvcreate /dev/loop6 93 | sudo pvcreate /dev/loop7 94 | sudo vgcreate github /dev/loop6 /dev/loop7 95 | sudo lvcreate -n runner -l 100%FREE github 96 | sudo mkfs.xfs /dev/github/runner 97 | sudo mkdir -p /mnt/workdir 98 | sudo mount /dev/github/runner /mnt/workdir 99 | sudo chown $USER:$GROUPS /mnt/workdir 100 | df -Th 101 | 102 | - name: Download source code 103 | working-directory: /mnt/workdir 104 | run: | 105 | df -hT ${PWD} 106 | git clone -q --branch=main https://github.com/armbian/build build 107 | ln -sf /mnt/workdir/build ${GITHUB_WORKSPACE}/build 108 | cd ${GITHUB_WORKSPACE}/build 109 | git reset --hard 530fbc86e8f65548b0e24ae7258c48b240c25f7e 110 | 111 | - name: Apply patches 112 | run: | 113 | cd "${GITHUB_WORKSPACE}/build" 114 | "${GITHUB_WORKSPACE}/scripts/apply_patches.sh" 115 | "${GITHUB_WORKSPACE}/scripts/rename_to_conf.sh" 116 | cp -f ${GITHUB_WORKSPACE}/patch/T4/fix-CPU-information.patch patch/kernel/archive/rockchip64-6.15/ 117 | cp -f ${GITHUB_WORKSPACE}/patch/T4/t4.patch patch/kernel/archive/rockchip64-6.15/ 118 | cp -f ${GITHUB_WORKSPACE}/patch/X2/rk3566-panther-x2.dts patch/kernel/archive/rockchip64-6.15/dt/ 119 | cp -f ${GITHUB_WORKSPACE}/patch/JP/rk3566-jp-tvbox.dts patch/kernel/archive/rockchip64-6.15/dt/ 120 | ls -la 121 | 122 | - name: Compile Kernel [ ${{ inputs.LinuxFamily }} ${{ inputs.BRANCH }} ] 123 | run: | 124 | cd "${GITHUB_WORKSPACE}/build/" 125 | BoardFamily=${{ inputs.LinuxFamily }} 126 | case "$BoardFamily" in 127 | rockchip64) BoardFamily="nanopct4" ;; 128 | meson64) BoardFamily="aml-s9xx-box" ;; 129 | rk35xx) BoardFamily="rock-5c" ;; 130 | meson) BoardFamily="onecloud" ;; 131 | esac 132 | ./compile.sh kernel BOARD=${BoardFamily} BRANCH=${{ inputs.BRANCH }} EXTRAWIFI=${{ inputs.EXTRAWIFI }} PREFER_DOCKER=no DOCKER_ARMBIAN_BASE_IMAGE=ubuntu:jammy DEB_COMPRESS=xz 133 | 134 | - name: Prepare Kernel Metadata 135 | run: | 136 | cd "${GITHUB_WORKSPACE}/build/output/debs/" 137 | Kernel_File=$(find . -maxdepth 1 -type f -name 'linux-image-*.deb' -printf '%f\n' | head -n 1) 138 | 139 | if [ -n "$Kernel_File" ]; then 140 | echo "Kernel_File: $Kernel_File" 141 | KERNEL_VERSION=$(echo "$Kernel_File" | cut -d '_' -f 5 | cut -d '-' -f 1) 142 | [[ ! "$KERNEL_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && KERNEL_VERSION="${KERNEL_VERSION}.0" 143 | echo "KERNEL_VERSION=$KERNEL_VERSION" >> $GITHUB_ENV 144 | echo "KERNEL_VERSION: $KERNEL_VERSION" 145 | LINUX_FAMILY=$(echo "$Kernel_File" | cut -d '-' -f 3 | cut -d '_' -f 1) 146 | echo "LINUX_FAMILY=$LINUX_FAMILY" >> $GITHUB_ENV 147 | echo "LINUX_FAMILY: $LINUX_FAMILY" 148 | else 149 | echo "No matching file found. Available files are:" 150 | ls -1 "${GITHUB_WORKSPACE}/build/output/debs/" 151 | exit 1 152 | fi 153 | 154 | matching_files_array=($(ls linux-dtb* linux-headers* linux-image* linux-libc* 2>/dev/null)) 155 | 156 | if [ ${#matching_files_array[@]} -gt 0 ]; then 157 | tar -czf "../kernel-${KERNEL_VERSION}-${LINUX_FAMILY}.tar.gz" "${matching_files_array[@]}" 158 | echo "Compressed matching files to kernel-${KERNEL_VERSION}-${LINUX_FAMILY}.tar.gz" 159 | else 160 | echo "No matching files found for compression." 161 | exit 1 162 | fi 163 | 164 | tar -tzf "../kernel-${KERNEL_VERSION}-${LINUX_FAMILY}.tar.gz" || { echo "Failed to create valid tar.gz file"; exit 1; } 165 | 166 | - name: Upload Kernel to Release 167 | if: success() 168 | uses: ncipollo/release-action@main 169 | with: 170 | tag: "Kernel-${{ env.LINUX_FAMILY }}" 171 | name: "Kernel-${{ env.LINUX_FAMILY }}" 172 | artifacts: "${{ github.workspace }}/build/output/kernel-${{ env.KERNEL_VERSION }}-${{ env.LINUX_FAMILY }}.tar.gz" 173 | allowUpdates: true 174 | removeArtifacts: false 175 | replacesArtifacts: true 176 | token: ${{ secrets.GITHUB_TOKEN }} 177 | body: | 178 | ### Armbian Kernel Packages for ${{ env.LINUX_FAMILY }} 179 | - Usage method: After unzipping, install the deb packages in order 180 | - Packages include: linux-dtb | linux-headers | linux-image | linux-libc-dev 181 | draft: false 182 | prerelease: false 183 | 184 | - name: Prepare SHA256 Metadata 185 | run: | 186 | cd "${GITHUB_WORKSPACE}/build/output/" 187 | sleep 15 && "${GITHUB_WORKSPACE}/scripts/sha256.sh" 188 | ls -la 189 | 190 | - name: Upload SHA256 to Release 191 | if: success() 192 | uses: ncipollo/release-action@main 193 | with: 194 | tag: "Kernel-${{ env.LINUX_FAMILY }}" 195 | name: "Kernel-${{ env.LINUX_FAMILY }}" 196 | artifacts: "${{ github.workspace }}/build/output/sha256.txt" 197 | allowUpdates: true 198 | removeArtifacts: false 199 | replacesArtifacts: true 200 | token: ${{ secrets.GITHUB_TOKEN }} 201 | body: | 202 | ### Armbian Kernel Packages for ${{ env.LINUX_FAMILY }} 203 | - Usage method: After unzipping, install the deb packages in order 204 | - Packages include: linux-dtb | linux-headers | linux-image | linux-libc-dev 205 | draft: false 206 | prerelease: false 207 | 208 | - name: Delete releases and workflows runs 209 | uses: ophub/delete-releases-workflows@main 210 | with: 211 | delete_releases: true 212 | releases_keep_latest: 10 213 | delete_workflows: true 214 | workflows_keep_day: 3 215 | gh_token: ${{ secrets.GITHUB_TOKEN }} 216 | 217 | - name: Calculate Workflow Duration 218 | id: duration 219 | run: | 220 | start_time="${{ env.START_TIME }}" 221 | echo "Start time: ${start_time}" 222 | end_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ") 223 | echo "End time: ${end_time}" 224 | duration=$(( $(date -d "$end_time" +%s) - $(date -d "$start_time" +%s) )) 225 | echo "Workflow duration: ${duration} seconds" 226 | echo "DURATION=${duration}" >> $GITHUB_ENV 227 | 228 | - name: Telegram notification 229 | run: | 230 | HOURS=$(( ${{ env.DURATION }} / 3600 )) 231 | MINUTES=$(( (${{ env.DURATION }} % 3600) / 60 )) 232 | SECONDS=$(( ${{ env.DURATION }} % 60 )) 233 | MSG=" 234 | ${{ env.KERNEL_VERSION }}-${{ env.LINUX_FAMILY }} 编译完成! 235 | 耗时: ${HOURS} 时 ${MINUTES} 分 ${SECONDS} 秒 236 | " 237 | echo "Sending message: $MSG" 238 | curl -s "https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/sendMessage" -d "chat_id=${{ secrets.TELEGRAM_TO }}&text=${MSG}" 239 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### 通过 GitHub Actions 构建 Armbian 固件和内核 2 | - 内核配置:启用 eBPF 支持,支持 DAE 代理,适用于 mesons64、rockchip64 和 rk35xx。 3 | - 针对 Nanopc-T4: 4 | - CPU 小核频率 1.5GHz,CPU 大核频率 2.0GHz。 5 | - 启用 PCIe 2.1 x4 支持。 6 | - CPU 温度达到 45°C 时启动风扇,65°C 时风扇全速运转。 7 | - 针对 Rock5C Lite: 8 | - 移除 U-Boot 对 GPU 的检测,启用 GPU 节点。 9 | - 网络接口:end* 重命名为 eth0。 10 | - 风扇策略: 11 | - 温度 >= 40°C -> 风扇转速 40% 12 | - 温度 >= 50°C -> 风扇转速 55% 13 | - 温度 >= 60°C -> 风扇转速 75% 14 | - 温度 >= 70°C -> 风扇转速 88% 15 | - 温度 >= 75°C -> 风扇转速 100% 16 | - 默认不支持 WiFi,请自行安装[驱动](https://github.com/radxa-pkg/aic8800)。 17 | - 针对 Panther-X2: 18 | - CPU 频率 2.0GHz。 19 | - vendor 固件支持 jellyfin 硬件转码。 20 | - 网络接口:end* 重命名为 eth0。 21 | - 其他修改: 22 | - 移除内核版本后缀信息。 23 | - Aml-s9xx-box 固件的默认配置针对斐讯 N1 盒子,直接将固件解压写入U盘设备即可。 24 | - 增加 cpuinfo 中的 model name 信息,更直观地了解硬件配置。 25 | - 增加 armbian-apt armbian-update armbian-sync [命令](https://github.com/Zane-E/Armbian-Actions/blob/main/screenshot/screenshot.png),方便换源,更新内核,同步脚本。 26 | 27 | ### 相关链接 28 | - [Armbian Build](https://github.com/armbian/build) 29 | - [DAE Universe](https://github.com/daeuniverse/dae) 30 | -------------------------------------------------------------------------------- /patch/5C/diyfan.patch: -------------------------------------------------------------------------------- 1 | --- a/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts 2 | +++ b/arch/arm64/boot/dts/rockchip/rk3588s-rock-5c.dts 3 | @@ -28,8 +28,15 @@ 4 | fan0: pwm-fan { 5 | compatible = "pwm-fan"; 6 | #cooling-cells = <2>; 7 | - cooling-levels = <0 64 128 192 255>; 8 | - pwms = <&pwm3 0 10000 0>; 9 | + cooling-levels = <0 102 140 190 225 255>; 10 | + pwms = <&pwm3 0 50000 0>; 11 | + rockchip,temp-trips = < 12 | + 40000 1 13 | + 50000 2 14 | + 60000 3 15 | + 70000 4 16 | + 75000 5 17 | + >; 18 | }; 19 | 20 | vcc5v0_sys: vcc5v0-sys { 21 | @@ -684,7 +691,7 @@ 22 | }; 23 | 24 | &threshold { 25 | - temperature = <60000>; 26 | + temperature = <40000>; 27 | }; 28 | 29 | &soc_thermal { 30 | -------------------------------------------------------------------------------- /patch/5C/fix-CPU-information.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Christian Hewitt 3 | Date: Sat, 13 Apr 2019 05:45:18 +0000 4 | Subject: HACK: arm64: fix Kodi sysinfo CPU information 5 | 6 | This allows the CPU information to show in the Kodi sysinfo screen, e.g. 7 | 8 | "ARMv8 Processor rev 4 (v81)" on Amlogic devices 9 | 10 | Signed-off-by: Christian Hewitt 11 | --- 12 | arch/arm64/kernel/cpuinfo.c | 3 +-- 13 | 1 file changed, 1 insertion(+), 2 deletions(-) 14 | 15 | diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c 16 | index 47043c0d95ec..03410a9fac77 100644 17 | --- a/arch/arm64/kernel/cpuinfo.c 18 | +++ b/arch/arm64/kernel/cpuinfo.c 19 | @@ -190,8 +190,7 @@ static int c_show(struct seq_file *m, void *v) 20 | * "processor". Give glibc what it expects. 21 | */ 22 | seq_printf(m, "processor\t: %d\n", i); 23 | - if (compat) 24 | - seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n", 25 | + seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n", 26 | MIDR_REVISION(midr), COMPAT_ELF_PLATFORM); 27 | 28 | seq_printf(m, "BogoMIPS\t: %lu.%02lu\n", 29 | -- 30 | Armbian 31 | 32 | -------------------------------------------------------------------------------- /patch/5C/reopen_disabled_nodes.patch: -------------------------------------------------------------------------------- 1 | diff --git a/arch/arm/mach-rockchip/rk3588/rk3588.c b/arch/arm/mach-rockchip/rk3588/rk3588.c 2 | index f7928a7f2..3c4d1e2f2 100644 3 | --- a/arch/arm/mach-rockchip/rk3588/rk3588.c 4 | +++ b/arch/arm/mach-rockchip/rk3588/rk3588.c 5 | @@ -1067,6 +1067,7 @@ int arch_cpu_init(void) 6 | #endif 7 | 8 | #define BAD_CPU(mask, n) ((mask) & (1 << (n))) 9 | +#define BAD_GPU(mask, n) ((mask) & (1 << (n))) 10 | #define BAD_RKVENC(mask, n) ((mask) & (1 << (n))) 11 | #define BAD_RKVDEC(mask, n) ((mask) & (1 << (n))) 12 | 13 | @@ -1220,51 +1221,54 @@ static void fdt_rm_cpu(const void *blob, u8 cpu_mask) 14 | 15 | static void rk3582_fdt_rm_cpus(const void *blob, u8 cpu_mask) 16 | { 17 | - /* 18 | - * policy: 19 | - * 20 | - * 1. both of cores within the same cluster should be normal, otherwise 21 | - * remove both of them. 22 | - * 2. if core4~7 are all normal, remove core6 and core7 anyway. 23 | - */ 24 | - if (BAD_CPU(cpu_mask, 4) || BAD_CPU(cpu_mask, 5)) 25 | - cpu_mask |= BIT(4) | BIT(5); 26 | - if (BAD_CPU(cpu_mask, 6) || BAD_CPU(cpu_mask, 7)) 27 | - cpu_mask |= BIT(6) | BIT(7); 28 | - 29 | - if (!BAD_CPU(cpu_mask, 4) & !BAD_CPU(cpu_mask, 5) && 30 | - !BAD_CPU(cpu_mask, 6) & !BAD_CPU(cpu_mask, 7)) 31 | - cpu_mask |= BIT(6) | BIT(7); 32 | + if (BAD_CPU(cpu_mask, 4)) 33 | + cpu_mask |= BIT(4); 34 | + if (BAD_CPU(cpu_mask, 5)) 35 | + cpu_mask |= BIT(5); 36 | + if (BAD_CPU(cpu_mask, 6)) 37 | + cpu_mask |= BIT(6); 38 | + if (BAD_CPU(cpu_mask, 7)) 39 | + cpu_mask |= BIT(7); 40 | 41 | fdt_rm_cooling_map(blob, cpu_mask); 42 | fdt_rm_cpu_affinity(blob, cpu_mask); 43 | fdt_rm_cpu(blob, cpu_mask); 44 | } 45 | 46 | -static void rk3582_fdt_rm_gpu(void *blob) 47 | +static void rk3582_fdt_rm_gpu(void *blob, u8 mask) 48 | { 49 | - /* 50 | - * policy: 51 | - * 52 | - * Remove GPU by default. 53 | - */ 54 | - fdt_rm_path(blob, "/gpu@fb000000"); 55 | - fdt_rm_path(blob, "/thermal-zones/soc-thermal/cooling-maps/map3"); 56 | - debug("rm: gpu\n"); 57 | + /* If one core is bad, disable gpu */ 58 | + if (0) 59 | + { 60 | + fdt_rm_path(blob, "/gpu@fb000000"); 61 | + fdt_rm_path(blob, "/thermal-zones/soc-thermal/cooling-maps/map3"); 62 | + debug("rm: gpu\n"); 63 | + } 64 | } 65 | 66 | -static void rk3582_fdt_rm_rkvdec01(void *blob) 67 | +static void rk3582_fdt_rm_rkvdec01(void *blob, u8 mask) 68 | { 69 | - /* 70 | - * policy: 71 | - * 72 | - * Remove rkvdec0 and rkvdec1 by default. 73 | - */ 74 | - fdt_rm_path(blob, "/rkvdec-core@fdc38000"); 75 | - fdt_rm_path(blob, "/iommu@fdc38700"); 76 | - fdt_rm_path(blob, "/rkvdec-core@fdc48000"); 77 | - fdt_rm_path(blob, "/iommu@fdc48700"); 78 | - debug("rm: rkvdec0, rkvdec1\n"); 79 | + /* Only remove bad cores */ 80 | + if (BAD_RKVDEC(mask, 0)) { 81 | + fdt_rm_path(blob, "/rkvdec-core@fdc38000"); 82 | + fdt_rm_path(blob, "/iommu@fdc38700"); 83 | + debug("rm: rkvdec0\n"); 84 | + } 85 | + if (BAD_RKVDEC(mask, 1)) { 86 | + fdt_rm_path(blob, "/rkvdec-core@fdc48000"); 87 | + fdt_rm_path(blob, "/iommu@fdc48700"); 88 | + debug("rm: rkvdec1\n"); 89 | + } 90 | + 91 | + /* If there is bad core, fix multi core related nodes */ 92 | + if (BAD_RKVDEC(mask, 0) || BAD_RKVDEC(mask, 1)) { 93 | + do_fixup_by_path((void *)blob, "/rkvdec-ccu", 94 | + "status", "disabled", sizeof("disabled"), 0); 95 | + 96 | + /* rename node name if the node exist, actually only one exist */ 97 | + fdt_rename_path(blob, "/rkvdec-core@fdc38000", "rkvdec@fdc38000"); 98 | + fdt_rename_path(blob, "/rkvdec-core@fdc48000", "rkvdec@fdc48000"); 99 | + } 100 | } 101 | 102 | static void rk3582_fdt_rm_rkvenc01(void *blob, u8 mask) 103 | @@ -1277,31 +1271,27 @@ static void rk3582_fdt_rm_rkvenc01(void *blob, u8 mask) 104 | * 3. disable '*-ccu' node 105 | * 4. rename '*-core@' node 106 | */ 107 | - if (!BAD_RKVENC(mask, 0) && !BAD_RKVENC(mask, 1)) { 108 | - /* rkvenc1 */ 109 | + if (BAD_RKVENC(mask, 0)) { 110 | + fdt_rm_path(blob, "/rkvenc-core@fdbd0000"); 111 | + fdt_rm_path(blob, "/iommu@fdbdf000"); 112 | + debug("rm: rkvenv0\n"); 113 | + 114 | + } 115 | + if (BAD_RKVENC(mask, 1)) { 116 | fdt_rm_path(blob, "/rkvenc-core@fdbe0000"); 117 | fdt_rm_path(blob, "/iommu@fdbef000"); 118 | debug("rm: rkvenv1\n"); 119 | - } else { 120 | - if (BAD_RKVENC(mask, 0)) { 121 | - fdt_rm_path(blob, "/rkvenc-core@fdbd0000"); 122 | - fdt_rm_path(blob, "/iommu@fdbdf000"); 123 | - debug("rm: rkvenv0\n"); 124 | - 125 | - } 126 | - if (BAD_RKVENC(mask, 1)) { 127 | - fdt_rm_path(blob, "/rkvenc-core@fdbe0000"); 128 | - fdt_rm_path(blob, "/iommu@fdbef000"); 129 | - debug("rm: rkvenv1\n"); 130 | - } 131 | } 132 | 133 | - do_fixup_by_path((void *)blob, "/rkvenc-ccu", 134 | - "status", "disabled", sizeof("disabled"), 0); 135 | + /* If there is bad core, fix multi core related nodes */ 136 | + if (BAD_RKVENC(mask, 0) || BAD_RKVENC(mask, 1)) { 137 | + do_fixup_by_path((void *)blob, "/rkvenc-ccu", 138 | + "status", "disabled", sizeof("disabled"), 0); 139 | 140 | - /* rename node name if the node exist, actually only one exist */ 141 | - fdt_rename_path(blob, "/rkvenc-core@fdbd0000", "rkvenc@fdbd0000"); 142 | - fdt_rename_path(blob, "/rkvenc-core@fdbe0000", "rkvenc@fdbe0000"); 143 | + /* rename node name if the node exist, actually only one exist */ 144 | + fdt_rename_path(blob, "/rkvenc-core@fdbd0000", "rkvenc@fdbd0000"); 145 | + fdt_rename_path(blob, "/rkvenc-core@fdbe0000", "rkvenc@fdbe0000"); 146 | + } 147 | } 148 | 149 | static void rk3583_fdt_rm_rkvdec01(void *blob, u8 mask) 150 | @@ -1352,6 +1342,7 @@ static int fdt_fixup_modules(void *blob) 151 | u8 rkvenc_mask; 152 | u8 rkvdec_mask; 153 | u8 cpu_mask; 154 | + u8 gpu_mask; 155 | int ret; 156 | 157 | ret = uclass_get_device_by_driver(UCLASS_MISC, 158 | @@ -1386,12 +1377,10 @@ static int fdt_fixup_modules(void *blob) 159 | rkvenc_mask = (ip_state[2] & 0x1) | ((ip_state[2] & 0x4) >> 1); 160 | /* ip_state[1]: bit6,7 */ 161 | rkvdec_mask = (ip_state[1] & 0xc0) >> 6; 162 | -#if 0 163 | /* ip_state[1]: bit1~4 */ 164 | gpu_mask = (ip_state[1] & 0x1e) >> 1; 165 | -#endif 166 | debug("hw-mask: 0x%02x, 0x%02x, 0x%02x\n", ip_state[0], ip_state[1], ip_state[2]); 167 | - debug("sw-mask: 0x%02x, 0x%02x, 0x%02x\n", cpu_mask, rkvenc_mask, rkvdec_mask); 168 | + debug("sw-mask: 0x%02x, 0x%02x, 0x%02x, 0x%02x\n", cpu_mask, gpu_mask, rkvenc_mask, rkvdec_mask); 169 | 170 | /* 171 | * FIXUP WARNING! 172 | @@ -1408,8 +1397,8 @@ static int fdt_fixup_modules(void *blob) 173 | * So don't use pattern like "if (rkvenc_mask) then rk3582_fdt_rm_rkvenc01()", 174 | * just go through all of them as this chip is rk3582. 175 | */ 176 | - rk3582_fdt_rm_gpu(blob); 177 | - rk3582_fdt_rm_rkvdec01(blob); 178 | + rk3582_fdt_rm_gpu(blob, gpu_mask); 179 | + rk3582_fdt_rm_rkvdec01(blob, rkvdec_mask); 180 | rk3582_fdt_rm_rkvenc01(blob, rkvenc_mask); 181 | rk3582_fdt_rm_cpus(blob, cpu_mask); 182 | } else if (chip_id[0] == 0x35 && chip_id[1] == 0x83) { 183 | -------------------------------------------------------------------------------- /patch/JP/rk3566-jp-tvbox.dts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2 | /* 3 | * Copyright (c) 2023 tdleiyao 4 | */ 5 | 6 | /dts-v1/; 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include "rk3566.dtsi" 13 | 14 | / { 15 | model = "JP TVbox"; 16 | compatible = "JP-TVbox,rk3566", "rockchip,rk3566"; 17 | 18 | aliases { 19 | ethernet0 = &gmac1; 20 | mmc0 = &sdhci; 21 | mmc1 = &sdmmc1; 22 | }; 23 | 24 | chosen: chosen { 25 | stdout-path = "serial2:1500000n8"; 26 | }; 27 | 28 | hdmi-con { 29 | compatible = "hdmi-connector"; 30 | type = "a"; 31 | 32 | port { 33 | hdmi_con_in: endpoint { 34 | remote-endpoint = <&hdmi_out_con>; 35 | }; 36 | }; 37 | }; 38 | 39 | gmac1_clkin: external-gmac1-clock { 40 | compatible = "fixed-clock"; 41 | clock-frequency = <125000000>; 42 | clock-output-names = "gmac1_clkin"; 43 | #clock-cells = <0>; 44 | }; 45 | 46 | leds { 47 | compatible = "gpio-leds"; 48 | 49 | led_status: led-status { 50 | label = "led-status"; 51 | gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; 52 | linux,default-trigger = "heartbeat"; 53 | pinctrl-names = "default"; 54 | pinctrl-0 = <&led_status_enable_h>; 55 | }; 56 | }; 57 | 58 | vbus: vbus-regulator { 59 | compatible = "regulator-fixed"; 60 | regulator-name = "vbus"; 61 | regulator-always-on; 62 | regulator-boot-on; 63 | regulator-min-microvolt = <5000000>; 64 | regulator-max-microvolt = <5000000>; 65 | }; 66 | 67 | vcc5v0_sys: vcc5v0-sys-regulator { 68 | compatible = "regulator-fixed"; 69 | regulator-name = "vcc5v0_sys"; 70 | regulator-always-on; 71 | regulator-boot-on; 72 | regulator-min-microvolt = <5000000>; 73 | regulator-max-microvolt = <5000000>; 74 | vin-supply = <&vbus>; 75 | }; 76 | 77 | vcc3v3_sys: vcc3v3-sys-regulator { 78 | compatible = "regulator-fixed"; 79 | regulator-name = "vcc3v3_sys"; 80 | regulator-always-on; 81 | regulator-boot-on; 82 | regulator-min-microvolt = <3300000>; 83 | regulator-max-microvolt = <3300000>; 84 | vin-supply = <&vcc5v0_sys>; 85 | }; 86 | 87 | sdio_pwrseq: sdio-pwrseq { 88 | status = "okay"; 89 | compatible = "mmc-pwrseq-simple"; 90 | clocks = <&rk809 1>; 91 | clock-names = "ext_clock"; 92 | pinctrl-names = "default"; 93 | pinctrl-0 = <&wifi_enable_h>; 94 | reset-gpios = <&gpio2 RK_PB1 GPIO_ACTIVE_LOW>; 95 | post-power-on-delay-ms = <100>; 96 | }; 97 | 98 | wireless_wlan: wireless-wlan { 99 | compatible = "wlan-platdata"; 100 | rockchip,grf = <&grf>; 101 | wifi_chip_type = "ap6398s"; 102 | pinctrl-names = "default"; 103 | pinctrl-0 = <&wifi_host_wake_irq>; 104 | WIFI,host_wake_irq = <&gpio2 RK_PB2 GPIO_ACTIVE_HIGH>; 105 | status = "okay"; 106 | }; 107 | 108 | }; 109 | 110 | &combphy1 { 111 | status = "okay"; 112 | }; 113 | 114 | &combphy2 { 115 | status = "okay"; 116 | }; 117 | 118 | &cpu0 { 119 | cpu-supply = <&vdd_cpu>; 120 | }; 121 | 122 | &cpu1 { 123 | cpu-supply = <&vdd_cpu>; 124 | }; 125 | 126 | &cpu2 { 127 | cpu-supply = <&vdd_cpu>; 128 | }; 129 | 130 | &cpu3 { 131 | cpu-supply = <&vdd_cpu>; 132 | }; 133 | 134 | &gpu { 135 | mali-supply = <&vdd_gpu>; 136 | status = "okay"; 137 | }; 138 | 139 | &gmac1 { 140 | assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru SCLK_GMAC1>; 141 | assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru SCLK_GMAC1>, <&gmac1_clkin>; 142 | clock_in_out = "input"; 143 | phy-supply = <&vcc_3v3>; 144 | phy-mode = "rgmii"; 145 | pinctrl-names = "default"; 146 | pinctrl-0 = <&gmac1m0_miim 147 | &gmac1m0_tx_bus2 148 | &gmac1m0_rx_bus2 149 | &gmac1m0_rgmii_clk 150 | &gmac1m0_clkinout 151 | &gmac1m0_rgmii_bus>; 152 | snps,reset-gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>; 153 | snps,reset-active-low; 154 | /* Reset time is 20ms, 100ms for rtl8211f, also works well here */ 155 | snps,reset-delays-us = <0 20000 100000>; 156 | tx_delay = <0x41>; 157 | rx_delay = <0x2e>; 158 | phy-handle = <&rgmii_phy1>; 159 | status = "okay"; 160 | }; 161 | 162 | &mdio1 { 163 | rgmii_phy1: ethernet-phy@0 { 164 | compatible = "ethernet-phy-ieee802.3-c22"; 165 | reg = <0>; 166 | status = "okay"; 167 | }; 168 | }; 169 | 170 | &hdmi { 171 | avdd-0v9-supply = <&vdda0v9_image>; 172 | avdd-1v8-supply = <&vcca1v8_image>; 173 | status = "okay"; 174 | }; 175 | 176 | &hdmi_in { 177 | hdmi_in_vp0: endpoint { 178 | remote-endpoint = <&vp0_out_hdmi>; 179 | }; 180 | }; 181 | 182 | &hdmi_out { 183 | hdmi_out_con: endpoint { 184 | remote-endpoint = <&hdmi_con_in>; 185 | }; 186 | }; 187 | 188 | &hdmi_sound { 189 | status = "okay"; 190 | }; 191 | 192 | &i2c0 { 193 | status = "okay"; 194 | 195 | vdd_cpu: regulator@1c { 196 | compatible = "tcs,tcs4525"; 197 | reg = <0x1c>; 198 | fcs,suspend-voltage-selector = <1>; 199 | regulator-name = "vdd_cpu"; 200 | regulator-min-microvolt = <800000>; 201 | regulator-max-microvolt = <1150000>; 202 | regulator-ramp-delay = <2300>; 203 | regulator-always-on; 204 | regulator-boot-on; 205 | vin-supply = <&vcc5v0_sys>; 206 | 207 | regulator-state-mem { 208 | regulator-off-in-suspend; 209 | }; 210 | }; 211 | 212 | rk809: pmic@20 { 213 | compatible = "rockchip,rk809"; 214 | reg = <0x20>; 215 | interrupt-parent = <&gpio0>; 216 | interrupts = ; 217 | #clock-cells = <1>; 218 | clock-output-names = "rk808-clkout1", "rk808-clkout2"; 219 | pinctrl-names = "default"; 220 | pinctrl-0 = <&pmic_int_l>; 221 | rockchip,system-power-controller; 222 | wakeup-source; 223 | 224 | vcc1-supply = <&vcc3v3_sys>; 225 | vcc2-supply = <&vcc3v3_sys>; 226 | vcc3-supply = <&vcc3v3_sys>; 227 | vcc4-supply = <&vcc3v3_sys>; 228 | vcc5-supply = <&vcc3v3_sys>; 229 | vcc6-supply = <&vcc3v3_sys>; 230 | vcc7-supply = <&vcc3v3_sys>; 231 | vcc8-supply = <&vcc3v3_sys>; 232 | vcc9-supply = <&vcc3v3_sys>; 233 | 234 | regulators { 235 | vdd_logic: DCDC_REG1 { 236 | regulator-name = "vdd_logic"; 237 | regulator-always-on; 238 | regulator-boot-on; 239 | regulator-min-microvolt = <500000>; 240 | regulator-max-microvolt = <1350000>; 241 | regulator-init-microvolt = <900000>; 242 | regulator-ramp-delay = <6001>; 243 | regulator-initial-mode = <0x2>; 244 | regulator-state-mem { 245 | regulator-off-in-suspend; 246 | }; 247 | }; 248 | 249 | vdd_gpu: DCDC_REG2 { 250 | regulator-name = "vdd_gpu"; 251 | regulator-always-on; 252 | regulator-boot-on; 253 | regulator-min-microvolt = <500000>; 254 | regulator-max-microvolt = <1350000>; 255 | regulator-init-microvolt = <900000>; 256 | regulator-ramp-delay = <6001>; 257 | regulator-initial-mode = <0x2>; 258 | regulator-state-mem { 259 | regulator-off-in-suspend; 260 | }; 261 | }; 262 | 263 | vcc_ddr: DCDC_REG3 { 264 | regulator-always-on; 265 | regulator-boot-on; 266 | regulator-initial-mode = <0x2>; 267 | regulator-name = "vcc_ddr"; 268 | regulator-state-mem { 269 | regulator-on-in-suspend; 270 | }; 271 | }; 272 | 273 | vdd_npu: DCDC_REG4 { 274 | regulator-always-on; 275 | regulator-boot-on; 276 | regulator-min-microvolt = <500000>; 277 | regulator-max-microvolt = <1350000>; 278 | regulator-init-microvolt = <900000>; 279 | regulator-initial-mode = <0x2>; 280 | regulator-name = "vdd_npu"; 281 | regulator-state-mem { 282 | regulator-off-in-suspend; 283 | }; 284 | }; 285 | 286 | vcc_1v8: DCDC_REG5 { 287 | regulator-name = "vcc_1v8"; 288 | regulator-always-on; 289 | regulator-boot-on; 290 | regulator-min-microvolt = <1800000>; 291 | regulator-max-microvolt = <1800000>; 292 | regulator-state-mem { 293 | regulator-off-in-suspend; 294 | }; 295 | }; 296 | 297 | vdda0v9_image: LDO_REG1 { 298 | regulator-always-on; 299 | regulator-boot-on; 300 | regulator-min-microvolt = <900000>; 301 | regulator-max-microvolt = <900000>; 302 | regulator-name = "vdda0v9_image"; 303 | regulator-state-mem { 304 | regulator-off-in-suspend; 305 | }; 306 | }; 307 | 308 | vdda_0v9: LDO_REG2 { 309 | regulator-always-on; 310 | regulator-boot-on; 311 | regulator-min-microvolt = <900000>; 312 | regulator-max-microvolt = <900000>; 313 | regulator-name = "vdda_0v9"; 314 | regulator-state-mem { 315 | regulator-off-in-suspend; 316 | }; 317 | }; 318 | 319 | vdda0v9_pmu: LDO_REG3 { 320 | regulator-always-on; 321 | regulator-boot-on; 322 | regulator-min-microvolt = <900000>; 323 | regulator-max-microvolt = <900000>; 324 | regulator-name = "vdda0v9_pmu"; 325 | regulator-state-mem { 326 | regulator-on-in-suspend; 327 | regulator-suspend-microvolt = <900000>; 328 | }; 329 | }; 330 | 331 | vccio_acodec: LDO_REG4 { 332 | regulator-always-on; 333 | regulator-boot-on; 334 | regulator-min-microvolt = <3300000>; 335 | regulator-max-microvolt = <3300000>; 336 | regulator-name = "vccio_acodec"; 337 | regulator-state-mem { 338 | regulator-off-in-suspend; 339 | }; 340 | }; 341 | 342 | vccio_sd: LDO_REG5 { 343 | regulator-always-on; 344 | regulator-boot-on; 345 | regulator-min-microvolt = <1800000>; 346 | regulator-max-microvolt = <3300000>; 347 | regulator-name = "vccio_sd"; 348 | regulator-state-mem { 349 | regulator-off-in-suspend; 350 | }; 351 | }; 352 | 353 | vcc3v3_pmu: LDO_REG6 { 354 | regulator-always-on; 355 | regulator-boot-on; 356 | regulator-min-microvolt = <3300000>; 357 | regulator-max-microvolt = <3300000>; 358 | regulator-name = "vcc3v3_pmu"; 359 | regulator-state-mem { 360 | regulator-on-in-suspend; 361 | regulator-suspend-microvolt = <3300000>; 362 | }; 363 | }; 364 | 365 | vcca_1v8: LDO_REG7 { 366 | regulator-always-on; 367 | regulator-boot-on; 368 | regulator-min-microvolt = <1800000>; 369 | regulator-max-microvolt = <1800000>; 370 | regulator-name = "vcca_1v8"; 371 | regulator-state-mem { 372 | regulator-off-in-suspend; 373 | }; 374 | }; 375 | 376 | vcca1v8_pmu: LDO_REG8 { 377 | regulator-always-on; 378 | regulator-boot-on; 379 | regulator-min-microvolt = <1800000>; 380 | regulator-max-microvolt = <1800000>; 381 | regulator-name = "vcca1v8_pmu"; 382 | regulator-state-mem { 383 | regulator-on-in-suspend; 384 | regulator-suspend-microvolt = <1800000>; 385 | }; 386 | }; 387 | 388 | vcca1v8_image: LDO_REG9 { 389 | regulator-always-on; 390 | regulator-boot-on; 391 | regulator-min-microvolt = <1800000>; 392 | regulator-max-microvolt = <1800000>; 393 | regulator-name = "vcca1v8_image"; 394 | regulator-state-mem { 395 | regulator-off-in-suspend; 396 | }; 397 | }; 398 | 399 | vcc_3v3: SWITCH_REG1 { 400 | regulator-name = "vcc_3v3"; 401 | regulator-state-mem { 402 | regulator-off-in-suspend; 403 | }; 404 | }; 405 | 406 | vcc3v3_sd: SWITCH_REG2 { 407 | regulator-name = "vcc3v3_sd"; 408 | regulator-state-mem { 409 | regulator-off-in-suspend; 410 | }; 411 | }; 412 | 413 | }; 414 | }; 415 | }; 416 | 417 | &pinctrl { 418 | 419 | pmic { 420 | pmic_int_l: pmic-int-l { 421 | rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; 422 | }; 423 | }; 424 | 425 | sdio-pwrseq { 426 | wifi_enable_h: wifi-enable-h { 427 | rockchip,pins = <2 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; 428 | }; 429 | }; 430 | 431 | wireless-wlan { 432 | wifi_host_wake_irq: wifi-host-wake-irq { 433 | rockchip,pins = <2 RK_PB2 RK_FUNC_GPIO &pcfg_pull_down>; 434 | }; 435 | }; 436 | 437 | bt { 438 | bt_enable_h: bt-enable-h { 439 | rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; 440 | }; 441 | 442 | bt_host_wake_l: bt-host-wake-l { 443 | rockchip,pins = <2 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>; 444 | }; 445 | 446 | bt_wake_l: bt-wake-l { 447 | rockchip,pins = <2 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; 448 | }; 449 | }; 450 | 451 | leds { 452 | led_status_enable_h: led-status-enable-h { 453 | rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>; 454 | }; 455 | }; 456 | }; 457 | 458 | &cpu0_opp_table { 459 | opp-1992000000 { 460 | opp-hz = /bits/ 64 <1992000000>; 461 | opp-microvolt = <1150000 1150000 1150000>; 462 | }; 463 | }; 464 | 465 | &pmu_io_domains { 466 | pmuio1-supply = <&vcc3v3_pmu>; 467 | pmuio2-supply = <&vcc3v3_pmu>; 468 | vccio1-supply = <&vccio_acodec>; 469 | vccio3-supply = <&vccio_sd>; 470 | vccio4-supply = <&vcc_1v8>; 471 | vccio5-supply = <&vcc_3v3>; 472 | vccio6-supply = <&vcc_1v8>; 473 | vccio7-supply = <&vcc_3v3>; 474 | status = "okay"; 475 | }; 476 | 477 | &saradc { 478 | vref-supply = <&vcca_1v8>; 479 | status = "okay"; 480 | }; 481 | 482 | &sata2 { 483 | status = "okay"; 484 | }; 485 | 486 | &sdhci { 487 | bus-width = <8>; 488 | mmc-hs200-1_8v; 489 | non-removable; 490 | vmmc-supply = <&vcc_3v3>; 491 | vqmmc-supply = <&vcc_1v8>; 492 | status = "okay"; 493 | }; 494 | 495 | &sdmmc1 { 496 | supports-sdio; 497 | bus-width = <4>; 498 | disable-wp; 499 | cap-sd-highspeed; 500 | cap-sdio-irq; 501 | keep-power-in-suspend; 502 | pinctrl-names = "default"; 503 | pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>; 504 | non-removable; 505 | mmc-pwrseq = <&sdio_pwrseq>; 506 | status = "okay"; 507 | 508 | }; 509 | 510 | &tsadc { 511 | status = "okay"; 512 | }; 513 | 514 | &uart1 { 515 | pinctrl-names = "default"; 516 | pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn &uart1m0_rtsn>; 517 | status = "okay"; 518 | 519 | bluetooth { 520 | compatible = "brcm,bcm43438-bt"; 521 | clocks = <&rk809 1>; 522 | clock-names = "lpo"; 523 | device-wakeup-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>; 524 | host-wakeup-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>; 525 | shutdown-gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>; 526 | max-speed = <1500000>; 527 | pinctrl-names = "default"; 528 | pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>; 529 | vbat-supply = <&vcc3v3_sys>; 530 | vddio-supply = <&vcca1v8_pmu>; 531 | }; 532 | }; 533 | 534 | &uart2 { 535 | status = "okay"; 536 | }; 537 | 538 | &usb_host0_xhci { 539 | dr_mode = "host"; 540 | status = "okay"; 541 | }; 542 | 543 | &usb2phy0 { 544 | status = "okay"; 545 | }; 546 | 547 | &usb2phy0_host { 548 | status = "okay"; 549 | }; 550 | 551 | &usb2phy0_otg { 552 | status = "okay"; 553 | }; 554 | 555 | &usb_host1_xhci { 556 | status = "okay"; 557 | }; 558 | 559 | &usb2phy1 { 560 | status = "okay"; 561 | }; 562 | 563 | &usb2phy1_host { 564 | status = "okay"; 565 | }; 566 | 567 | &usb2phy1_otg { 568 | status = "okay"; 569 | }; 570 | 571 | &vop { 572 | assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>; 573 | assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>; 574 | status = "okay"; 575 | }; 576 | 577 | &vop_mmu { 578 | status = "okay"; 579 | }; 580 | 581 | &vp0 { 582 | vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { 583 | reg = ; 584 | remote-endpoint = <&hdmi_in_vp0>; 585 | }; 586 | }; 587 | -------------------------------------------------------------------------------- /patch/N1/fix-n1-1.patch: -------------------------------------------------------------------------------- 1 | --- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts 2 | +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts 3 | @@ -84,7 +84,7 @@ 4 | reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>; 5 | 6 | interrupt-parent = <&gpio_intc>; 7 | - interrupts = <29 IRQ_TYPE_LEVEL_LOW>; 8 | + interrupts = <25 IRQ_TYPE_LEVEL_LOW>; 9 | eee-broken-1000t; 10 | }; 11 | }; 12 | -------------------------------------------------------------------------------- /patch/N1/fix-n1-2.patch: -------------------------------------------------------------------------------- 1 | --- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-phicomm-n1.dts 2 | +++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-phicomm-n1.dts 3 | @@ -24,6 +24,25 @@ 4 | default-state = "on"; 5 | }; 6 | }; 7 | + 8 | + dc_in: regulator-vcc_12v { 9 | + compatible = "regulator-fixed"; 10 | + regulator-name = "VCC_12V"; 11 | + regulator-min-microvolt = <12000000>; 12 | + regulator-max-microvolt = <12000000>; 13 | + regulator-boot-on; 14 | + regulator-always-on; 15 | + }; 16 | + 17 | + vddgpu: regulator-vddgpu { 18 | + compatible = "regulator-fixed"; 19 | + regulator-name = "mali"; 20 | + regulator-min-microvolt = <950000>; 21 | + regulator-max-microvolt = <950000>; 22 | + vin-supply = <&dc_in>; 23 | + regulator-boot-on; 24 | + regulator-always-on; 25 | + }; 26 | }; 27 | 28 | &cvbs_vdac_port { 29 | @@ -33,3 +52,37 @@ 30 | &usb { 31 | dr_mode = "host"; 32 | }; 33 | + 34 | +&sd_emmc_a { 35 | + max-frequency = <100000000>; 36 | + sd-uhs-sdr50; 37 | + //max-frequency = <200000000>; 38 | + //sd-uhs-sdr104; 39 | + //max-frequency = <50000000>; 40 | + //sd-uhs-ddr50; 41 | +}; 42 | + 43 | +&sd_emmc_b { 44 | + status = "disabled"; 45 | +}; 46 | + 47 | +ðmac { 48 | + snps,aal; 49 | + snps,txpbl = <0x8>; 50 | + snps,rxpbl = <0x8>; 51 | +}; 52 | + 53 | +&uart_A { 54 | + status = "okay"; 55 | + pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>; 56 | + pinctrl-names = "default"; 57 | + uart-has-rtscts; 58 | + 59 | + bluetooth { 60 | + compatible = "brcm,bcm43438-bt"; 61 | + shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; 62 | + max-speed = <2000000>; 63 | + clocks = <&wifi32k>; 64 | + clock-names = "lpo"; 65 | + }; 66 | +}; 67 | -------------------------------------------------------------------------------- /patch/N1/u-boot.ext: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zane-E/Armbian-Actions/60a75811b6aa39ce121dad0475c2a94cf43b2a50/patch/N1/u-boot.ext -------------------------------------------------------------------------------- /patch/T4/fix-CPU-information.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Christian Hewitt 3 | Date: Sat, 13 Apr 2019 05:45:18 +0000 4 | Subject: HACK: arm64: fix Kodi sysinfo CPU information 5 | 6 | This allows the CPU information to show in the Kodi sysinfo screen, e.g. 7 | 8 | "ARMv8 Processor rev 4 (v81)" on Amlogic devices 9 | 10 | Signed-off-by: Christian Hewitt 11 | --- 12 | arch/arm64/kernel/cpuinfo.c | 3 +-- 13 | 1 file changed, 1 insertion(+), 2 deletions(-) 14 | 15 | diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c 16 | index 47043c0d95ec..03410a9fac77 100644 17 | --- a/arch/arm64/kernel/cpuinfo.c 18 | +++ b/arch/arm64/kernel/cpuinfo.c 19 | @@ -190,8 +190,7 @@ static int c_show(struct seq_file *m, void *v) 20 | * "processor". Give glibc what it expects. 21 | */ 22 | seq_printf(m, "processor\t: %d\n", i); 23 | - if (compat) 24 | - seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n", 25 | + seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n", 26 | MIDR_REVISION(midr), COMPAT_ELF_PLATFORM); 27 | 28 | seq_printf(m, "BogoMIPS\t: %lu.%02lu\n", 29 | -- 30 | Armbian 31 | 32 | -------------------------------------------------------------------------------- /patch/T4/t4.patch: -------------------------------------------------------------------------------- 1 | --- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi 2 | +++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi 3 | @@ -13,7 +13,7 @@ 4 | 5 | /dts-v1/; 6 | #include 7 | -#include "rk3399.dtsi" 8 | +#include "rk3399-op1.dtsi" 9 | 10 | / { 11 | aliases { 12 | 13 | --- a/arch/arm64/boot/dts/rockchip/rk3399-base.dtsi 14 | +++ b/arch/arm64/boot/dts/rockchip/rk3399-base.dtsi 15 | @@ -312,7 +312,7 @@ 16 | <0 0 0 2 &pcie0_intc 1>, 17 | <0 0 0 3 &pcie0_intc 2>, 18 | <0 0 0 4 &pcie0_intc 3>; 19 | - max-link-speed = <1>; 20 | + max-link-speed = <2>; 21 | msi-map = <0x0 &its 0x0 0x1000>; 22 | phys = <&pcie_phy 0>, <&pcie_phy 1>, 23 | <&pcie_phy 2>, <&pcie_phy 3>; 24 | 25 | --- a/arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dts 26 | +++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopc-t4.dts 27 | @@ -59,7 +59,7 @@ 28 | * With 20KHz PWM and an EVERCOOL EC4007H12SA fan, these levels 29 | * work out to 0, ~1200, ~3000, and 5000RPM respectively. 30 | */ 31 | - cooling-levels = <0 12 18 255>; 32 | + cooling-levels = <0 18 24 255>; 33 | #cooling-cells = <2>; 34 | fan-supply = <&vcc12v0_sys>; 35 | pwms = <&pwm1 0 50000 0>; 36 | @@ -69,7 +69,7 @@ 37 | &cpu_thermal { 38 | trips { 39 | cpu_warm: cpu_warm { 40 | - temperature = <55000>; 41 | + temperature = <45000>; 42 | hysteresis = <2000>; 43 | type = "active"; 44 | }; -------------------------------------------------------------------------------- /patch/X2/dt/rk3566-panther-x2.dts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2 | /* 3 | * Copyright (c) 2023 hiasia 4 | */ 5 | 6 | /dts-v1/; 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #ifdef DTS_NO_LEGACY 13 | #include 14 | #else 15 | #include 16 | #endif 17 | #include "rk3566.dtsi" 18 | 19 | / { 20 | model = "Panther X2"; 21 | compatible = "panther,x2", "rockchip,rk3566"; 22 | 23 | aliases { 24 | ethernet0 = &gmac1; 25 | mmc0 = &sdhci; 26 | mmc1 = &sdmmc0; 27 | mmc2 = &sdmmc1; 28 | }; 29 | 30 | chosen: chosen { 31 | bootargs = "earlycon=uart8250,mmio32,0xfe660000 console=ttyS2,1500000"; 32 | }; 33 | 34 | gmac1_clkin: external-gmac1-clock { 35 | compatible = "fixed-clock"; 36 | clock-frequency = <125000000>; 37 | clock-output-names = "gmac1_clkin"; 38 | #clock-cells = <0>; 39 | }; 40 | 41 | leds { 42 | compatible = "gpio-leds"; 43 | 44 | led_pwr: led-pwr { 45 | label = "led-pwr"; 46 | default-state = "on"; 47 | gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; 48 | pinctrl-names = "default"; 49 | pinctrl-0 = <&led_pwr_enable_h>; 50 | retain-state-suspended; 51 | status = "okay"; 52 | }; 53 | 54 | led_wifi: led-wifi { 55 | label = "led-wifi"; 56 | default-state = "off"; 57 | gpios = <&gpio0 RK_PD6 GPIO_ACTIVE_HIGH>; 58 | pinctrl-names = "default"; 59 | pinctrl-0 = <&led_wifi_enable_h>; 60 | retain-state-suspended; 61 | status = "okay"; 62 | }; 63 | 64 | led_eth: led-eth { 65 | label = "led-eth"; 66 | default-state = "off"; 67 | gpios = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>; 68 | pinctrl-names = "default"; 69 | pinctrl-0 = <&led_eth_enable_h>; 70 | retain-state-suspended; 71 | status = "okay"; 72 | }; 73 | 74 | led_status: led-status { 75 | label = "led-status"; 76 | default-state = "on"; 77 | gpios = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>; 78 | linux,default-trigger = "heartbeat"; 79 | pinctrl-names = "default"; 80 | pinctrl-0 = <&led_status_enable_h>; 81 | retain-state-suspended; 82 | status = "okay"; 83 | }; 84 | }; 85 | 86 | dc_12v: dc-12v { 87 | compatible = "regulator-fixed"; 88 | regulator-name = "dc_12v"; 89 | regulator-always-on; 90 | regulator-boot-on; 91 | regulator-min-microvolt = <12000000>; 92 | regulator-max-microvolt = <12000000>; 93 | }; 94 | 95 | vcc5v0_sys: vcc5v0-sys { 96 | compatible = "regulator-fixed"; 97 | regulator-name = "vcc5v0_sys"; 98 | regulator-always-on; 99 | regulator-boot-on; 100 | regulator-min-microvolt = <5000000>; 101 | regulator-max-microvolt = <5000000>; 102 | vin-supply = <&dc_12v>; 103 | }; 104 | 105 | vcc3v3_sys: vcc3v3-sys { 106 | compatible = "regulator-fixed"; 107 | regulator-name = "vcc3v3_sys"; 108 | regulator-always-on; 109 | regulator-boot-on; 110 | regulator-min-microvolt = <3300000>; 111 | regulator-max-microvolt = <3300000>; 112 | vin-supply = <&vcc5v0_sys>; 113 | }; 114 | 115 | sdio_pwrseq: sdio-pwrseq { 116 | status = "okay"; 117 | compatible = "mmc-pwrseq-simple"; 118 | clocks = <&rk809 1>; 119 | clock-names = "ext_clock"; 120 | pinctrl-names = "default"; 121 | pinctrl-0 = <&wifi_enable_h>; 122 | reset-gpios = <&gpio2 RK_PB1 GPIO_ACTIVE_LOW>; 123 | post-power-on-delay-ms = <100>; 124 | }; 125 | 126 | wireless_wlan: wireless-wlan { 127 | compatible = "wlan-platdata"; 128 | rockchip,grf = <&grf>; 129 | wifi_chip_type = "ap6236"; 130 | pinctrl-names = "default"; 131 | pinctrl-0 = <&wifi_host_wake_irq>; 132 | WIFI,host_wake_irq = <&gpio2 RK_PB2 GPIO_ACTIVE_HIGH>; 133 | status = "okay"; 134 | }; 135 | 136 | }; 137 | 138 | &cpu0 { 139 | cpu-supply = <&vdd_cpu>; 140 | }; 141 | 142 | &cpu1 { 143 | cpu-supply = <&vdd_cpu>; 144 | }; 145 | 146 | &cpu2 { 147 | cpu-supply = <&vdd_cpu>; 148 | }; 149 | 150 | &cpu3 { 151 | cpu-supply = <&vdd_cpu>; 152 | }; 153 | 154 | &dfi { 155 | status = "okay"; 156 | }; 157 | 158 | &dmc { 159 | center-supply = <&vdd_logic>; 160 | status = "okay"; 161 | }; 162 | 163 | &gpu { 164 | mali-supply = <&vdd_gpu>; 165 | status = "okay"; 166 | }; 167 | 168 | &gmac1 { 169 | assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru SCLK_GMAC1>; 170 | assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru SCLK_GMAC1>, <&gmac1_clkin>; 171 | clock_in_out = "input"; 172 | phy-supply = <&vcc_3v3>; 173 | phy-mode = "rgmii"; 174 | pinctrl-names = "default"; 175 | pinctrl-0 = <&gmac1m0_miim 176 | &gmac1m0_tx_bus2 177 | &gmac1m0_rx_bus2 178 | &gmac1m0_rgmii_clk 179 | &gmac1m0_clkinout 180 | &gmac1m0_rgmii_bus>; 181 | snps,reset-gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>; 182 | snps,reset-active-low; 183 | /* Reset time is 20ms, 100ms for rtl8211f, also works well here */ 184 | snps,reset-delays-us = <0 20000 100000>; 185 | tx_delay = <0x30>; 186 | rx_delay = <0x10>; 187 | phy-handle = <&rgmii_phy1>; 188 | status = "okay"; 189 | }; 190 | 191 | &mdio1 { 192 | rgmii_phy1: ethernet-phy@1 { 193 | compatible = "ethernet-phy-ieee802.3-c22"; 194 | reg = <0x1>; 195 | status = "okay"; 196 | }; 197 | }; 198 | 199 | &i2c0 { 200 | status = "okay"; 201 | 202 | vdd_cpu: regulator@1c { 203 | compatible = "tcs,tcs4525"; 204 | reg = <0x1c>; 205 | fcs,suspend-voltage-selector = <1>; 206 | regulator-name = "vdd_cpu"; 207 | regulator-min-microvolt = <800000>; 208 | regulator-max-microvolt = <1150000>; 209 | regulator-ramp-delay = <2300>; 210 | regulator-always-on; 211 | regulator-boot-on; 212 | vin-supply = <&vcc5v0_sys>; 213 | 214 | regulator-state-mem { 215 | regulator-off-in-suspend; 216 | }; 217 | }; 218 | 219 | rk809: pmic@20 { 220 | compatible = "rockchip,rk809"; 221 | reg = <0x20>; 222 | interrupt-parent = <&gpio0>; 223 | interrupts = ; 224 | #clock-cells = <1>; 225 | clock-output-names = "rk808-clkout1", "rk808-clkout2"; 226 | pinctrl-names = "default"; 227 | pinctrl-0 = <&pmic_int_l>; 228 | rockchip,system-power-controller; 229 | wakeup-source; 230 | 231 | vcc1-supply = <&vcc3v3_sys>; 232 | vcc2-supply = <&vcc3v3_sys>; 233 | vcc3-supply = <&vcc3v3_sys>; 234 | vcc4-supply = <&vcc3v3_sys>; 235 | vcc5-supply = <&vcc3v3_sys>; 236 | vcc6-supply = <&vcc3v3_sys>; 237 | vcc7-supply = <&vcc3v3_sys>; 238 | vcc8-supply = <&vcc3v3_sys>; 239 | vcc9-supply = <&vcc3v3_sys>; 240 | 241 | regulators { 242 | vdd_logic: DCDC_REG1 { 243 | regulator-name = "vdd_logic"; 244 | regulator-always-on; 245 | regulator-boot-on; 246 | regulator-min-microvolt = <500000>; 247 | regulator-max-microvolt = <1350000>; 248 | regulator-init-microvolt = <900000>; 249 | regulator-ramp-delay = <6001>; 250 | regulator-initial-mode = <0x2>; 251 | 252 | regulator-state-mem { 253 | regulator-on-in-suspend; 254 | regulator-suspend-microvolt = <900000>; 255 | }; 256 | }; 257 | 258 | vdd_gpu: DCDC_REG2 { 259 | regulator-name = "vdd_gpu"; 260 | regulator-always-on; 261 | regulator-boot-on; 262 | regulator-min-microvolt = <500000>; 263 | regulator-max-microvolt = <1350000>; 264 | regulator-init-microvolt = <900000>; 265 | regulator-ramp-delay = <6001>; 266 | regulator-initial-mode = <0x2>; 267 | 268 | regulator-state-mem { 269 | regulator-off-in-suspend; 270 | }; 271 | }; 272 | 273 | vcc_ddr: DCDC_REG3 { 274 | regulator-always-on; 275 | regulator-boot-on; 276 | regulator-initial-mode = <0x2>; 277 | regulator-name = "vcc_ddr"; 278 | 279 | regulator-state-mem { 280 | regulator-on-in-suspend; 281 | }; 282 | }; 283 | 284 | vdd_npu: DCDC_REG4 { 285 | regulator-always-on; 286 | regulator-boot-on; 287 | regulator-min-microvolt = <500000>; 288 | regulator-max-microvolt = <1350000>; 289 | regulator-init-microvolt = <900000>; 290 | regulator-initial-mode = <0x2>; 291 | regulator-name = "vdd_npu"; 292 | 293 | regulator-state-mem { 294 | regulator-off-in-suspend; 295 | }; 296 | }; 297 | 298 | vcc_1v8: DCDC_REG5 { 299 | regulator-name = "vcc_1v8"; 300 | regulator-always-on; 301 | regulator-boot-on; 302 | regulator-min-microvolt = <1800000>; 303 | regulator-max-microvolt = <1800000>; 304 | 305 | regulator-state-mem { 306 | regulator-on-in-suspend; 307 | regulator-suspend-microvolt = <1800000>; 308 | }; 309 | }; 310 | 311 | vdda0v9_image: LDO_REG1 { 312 | regulator-always-on; 313 | regulator-boot-on; 314 | regulator-min-microvolt = <900000>; 315 | regulator-max-microvolt = <900000>; 316 | regulator-name = "vdda0v9_image"; 317 | 318 | regulator-state-mem { 319 | regulator-on-in-suspend; 320 | regulator-suspend-microvolt = <900000>; 321 | }; 322 | }; 323 | 324 | vdda_0v9: LDO_REG2 { 325 | regulator-always-on; 326 | regulator-boot-on; 327 | regulator-min-microvolt = <900000>; 328 | regulator-max-microvolt = <900000>; 329 | regulator-name = "vdda_0v9"; 330 | 331 | regulator-state-mem { 332 | regulator-off-in-suspend; 333 | }; 334 | }; 335 | 336 | vdda0v9_pmu: LDO_REG3 { 337 | regulator-always-on; 338 | regulator-boot-on; 339 | regulator-min-microvolt = <900000>; 340 | regulator-max-microvolt = <900000>; 341 | regulator-name = "vdda0v9_pmu"; 342 | 343 | regulator-state-mem { 344 | regulator-on-in-suspend; 345 | regulator-suspend-microvolt = <900000>; 346 | }; 347 | }; 348 | 349 | vccio_acodec: LDO_REG4 { 350 | regulator-always-on; 351 | regulator-boot-on; 352 | regulator-min-microvolt = <3300000>; 353 | regulator-max-microvolt = <3300000>; 354 | regulator-name = "vccio_acodec"; 355 | 356 | regulator-state-mem { 357 | regulator-off-in-suspend; 358 | }; 359 | }; 360 | 361 | vccio_sd: LDO_REG5 { 362 | regulator-always-on; 363 | regulator-boot-on; 364 | regulator-min-microvolt = <1800000>; 365 | regulator-max-microvolt = <3300000>; 366 | regulator-name = "vccio_sd"; 367 | 368 | regulator-state-mem { 369 | regulator-on-in-suspend; 370 | }; 371 | }; 372 | 373 | vcc3v3_pmu: LDO_REG6 { 374 | regulator-always-on; 375 | regulator-boot-on; 376 | regulator-min-microvolt = <3300000>; 377 | regulator-max-microvolt = <3300000>; 378 | regulator-name = "vcc3v3_pmu"; 379 | 380 | regulator-state-mem { 381 | regulator-on-in-suspend; 382 | regulator-suspend-microvolt = <3300000>; 383 | }; 384 | }; 385 | 386 | vcca_1v8: LDO_REG7 { 387 | regulator-always-on; 388 | regulator-boot-on; 389 | regulator-min-microvolt = <1800000>; 390 | regulator-max-microvolt = <1800000>; 391 | regulator-name = "vcca_1v8"; 392 | 393 | regulator-state-mem { 394 | regulator-off-in-suspend; 395 | }; 396 | }; 397 | 398 | vcca1v8_pmu: LDO_REG8 { 399 | regulator-always-on; 400 | regulator-boot-on; 401 | regulator-min-microvolt = <1800000>; 402 | regulator-max-microvolt = <1800000>; 403 | regulator-name = "vcca1v8_pmu"; 404 | 405 | regulator-state-mem { 406 | regulator-off-in-suspend; 407 | }; 408 | }; 409 | 410 | vcca1v8_image: LDO_REG9 { 411 | regulator-always-on; 412 | regulator-boot-on; 413 | regulator-min-microvolt = <1800000>; 414 | regulator-max-microvolt = <1800000>; 415 | regulator-name = "vcca1v8_image"; 416 | 417 | regulator-state-mem { 418 | regulator-off-in-suspend; 419 | }; 420 | }; 421 | 422 | vcc_3v3: SWITCH_REG1 { 423 | regulator-always-on; 424 | regulator-boot-on; 425 | regulator-name = "vcc_3v3"; 426 | 427 | regulator-state-mem { 428 | regulator-off-in-suspend; 429 | }; 430 | }; 431 | 432 | vcc3v3_sd: SWITCH_REG2 { 433 | regulator-always-on; 434 | regulator-boot-on; 435 | regulator-name = "vcc3v3_sd"; 436 | 437 | regulator-state-mem { 438 | regulator-on-in-suspend; 439 | }; 440 | }; 441 | 442 | }; 443 | }; 444 | }; 445 | 446 | &i2s1_8ch { 447 | pinctrl-names = "default"; 448 | pinctrl-0 = <&i2s1m1_sclktx &i2s1m1_sclkrx 449 | &i2s1m1_lrcktx &i2s1m1_lrckrx 450 | &i2s1m1_sdi0 &i2s1m1_sdi1 451 | &i2s1m1_sdi2 &i2s1m1_sdi3 452 | &i2s1m1_sdo0 &i2s1m1_sdo1 453 | &i2s1m1_sdo2 &i2s1m1_sdo3>; 454 | status = "disabled"; 455 | }; 456 | 457 | &pinctrl { 458 | 459 | sdio-pwrseq { 460 | wifi_enable_h: wifi-enable-h { 461 | rockchip,pins = <2 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; 462 | }; 463 | }; 464 | 465 | wireless-wlan { 466 | wifi_host_wake_irq: wifi-host-wake-irq { 467 | rockchip,pins = <2 RK_PB2 RK_FUNC_GPIO &pcfg_pull_down>; 468 | }; 469 | }; 470 | 471 | bt { 472 | bt_enable_h: bt-enable-h { 473 | rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; 474 | }; 475 | 476 | bt_host_wake_l: bt-host-wake-l { 477 | rockchip,pins = <2 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>; 478 | }; 479 | 480 | bt_wake_l: bt-wake-l { 481 | rockchip,pins = <2 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; 482 | }; 483 | }; 484 | 485 | leds { 486 | led_pwr_enable_h: led-pwr-enable-h { 487 | rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>; 488 | }; 489 | 490 | led_wifi_enable_h: led-wifi-enable-h { 491 | rockchip,pins = <0 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>; 492 | }; 493 | 494 | led_eth_enable_h: led-eth-enable-h { 495 | rockchip,pins = <0 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>; 496 | }; 497 | 498 | led_status_enable_h: led-status-enable-h { 499 | rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>; 500 | }; 501 | }; 502 | 503 | pmic { 504 | pmic_int_l: pmic-int-l { 505 | rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; 506 | }; 507 | }; 508 | }; 509 | 510 | &cpu0_opp_table { 511 | opp-1992000000 { 512 | opp-supported-hw = <0xf9 0xffff>; 513 | opp-hz = /bits/ 64 <1992000000>; 514 | opp-microvolt = <1150000 1150000 1150000>; 515 | opp-microvolt-L0 = <1150000 1150000 1150000>; 516 | opp-microvolt-L1 = <1150000 1150000 1150000>; 517 | opp-microvolt-L2 = <1125000 1125000 1150000>; 518 | opp-microvolt-L3 = <1100000 1100000 1150000>; 519 | clock-latency-ns = <40000>; 520 | }; 521 | 522 | /* RK3568J cpu OPPs */ 523 | opp-j-1008000000 { 524 | opp-supported-hw = <0x04 0xffff>; 525 | opp-hz = /bits/ 64 <1008000000>; 526 | opp-microvolt = <850000 850000 1150000>; 527 | clock-latency-ns = <40000>; 528 | }; 529 | 530 | opp-j-1416000000 { 531 | opp-supported-hw = <0x04 0xffff>; 532 | opp-hz = /bits/ 64 <1416000000>; 533 | opp-microvolt = <900000 900000 1150000>; 534 | clock-latency-ns = <40000>; 535 | }; 536 | 537 | /* RK3568M cpu OPPs */ 538 | opp-m-1608000000 { 539 | opp-supported-hw = <0x02 0xffff>; 540 | opp-hz = /bits/ 64 <1608000000>; 541 | opp-microvolt = <1000000 1000000 1150000>; 542 | clock-latency-ns = <40000>; 543 | }; 544 | }; 545 | 546 | &pmu_io_domains { 547 | pmuio1-supply = <&vcc3v3_pmu>; 548 | pmuio2-supply = <&vcc3v3_pmu>; 549 | vccio1-supply = <&vcc_3v3>; 550 | vccio2-supply = <&vcc_1v8>; 551 | vccio3-supply = <&vccio_sd>; 552 | vccio4-supply = <&vcc_1v8>; 553 | vccio5-supply = <&vcc_3v3>; 554 | vccio6-supply = <&vcc_3v3>; 555 | vccio7-supply = <&vcc_3v3>; 556 | status = "okay"; 557 | }; 558 | 559 | &saradc { 560 | vref-supply = <&vcca_1v8>; 561 | status = "okay"; 562 | }; 563 | 564 | &sdhci { 565 | bus-width = <8>; 566 | max-frequency = <200000000>; 567 | no-sdio; 568 | no-sd; 569 | mmc-hs200-1_8v; 570 | supports-emmc; 571 | non-removable; 572 | status = "okay"; 573 | }; 574 | 575 | &sdmmc0 { 576 | bus-width = <4>; 577 | max-frequency = <150000000>; 578 | cap-mmc-highspeed; 579 | cap-sd-highspeed; 580 | supports-sd; 581 | disable-wp; 582 | pinctrl-names = "default"; 583 | pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; 584 | vmmc-supply = <&vcc3v3_sd>; 585 | vqmmc-supply = <&vccio_sd>; 586 | status = "okay"; 587 | }; 588 | 589 | &sdmmc1 { 590 | #address-cells = <1>; 591 | #size-cells = <0>; 592 | bus-width = <4>; 593 | max-frequency = <150000000>; 594 | cap-sd-highspeed; 595 | sd-uhs-sdr104; 596 | cap-sdio-irq; 597 | disable-wp; 598 | supports-sdio; 599 | non-removable; 600 | keep-power-in-suspend; 601 | mmc-pwrseq = <&sdio_pwrseq>; 602 | pinctrl-names = "default"; 603 | pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>; 604 | status = "okay"; 605 | }; 606 | 607 | &tsadc { 608 | status = "okay"; 609 | }; 610 | 611 | &uart1 { 612 | pinctrl-names = "default"; 613 | pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn &uart1m0_rtsn>; 614 | status = "okay"; 615 | 616 | bluetooth { 617 | compatible = "brcm,bcm43438-bt"; 618 | clocks = <&rk809 1>; 619 | clock-names = "lpo"; 620 | device-wakeup-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>; 621 | host-wakeup-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>; 622 | shutdown-gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>; 623 | max-speed = <1500000>; 624 | pinctrl-names = "default"; 625 | pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>; 626 | vbat-supply = <&vcc3v3_sys>; 627 | vddio-supply = <&vcca1v8_pmu>; 628 | }; 629 | }; 630 | 631 | &uart2 { 632 | status = "okay"; 633 | }; 634 | 635 | &usb_host0_ehci { 636 | status = "okay"; 637 | }; 638 | 639 | &usb_host0_ohci { 640 | status = "okay"; 641 | }; 642 | 643 | &usb2phy0 { 644 | status = "okay"; 645 | }; 646 | 647 | &u2phy0_host { 648 | status = "okay"; 649 | }; 650 | 651 | &u2phy0_otg { 652 | status = "okay"; 653 | }; 654 | 655 | &usbdrd_dwc3 { 656 | dr_mode = "host"; 657 | extcon = <&usb2phy0>; 658 | status = "okay"; 659 | }; 660 | 661 | &usbdrd30 { 662 | status = "okay"; 663 | }; 664 | 665 | &usbhost_dwc3 { 666 | status = "okay"; 667 | }; 668 | 669 | &usbhost30 { 670 | status = "okay"; 671 | }; 672 | 673 | &i2c1 { 674 | status = "okay"; 675 | clock-frequency = <400000>; 676 | }; 677 | 678 | &spi3 { 679 | status = "okay"; 680 | pinctrl-names = "default"; 681 | pinctrl-0 = <&spi3m1_cs0 &spi3m1_pins >; 682 | // pinctrl-1 = <&spi3m1_cs0 &spi3m1_pins_hs>; 683 | st7789v@0 { 684 | status = "okay"; 685 | compatible = "sitronix,st7789v"; 686 | reg = <0>; 687 | spi-max-frequency = <12000000>; 688 | bgr; 689 | fps = <30>; 690 | rotate = <90>; 691 | buswidth = <8>; 692 | dc-gpios = <&gpio3 28 GPIO_ACTIVE_HIGH>; 693 | reset-gpios = <&gpio3 29 GPIO_ACTIVE_LOW>; 694 | led-gpios = <&gpio4 12 GPIO_ACTIVE_HIGH>; 695 | debug = <0>; //等级0~7 越高信息越多 696 | }; 697 | }; 698 | 699 | 700 | // video output 701 | 702 | &hdmi { 703 | status = "disabled"; 704 | }; 705 | 706 | &i2s0_8ch { 707 | status = "okay"; 708 | }; 709 | 710 | &rng { 711 | status = "okay"; 712 | }; 713 | 714 | &reserved_memory { 715 | ramoops: ramoops@110000 { 716 | compatible = "ramoops"; 717 | reg = <0x0 0x110000 0x0 0xf0000>; 718 | record-size = <0x20000>; 719 | console-size = <0x80000>; 720 | ftrace-size = <0x00000>; 721 | pmsg-size = <0x50000>; 722 | }; 723 | }; 724 | 725 | &bus_npu { 726 | bus-supply = <&vdd_logic>; 727 | pvtm-supply = <&vdd_cpu>; 728 | status = "okay"; 729 | }; 730 | 731 | &iep { 732 | status = "okay"; 733 | }; 734 | 735 | &iep_mmu { 736 | status = "okay"; 737 | }; 738 | 739 | &jpegd { 740 | status = "okay"; 741 | }; 742 | 743 | &jpegd_mmu { 744 | status = "okay"; 745 | }; 746 | 747 | &mpp_srv { 748 | status = "okay"; 749 | }; 750 | 751 | &rk_rga { 752 | status = "okay"; 753 | }; 754 | 755 | &rkvdec { 756 | status = "okay"; 757 | }; 758 | 759 | &rkvdec_mmu { 760 | status = "okay"; 761 | }; 762 | 763 | &rkvenc { 764 | venc-supply = <&vdd_logic>; 765 | status = "okay"; 766 | }; 767 | 768 | &rkvenc_mmu { 769 | status = "okay"; 770 | }; 771 | 772 | &rknpu { 773 | rknpu-supply = <&vdd_npu>; 774 | status = "okay"; 775 | }; 776 | 777 | &rknpu_mmu { 778 | status = "okay"; 779 | }; 780 | 781 | &vdpu { 782 | status = "okay"; 783 | }; 784 | 785 | &vdpu_mmu { 786 | status = "okay"; 787 | }; 788 | 789 | &vepu { 790 | status = "okay"; 791 | }; 792 | 793 | &vepu_mmu { 794 | status = "okay"; 795 | }; 796 | 797 | &vop { 798 | assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>, <&cru DCLK_VOP2>; 799 | assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>, <&cru PLL_GPLL>; 800 | status = "okay"; 801 | }; 802 | 803 | &vop_mmu { 804 | status = "okay"; 805 | }; 806 | -------------------------------------------------------------------------------- /patch/X2/rk3566-panther-x2.dts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) 2 | /* 3 | * Copyright (c) 2023 tdleiyao 4 | */ 5 | 6 | /dts-v1/; 7 | 8 | #include 9 | #include 10 | #include 11 | #include "rk3566.dtsi" 12 | 13 | / { 14 | model = "Panther X2"; 15 | compatible = "panther,x2", "rockchip,rk3566"; 16 | 17 | aliases { 18 | ethernet0 = &gmac1; 19 | mmc0 = &sdmmc0; 20 | mmc1 = &sdhci; 21 | mmc2 = &sdmmc1; 22 | }; 23 | 24 | chosen: chosen { 25 | stdout-path = "serial2:1500000n8"; 26 | }; 27 | 28 | gmac1_clkin: external-gmac1-clock { 29 | compatible = "fixed-clock"; 30 | clock-frequency = <125000000>; 31 | clock-output-names = "gmac1_clkin"; 32 | #clock-cells = <0>; 33 | }; 34 | 35 | leds { 36 | compatible = "gpio-leds"; 37 | //Corresponds to the actual order 38 | led_pwr: led-pwr { 39 | label = "led-pwr"; 40 | default-state = "on"; 41 | gpios = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>; 42 | pinctrl-names = "default"; 43 | pinctrl-0 = <&led_pwr_enable_h>; 44 | retain-state-suspended; 45 | status = "okay"; 46 | }; 47 | 48 | led_wifi: led-wifi { 49 | label = "led-wifi"; 50 | default-state = "off"; 51 | gpios = <&gpio0 RK_PD6 GPIO_ACTIVE_HIGH>; 52 | pinctrl-names = "default"; 53 | pinctrl-0 = <&led_wifi_enable_h>; 54 | retain-state-suspended; 55 | status = "okay"; 56 | }; 57 | 58 | led_eth: led-eth { 59 | label = "led-eth"; 60 | default-state = "off"; 61 | gpios = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>; 62 | pinctrl-names = "default"; 63 | pinctrl-0 = <&led_eth_enable_h>; 64 | retain-state-suspended; 65 | status = "okay"; 66 | }; 67 | 68 | led_status: led-status { 69 | label = "led-status"; 70 | default-state = "on"; 71 | gpios = <&gpio0 RK_PD3 GPIO_ACTIVE_HIGH>; 72 | linux,default-trigger = "heartbeat"; 73 | pinctrl-names = "default"; 74 | pinctrl-0 = <&led_status_enable_h>; 75 | retain-state-suspended; 76 | status = "okay"; 77 | }; 78 | }; 79 | 80 | vbus: vbus-regulator { 81 | compatible = "regulator-fixed"; 82 | regulator-name = "vbus"; 83 | regulator-always-on; 84 | regulator-boot-on; 85 | regulator-min-microvolt = <5000000>; 86 | regulator-max-microvolt = <5000000>; 87 | }; 88 | 89 | vcc5v0_sys: vcc5v0-sys-regulator { 90 | compatible = "regulator-fixed"; 91 | regulator-name = "vcc5v0_sys"; 92 | regulator-always-on; 93 | regulator-boot-on; 94 | regulator-min-microvolt = <5000000>; 95 | regulator-max-microvolt = <5000000>; 96 | vin-supply = <&vbus>; 97 | }; 98 | 99 | vcc3v3_sys: vcc3v3-sys-regulator { 100 | compatible = "regulator-fixed"; 101 | regulator-name = "vcc3v3_sys"; 102 | regulator-always-on; 103 | regulator-boot-on; 104 | regulator-min-microvolt = <3300000>; 105 | regulator-max-microvolt = <3300000>; 106 | vin-supply = <&vcc5v0_sys>; 107 | }; 108 | 109 | sdio_pwrseq: sdio-pwrseq { 110 | status = "okay"; 111 | compatible = "mmc-pwrseq-simple"; 112 | clocks = <&rk809 1>; 113 | clock-names = "ext_clock"; 114 | pinctrl-names = "default"; 115 | pinctrl-0 = <&wifi_enable_h>; 116 | reset-gpios = <&gpio2 RK_PB1 GPIO_ACTIVE_LOW>; 117 | post-power-on-delay-ms = <100>; 118 | }; 119 | 120 | wireless_wlan: wireless-wlan { 121 | compatible = "wlan-platdata"; 122 | rockchip,grf = <&grf>; 123 | wifi_chip_type = "ap6236"; 124 | pinctrl-names = "default"; 125 | pinctrl-0 = <&wifi_host_wake_irq>; 126 | WIFI,host_wake_irq = <&gpio2 RK_PB2 GPIO_ACTIVE_HIGH>; 127 | status = "okay"; 128 | }; 129 | 130 | }; 131 | 132 | &cpu0 { 133 | cpu-supply = <&vdd_cpu>; 134 | }; 135 | 136 | &cpu1 { 137 | cpu-supply = <&vdd_cpu>; 138 | }; 139 | 140 | &cpu2 { 141 | cpu-supply = <&vdd_cpu>; 142 | }; 143 | 144 | &cpu3 { 145 | cpu-supply = <&vdd_cpu>; 146 | }; 147 | 148 | &gpu { 149 | mali-supply = <&vdd_gpu>; 150 | status = "okay"; 151 | }; 152 | 153 | &gmac1 { 154 | assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru SCLK_GMAC1>; 155 | assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru SCLK_GMAC1>, <&gmac1_clkin>; 156 | clock_in_out = "input"; 157 | phy-supply = <&vcc_3v3>; 158 | phy-mode = "rgmii"; 159 | pinctrl-names = "default"; 160 | pinctrl-0 = <&gmac1m0_miim 161 | &gmac1m0_tx_bus2 162 | &gmac1m0_rx_bus2 163 | &gmac1m0_rgmii_clk 164 | &gmac1m0_clkinout 165 | &gmac1m0_rgmii_bus>; 166 | snps,reset-gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>; 167 | snps,reset-active-low; 168 | /* Reset time is 20ms, 100ms for rtl8211f, also works well here */ 169 | snps,reset-delays-us = <0 20000 100000>; 170 | tx_delay = <0x30>; 171 | rx_delay = <0x10>; 172 | phy-handle = <&rgmii_phy1>; 173 | status = "okay"; 174 | }; 175 | &mdio1 { 176 | rgmii_phy1: ethernet-phy@0 { 177 | compatible = "ethernet-phy-ieee802.3-c22"; 178 | reg = <0>; 179 | status = "okay"; 180 | }; 181 | }; 182 | 183 | &i2c0 { 184 | status = "okay"; 185 | 186 | vdd_cpu: regulator@1c { 187 | compatible = "tcs,tcs4525"; 188 | reg = <0x1c>; 189 | fcs,suspend-voltage-selector = <1>; 190 | regulator-name = "vdd_cpu"; 191 | regulator-min-microvolt = <800000>; 192 | regulator-max-microvolt = <1150000>; 193 | regulator-ramp-delay = <2300>; 194 | regulator-always-on; 195 | regulator-boot-on; 196 | vin-supply = <&vcc5v0_sys>; 197 | 198 | regulator-state-mem { 199 | regulator-off-in-suspend; 200 | }; 201 | }; 202 | 203 | rk809: pmic@20 { 204 | compatible = "rockchip,rk809"; 205 | reg = <0x20>; 206 | interrupt-parent = <&gpio0>; 207 | interrupts = ; 208 | #clock-cells = <1>; 209 | clock-output-names = "rk808-clkout1", "rk808-clkout2"; 210 | pinctrl-names = "default"; 211 | pinctrl-0 = <&pmic_int_l>; 212 | rockchip,system-power-controller; 213 | wakeup-source; 214 | 215 | vcc1-supply = <&vcc3v3_sys>; 216 | vcc2-supply = <&vcc3v3_sys>; 217 | vcc3-supply = <&vcc3v3_sys>; 218 | vcc4-supply = <&vcc3v3_sys>; 219 | vcc5-supply = <&vcc3v3_sys>; 220 | vcc6-supply = <&vcc3v3_sys>; 221 | vcc7-supply = <&vcc3v3_sys>; 222 | vcc8-supply = <&vcc3v3_sys>; 223 | vcc9-supply = <&vcc3v3_sys>; 224 | 225 | regulators { 226 | vdd_logic: DCDC_REG1 { 227 | regulator-name = "vdd_logic"; 228 | regulator-always-on; 229 | regulator-boot-on; 230 | regulator-min-microvolt = <500000>; 231 | regulator-max-microvolt = <1350000>; 232 | regulator-init-microvolt = <900000>; 233 | regulator-ramp-delay = <6001>; 234 | regulator-initial-mode = <0x2>; 235 | regulator-state-mem { 236 | regulator-on-in-suspend; 237 | regulator-suspend-microvolt = <900000>; 238 | }; 239 | }; 240 | 241 | vdd_gpu: DCDC_REG2 { 242 | regulator-name = "vdd_gpu"; 243 | regulator-always-on; 244 | regulator-boot-on; 245 | regulator-min-microvolt = <500000>; 246 | regulator-max-microvolt = <1350000>; 247 | regulator-init-microvolt = <900000>; 248 | regulator-ramp-delay = <6001>; 249 | regulator-initial-mode = <0x2>; 250 | regulator-state-mem { 251 | regulator-off-in-suspend; 252 | }; 253 | }; 254 | 255 | vcc_ddr: DCDC_REG3 { 256 | regulator-always-on; 257 | regulator-boot-on; 258 | regulator-initial-mode = <0x2>; 259 | regulator-name = "vcc_ddr"; 260 | regulator-state-mem { 261 | regulator-on-in-suspend; 262 | }; 263 | }; 264 | 265 | vdd_npu: DCDC_REG4 { 266 | regulator-always-on; 267 | regulator-boot-on; 268 | regulator-min-microvolt = <500000>; 269 | regulator-max-microvolt = <1350000>; 270 | regulator-init-microvolt = <900000>; 271 | regulator-initial-mode = <0x2>; 272 | regulator-name = "vdd_npu"; 273 | regulator-state-mem { 274 | regulator-off-in-suspend; 275 | }; 276 | }; 277 | 278 | vcc_1v8: DCDC_REG5 { 279 | regulator-name = "vcc_1v8"; 280 | regulator-always-on; 281 | regulator-boot-on; 282 | regulator-min-microvolt = <1800000>; 283 | regulator-max-microvolt = <1800000>; 284 | regulator-state-mem { 285 | regulator-on-in-suspend; 286 | regulator-suspend-microvolt = <1800000>; 287 | }; 288 | }; 289 | 290 | vdda0v9_image: LDO_REG1 { 291 | regulator-always-on; 292 | regulator-boot-on; 293 | regulator-min-microvolt = <900000>; 294 | regulator-max-microvolt = <900000>; 295 | regulator-name = "vdda0v9_image"; 296 | regulator-state-mem { 297 | regulator-on-in-suspend; 298 | regulator-suspend-microvolt = <900000>; 299 | }; 300 | }; 301 | 302 | vdda_0v9: LDO_REG2 { 303 | regulator-always-on; 304 | regulator-boot-on; 305 | regulator-min-microvolt = <900000>; 306 | regulator-max-microvolt = <900000>; 307 | regulator-name = "vdda_0v9"; 308 | regulator-state-mem { 309 | regulator-off-in-suspend; 310 | }; 311 | }; 312 | 313 | vdda0v9_pmu: LDO_REG3 { 314 | regulator-always-on; 315 | regulator-boot-on; 316 | regulator-min-microvolt = <900000>; 317 | regulator-max-microvolt = <900000>; 318 | regulator-name = "vdda0v9_pmu"; 319 | regulator-state-mem { 320 | regulator-on-in-suspend; 321 | regulator-suspend-microvolt = <900000>; 322 | }; 323 | }; 324 | 325 | vccio_acodec: LDO_REG4 { 326 | regulator-always-on; 327 | regulator-boot-on; 328 | regulator-min-microvolt = <3300000>; 329 | regulator-max-microvolt = <3300000>; 330 | regulator-name = "vccio_acodec"; 331 | regulator-state-mem { 332 | regulator-off-in-suspend; 333 | }; 334 | }; 335 | 336 | vccio_sd: LDO_REG5 { 337 | regulator-always-on; 338 | regulator-boot-on; 339 | regulator-min-microvolt = <1800000>; 340 | regulator-max-microvolt = <3300000>; 341 | regulator-name = "vccio_sd"; 342 | regulator-state-mem { 343 | regulator-off-in-suspend; 344 | }; 345 | }; 346 | 347 | vcc3v3_pmu: LDO_REG6 { 348 | regulator-always-on; 349 | regulator-boot-on; 350 | regulator-min-microvolt = <3300000>; 351 | regulator-max-microvolt = <3300000>; 352 | regulator-name = "vcc3v3_pmu"; 353 | regulator-state-mem { 354 | regulator-on-in-suspend; 355 | regulator-suspend-microvolt = <3300000>; 356 | }; 357 | }; 358 | 359 | vcca_1v8: LDO_REG7 { 360 | regulator-always-on; 361 | regulator-boot-on; 362 | regulator-min-microvolt = <1800000>; 363 | regulator-max-microvolt = <1800000>; 364 | regulator-name = "vcca_1v8"; 365 | regulator-state-mem { 366 | regulator-off-in-suspend; 367 | }; 368 | }; 369 | 370 | vcca1v8_pmu: LDO_REG8 { 371 | regulator-always-on; 372 | regulator-boot-on; 373 | regulator-min-microvolt = <1800000>; 374 | regulator-max-microvolt = <1800000>; 375 | regulator-name = "vcca1v8_pmu"; 376 | regulator-state-mem { 377 | regulator-off-in-suspend; 378 | }; 379 | }; 380 | 381 | vcca1v8_image: LDO_REG9 { 382 | regulator-always-on; 383 | regulator-boot-on; 384 | regulator-min-microvolt = <1800000>; 385 | regulator-max-microvolt = <1800000>; 386 | regulator-name = "vcca1v8_image"; 387 | regulator-state-mem { 388 | regulator-off-in-suspend; 389 | }; 390 | }; 391 | 392 | vcc_3v3: SWITCH_REG1 { 393 | regulator-name = "vcc_3v3"; 394 | regulator-state-mem { 395 | regulator-off-in-suspend; 396 | }; 397 | }; 398 | 399 | vcc3v3_sd: SWITCH_REG2 { 400 | regulator-name = "vcc3v3_sd"; 401 | status = "disabled"; 402 | regulator-state-mem { 403 | regulator-on-in-suspend; 404 | }; 405 | }; 406 | 407 | }; 408 | }; 409 | }; 410 | 411 | &i2s1_8ch { 412 | pinctrl-names = "default"; 413 | pinctrl-0 = <&i2s1m1_sclktx &i2s1m1_sclkrx 414 | &i2s1m1_lrcktx &i2s1m1_lrckrx 415 | &i2s1m1_sdi0 &i2s1m1_sdi1 416 | &i2s1m1_sdi2 &i2s1m1_sdi3 417 | &i2s1m1_sdo0 &i2s1m1_sdo1 418 | &i2s1m1_sdo2 &i2s1m1_sdo3>; 419 | status = "disabled"; 420 | }; 421 | 422 | &pinctrl { 423 | sdio-pwrseq { 424 | wifi_enable_h: wifi-enable-h { 425 | rockchip,pins = <2 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>; 426 | }; 427 | }; 428 | 429 | wireless-wlan { 430 | wifi_host_wake_irq: wifi-host-wake-irq { 431 | rockchip,pins = <2 RK_PB2 RK_FUNC_GPIO &pcfg_pull_down>; 432 | }; 433 | }; 434 | 435 | bt { 436 | bt_enable_h: bt-enable-h { 437 | rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>; 438 | }; 439 | 440 | bt_host_wake_l: bt-host-wake-l { 441 | rockchip,pins = <2 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>; 442 | }; 443 | 444 | bt_wake_l: bt-wake-l { 445 | rockchip,pins = <2 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>; 446 | }; 447 | }; 448 | 449 | leds { 450 | led_pwr_enable_h: led-pwr-enable-h { 451 | rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>; 452 | }; 453 | 454 | led_wifi_enable_h: led-wifi-enable-h { 455 | rockchip,pins = <0 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>; 456 | }; 457 | 458 | led_eth_enable_h: led-eth-enable-h { 459 | rockchip,pins = <0 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>; 460 | }; 461 | 462 | led_status_enable_h: led-status-enable-h { 463 | rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>; 464 | }; 465 | }; 466 | 467 | pmic { 468 | pmic_int_l: pmic-int-l { 469 | rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>; 470 | }; 471 | }; 472 | 473 | }; 474 | 475 | &cpu0_opp_table { 476 | opp-1992000000 { 477 | opp-hz = /bits/ 64 <1992000000>; 478 | opp-microvolt = <1150000 1150000 1150000>; 479 | }; 480 | }; 481 | 482 | &pmu_io_domains { 483 | pmuio1-supply = <&vcc3v3_pmu>; 484 | pmuio2-supply = <&vcc3v3_pmu>; 485 | vccio1-supply = <&vcc_3v3>; 486 | vccio2-supply = <&vcc_1v8>; 487 | vccio3-supply = <&vccio_sd>; 488 | vccio4-supply = <&vcc_1v8>; 489 | vccio5-supply = <&vcc_3v3>; 490 | vccio6-supply = <&vcc_3v3>; 491 | vccio7-supply = <&vcc_3v3>; 492 | status = "okay"; 493 | }; 494 | 495 | &saradc { 496 | vref-supply = <&vcca_1v8>; 497 | status = "okay"; 498 | }; 499 | 500 | &sdhci { 501 | bus-width = <8>; 502 | mmc-hs200-1_8v; 503 | non-removable; 504 | vmmc-supply = <&vcc_3v3>; 505 | vqmmc-supply = <&vcc_1v8>; 506 | status = "okay"; 507 | }; 508 | 509 | &sdmmc0 { 510 | broken-cd; 511 | bus-width = <4>; 512 | cap-sd-highspeed; 513 | disable-wp; 514 | pinctrl-names = "default"; 515 | pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; 516 | vqmmc-supply = <&vccio_sd>; 517 | status = "okay"; 518 | }; 519 | 520 | &sdmmc1 { 521 | supports-sdio; 522 | bus-width = <4>; 523 | disable-wp; 524 | cap-sd-highspeed; 525 | cap-sdio-irq; 526 | keep-power-in-suspend; 527 | pinctrl-names = "default"; 528 | pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>; 529 | non-removable; 530 | mmc-pwrseq = <&sdio_pwrseq>; 531 | status = "okay"; 532 | 533 | }; 534 | 535 | &tsadc { 536 | status = "okay"; 537 | }; 538 | 539 | &uart1 { 540 | pinctrl-names = "default"; 541 | pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn &uart1m0_rtsn>; 542 | status = "okay"; 543 | 544 | bluetooth { 545 | compatible = "brcm,bcm43438-bt"; 546 | clocks = <&rk809 1>; 547 | clock-names = "lpo"; 548 | device-wakeup-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>; 549 | host-wakeup-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>; 550 | shutdown-gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>; 551 | max-speed = <1500000>; 552 | pinctrl-names = "default"; 553 | pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>; 554 | vbat-supply = <&vcc3v3_sys>; 555 | vddio-supply = <&vcca1v8_pmu>; 556 | }; 557 | }; 558 | 559 | &uart2 { 560 | status = "okay"; 561 | }; 562 | 563 | &usb_host0_xhci { 564 | dr_mode = "host"; 565 | status = "okay"; 566 | }; 567 | 568 | &usb_host0_ohci { 569 | status = "okay"; 570 | }; 571 | 572 | &usb_host1_ehci { 573 | status = "okay"; 574 | }; 575 | 576 | &usb2phy0 { 577 | status = "okay"; 578 | }; 579 | 580 | &usb2phy0_host { 581 | status = "okay"; 582 | }; 583 | 584 | &usb2phy0_otg { 585 | status = "okay"; 586 | }; 587 | -------------------------------------------------------------------------------- /patch/boards/aml-s9xx-box.tvb: -------------------------------------------------------------------------------- 1 | # Amlogic S9xx based TVBox 2 | BOARD_NAME="aml-s9xx-box" 3 | BOARDFAMILY="meson-gxl" 4 | BOARD_MAINTAINER="SteeManMI" 5 | BOOTSIZE="512" 6 | BOOTFS_TYPE="fat" 7 | KERNEL_TARGET="current,edge" 8 | KERNEL_TEST_TARGET="current" 9 | SERIALCON="ttyAML0" 10 | FULL_DESKTOP="yes" 11 | ASOUND_STATE="asound.state.mesongx" 12 | BOOT_FDT_FILE="amlogic/meson-gxl-s905d-phicomm-n1.dtb" 13 | BOOT_LOGO="desktop" 14 | SRC_EXTLINUX="yes" 15 | SRC_CMDLINE='rootflags=data=writeback console=ttyAML0,115200n8 console=tty0' 16 | 17 | function post_family_config__uboot_aml-s9xx-box() { 18 | # This board type relies on the vendor installed u-boot on emmc to boot 19 | display_alert "$BOARD" "Configuring ($BOARD) non-u-boot" "info" 20 | unset BOOTSOURCE 21 | declare -g BOOTCONFIG='none' 22 | } 23 | 24 | function post_family_tweaks_bsp__config_aml-s9xx-box_bsp() { 25 | : "${destination:?destination is not set}" 26 | 27 | # Important: this board has board-specific bsp-cli files in config/optional/boards/aml-s9xx-box/_packages/bsp-cli 28 | # that path is hashed by the bsp-cli hashing function automatically 29 | display_alert "${BOARD}" "Adjusting perms of bsp-cli files for ${BOARD} in /root" "info" 30 | run_host_command_logged chmod -v 744 "${destination}"/root/install-aml.sh 31 | run_host_command_logged chmod -v 644 "${destination}"/root/fstab.template 32 | 33 | display_alert "${BOARD}" "Removing armbian-install" "info" 34 | run_host_command_logged rm -v "${destination}"/usr/bin/armbian-install 35 | 36 | display_alert "${BOARD}" "Adding bsp-cli preinst logic" "info" 37 | # Inline function! So this function is automatically hashed when this hook is hashed. 38 | function aml-s9xx-box-bsp-cli-preinst() { 39 | #update of the board bsp-cli package fails because the filesystem type is 40 | #fat and dpkg tries to create a hard link for the existing files as backup 41 | #so rm the files instead in a preinst step 42 | [ -f /boot/aml_autoscript ] && rm /boot/aml_autoscript 43 | [ -f /boot/emmc_autoscript ] && rm /boot/emmc_autoscript 44 | [ -f /boot/s905_autoscript ] && rm /boot/s905_autoscript 45 | [ -f /boot/u-boot-s905 ] && rm /boot/u-boot-s905 46 | [ -f /boot/u-boot-s905x-s912 ] && rm /boot/u-boot-s905x-s912 47 | [ -f /boot/u-boot-s905x2-s922 ] && rm /boot/u-boot-s905x2-s922 48 | [ -f /boot/u-boot-s905x3 ] && rm /boot/u-boot-s905x3 49 | [ -f /boot/u-boot-s905x3-ugoosx3 ] && rm /boot/u-boot-s905x3-ugoosx3 50 | [ -f /boot/u-boot.ext ] && rm /boot/u-boot.ext 51 | [ -f /boot/extlinux/extlinux.conf.template ] && rm /boot/extlinux/extlinux.conf.template 52 | [ -f /boot/build-u-boot/readme.txt ] && rm /boot/build-u-boot/readme.txt 53 | [ -f /boot/build-u-boot/u-boot-s905x-s912.patch ] && rm /boot/build-u-boot/u-boot-s905x-s912.patch 54 | [ -f /boot/build-u-boot/u-boot-s905x2-s922.patch ] && rm /boot/build-u-boot/u-boot-s905x2-s922.patch 55 | [ -f /boot/build-u-boot/u-boot-s905x3.patch ] && rm /boot/build-u-boot/u-boot-s905x3.patch 56 | [ -f /boot/build-u-boot/u-boot-s905x3-ugoos-x3.patch ] && rm /boot/build-u-boot/u-boot-s905x3-ugoos-x3.patch 57 | return 0 # short-circuits above, avoid errors 58 | } 59 | preinst_functions+=('aml-s9xx-box-bsp-cli-preinst') 60 | if false; then aml-s9xx-box-bsp-cli-preinst; fi # so shellcheck stops complaining the function is unused. sorry 61 | } 62 | -------------------------------------------------------------------------------- /patch/boards/jp-tvbox.conf: -------------------------------------------------------------------------------- 1 | # Rockchip RK3566 quad core 8GB RAM SoC WIFI/BT eMMC USB2/3 SATA 2 | BOARD_NAME="JP TVbox" 3 | BOARDFAMILY="rk35xx" 4 | BOARD_MAINTAINER="tdleiyao" 5 | #BOOTCONFIG="rock-3c-rk3566_defconfig" 6 | BOOTCONFIG="rk3568_defconfig" 7 | KERNEL_TARGET="vendor,current,edge" 8 | KERNEL_TEST_TARGET="current" 9 | FULL_DESKTOP="yes" 10 | BOOT_LOGO="desktop" 11 | BOOT_FDT_FILE="rockchip/rk3566-jp-tvbox.dtb" 12 | IMAGE_PARTITION_TABLE="gpt" 13 | BOOT_SCENARIO="spl-blobs" 14 | BOOTFS_TYPE="fat" 15 | 16 | function post_family_tweaks__JP-TVbox_naming_lan() { 17 | display_alert "$BOARD" "Renaming JP-TVbox lan" "info" 18 | 19 | mkdir -p "${SDCARD}"/etc/udev/rules.d/ 20 | echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="end*", NAME="eth0"' > $SDCARD/etc/udev/rules.d/97-rename-lan.rules 21 | 22 | return 0 23 | } 24 | -------------------------------------------------------------------------------- /patch/boards/panther-x2.csc: -------------------------------------------------------------------------------- 1 | # Rockchip RK3566 quad core 4GB RAM SoC WIFI/BT eMMC USB2 2 | BOARD_NAME="Panther X2" 3 | BOARDFAMILY="rk35xx" 4 | BOARD_MAINTAINER="" 5 | BOOTCONFIG="rock-3c-rk3566_defconfig" 6 | KERNEL_TARGET="vendor,current,edge" 7 | KERNEL_TEST_TARGET="current" 8 | FULL_DESKTOP="yes" 9 | BOOT_LOGO="desktop" 10 | BOOT_FDT_FILE="rockchip/rk3566-panther-x2.dtb" 11 | IMAGE_PARTITION_TABLE="gpt" 12 | BOOT_SCENARIO="spl-blobs" 13 | BOOTFS_TYPE="fat" 14 | 15 | function post_family_tweaks__panther-x2_naming_lan() { 16 | display_alert "$BOARD" "Renaming panther-x2 lan" "info" 17 | 18 | mkdir -p "${SDCARD}"/etc/udev/rules.d/ 19 | echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="end*", NAME="eth0"' > $SDCARD/etc/udev/rules.d/97-rename-lan.rules 20 | 21 | return 0 22 | } 23 | -------------------------------------------------------------------------------- /patch/boards/rock-5c.conf: -------------------------------------------------------------------------------- 1 | # Rockchip RK3588s SoC octa core 4-16GB SoC eMMC USB3 NvME 2 | BOARD_NAME="Rock 5C" 3 | BOARDFAMILY="rockchip-rk3588" 4 | BOARD_MAINTAINER="schwar3kat" 5 | BOOTCONFIG="rock-5c-rk3588s_defconfig" 6 | KERNEL_TARGET="vendor,current,edge" 7 | KERNEL_TEST_TARGET="vendor,current" 8 | FULL_DESKTOP="yes" 9 | BOOT_LOGO="desktop" 10 | BOOT_FDT_FILE="rockchip/rk3588s-rock-5c.dtb" 11 | BOOT_SCENARIO="spl-blobs" 12 | BOOT_SOC="rk3588" 13 | IMAGE_PARTITION_TABLE="gpt" 14 | # enable_extension "radxa-aic8800" 15 | # AIC8800_TYPE="usb" 16 | ASOUND_STATE="asound.state.rock-5c" 17 | 18 | function post_family_tweaks__rock5c_naming_audios() { 19 | display_alert "$BOARD" "Renaming rock5c audios" "info" 20 | 21 | mkdir -p $SDCARD/etc/udev/rules.d/ 22 | echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-hdmi0-sound", ENV{SOUND_DESCRIPTION}="HDMI0 Audio"' > $SDCARD/etc/udev/rules.d/90-naming-audios.rules 23 | echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-es8316-sound", ENV{SOUND_DESCRIPTION}="ES8316 Audio"' >> $SDCARD/etc/udev/rules.d/90-naming-audios.rules 24 | 25 | return 0 26 | } 27 | 28 | function post_family_tweaks__rock5c_naming_lan() { 29 | display_alert "$BOARD" "Renaming rock5c lan" "info" 30 | 31 | mkdir -p "${SDCARD}"/etc/udev/rules.d/ 32 | echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="end*", NAME="eth0"' > $SDCARD/etc/udev/rules.d/97-rename-lan.rules 33 | 34 | return 0 35 | } 36 | -------------------------------------------------------------------------------- /patch/boards/station-m2.csc: -------------------------------------------------------------------------------- 1 | # Rockchip RK3566 quad core 2GB-8GB GBE eMMC NVMe USB3 WiFi 2 | BOARD_NAME="Station M2" 3 | BOARDFAMILY="rk35xx" 4 | BOARD_MAINTAINER="" 5 | BOOTCONFIG="station-m2-rk3566_defconfig" 6 | KERNEL_TARGET="current,edge,vendor" 7 | KERNEL_TEST_TARGET="current" 8 | FULL_DESKTOP="yes" 9 | BOOT_LOGO="desktop" 10 | BOOT_FDT_FILE="rockchip/rk3566-roc-pc.dtb" 11 | BOOT_SCENARIO="spl-blobs" 12 | ASOUND_STATE="asound.state.station-m2" 13 | IMAGE_PARTITION_TABLE="gpt" 14 | 15 | # Override family config for this board; let's avoid conditionals in family config. 16 | function post_family_config__stationm2_use_radxa_vendor_uboot() { 17 | BOOTSOURCE='https://github.com/radxa/u-boot.git' 18 | BOOTBRANCH='branch:rk35xx-2024.01' 19 | BOOTPATCHDIR="u-boot-radxa-latest" 20 | 21 | UBOOT_TARGET_MAP="BL31=$RKBIN_DIR/$BL31_BLOB ROCKCHIP_TPL=$RKBIN_DIR/$DDR_BLOB;;u-boot-rockchip.bin" 22 | 23 | unset uboot_custom_postprocess write_uboot_platform write_uboot_platform_mtd 24 | 25 | function write_uboot_platform() { 26 | dd if=$1/u-boot-rockchip.bin of=$2 seek=64 conv=notrunc status=none 27 | } 28 | } 29 | 30 | function post_family_tweaks__station-m2_naming_lan() { 31 | display_alert "$BOARD" "Renaming station-m2 lan" "info" 32 | 33 | mkdir -p "${SDCARD}"/etc/udev/rules.d/ 34 | echo 'SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="end*", NAME="eth0"' > $SDCARD/etc/udev/rules.d/97-rename-lan.rules 35 | 36 | return 0 37 | } 38 | -------------------------------------------------------------------------------- /patch/sbin/armbian-apt: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 定义文件路径 4 | source_file="/etc/apt/sources.list" 5 | source_backup_file="/etc/apt/sources.list.bak" 6 | 7 | debian_source_file="/etc/apt/sources.list.d/debian.sources" 8 | debian_source_backup_file="/etc/apt/sources.list.d/debian.sources.bak" 9 | 10 | ubuntu_source_file="/etc/apt/sources.list.d/ubuntu.sources" 11 | ubuntu_source_backup_file="/etc/apt/sources.list.d/ubuntu.sources.bak" 12 | 13 | # 获取固件信息 14 | release_file="/etc/os-release" 15 | 16 | # 设置字体颜色 17 | STEPS="[\033[95m 步骤 \033[0m]" # 步骤 18 | INFO="[\033[94m 信息 \033[0m]" # 信息 19 | SUCCESS="[\033[92m 成功 \033[0m]" # 成功 20 | OPTIONS="[\033[93m 选项 \033[0m]" # 选项 21 | ERROR="[\033[91m 错误 \033[0m]" # 错误 22 | SN="[\033[96m 序号 \033[0m]" # 序号 23 | 24 | # 错误处理 25 | error_msg() { 26 | echo -e "${ERROR} ${1}" 27 | exit 1 28 | } 29 | 30 | # 检查系统版本 31 | check_release() { 32 | if [[ -f "${release_file}" ]]; then 33 | source "${release_file}" 34 | VERSION_CODEID="${ID}" 35 | VERSION_CODENAME="${VERSION_CODENAME}" 36 | [[ -z "${VERSION_CODEID}" ]] && error_msg "未检测到系统的 VERSION_CODEID!" 37 | [[ -z "${VERSION_CODENAME}" ]] && error_msg "未检测到系统的 VERSION_CODENAME!" 38 | else 39 | error_msg "未检测到系统的 release 文件!" 40 | fi 41 | } 42 | 43 | # 备份软件源列表 44 | backup_source_list() { 45 | [[ -f "${source_file}" && ! -f "${source_backup_file}" ]] && { 46 | cp -f "${source_file}" "${source_backup_file}" 47 | } 48 | [[ -f "${debian_source_file}" && ! -f "${debian_source_backup_file}" ]] && { 49 | cp -f "${debian_source_file}" "${debian_source_backup_file}" 50 | } 51 | [[ -f "${ubuntu_source_file}" && ! -f "${ubuntu_source_backup_file}" ]] && { 52 | cp -f "${ubuntu_source_file}" "${ubuntu_source_backup_file}" 53 | } 54 | } 55 | 56 | # 更改系统的软件源 57 | change_source_list() { 58 | echo -e "${STEPS} 开始更改系统软件源: [\033[92m ${MIRROR_URL} \033[0m]" 59 | echo -e "${INFO} 系统版本: [\033[92m ${VERSION_CODENAME} \033[0m]" 60 | case "${VERSION_CODENAME}" in 61 | buster) 62 | cat >${source_file} <${source_file} <${source_file} <${source_file} <${source_file} < [\033[92m 恢复默认软件源 \033[0m]" 207 | echo -e "${SN} [\033[96m 1 \033[0m] -> [\033[92m 中国科学技术大学 \033[0m]" 208 | echo -e "${SN} [\033[96m 2 \033[0m] -> [\033[92m 北京外国语大学 \033[0m]" 209 | echo -e "${SN} [\033[96m 3 \033[0m] -> [\033[92m 清华大学 \033[0m]" 210 | echo -e "${SN} [\033[96m 4 \033[0m] -> [\033[92m 阿里云 \033[0m]" 211 | echo -e "${SN} [\033[96m 5 \033[0m] -> [\033[92m 退出 \033[0m]" 212 | 213 | while true; do 214 | echo -ne "${OPTIONS} 请输入序号 [\033[96m 0-5 \033[0m]: " 215 | read mwid 216 | if [[ "${mwid}" =~ ^[0-9]+$ ]] && [[ "${mwid}" -ge 0 && "${mwid}" -le 5 ]]; then 217 | if [[ "${mwid}" -eq 5 ]]; then 218 | echo -e "${INFO} 已退出脚本。" 219 | exit 0 220 | else 221 | select_mirror_site "${mwid}" 222 | break 223 | fi 224 | else 225 | echo -e "${ERROR} 无效选择,重新输入!" 226 | fi 227 | done 228 | -------------------------------------------------------------------------------- /patch/sbin/armbian-sync: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 定义 GitHub 上的脚本文件路径和目标路径 4 | BASE_URL="https://raw.githubusercontent.com/Zane-E/Armbian-Actions/main/patch/sbin" 5 | TARGET_DIR="/usr/sbin" 6 | 7 | # 设置字体颜色 8 | STEPS="[\033[95m 步骤 \033[0m]" # 步骤 9 | INFO="[\033[94m 信息 \033[0m]" # 信息 10 | SUCCESS="[\033[92m 成功 \033[0m]" # 成功 11 | ERROR="[\033[91m 错误 \033[0m]" # 错误 12 | 13 | # 错误处理函数 14 | error() { 15 | echo -e "${ERROR} ${1}" 16 | exit 1 17 | } 18 | 19 | # 创建临时目录 20 | TEMP_DIR=$(mktemp -d) || error "创建临时目录失败!" 21 | 22 | # 确保临时目录在脚本结束时删除 23 | trap 'rm -rf "${TEMP_DIR}"' EXIT 24 | 25 | # GitHub API 获取文件列表(返回 JSON) 26 | API_URL="https://api.github.com/repos/Zane-E/Armbian-Actions/contents/patch/sbin" 27 | 28 | # 获取脚本文件的名称 29 | SCRIPT_NAME=$(basename "${0}") 30 | 31 | # 使用 curl 获取 JSON 文件列表 32 | echo -e "${STEPS} 正在获取文件列表..." 33 | FILES=$(curl -fsSL --retry 3 --retry-delay 1 --max-time 3 "${API_URL}" 2>/dev/null | jq -r --arg SCRIPT_NAME "${SCRIPT_NAME}" '.[] | select(.name != $SCRIPT_NAME) | .name') || error "获取文件列表失败!" 34 | 35 | # 检查文件列表是否为空 36 | [[ -z "${FILES}" ]] && error "文件列表为空!" || echo -e "${SUCCESS} 获取文件列表成功!" 37 | 38 | # 打印文件列表(逐个输出) 39 | # echo -e "${INFO} 文件列表:" 40 | for SCRIPT in ${FILES}; do 41 | echo -e "${INFO} 文件名: [\033[92m ${SCRIPT} \033[0m]" 42 | done 43 | 44 | # 确保目标目录存在 45 | if [[ ! -d "${TARGET_DIR}" ]]; then 46 | echo -e "${ERROR} 目标目录 [\033[92m ${TARGET_DIR} \033[0m] 不存在!正在创建..." 47 | mkdir -p "${TARGET_DIR}" || error "创建目标目录失败!" 48 | fi 49 | 50 | # 下载、设置执行权限并移动文件 51 | # echo -e "${INFO} 开始同步文件..." 52 | for SCRIPT in ${FILES}; do 53 | SCRIPT_URL="${BASE_URL}/${SCRIPT}" 54 | echo -e "${STEPS} 正在同步文件: [\033[92m ${SCRIPT} \033[0m]" 55 | # 下载文件 56 | curl -fsSL --retry 3 --retry-delay 1 --max-time 3 -o "${TEMP_DIR}/${SCRIPT}" "${SCRIPT_URL}" >/dev/null 2>&1 || error "下载失败: [\033[92m ${SCRIPT} \033[0m]" 57 | # 设置执行权限 58 | chmod +x "${TEMP_DIR}/${SCRIPT}" || error "设置权限失败: [\033[92m ${SCRIPT} \033[0m]" 59 | # 移动到目标目录,覆盖原有文件 60 | mv -f "${TEMP_DIR}/${SCRIPT}" "${TARGET_DIR}/" || error "移动失败: [\033[92m ${SCRIPT} \033[0m]" 61 | done 62 | 63 | echo -e "${SUCCESS} 文件同步完成!" 64 | -------------------------------------------------------------------------------- /patch/sbin/armbian-update: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 设置字体颜色 4 | STEPS="[\033[95m 步骤 \033[0m]" # 步骤 5 | INFO="[\033[94m 信息 \033[0m]" # 信息 6 | SUCCESS="[\033[92m 成功 \033[0m]" # 成功 7 | OPTIONS="[\033[93m 选项 \033[0m]" # 选项 8 | ERROR="[\033[91m 错误 \033[0m]" # 错误 9 | VERSION="[\033[96m 版本 \033[0m]" # 版本 10 | SN="[\033[96m 序号 \033[0m]" # 序号 11 | 12 | # 固件信息文件 13 | release_file="/etc/armbian-release" 14 | 15 | # 定义版本列表 16 | VERSION_PREFIXES="6.1 6.12 6.15 6.16" 17 | 18 | # 定义代理加速 19 | PROXIES=("gh-proxy.com" "ghproxy.cn" "ghfast.top") 20 | 21 | # 错误处理 22 | error() { 23 | echo -e "${ERROR} ${1}" 24 | exit 1 25 | } 26 | 27 | # 获取内核类型 28 | LINUXFAMILY=$(grep "^LINUXFAMILY=" ${release_file} | cut -d'=' -f2) || error "未能成功获取内核类型,请检查 /etc/armbian-release 文件。" 29 | [[ -z "${LINUXFAMILY}" ]] && error "内核类型为空,请检查 /etc/armbian-release 文件。" 30 | 31 | # 显示用法 32 | usage() { 33 | echo -e "${INFO} 使用方法: [-k] [-l] [-h]" 34 | echo -e "${INFO} 参数说明:" 35 | echo -e "${INFO} -k 指定要安装的内核版本,格式为 x.y.z" 36 | echo -e "${INFO} -l 显示仓库内核版本列表(前五)" 37 | echo -e "${INFO} -h 显示此帮助信息" 38 | exit 0 39 | } 40 | 41 | # 验证版本号格式 42 | validate_version_format() { 43 | [[ "${1}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || error "版本号格式不正确:[\033[92m ${1} \033[0m],请使用 x.y.z 的格式,例如 6.6.66" 44 | return 0 45 | } 46 | 47 | # 获取仓库最新同系列内核版本 48 | get_latest_version() { 49 | CURRENT_MAJOR_MINOR=$(echo "${CURRENT_KERNEL}" | grep -oP '^[0-9]+\.[0-9]+') 50 | versions=$(curl -fsSL --retry 3 --retry-delay 1 --max-time 3 "https://github.com/Zane-E/Armbian-Actions/releases/expanded_assets/Kernel-${LINUXFAMILY}" 2>/dev/null) || error "无法访问 GITHUB,检查网络连接。" 51 | filtered_versions=$(echo "${versions}" | grep -oP '>kernel-\K[0-9]+\.[0-9]+\.[0-9]+-('"${LINUXFAMILY}"')\.tar\.gz<' | grep "^${CURRENT_MAJOR_MINOR}\.") 52 | [[ -z "${filtered_versions}" ]] && error "未找到与当前内核版本相同系列的内核。" 53 | echo "${filtered_versions}" | grep -oP '[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1 54 | } 55 | 56 | # 列出同Board系列内核版本(前五) 57 | list_all_versions() { 58 | versions=$(curl -fsSL --retry 3 --retry-delay 1 --max-time 3 "https://github.com/Zane-E/Armbian-Actions/releases/expanded_assets/Kernel-${LINUXFAMILY}" 2>/dev/null) || error "无法访问 GITHUB,检查网络连接。" 59 | filtered_versions=$(echo "${versions}" | grep -oP '>kernel-\K[0-9]+\.[0-9]+\.[0-9]+-('"${LINUXFAMILY}"')\.tar\.gz<') 60 | [[ -z "${filtered_versions}" ]] && error "未找到相同系列的内核版本。" 61 | all_versions=$(echo "${filtered_versions}" | grep -oP '[0-9]+\.[0-9]+\.[0-9]+' | sort -Vr) 62 | [[ -z "${all_versions}" ]] && error "无法列出同系列内核版本。" 63 | columns=() 64 | for version_prefix in ${VERSION_PREFIXES}; do 65 | column=$(echo "${all_versions}" | grep "^${version_prefix}\." | head -n 5) 66 | [[ -n "${column}" ]] && columns+=("${column}") 67 | done 68 | max_width=0 69 | for column in "${columns[@]}"; do 70 | for version in ${column}; do 71 | (( ${#version} > max_width )) && max_width=${#version} 72 | done 73 | done 74 | max_lines=0 75 | for column in "${columns[@]}"; do 76 | num_lines=$(wc -l <<< "${column}") 77 | (( num_lines > max_lines )) && max_lines=$num_lines 78 | done 79 | for i in $(seq 1 "${max_lines}"); do 80 | printf "${VERSION}" 81 | for column in "${columns[@]}"; do 82 | version=$(sed -n "${i}p" <<< "${column}") 83 | printf "\033[92m %-${max_width}s\033[0m" "${version:-}" 84 | done 85 | echo 86 | done 87 | } 88 | 89 | # 检查卸载冲突包 90 | uninstall_linux_libc_dev() { 91 | local ARCH_LIST=("arm64" "armhf") 92 | for ARCH in "${ARCH_LIST[@]}"; do 93 | if dpkg-query -W -f='${Status}' linux-libc-dev:$ARCH 2>/dev/null | grep -q "installed"; then 94 | echo -e "${INFO} 检测到已安装: [\033[92m linux-libc-dev:$ARCH \033[0m]" 95 | echo -e "${STEPS} 正在卸载..." 96 | apt-get remove -y linux-libc-dev:$ARCH >/dev/null 2>&1 || exit 1 97 | fi 98 | done 99 | } 100 | 101 | # 创建临时目录 102 | create_temp_dir() { 103 | TEMP_DIR=$(mktemp -d) 104 | [[ -d "$TEMP_DIR" ]] || error "无法创建临时目录。" 105 | echo -e "${STEPS} 创建临时目录: [\033[92m ${TEMP_DIR} \033[0m]" 106 | } 107 | 108 | # 安装包 109 | install_package() { 110 | local pkg="${1}" 111 | DEB_FILE=$(ls ${pkg}*.deb 2>/dev/null) 112 | [[ -z "${DEB_FILE}" ]] && error "未找到 [\033[92m ${pkg}*.deb \033[0m] 文件。" 113 | dpkg -i "${DEB_FILE}" >/dev/null 2>&1 || { 114 | echo -e "${ERROR} 安装失败!" 115 | echo -e "${STEPS} 正在修复依赖..." 116 | apt-get update >/dev/null 2>&1 && apt-get -f install -y >/dev/null 2>&1 || error "修复依赖失败,请检查相关依赖和文件是否存在。" 117 | echo -e "${SUCCESS} 依赖修复成功!" 118 | echo -e "${STEPS} 重新安装: [\033[92m ${pkg} \033[0m]" 119 | dpkg -i "${DEB_FILE}" >/dev/null 2>&1 || error "重新安装 [\033[92m ${pkg} \033[0m] 失败!" 120 | } 121 | } 122 | 123 | # 安装内核包 124 | install_kernel_packages() { 125 | for pkg in linux-libc-dev linux-headers linux-image linux-dtb; do 126 | echo -e "${STEPS} 正在安装: [\033[92m ${pkg} \033[0m]" 127 | install_package "${pkg}" || exit 1 128 | done 129 | echo -e "${SUCCESS} 所有文件已安装!" 130 | } 131 | 132 | # 删除临时目录 133 | cleanup_temp_dir() { 134 | cd - > /dev/null 2>&1 135 | rm -rf "${TEMP_DIR}" 136 | echo -e "${SUCCESS} 临时目录已删除!" 137 | } 138 | 139 | # 提示重启系统 140 | reboot_system() { 141 | read -p "$(echo -e "${OPTIONS} 是否立即重启系统?[Y/n]: ")" REBOOT_CHOICE 142 | REBOOT_CHOICE=${REBOOT_CHOICE:-y} 143 | if [[ "${REBOOT_CHOICE}" =~ ^[Yy]$ ]]; then 144 | # echo -e "${INFO} 系统将在 5 秒后重启,按 Ctrl+C 取消重启。" 145 | for ((i=5; i>=0; i--)); do 146 | echo -ne "${STEPS} 倒计时: [ " 147 | for ((j=5; j>i; j--)); do echo -ne "\e[31m=\e[0m"; done 148 | for ((j=i; j>0; j--)); do echo -ne "\e[32m-\e[0m"; done 149 | echo -ne " ]\r" 150 | sleep 1 151 | done 152 | echo "" 153 | echo -e "${INFO} 重启中..." 154 | reboot 155 | else 156 | echo -e "${INFO} 请手动重启系统以使更改生效。" 157 | fi 158 | exit 0 159 | } 160 | 161 | # 检查目录文件并安装 162 | check_and_install_kernel() { 163 | KERNEL_FILES=($(find . -maxdepth 1 -name "kernel-*-${LINUXFAMILY}.tar.gz" -exec basename {} \;)) 164 | if [[ ${#KERNEL_FILES[@]} -gt 0 ]]; then 165 | if [[ ${#KERNEL_FILES[@]} -eq 1 ]]; then 166 | KERNEL_FILE="${KERNEL_FILES[0]}" 167 | echo -e "${INFO} 发现内核文件: [\033[92m ${KERNEL_FILE} \033[0m]" 168 | echo -e "${INFO} 本地文件,请自行校验 SHA256 !" 169 | read -p "$(echo -e "${OPTIONS} 是否安装内核?[Y/n]: ")" INSTALL_CHOICE 170 | [[ ! "${INSTALL_CHOICE:-y}" =~ ^[Yy]$ ]] && { echo -e "${INFO} 您选择不安装。"; exit 0; } 171 | else 172 | echo -e "${INFO} 发现内核文件:" 173 | for i in "${!KERNEL_FILES[@]}"; do 174 | echo -e "${SN} [\033[96m $((i+1)) \033[0m] -> [\033[92m ${KERNEL_FILES[$i]} \033[0m]" 175 | done 176 | while true; do 177 | echo -e "${INFO} 本地文件,请自行校验 SHA256 !" 178 | read -p "$(echo -e "${OPTIONS} 请输入序号 [\033[96m 1-${#KERNEL_FILES[@]} \033[0m]: ")" CHOICE 179 | if [[ "$CHOICE" -ge 1 && "$CHOICE" -le ${#KERNEL_FILES[@]} ]]; then 180 | KERNEL_FILE="${KERNEL_FILES[$((CHOICE-1))]}" 181 | break 182 | else 183 | echo -e "${ERROR} 选择无效,请重新输入!" 184 | fi 185 | done 186 | fi 187 | create_temp_dir 188 | tar -xzf "${KERNEL_FILE}" -C "${TEMP_DIR}" || error "解压失败,请检查文件。" 189 | echo -e "${SUCCESS} 解压文件完成!" 190 | cd "${TEMP_DIR}" || error "无法进入临时目录:${TEMP_DIR}" 191 | uninstall_linux_libc_dev 192 | install_kernel_packages 193 | cleanup_temp_dir 194 | read -p "$(echo -e "${OPTIONS} 是否删除内核文件?[Y/n]: ")" DELETE_CHOICE 195 | DELETE_CHOICE=${DELETE_CHOICE:-y} 196 | [[ "${DELETE_CHOICE}" =~ ^[Yy]$ ]] && rm -f "${KERNEL_FILE}" 197 | reboot_system 198 | fi 199 | } 200 | 201 | # 随机选择代理 202 | select_proxy() { 203 | shuffled_indices=($(shuf -i 0-2 -n 3)) 204 | for i in "${shuffled_indices[@]}"; do 205 | RANDOM_PROXY_URL="https://${PROXIES[$i]}/" 206 | echo -e "${INFO} 尝试代理加速:[\033[92m ${PROXIES[$i]} \033[0m]" 207 | if curl -L -s --head --request GET "${RANDOM_PROXY_URL}" | grep "HTTP/" | grep -E "200" > /dev/null; then 208 | PROXY_URL="${RANDOM_PROXY_URL}" 209 | echo -e "${SUCCESS} 代理加速可用!" 210 | return 0 211 | fi 212 | done 213 | echo -e "${ERROR} 代理加速失效!" 214 | read -p "$(echo -e "${OPTIONS} 是否尝试直连?[Y/n]: ")" USE_direct 215 | USE_direct=${USE_direct:-Y} 216 | [[ "${USE_direct}" =~ ^[Nn]$ ]] && { echo -e "${INFO} 放弃尝试,退出脚本!"; exit 0; } 217 | PROXY_URL="" 218 | echo -e "${INFO} 使用直连下载!" 219 | } 220 | 221 | # 下载校验解压内核包 222 | download_kernel_package() { 223 | DOWNLOAD_URL="${PROXY_URL}https://github.com/Zane-E/Armbian-Actions/releases/download/Kernel-${LINUXFAMILY}/kernel-${KERNEL_VERSION}-${LINUXFAMILY}.tar.gz" 224 | DOWNLOAD_SHA_URL="${PROXY_URL}https://github.com/Zane-E/Armbian-Actions/releases/download/Kernel-${LINUXFAMILY}/sha256.txt" 225 | cd "${TEMP_DIR}" || exit 226 | echo -e "${STEPS} 正在下载文件: [\033[92m ${KERNEL_VERSION}-${LINUXFAMILY} \033[0m]" 227 | wget -q -O "kernel-${KERNEL_VERSION}-${LINUXFAMILY}.tar.gz" "${DOWNLOAD_URL}" >/dev/null 2>&1 || error "下载失败,请检查版本号或网络连接。" 228 | echo -e "${STEPS} 正在下载文件: [\033[92m sha256.txt \033[0m]" 229 | wget -q -O "sha256.txt" "${DOWNLOAD_SHA_URL}" >/dev/null 2>&1 || error "下载失败,请检查版本号或网络连接。" 230 | echo -e "${SUCCESS} 下载完成!" 231 | expected_sha=$(grep "kernel-${KERNEL_VERSION}-${LINUXFAMILY}.tar.gz" sha256.txt | awk '{print $2}') 232 | [[ -z "$expected_sha" ]] && error "sha256.txt 中未找到对应版本条目。" 233 | actual_sha=$(sha256sum "kernel-${KERNEL_VERSION}-${LINUXFAMILY}.tar.gz" | awk '{print $1}') 234 | if [[ "$expected_sha" != "$actual_sha" ]]; then 235 | echo -e "${ERROR} 校验失败!" 236 | echo -e "${INFO} 预期值: [\033[92m $expected_sha \033[0m]" 237 | echo -e "${INFO} 实际值: [\033[92m $actual_sha \033[0m]" 238 | exit 1 239 | fi 240 | echo -e "${SUCCESS} 校验通过!" 241 | tar -xzf "kernel-${KERNEL_VERSION}-${LINUXFAMILY}.tar.gz" || error "解压失败,请检查压缩文件。" 242 | echo -e "${SUCCESS} 解压完成!" 243 | } 244 | 245 | OPTERR=0 246 | while getopts "k:lh" opt; do 247 | case ${opt} in 248 | k) validate_version_format "${OPTARG}" || exit 1; KERNEL_VERSION="${OPTARG}"; SKIP_KERNEL_CHECK=true ;; 249 | l) SHOW_VERSIONS=true ;; 250 | h) usage ;; 251 | *) usage ;; 252 | esac 253 | done 254 | 255 | # -l 参数,则显示同系列内核版本列表 256 | [[ "${SHOW_VERSIONS}" == true ]] && { list_all_versions; exit 0; } 257 | 258 | # 显示内核类型 259 | echo -e "${INFO} 系统内核类型: [\033[92m ${LINUXFAMILY} \033[0m]" 260 | 261 | # 显示当前内核版本 262 | CURRENT_KERNEL=$(uname -r | cut -d'-' -f1) 263 | echo -e "${INFO} 当前内核版本: [\033[92m ${CURRENT_KERNEL} \033[0m]" 264 | 265 | # -k 参数,则不检查目录文件 266 | [[ "${SKIP_KERNEL_CHECK}" != true ]] && check_and_install_kernel 267 | 268 | # 获取/处理内核版本 269 | if [[ -z "${KERNEL_VERSION}" ]]; then 270 | LATEST_VERSION=$(get_latest_version) || error "无法获取最新的 Linux 内核版本。" 271 | [[ -z "${LATEST_VERSION}" || ! "${LATEST_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] && error "获取到的最新版本号格式错误:${LATEST_VERSION}。" 272 | echo -e "${INFO} 最新内核版本: [\033[92m ${LATEST_VERSION} \033[0m]" 273 | [[ "${CURRENT_KERNEL}" == "${LATEST_VERSION}" ]] && { echo -e "${INFO} 您的系统已是最新内核版本。"; exit 0; } 274 | if [[ "$(printf '%s\n' "${CURRENT_KERNEL}" "${LATEST_VERSION}" | sort -V | head -n1)" == "${CURRENT_KERNEL}" ]]; then 275 | read -p "$(echo -e "${OPTIONS} 检测到新版本,是否更新?[Y/n]: ")" UPDATE_CHOICE 276 | [[ ! "${UPDATE_CHOICE:-y}" =~ ^[Yy]$ ]] && { echo -e "${INFO} 您选择不更新。"; exit 0; } 277 | KERNEL_VERSION="${LATEST_VERSION}" 278 | echo -e "${INFO} 您选择更新到最新版本: [\033[92m ${KERNEL_VERSION} \033[0m]" 279 | fi 280 | else 281 | echo -e "${INFO} 指定内核版本: [\033[92m ${KERNEL_VERSION} \033[0m]" 282 | fi 283 | 284 | # 选择是否使用代理下载 285 | read -p "$(echo -e "${OPTIONS} 是否使用代理下载?[y/N]: ")" USE_PROXY 286 | USE_PROXY=${USE_PROXY:-n} 287 | [[ "${USE_PROXY}" =~ ^[Yy]$ ]] && select_proxy || PROXY_URL="" 288 | 289 | # 创建临时目录 290 | create_temp_dir 291 | 292 | # 下载解压内核包 293 | download_kernel_package 294 | 295 | # 检查卸载冲突包 296 | uninstall_linux_libc_dev 297 | 298 | # 安装内核文件 299 | install_kernel_packages 300 | 301 | # 删除临时目录 302 | cleanup_temp_dir 303 | 304 | # 提示重启系统 305 | reboot_system 306 | -------------------------------------------------------------------------------- /patch/test/meson64/general-fix-Kodi-sysinfo-CPU-information.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Christian Hewitt 3 | Date: Sat, 13 Apr 2019 05:45:18 +0000 4 | Subject: HACK: arm64: fix Kodi sysinfo CPU information 5 | 6 | This allows the CPU information to show in the Kodi sysinfo screen, e.g. 7 | 8 | "ARMv8 Processor rev 4 (v81)" on Amlogic devices 9 | 10 | Signed-off-by: Christian Hewitt 11 | --- 12 | arch/arm64/kernel/cpuinfo.c | 3 +-- 13 | 1 file changed, 1 insertion(+), 2 deletions(-) 14 | 15 | diff --git a/arch/arm64/kernel/cpuinfo.c b/arch/arm64/kernel/cpuinfo.c 16 | index 111111111111..222222222222 100644 17 | --- a/arch/arm64/kernel/cpuinfo.c 18 | +++ b/arch/arm64/kernel/cpuinfo.c 19 | @@ -221,8 +221,7 @@ 20 | * "processor". Give glibc what it expects. 21 | */ 22 | seq_printf(m, "processor\t: %d\n", cpu); 23 | - if (compat) 24 | - seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n", 25 | + seq_printf(m, "model name\t: ARMv8 Processor rev %d (%s)\n", 26 | MIDR_REVISION(midr), COMPAT_ELF_PLATFORM); 27 | 28 | seq_printf(m, "BogoMIPS\t: %lu.%02lu\n", 29 | 30 | -- 31 | Armbian 32 | -------------------------------------------------------------------------------- /patch/test/meson64/general-input-touchscreen-Add-D-WAV-Multitouch.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Hyeonki Hong 3 | Date: Thu, 5 Mar 2020 19:01:43 +0900 4 | Subject: ODROID-COMMON: input/touchscreen: Add D-WAV Multitouch driver. 5 | 6 | Change-Id: Ia1c8c29d3f69c6ba5d630279c4cc98119b68ab71 7 | --- 8 | drivers/hid/hid-ids.h | 6 + 9 | drivers/hid/hid-quirks.c | 3 + 10 | drivers/input/touchscreen/Kconfig | 10 + 11 | drivers/input/touchscreen/Makefile | 1 + 12 | drivers/input/touchscreen/dwav-usb-mt.c | 554 ++++++++++ 13 | 5 files changed, 574 insertions(+) 14 | 15 | diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h 16 | index 111111111111..222222222222 100644 17 | --- a/drivers/hid/hid-ids.h 18 | +++ b/drivers/hid/hid-ids.h 19 | @@ -1524,4 +1524,10 @@ 20 | #define USB_VENDOR_ID_SIGNOTEC 0x2133 21 | #define USB_DEVICE_ID_SIGNOTEC_VIEWSONIC_PD1011 0x0018 22 | 23 | +#define USB_DEVICE_ID_DWAV_MULTITOUCH 0x0005 24 | + 25 | +#define USB_VENDOR_ID_ODROID 0x16b4 26 | +#define USB_DEVICE_ID_VU5 0x0704 27 | +#define USB_DEVICE_ID_VU7PLUS 0x0705 28 | + 29 | #endif 30 | diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c 31 | index 111111111111..222222222222 100644 32 | --- a/drivers/hid/hid-quirks.c 33 | +++ b/drivers/hid/hid-quirks.c 34 | @@ -907,6 +907,8 @@ 35 | { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) }, 36 | { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_HP_5MP_CAMERA_5473) }, 37 | { HID_USB_DEVICE(USB_VENDOR_ID_SMARTLINKTECHNOLOGY, USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155) }, 38 | + { HID_USB_DEVICE(USB_VENDOR_ID_ODROID, USB_DEVICE_ID_VU5) }, 39 | + { HID_USB_DEVICE(USB_VENDOR_ID_ODROID, USB_DEVICE_ID_VU7PLUS) }, 40 | { } 41 | }; 42 | 43 | diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig 44 | index 111111111111..222222222222 100644 45 | --- a/drivers/input/touchscreen/Kconfig 46 | +++ b/drivers/input/touchscreen/Kconfig 47 | @@ -1403,4 +1403,14 @@ config TOUCHSCREEN_HIMAX_HX83112B 48 | To compile this driver as a module, choose M here: the 49 | module will be called himax_hx83112b. 50 | 51 | +config TOUCHSCREEN_DWAV_USB_MT 52 | + tristate "D-WAV Scientific USB MultiTouch" 53 | + depends on USB_ARCH_HAS_HCD 54 | + select USB 55 | + help 56 | + Say Y here if you have a D-WAV Scientific USB(HID) based MultiTouch 57 | + controller. 58 | + 59 | + module will be called dwav-usb-mt. 60 | + 61 | endif 62 | diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile 63 | index 111111111111..222222222222 100644 64 | --- a/drivers/input/touchscreen/Makefile 65 | +++ b/drivers/input/touchscreen/Makefile 66 | @@ -117,4 +117,5 @@ obj-$(CONFIG_TOUCHSCREEN_RASPBERRYPI_FW) += raspberrypi-ts.o 67 | obj-$(CONFIG_TOUCHSCREEN_IQS5XX) += iqs5xx.o 68 | obj-$(CONFIG_TOUCHSCREEN_IQS7211) += iqs7211.o 69 | obj-$(CONFIG_TOUCHSCREEN_ZINITIX) += zinitix.o 70 | +obj-$(CONFIG_TOUCHSCREEN_DWAV_USB_MT) += dwav-usb-mt.o 71 | obj-$(CONFIG_TOUCHSCREEN_HIMAX_HX83112B) += himax_hx83112b.o 72 | diff --git a/drivers/input/touchscreen/dwav-usb-mt.c b/drivers/input/touchscreen/dwav-usb-mt.c 73 | new file mode 100644 74 | index 000000000000..111111111111 75 | --- /dev/null 76 | +++ b/drivers/input/touchscreen/dwav-usb-mt.c 77 | @@ -0,0 +1,554 @@ 78 | +// SPDX-License-Identifier: GPL-2.0+ 79 | +/* 80 | + * D-WAV Scientific USB(HID) MultiTouch Screen Driver(Based on usbtouchscreen.c) 81 | + * 82 | + * Copyright (C) Hardkernel, 2015 83 | + */ 84 | + 85 | +#include 86 | +#include 87 | +#include 88 | +#include 89 | +#include 90 | +#include 91 | +#include 92 | +#include 93 | + 94 | +#include 95 | + 96 | +#define USB_VENDOR_ID_DWAV 0x0eef /* 800 x 480, 7" DWAV touch */ 97 | +#define USB_DEVICE_ID_VU7 0x0005 98 | + 99 | +#define USB_VENDOR_ID_ODROID 0x16b4 100 | +#define USB_DEVICE_ID_VU5 0x0704 101 | +#define USB_DEVICE_ID_VU7PLUS 0x0705 102 | + 103 | +enum { 104 | + ODROID_VU7 = 0, /* 800 x 480, 7" Touch */ 105 | + ODROID_VU5, /* 800 x 480, 5" Touch */ 106 | + ODROID_VU7PLUS, /* 1024 x 600, 7" Touch */ 107 | +}; 108 | + 109 | +struct usbtouch_device_info { 110 | + char name[64]; 111 | + int max_x; 112 | + int max_y; 113 | + int max_press; 114 | + int max_finger; 115 | +}; 116 | + 117 | +const struct usbtouch_device_info DEV_INFO[] = { 118 | + [ODROID_VU7] = { 119 | + .name = "ODROID VU7 MultiTouch(800x480)", 120 | + .max_x = 800, 121 | + .max_y = 480, 122 | + .max_press = 255, 123 | + .max_finger = 5, 124 | + }, 125 | + [ODROID_VU5] = { 126 | + .name = "ODROID VU5 MultiTouch(800x480)", 127 | + .max_x = 800, 128 | + .max_y = 480, 129 | + .max_press = 255, 130 | + .max_finger = 5, 131 | + }, 132 | + [ODROID_VU7PLUS] = { 133 | + .name = "ODROID VU7 Plus MultiTouch(1024x600)", 134 | + .max_x = 1024, 135 | + .max_y = 600, 136 | + .max_press = 255, 137 | + .max_finger = 5, 138 | + }, 139 | +}; 140 | + 141 | +static const struct usb_device_id dwav_usb_mt_devices[] = { 142 | + {USB_DEVICE(USB_VENDOR_ID_DWAV, USB_DEVICE_ID_VU7), 143 | + .driver_info = ODROID_VU7}, 144 | + {USB_DEVICE(USB_VENDOR_ID_ODROID, USB_DEVICE_ID_VU5), 145 | + .driver_info = ODROID_VU5}, 146 | + {USB_DEVICE(USB_VENDOR_ID_ODROID, USB_DEVICE_ID_VU7PLUS), 147 | + .driver_info = ODROID_VU7PLUS}, 148 | + {} 149 | +}; 150 | + 151 | +struct dwav_raw { /* Total 25 bytes */ 152 | + unsigned char header; /* frame header 0xAA*/ 153 | + unsigned char press; 154 | + /* Touch flag (1:valid touch data, 0:touch finished) */ 155 | + unsigned short x1; /* 1st x */ 156 | + unsigned short y1; /* 1st y */ 157 | + unsigned char end; 158 | + /* 1st touch finish flags 0xBB, RPI only uses the first 7 bytes */ 159 | + unsigned char ids; /* touch ID(bit field) */ 160 | + unsigned short y2; 161 | + unsigned short x2; 162 | + unsigned short y3; 163 | + unsigned short x3; 164 | + unsigned short y4; 165 | + unsigned short x4; 166 | + unsigned short y5; 167 | + unsigned short x5; 168 | + unsigned char tail; /* frame end 0xCC */ 169 | +}; 170 | + 171 | +#define TS_EVENT_UNKNOWN 0x00 172 | +#define TS_EVENT_PRESS 0x01 173 | +#define TS_EVENT_RELEASE 0x02 174 | + 175 | +struct finger_t { 176 | + unsigned int status; /* ts event type */ 177 | + unsigned int x; /* ts data x */ 178 | + unsigned int y; /* ts data y */ 179 | +} __packed; 180 | + 181 | +struct dwav_usb_mt { 182 | + char name[128], phys[64]; 183 | + 184 | + int dev_id; 185 | + /* for URB Data DMA */ 186 | + dma_addr_t data_dma; 187 | + unsigned char *data; 188 | + int data_size; 189 | + 190 | + struct urb *irq; 191 | + struct usb_interface *interface; 192 | + struct input_dev *input; 193 | + 194 | + struct finger_t *finger; 195 | +}; 196 | + 197 | +static void dwav_usb_mt_report(struct dwav_usb_mt *dwav_usb_mt) 198 | +{ 199 | + int id, max_x, max_y, max_press, max_finger; 200 | + 201 | + max_x = DEV_INFO[dwav_usb_mt->dev_id].max_x; 202 | + max_y = DEV_INFO[dwav_usb_mt->dev_id].max_y; 203 | + max_press = DEV_INFO[dwav_usb_mt->dev_id].max_press; 204 | + max_finger = DEV_INFO[dwav_usb_mt->dev_id].max_finger; 205 | + 206 | + for (id = 0; id < max_finger; id++) { 207 | + 208 | + if (dwav_usb_mt->finger[id].status == TS_EVENT_UNKNOWN) 209 | + continue; 210 | + 211 | + if (dwav_usb_mt->finger[id].x >= max_x || 212 | + dwav_usb_mt->finger[id].y >= max_y) 213 | + continue; 214 | + 215 | + input_mt_slot(dwav_usb_mt->input, id); 216 | + 217 | + if (dwav_usb_mt->finger[id].status != TS_EVENT_RELEASE) { 218 | + input_mt_report_slot_state(dwav_usb_mt->input, 219 | + MT_TOOL_FINGER, true); 220 | + input_report_abs(dwav_usb_mt->input, 221 | + ABS_MT_POSITION_X, 222 | + dwav_usb_mt->finger[id].x); 223 | + input_report_abs(dwav_usb_mt->input, 224 | + ABS_MT_POSITION_Y, 225 | + dwav_usb_mt->finger[id].y); 226 | + input_report_abs(dwav_usb_mt->input, 227 | + ABS_MT_PRESSURE, 228 | + max_press); 229 | + } else { 230 | + input_mt_report_slot_state(dwav_usb_mt->input, 231 | + MT_TOOL_FINGER, false); 232 | + dwav_usb_mt->finger[id].status = TS_EVENT_UNKNOWN; 233 | + } 234 | + input_mt_report_pointer_emulation(dwav_usb_mt->input, true); 235 | + input_sync(dwav_usb_mt->input); 236 | + } 237 | +} 238 | + 239 | +static void dwav_usb_mt_process(struct dwav_usb_mt *dwav_usb_mt, 240 | + unsigned char *pkt, int len) 241 | +{ 242 | + struct dwav_raw *dwav_raw = (struct dwav_raw *)pkt; 243 | + unsigned char bit_mask, cnt; 244 | + 245 | + for (cnt = 0, bit_mask = 0x01; 246 | + cnt < DEV_INFO[dwav_usb_mt->dev_id].max_finger; 247 | + cnt++, bit_mask <<= 1) { 248 | + if ((dwav_raw->ids & bit_mask) && dwav_raw->press) { 249 | + dwav_usb_mt->finger[cnt].status = TS_EVENT_PRESS; 250 | + switch (cnt) { 251 | + case 0: 252 | + dwav_usb_mt->finger[cnt].x 253 | + = cpu_to_be16(dwav_raw->x1); 254 | + dwav_usb_mt->finger[cnt].y 255 | + = cpu_to_be16(dwav_raw->y1); 256 | + break; 257 | + case 1: 258 | + dwav_usb_mt->finger[cnt].x 259 | + = cpu_to_be16(dwav_raw->x2); 260 | + dwav_usb_mt->finger[cnt].y 261 | + = cpu_to_be16(dwav_raw->y2); 262 | + break; 263 | + case 2: 264 | + dwav_usb_mt->finger[cnt].x 265 | + = cpu_to_be16(dwav_raw->x3); 266 | + dwav_usb_mt->finger[cnt].y 267 | + = cpu_to_be16(dwav_raw->y3); 268 | + break; 269 | + case 3: 270 | + dwav_usb_mt->finger[cnt].x 271 | + = cpu_to_be16(dwav_raw->x4); 272 | + dwav_usb_mt->finger[cnt].y 273 | + = cpu_to_be16(dwav_raw->y4); 274 | + break; 275 | + case 4: 276 | + dwav_usb_mt->finger[cnt].x 277 | + = cpu_to_be16(dwav_raw->x5); 278 | + dwav_usb_mt->finger[cnt].y 279 | + = cpu_to_be16(dwav_raw->y5); 280 | + break; 281 | + default: 282 | + break; 283 | + } 284 | + } else { 285 | + if (dwav_usb_mt->finger[cnt].status == TS_EVENT_PRESS) 286 | + dwav_usb_mt->finger[cnt].status 287 | + = TS_EVENT_RELEASE; 288 | + else 289 | + dwav_usb_mt->finger[cnt].status 290 | + = TS_EVENT_UNKNOWN; 291 | + } 292 | + } 293 | + dwav_usb_mt_report(dwav_usb_mt); 294 | +} 295 | + 296 | +static void dwav_usb_mt_irq(struct urb *urb) 297 | +{ 298 | + struct dwav_usb_mt *dwav_usb_mt = urb->context; 299 | + struct device *dev = &dwav_usb_mt->interface->dev; 300 | + int retval; 301 | + 302 | + switch (urb->status) { 303 | + case 0: 304 | + /* success */ 305 | + break; 306 | + case -ETIME: 307 | + /* this urb is timing out */ 308 | + dev_dbg(dev, "%s - urb timed out - was the device unplugged?\n", 309 | + __func__); 310 | + return; 311 | + case -ECONNRESET: 312 | + case -ENOENT: 313 | + case -ESHUTDOWN: 314 | + case -EPIPE: 315 | + /* this urb is terminated, clean up */ 316 | + dev_dbg(dev, "%s - urb shutting down with status: %d\n", 317 | + __func__, urb->status); 318 | + return; 319 | + default: 320 | + dev_dbg(dev, "%s - nonzero urb status received: %d\n", 321 | + __func__, urb->status); 322 | + goto exit; 323 | + } 324 | + 325 | + dwav_usb_mt_process(dwav_usb_mt, dwav_usb_mt->data, urb->actual_length); 326 | + 327 | +exit: 328 | + usb_mark_last_busy(interface_to_usbdev(dwav_usb_mt->interface)); 329 | + retval = usb_submit_urb(urb, GFP_ATOMIC); 330 | + if (retval) { 331 | + dev_err(dev, "%s - usb_submit_urb failed with result: %d\n", 332 | + __func__, retval); 333 | + } 334 | +} 335 | + 336 | +static int dwav_usb_mt_open(struct input_dev *input) 337 | +{ 338 | + struct dwav_usb_mt *dwav_usb_mt = input_get_drvdata(input); 339 | + int r; 340 | + 341 | + dwav_usb_mt->irq->dev = interface_to_usbdev(dwav_usb_mt->interface); 342 | + 343 | + r = usb_autopm_get_interface(dwav_usb_mt->interface) ? -EIO : 0; 344 | + if (r < 0) 345 | + goto out; 346 | + 347 | + if (usb_submit_urb(dwav_usb_mt->irq, GFP_KERNEL)) { 348 | + r = -EIO; 349 | + goto out_put; 350 | + } 351 | + 352 | + dwav_usb_mt->interface->needs_remote_wakeup = 1; 353 | +out_put: 354 | + usb_autopm_put_interface(dwav_usb_mt->interface); 355 | +out: 356 | + return r; 357 | +} 358 | + 359 | +static void dwav_usb_mt_close(struct input_dev *input) 360 | +{ 361 | + struct dwav_usb_mt *dwav_usb_mt = input_get_drvdata(input); 362 | + int r; 363 | + 364 | + usb_kill_urb(dwav_usb_mt->irq); 365 | + 366 | + r = usb_autopm_get_interface(dwav_usb_mt->interface); 367 | + 368 | + dwav_usb_mt->interface->needs_remote_wakeup = 0; 369 | + if (!r) 370 | + usb_autopm_put_interface(dwav_usb_mt->interface); 371 | +} 372 | + 373 | +static int dwav_usb_mt_suspend(struct usb_interface *intf, pm_message_t message) 374 | +{ 375 | + struct dwav_usb_mt *dwav_usb_mt = usb_get_intfdata(intf); 376 | + 377 | + usb_kill_urb(dwav_usb_mt->irq); 378 | + 379 | + return 0; 380 | +} 381 | + 382 | +static int dwav_usb_mt_resume(struct usb_interface *intf) 383 | +{ 384 | + struct dwav_usb_mt *dwav_usb_mt = usb_get_intfdata(intf); 385 | + struct input_dev *input = dwav_usb_mt->input; 386 | + int result = 0; 387 | + 388 | + mutex_lock(&input->mutex); 389 | + if (input->users) 390 | + result = usb_submit_urb(dwav_usb_mt->irq, GFP_NOIO); 391 | + mutex_unlock(&input->mutex); 392 | + 393 | + return result; 394 | +} 395 | + 396 | +static int dwav_usb_mt_reset_resume(struct usb_interface *intf) 397 | +{ 398 | + struct dwav_usb_mt *dwav_usb_mt = usb_get_intfdata(intf); 399 | + struct input_dev *input = dwav_usb_mt->input; 400 | + int err = 0; 401 | + 402 | + /* restart IO if needed */ 403 | + mutex_lock(&input->mutex); 404 | + if (input->users) 405 | + err = usb_submit_urb(dwav_usb_mt->irq, GFP_NOIO); 406 | + mutex_unlock(&input->mutex); 407 | + 408 | + return err; 409 | +} 410 | + 411 | +static void dwav_usb_mt_free_buffers(struct usb_device *udev, 412 | + struct dwav_usb_mt *dwav_usb_mt) 413 | +{ 414 | + usb_free_coherent(udev, dwav_usb_mt->data_size, 415 | + dwav_usb_mt->data, dwav_usb_mt->data_dma); 416 | +} 417 | + 418 | +static struct usb_endpoint_descriptor *dwav_usb_mt_get_input_endpoint( 419 | + struct usb_host_interface *interface) 420 | +{ 421 | + int i; 422 | + 423 | + for (i = 0; i < interface->desc.bNumEndpoints; i++) { 424 | + if (usb_endpoint_dir_in(&interface->endpoint[i].desc)) 425 | + return &interface->endpoint[i].desc; 426 | + } 427 | + 428 | + return NULL; 429 | +} 430 | + 431 | +static int dwav_usb_mt_init(struct dwav_usb_mt *dwav_usb_mt, void *dev) 432 | +{ 433 | + int err; 434 | + struct input_dev *input_dev = (struct input_dev *)dev; 435 | + 436 | + input_dev->name = dwav_usb_mt->name; 437 | + input_dev->phys = dwav_usb_mt->phys; 438 | + 439 | + input_set_drvdata(input_dev, dwav_usb_mt); 440 | + 441 | + input_dev->open = dwav_usb_mt_open; 442 | + input_dev->close = dwav_usb_mt_close; 443 | + 444 | + input_dev->id.bustype = BUS_USB; 445 | + 446 | + /* single touch */ 447 | + input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); 448 | + input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); 449 | + 450 | + input_set_abs_params(input_dev, ABS_X, 0, 451 | + DEV_INFO[dwav_usb_mt->dev_id].max_x, 0, 0); 452 | + input_set_abs_params(input_dev, ABS_Y, 0, 453 | + DEV_INFO[dwav_usb_mt->dev_id].max_y, 0, 0); 454 | + 455 | + /* multi touch */ 456 | + input_set_abs_params(input_dev, ABS_MT_POSITION_X, 0, 457 | + DEV_INFO[dwav_usb_mt->dev_id].max_x, 0, 0); 458 | + input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0, 459 | + DEV_INFO[dwav_usb_mt->dev_id].max_y, 0, 0); 460 | + input_mt_init_slots(input_dev, 461 | + DEV_INFO[dwav_usb_mt->dev_id].max_finger, 0); 462 | + 463 | + err = input_register_device(input_dev); 464 | + if (err) { 465 | + pr_err("%s - input_register_device failed, err: %d\n", 466 | + __func__, err); 467 | + return err; 468 | + } 469 | + 470 | + dwav_usb_mt->input = input_dev; 471 | + 472 | + return 0; 473 | +} 474 | + 475 | +static int dwav_usb_mt_probe(struct usb_interface *intf, 476 | + const struct usb_device_id *id) 477 | +{ 478 | + struct dwav_usb_mt *dwav_usb_mt = NULL; 479 | + struct input_dev *input_dev = NULL; 480 | + struct usb_endpoint_descriptor *endpoint; 481 | + struct usb_device *udev = interface_to_usbdev(intf); 482 | + 483 | + int err = 0; 484 | + 485 | + endpoint = dwav_usb_mt_get_input_endpoint(intf->cur_altsetting); 486 | + if (!endpoint) 487 | + return -ENXIO; 488 | + 489 | + dwav_usb_mt = kzalloc(sizeof(struct dwav_usb_mt), GFP_KERNEL); 490 | + if (!dwav_usb_mt) 491 | + return -ENOMEM; 492 | + 493 | + dwav_usb_mt->dev_id = id->driver_info; 494 | + 495 | + dwav_usb_mt->finger = kzalloc(sizeof(struct finger_t) * 496 | + DEV_INFO[dwav_usb_mt->dev_id].max_finger, 497 | + GFP_KERNEL); 498 | + 499 | + if (!dwav_usb_mt->finger) 500 | + goto err_free_mem; 501 | + 502 | + input_dev = input_allocate_device(); 503 | + if (!input_dev) 504 | + goto err_free_mem; 505 | + 506 | + dwav_usb_mt->data_size = sizeof(struct dwav_raw); 507 | + dwav_usb_mt->data = usb_alloc_coherent(udev, dwav_usb_mt->data_size, 508 | + GFP_KERNEL, &dwav_usb_mt->data_dma); 509 | + if (!dwav_usb_mt->data) 510 | + goto err_free_mem; 511 | + 512 | + dwav_usb_mt->irq = usb_alloc_urb(0, GFP_KERNEL); 513 | + if (!dwav_usb_mt->irq) { 514 | + dev_dbg(&intf->dev, 515 | + "%s - usb_alloc_urb failed: usbtouch->irq\n", 516 | + __func__); 517 | + goto err_free_buffers; 518 | + } 519 | + 520 | + if (usb_endpoint_type(endpoint) == USB_ENDPOINT_XFER_INT) { 521 | + usb_fill_int_urb(dwav_usb_mt->irq, udev, 522 | + usb_rcvintpipe(udev, endpoint->bEndpointAddress), 523 | + dwav_usb_mt->data, dwav_usb_mt->data_size, 524 | + dwav_usb_mt_irq, dwav_usb_mt, endpoint->bInterval); 525 | + } else { 526 | + usb_fill_bulk_urb(dwav_usb_mt->irq, udev, 527 | + usb_rcvbulkpipe(udev, endpoint->bEndpointAddress), 528 | + dwav_usb_mt->data, dwav_usb_mt->data_size, 529 | + dwav_usb_mt_irq, dwav_usb_mt); 530 | + } 531 | + 532 | + dwav_usb_mt->irq->dev = udev; 533 | + dwav_usb_mt->irq->transfer_dma = dwav_usb_mt->data_dma; 534 | + dwav_usb_mt->irq->transfer_flags |= URB_NO_TRANSFER_DMA_MAP; 535 | + 536 | + dwav_usb_mt->interface = intf; 537 | + 538 | + if (udev->manufacturer) 539 | + strscpy(dwav_usb_mt->name, 540 | + udev->manufacturer, sizeof(dwav_usb_mt->name)); 541 | + 542 | + if (udev->product) { 543 | + if (udev->manufacturer) 544 | + strlcat(dwav_usb_mt->name, 545 | + " ", sizeof(dwav_usb_mt->name)); 546 | + 547 | + strlcat(dwav_usb_mt->name, 548 | + udev->product, sizeof(dwav_usb_mt->name)); 549 | + } 550 | + 551 | + if (!strlen(dwav_usb_mt->name)) { 552 | + snprintf(dwav_usb_mt->name, sizeof(dwav_usb_mt->name), 553 | + "D-WAV Scientific MultiTouch %04x:%04x", 554 | + le16_to_cpu(udev->descriptor.idVendor), 555 | + le16_to_cpu(udev->descriptor.idProduct)); 556 | + } 557 | + 558 | + usb_make_path(udev, dwav_usb_mt->phys, sizeof(dwav_usb_mt->phys)); 559 | + strlcat(dwav_usb_mt->phys, "/input0", sizeof(dwav_usb_mt->phys)); 560 | + 561 | + usb_to_input_id(udev, &input_dev->id); 562 | + 563 | + input_dev->dev.parent = &intf->dev; 564 | + 565 | + err = dwav_usb_mt_init(dwav_usb_mt, (void *)input_dev); 566 | + if (err) 567 | + goto err_free_urb; 568 | + 569 | + usb_set_intfdata(intf, dwav_usb_mt); 570 | + 571 | + dev_info(&intf->dev, "%s\n", DEV_INFO[dwav_usb_mt->dev_id].name); 572 | + 573 | + return 0; 574 | + 575 | +err_free_urb: 576 | + usb_free_urb(dwav_usb_mt->irq); 577 | + 578 | +err_free_buffers: 579 | + dwav_usb_mt_free_buffers(udev, dwav_usb_mt); 580 | + 581 | +err_free_mem: 582 | + if (input_dev) 583 | + input_free_device(input_dev); 584 | + kfree(dwav_usb_mt); 585 | + 586 | + return err; 587 | +} 588 | + 589 | +static void dwav_usb_mt_disconnect(struct usb_interface *intf) 590 | +{ 591 | + struct dwav_usb_mt *dwav_usb_mt = usb_get_intfdata(intf); 592 | + 593 | + if (!dwav_usb_mt) 594 | + return; 595 | + 596 | + dev_dbg(&intf->dev, 597 | + "%s - dwav_usb_mt is initialized, cleaning up\n", 598 | + __func__); 599 | + 600 | + usb_set_intfdata(intf, NULL); 601 | + 602 | + /* this will stop IO via close */ 603 | + input_unregister_device(dwav_usb_mt->input); 604 | + 605 | + usb_free_urb(dwav_usb_mt->irq); 606 | + 607 | + dwav_usb_mt_free_buffers(interface_to_usbdev(intf), dwav_usb_mt); 608 | + 609 | + kfree(dwav_usb_mt); 610 | +} 611 | + 612 | +MODULE_DEVICE_TABLE(usb, dwav_usb_mt_devices); 613 | + 614 | +static struct usb_driver dwav_usb_mt_driver = { 615 | + .name = "dwav_usb_mt", 616 | + .probe = dwav_usb_mt_probe, 617 | + .disconnect = dwav_usb_mt_disconnect, 618 | + .suspend = dwav_usb_mt_suspend, 619 | + .resume = dwav_usb_mt_resume, 620 | + .reset_resume = dwav_usb_mt_reset_resume, 621 | + .id_table = dwav_usb_mt_devices, 622 | + .supports_autosuspend = 1, 623 | +}; 624 | + 625 | +module_usb_driver(dwav_usb_mt_driver); 626 | + 627 | +MODULE_AUTHOR("Hardkernel Co.,Ltd"); 628 | +MODULE_DESCRIPTION("D-WAV USB(HID) MultiTouch Driver"); 629 | +MODULE_LICENSE("GPL"); 630 | + 631 | +MODULE_ALIAS("dwav_usb_mt"); 632 | \ No newline at end of file 633 | -- 634 | Armbian 635 | 636 | -------------------------------------------------------------------------------- /patch/test/meson64/general-meson64-overlays.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: Zhang Ning <832666+zhangn1985@users.noreply.github.com> 3 | Date: Thu, 19 Sep 2019 16:20:31 +0800 4 | Subject: general: meson64 overlays 5 | 6 | Signed-off-by: Zhang Ning <832666+zhangn1985@users.noreply.github.com> 7 | --- 8 | scripts/Makefile.build | 3 +++ 9 | 1 file changed, 3 insertions(+) 10 | 11 | diff --git a/scripts/Makefile.build b/scripts/Makefile.build 12 | index 111111111111..222222222222 100644 13 | --- a/scripts/Makefile.build 14 | +++ b/scripts/Makefile.build 15 | @@ -107,6 +107,9 @@ 16 | userprogs += $(userprogs-always-y) $(userprogs-always-m) 17 | always-y += $(userprogs-always-y) $(userprogs-always-m) 18 | 19 | +# Overlay targets 20 | +extra-y += $(dtbo-y) $(scr-y) $(dtbotxt-y) 21 | + 22 | # Add subdir path 23 | 24 | ifneq ($(obj),.) 25 | -- 26 | Armbian 27 | -------------------------------------------------------------------------------- /patch/test/meson64/jethome-0001-Fix-meson64-add-gpio-irq-patch-from-https-lkml.org-l.patch: -------------------------------------------------------------------------------- 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 2 | From: usera 3 | Date: Mon, 12 Apr 2021 16:16:42 +0200 4 | Subject: Fix:meson64: add gpio irq (patch from 5 | https://lkml.org/lkml/2020/11/27/8) 6 | 7 | Signed-off-by: Vyacheslav Bocharov 8 | --- 9 | drivers/pinctrl/meson/pinctrl-meson.c | 41 ++++++++++ 10 | drivers/pinctrl/meson/pinctrl-meson.h | 1 + 11 | 2 files changed, 42 insertions(+) 12 | 13 | diff --git a/drivers/pinctrl/meson/pinctrl-meson.c b/drivers/pinctrl/meson/pinctrl-meson.c 14 | index 111111111111..222222222222 100644 15 | --- a/drivers/pinctrl/meson/pinctrl-meson.c 16 | +++ b/drivers/pinctrl/meson/pinctrl-meson.c 17 | @@ -51,6 +51,7 @@ 18 | #include 19 | #include 20 | #include 21 | +#include 22 | 23 | #include "../core.h" 24 | #include "../pinctrl-utils.h" 25 | @@ -602,6 +603,40 @@ 26 | return !!(val & BIT(bit)); 27 | } 28 | 29 | +static int meson_gpio_to_irq(struct gpio_chip *chip, unsigned int gpio) 30 | +{ 31 | + struct meson_pinctrl *pc = gpiochip_get_data(chip); 32 | + const struct meson_bank *bank; 33 | + struct irq_fwspec fwspec; 34 | + int hwirq; 35 | + 36 | + if (meson_get_bank(pc, gpio, &bank)) 37 | + return -EINVAL; 38 | + 39 | + if (bank->irq_first < 0) { 40 | + dev_warn(pc->dev, "no support irq for pin[%d]\n", gpio); 41 | + return -EINVAL; 42 | + } 43 | + if (!pc->of_irq) { 44 | + dev_err(pc->dev, "invalid device node of gpio INTC\n"); 45 | + return -EINVAL; 46 | + } 47 | + 48 | + hwirq = gpio - bank->first + bank->irq_first; 49 | + printk("gpio irq setup: hwirq: 0x%X irqfirst: 0x%X irqlast: 0x%X pin[%d]\n", hwirq, bank->irq_first, bank->irq_last, gpio); 50 | + if (hwirq > bank->irq_last) 51 | + { 52 | + dev_warn(pc->dev, "no more irq for pin[%d]\n", gpio); 53 | + return -EINVAL; 54 | + } 55 | + fwspec.fwnode = of_node_to_fwnode(pc->of_irq); 56 | + fwspec.param_count = 2; 57 | + fwspec.param[0] = hwirq; 58 | + fwspec.param[1] = IRQ_TYPE_NONE; 59 | + 60 | + return irq_create_fwspec_mapping(&fwspec); 61 | +} 62 | + 63 | static int meson_gpiolib_register(struct meson_pinctrl *pc) 64 | { 65 | int ret; 66 | @@ -617,6 +652,7 @@ 67 | pc->chip.direction_output = meson_gpio_direction_output; 68 | pc->chip.get = meson_gpio_get; 69 | pc->chip.set_rv = meson_gpio_set; 70 | + pc->chip.to_irq = meson_gpio_to_irq; 71 | pc->chip.base = -1; 72 | pc->chip.ngpio = pc->data->num_pins; 73 | pc->chip.can_sleep = false; 74 | @@ -680,6 +716,11 @@ 75 | pc->fwnode = gpiochip_node_get_first(pc->dev); 76 | gpio_np = to_of_node(pc->fwnode); 77 | 78 | + pc->of_irq = of_find_compatible_node(NULL, 79 | + NULL, "amlogic,meson-gpio-intc"); 80 | + if (!pc->of_irq) 81 | + pc->of_irq = of_find_compatible_node(NULL, 82 | + NULL, "amlogic,meson-gpio-intc-ext"); 83 | pc->reg_mux = meson_map_resource(pc, gpio_np, "mux"); 84 | if (IS_ERR_OR_NULL(pc->reg_mux)) { 85 | dev_err(pc->dev, "mux registers not found\n"); 86 | diff --git a/drivers/pinctrl/meson/pinctrl-meson.h b/drivers/pinctrl/meson/pinctrl-meson.h 87 | index 111111111111..222222222222 100644 88 | --- a/drivers/pinctrl/meson/pinctrl-meson.h 89 | +++ b/drivers/pinctrl/meson/pinctrl-meson.h 90 | @@ -134,6 +134,7 @@ 91 | struct regmap *reg_ds; 92 | struct gpio_chip chip; 93 | struct fwnode_handle *fwnode; 94 | + struct device_node *of_irq; 95 | }; 96 | 97 | #define FUNCTION(fn) \ 98 | -- 99 | Armbian 100 | -------------------------------------------------------------------------------- /screenshot/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Zane-E/Armbian-Actions/60a75811b6aa39ce121dad0475c2a94cf43b2a50/screenshot/screenshot.png -------------------------------------------------------------------------------- /scripts/apply_patches.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # General patches 4 | echo "Copying General patches..." 5 | cp -f ${GITHUB_WORKSPACE}/patch/config/* config/kernel/ 6 | cp -f ${GITHUB_WORKSPACE}/patch/boards/* config/boards/ 7 | cp -f ${GITHUB_WORKSPACE}/patch/sbin/* packages/bsp/common/usr/sbin/ 8 | 9 | # T4 Patches 10 | echo "Copying T4 patches..." 11 | cp -f ${GITHUB_WORKSPACE}/patch/test/meson64/general-fix-Kodi-sysinfo-CPU-information.patch patch/kernel/archive/rockchip64-6.16/ 12 | cp -f ${GITHUB_WORKSPACE}/patch/T4/fix-CPU-information.patch patch/kernel/archive/rockchip64-6.12/ 13 | cp -f ${GITHUB_WORKSPACE}/patch/T4/t4.patch patch/kernel/archive/rockchip64-6.16/ 14 | cp -f ${GITHUB_WORKSPACE}/patch/T4/t4.patch patch/kernel/archive/rockchip64-6.12/ 15 | 16 | # 5C Patches 17 | echo "Copying 5C patches..." 18 | cp -f ${GITHUB_WORKSPACE}/patch/5C/reopen_disabled_nodes.patch patch/u-boot/legacy/u-boot-radxa-rk35xx/board_rock-5c/ 19 | cp -f ${GITHUB_WORKSPACE}/patch/5C/fix-CPU-information.patch patch/kernel/rk35xx-vendor-6.1/ 20 | cp -f ${GITHUB_WORKSPACE}/patch/5C/diyfan.patch patch/kernel/rk35xx-vendor-6.1/ 21 | 22 | # N1 Patches 23 | echo "Copying N1 patches..." 24 | cp -f ${GITHUB_WORKSPACE}/patch/N1/fix-n1-1.patch patch/kernel/archive/meson64-6.12/ 25 | cp -f ${GITHUB_WORKSPACE}/patch/N1/fix-n1-2.patch patch/kernel/archive/meson64-6.12/ 26 | cp -f ${GITHUB_WORKSPACE}/patch/N1/fix-n1-1.patch patch/kernel/archive/meson64-6.15/ 27 | cp -f ${GITHUB_WORKSPACE}/patch/N1/fix-n1-2.patch patch/kernel/archive/meson64-6.15/ 28 | cp -f ${GITHUB_WORKSPACE}/patch/N1/u-boot.ext config/optional/boards/aml-s9xx-box/_packages/bsp-cli/boot/ 29 | 30 | # X2 Patches 31 | echo "Copying X2 patches..." 32 | cp -f ${GITHUB_WORKSPACE}/patch/X2/rk3566-panther-x2.dts patch/kernel/archive/rockchip64-6.12/dt/ 33 | cp -f ${GITHUB_WORKSPACE}/patch/X2/rk3566-panther-x2.dts patch/kernel/archive/rockchip64-6.16/dt/ 34 | cp -r ${GITHUB_WORKSPACE}/patch/X2/dt patch/kernel/rk35xx-vendor-6.1/ 35 | 36 | # JP Patches 37 | echo "Copying JP patches..." 38 | cp -f ${GITHUB_WORKSPACE}/patch/JP/rk3566-jp-tvbox.dts patch/kernel/archive/rockchip64-6.12/dt/ 39 | cp -f ${GITHUB_WORKSPACE}/patch/JP/rk3566-jp-tvbox.dts patch/kernel/archive/rockchip64-6.16/dt/ 40 | cp -f ${GITHUB_WORKSPACE}/patch/JP/dt/rk3566-jp-tvbox.dts patch/kernel/rk35xx-vendor-6.1/dt/ 41 | 42 | # Remove '-unofficial' from the VENDOR name 43 | sed -i 's|Armbian-unofficial|Armbian|g' lib/functions/configuration/main-config.sh 44 | 45 | # Remove the suffix information from 'uname -r' in LOCALVERSION 46 | sed -i 's|LOCALVERSION=-${BRANCH}-${LINUXFAMILY}|LOCALVERSION=|g' lib/functions/compilation/kernel-make.sh 47 | sed -i 's|${kernel_version}-${BRANCH}-${LINUXFAMILY}|${kernel_version}|g' lib/functions/compilation/kernel-debs.sh 48 | 49 | # Remove branch information from linux debs packages name in kernel-debs.sh 50 | sed -i 's|linux-image-${BRANCH}-${LINUXFAMILY}|linux-image-${LINUXFAMILY}|g' lib/functions/compilation/kernel-debs.sh 51 | sed -i 's|linux-dtb-${BRANCH}-${LINUXFAMILY}|linux-dtb-${LINUXFAMILY}|g' lib/functions/compilation/kernel-debs.sh 52 | sed -i 's|linux-headers-${BRANCH}-${LINUXFAMILY}|linux-headers-${LINUXFAMILY}|g' lib/functions/compilation/kernel-debs.sh 53 | sed -i 's|linux-libc-dev-${BRANCH}-${LINUXFAMILY}|linux-libc-dev-${LINUXFAMILY}|g' lib/functions/compilation/kernel-debs.sh 54 | 55 | # Remove branch information from linux debs packages name in artifact-kernel.sh 56 | sed -i 's|linux-image-${BRANCH}-${LINUXFAMILY}|linux-image-${LINUXFAMILY}|g' lib/functions/artifacts/artifact-kernel.sh 57 | sed -i 's|linux-dtb-${BRANCH}-${LINUXFAMILY}|linux-dtb-${LINUXFAMILY}|g' lib/functions/artifacts/artifact-kernel.sh 58 | sed -i 's|linux-headers-${BRANCH}-${LINUXFAMILY}|linux-headers-${LINUXFAMILY}|g' lib/functions/artifacts/artifact-kernel.sh 59 | sed -i 's|linux-libc-dev-${BRANCH}-${LINUXFAMILY}|linux-libc-dev-${LINUXFAMILY}|g' lib/functions/artifacts/artifact-kernel.sh 60 | 61 | # Change IMAGE_TYPE from user-built to stable 62 | sed -i 's|IMAGE_TYPE=user-built|IMAGE_TYPE=stable|g' lib/functions/main/config-prepare.sh 63 | 64 | # Change the maximum frequency of RK3566 from 1800000 to 1992000 65 | sed -i 's|1800000|1992000|g' config/sources/families/include/rockchip64_common.inc 66 | 67 | # Remove Actions warnings 68 | sed -i '252{/else/s/^/#/}' lib/functions/cli/utils-cli.sh 69 | sed -i '253{/display_alert/s/^/#/}' lib/functions/cli/utils-cli.sh 70 | sed -i '272{/display_alert/s/^/#/}' lib/functions/cli/utils-cli.sh 71 | sed -i '398{/display_alert/s/^/#/}' lib/functions/main/config-prepare.sh 72 | sed -i '53{/display_alert/s/^/#/}' config/sources/families/include/meson64_common.inc 73 | 74 | # Set custom version 75 | echo "25.8.1" > VERSION 76 | 77 | echo "Patches applied successfully." 78 | -------------------------------------------------------------------------------- /scripts/rename_to_conf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # 设置目标目录 4 | TARGET_DIR="config/boards" 5 | 6 | # 判断目录是否存在 7 | if [ ! -d "$TARGET_DIR" ]; then 8 | echo "❌ 目录不存在:$TARGET_DIR" 9 | exit 1 10 | fi 11 | 12 | # 查找并重命名 .tvb 和 .csc 文件为 .conf 13 | find "$TARGET_DIR" -type f \( -name "*.tvb" -o -name "*.csc" \) | while read -r file; do 14 | new_file="${file%.*}.conf" 15 | if [ -e "$new_file" ]; then 16 | echo "⚠️ 已存在目标文件,跳过:$new_file" 17 | else 18 | mv "$file" "$new_file" 19 | echo "✅ 重命名:$file → $new_file" 20 | fi 21 | done -------------------------------------------------------------------------------- /scripts/sha256.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | 4 | LINUXFAMILY="${LINUX_FAMILY}" 5 | REPO="${GITHUB_REPOSITORY}" 6 | 7 | extract_all_versions_with_sha() { 8 | awk ' 9 | BEGIN { RS=" sha256.txt; then 32 | echo "✅ 提取完成,已保存到 sha256.txt" 33 | else 34 | echo "❌ 提取失败。" 35 | fi 36 | --------------------------------------------------------------------------------