Skip to content

u-boot v2026.01 for RK3576 #34

u-boot v2026.01 for RK3576

u-boot v2026.01 for RK3576 #34

Workflow file for this run

name: Build u-boot for RK3576
run-name: u-boot ${{ inputs.uboot_ref }} for RK3576
permissions:
contents: write
on:
workflow_dispatch:
inputs:
uboot_ref:
description: Enter a u-boot git tag (or branch/commit)
required: true
default: v2026.01
type: string
use_arm_tf:
description: Use ARM Trusted Firmware for BL31 (if unchecked, uses Rockchip BL31)
required: true
default: true
type: boolean
cherry_pick_commit:
description: Enter u-boot commit(s) to cherry-pick (optional, comma-separated)
required: false
type: string
upload_release:
description: Upload artifacts to GitHub Release
required: true
default: false
type: boolean
jobs:
build:
name: ${{ matrix.board.name }}
runs-on: ubuntu-24.04-arm
strategy:
matrix:
board:
- name: rk3576-generic
config: generic-rk3576_defconfig
- name: rk3576-armsom-sige5
config: sige5-rk3576_defconfig
- name: rk3576-luckfox-omni3576
config: omni3576-rk3576_defconfig
- name: rk3576-nanopi-m5
config: nanopi-m5-rk3576_defconfig
- name: rk3576-roc-pc
config: roc-pc-rk3576_defconfig
- name: rk3576-rock-4d
config: rock-4d-rk3576_defconfig
fail-fast: true
steps:
- name: Toolchain
run: |
sudo apt update
sudo apt install gcc python3-pyelftools libgnutls28-dev
gcc --version
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout rockchip rkbin
uses: actions/checkout@v4
with:
repository: rockchip-linux/rkbin
ref: master
path: rkbin
fetch-depth: 1
- name: Checkout ARM Trusted Firmware
if: inputs.use_arm_tf
uses: actions/checkout@v4
with:
repository: ARM-software/arm-trusted-firmware
ref: v2.13.0
path: arm-trusted-firmware
fetch-depth: 1
submodules: recursive
- name: Build BL31
if: inputs.use_arm_tf
run: |
cd arm-trusted-firmware
make PLAT=rk3576 bl31
ls -l build/rk3576/release/bl31/bl31.elf
- name: Checkout u-boot ${{ inputs.uboot_ref }}
uses: actions/checkout@v4
with:
repository: u-boot/u-boot
ref: ${{ inputs.uboot_ref }}
path: u-boot
fetch-depth: 1
- name: Checkout inindev uboot-rockchip patches
uses: actions/checkout@v4
with:
repository: inindev/uboot-rockchip
ref: main
path: uboot-rockchip
fetch-depth: 1
- name: Apply patches
run: |
cd u-boot
patches=$(find ../uboot-rockchip/patches -maxdepth 2 -name '*.patch' | sort)
if [ -n "$patches" ]; then
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
for patch in $patches; do
echo "Applying $patch"
git am "$patch" || { echo "Failed to apply: $patch"; exit 1; }
done
fi
- name: Cherry-pick commits
if: inputs.cherry_pick_commit != ''
run: |
cd u-boot
git fetch origin
IFS=',' read -ra COMMITS <<< "${{ inputs.cherry_pick_commit }}"
for COMMIT in "${COMMITS[@]}"; do
git cherry-pick $(echo $COMMIT) || (echo "Cherry-pick failed for $COMMIT"; exit 1)
done
- name: "Configure and build u-boot config: ${{ matrix.board.config }}"
run: |
set -e
export ROCKCHIP_TPL=../rkbin/$(awk -F'=' '$1 == "[LOADER_OPTION]" {f=1; next} f && $1 == "FlashData" {print $2; exit}' rkbin/RKBOOT/RK3576MINIALL.ini)
if [ "${{ inputs.use_arm_tf }}" = "true" ]; then
export BL31=../arm-trusted-firmware/build/rk3576/release/bl31/bl31.elf
else
export BL31=../rkbin/$(awk -F'=' '$1 == "[BL31_OPTION]" {f=1; next} f && $1 == "PATH" {print $2; exit}' rkbin/RKTRUST/RK3576TRUST.ini)
fi
cd u-boot
make mrproper
make ${{ matrix.board.config }}
make -j$(nproc) KCFLAGS="-Werror"
tools/mkimage -l u-boot.itb
mkdir -p ../output/${{ matrix.board.name }}/base-files
cp idbloader*.img u-boot.itb ../output/${{ matrix.board.name }}/base-files/ 2>/dev/null || true
cp u-boot-rockchip*.bin ../output/${{ matrix.board.name }}/ 2>/dev/null || true
cp ../../uboot-rockchip/readme.txt ../output/${{ matrix.board.name }}/
cd ../output/${{ matrix.board.name }}
sha256sum u-boot-rockchip*.bin > sha256sums.txt 2>/dev/null || true
cd base-files
sha256sum idbloader*.img u-boot.itb > sha256sums.txt 2>/dev/null || true
cd ../..
zip -r ../${{ matrix.board.name }}.zip ${{ matrix.board.name }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.board.name }}
path: output/
if-no-files-found: error
- name: Upload Release Artifacts
if: inputs.upload_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.uboot_ref }}
name: u-boot arm64 ${{ inputs.uboot_ref }}
draft: true
prerelease: ${{ contains(inputs.uboot_ref, '-rc') }}
files: ${{ matrix.board.name }}.zip
fail_on_unmatched_files: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}