u-boot-clockworkpi-uconsole-radxa-cm5: rename from u-boot-radxa-cm5

* refactor to only target uconsole
* add update-u-boot tool

[ci:skip-vercheck]: not new package

Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7918>
This commit is contained in:
Antoine Martin 2026-02-08 06:40:17 -05:00 committed by The Friendly Meow (merge) Bot
parent cf186ae56d
commit 41660ec3d2
No known key found for this signature in database
7 changed files with 139 additions and 29 deletions

View file

@ -1,8 +1,9 @@
maintainer="Antoine Martin (ayakael) <dev@ayakael.net>"
pkgname=u-boot-radxa-cm5
pkgname=u-boot-clockworkpi-uconsole-radxa-cm5
pkgver=2017.09
pkgrel=0
pkgdesc="U-Boot fork for the Radxa CM5"
pkgrel=1
_ddr_ver=1.19
pkgdesc="U-Boot fork for the Radxa CM5 for uConsole"
arch="aarch64"
_carch="arm"
license="GPL-2.0"
@ -23,20 +24,24 @@ makedepends="
swig
u-boot-tools
"
options="!check !tracedeps pmb:crossdirect"
_targets="rpi-cm4-io io"
options="!check !tracedeps"
_repository="u-boot"
_commit="575d1a114c66ad09e0d9d9f478c993fc243f5aec"
_rkbin_commit="efaf8526fe85521ac86f4e88b0a6a6c6cf2563a1"
source="
$pkgname-$_commit.tar.gz::https://github.com/radxa/$_repository/archive/$_commit.tar.gz
https://ayakael.net/api/packages/forge/generic/spl_loader_rk3588/1.19.113/rk3588_spl_loader_v1.19.113.bin
https://github.com/radxa/rkbin/raw/$_rkbin_commit/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v$_ddr_ver.bin
0001-menu-fix-timeout-duration.patch
0002-rockchip-move-crypto-functions-to-rk3588s.patch
0003-rk3588-support-compressed-kernel.patch
disable-spl-spi-load.patch
use-python3.patch
https://github.com/radxa/rkbin/raw/efaf8526fe85521ac86f4e88b0a6a6c6cf2563a1/bin/rk35/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.19.bin
update-u-boot
"
replaces="u-boot-radxa-cm5=$pkgver-r$pkgrel"
builddir="$srcdir/$_repository-$_commit"
build() {
@ -44,39 +49,34 @@ build() {
LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > include/timestamp_autogenerated.h
LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> include/timestamp_autogenerated.h
for target in $_targets; do
export BUILD_DIR="$builddir"/build_$target
export ROCKCHIP_TPL="$srcdir"/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v$_ddr_ver.bin
export UBOOTVERSION=rk2410-2017.09-1
export BL31="/usr/share/arm-trusted-firmware/rk3588/bl31.elf"
export ROCKCHIP_TPL="$srcdir"/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.19.bin
export UBOOTVERSION=rk2410-2017.09-1
export BL31="/usr/share/arm-trusted-firmware/rk3588/bl31.elf"
make radxa-cm5-rpi-cm4-io-rk3588s_defconfig
make all u-boot.itb
# python scripts for BL31 management doesn't get copied over
mkdir -p "$BUILD_DIR"/arch/arm/mach-rockchip
cp "$builddir"/arch/arm/mach-rockchip/*.py "$BUILD_DIR"/arch/arm/mach-rockchip/.
make O="$BUILD_DIR" ARCH="$_carch" radxa-cm5-$target-rk3588s_defconfig
make O="$BUILD_DIR" ARCH="$_carch" all u-boot.itb
# make idbloader.img
mkimage -n rk3588 -T rksd -d "$ROCKCHIP_TPL:$BUILD_DIR"/spl/u-boot-spl.bin "$BUILD_DIR"/idbloader.img
done
# make idbloader.img
mkimage -n rk3588 -T rksd -d "$ROCKCHIP_TPL:$builddir"/spl/u-boot-spl.bin "$builddir"/idbloader.img
}
package() {
for target in $_targets; do
install -Dm644 "$builddir/build_$target/u-boot-dtb.bin" "$pkgdir/usr/share/u-boot/radxa-cm5/$target/u-boot.bin"
install -Dm644 "$builddir/build_$target/idbloader.img" "$pkgdir/usr/share/u-boot/radxa-cm5/$target/idbloader.img"
install -Dm644 "$builddir/build_$target/u-boot.itb" "$pkgdir/usr/share/u-boot/radxa-cm5/$target/u-boot.itb"
done
install -D -m755 "$srcdir"/update-u-boot "$pkgdir"/usr/sbin/update-u-boot
install -Dm644 \
"$builddir"/idbloader.img \
"$builddir"/u-boot.itb \
"$srcdir"/rk3588_spl_loader_v1.19.113.bin \
-t "$pkgdir"/usr/share/u-boot/clockworkpi-uconsole-radxa-cm5
}
sha512sums="
4805d0224b8c4ffecdaf560cf493ea06df9e195b7009aa7c30457cb33ecaeea92a64e7b2004ec1903d20fecc0e711905c710bca53072eefececd41a46b4176a2 u-boot-radxa-cm5-575d1a114c66ad09e0d9d9f478c993fc243f5aec.tar.gz
4805d0224b8c4ffecdaf560cf493ea06df9e195b7009aa7c30457cb33ecaeea92a64e7b2004ec1903d20fecc0e711905c710bca53072eefececd41a46b4176a2 u-boot-clockworkpi-uconsole-radxa-cm5-575d1a114c66ad09e0d9d9f478c993fc243f5aec.tar.gz
ec2bcf5d5574759ba4bfa71a1880aa76a6647b73a104cac01c17666beab44bf864cc25407435bd2bdc2f9bb88f4bee12ee980cd824044179549e895daba8eff9 rk3588_spl_loader_v1.19.113.bin
0b529e57a7206471a66dcdb98dab3f8deeff333d587c2ebdd08febb40ab9b44e2d51de364d2383ed80dd2b38764ccb552a48f9e34da43607f1e08d385af3f161 rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.19.bin
36baf3b8618928e8927229353157ccecb5477e6ed868b9425a04acc2b297026084bd5ed96785292ab2ccb74b9f6328fe032b55505749b103cd68e25777dc3334 0001-menu-fix-timeout-duration.patch
364a8701898e34f6235d2de486316413b5beec95578ee450e504e9a6f5c9feec773642a8129a91eef264e9466206c082950d0793a6a3e97f638edac42e4a70bf 0002-rockchip-move-crypto-functions-to-rk3588s.patch
d80fbde984311b97b0dbd3d1bf7e740350f7c85f3bc8c22fdac93f9200c5b7c722c956dbcc3ec0f4422a72fe5c46b14c0770433efa0f6faf01520ad2ac5f9eca 0003-rk3588-support-compressed-kernel.patch
11a1e30ad0002148f32314dc60c95120d45ffe462755e0bbc7d52ee4001e3283ffb87ba6f58d41feb0c40d456ef42c03857f98f8921c9a7bb810bbf404abedb3 disable-spl-spi-load.patch
1164247343518c9820ce2bf1302f18079b9af81f6ef164e5b9d2c5cbad00ac20e1943bb44d48862c0d4a2f0b7448f9fa35d02d2f66e90c34033d999b3a968443 use-python3.patch
0b529e57a7206471a66dcdb98dab3f8deeff333d587c2ebdd08febb40ab9b44e2d51de364d2383ed80dd2b38764ccb552a48f9e34da43607f1e08d385af3f161 rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.19.bin
c38b421d48f399ab30707cb244460d9dfc9050592dbafd13f09be11aeda2a19d325f2599cf2650e6855034999a1daf54324e9a65979f9a5d5dc55fe012421384 update-u-boot
"

View file

@ -0,0 +1,110 @@
#!/bin/sh
verbose=
board=
device=
dryrun=
imagedir=
get_defaults() {
if [ -z "$board" -a -e /sys/firmware/devicetree/base/compatible ]; then
case "$(cat /sys/firmware/devicetree/base/compatible 2>/dev/null)" in
radxa,cm5-rpi-cm4-io*) board=radxa-cm5 ;;
esac
fi
if [ -z "$device" ]; then
case "$board" in
radxa-cm5) device=/dev/mmcblk1 ;;
esac
fi
if [ -z "$imagedir" ]; then
imagedir="$(realpath $(dirname $0))"
[ -f "$imagedir/README.txt" ] || imagedir="/usr/share/u-boot"
fi
}
die() {
echo "ERROR: $@"
exit 1
}
usage() {
get_defaults
cat <<EOF
usage: $0 [-n,--dry-run] [-i,--imagedir <imagedir>] [-b|--board <board-type>] [-d|--device <device>]
options:
-b,--board <board> Specify the board type: radxa-cm5
(current default: ${board:-none})
-d,--device <device> Specify the device where to install u-boot
(current default: ${device:-none})
-i,--imagedir <imagedir> Specify u-boot image directory
(current default: ${imagedir:-none})
-n,--dry-run Print commands but don't execute them
EOF
}
while [ $# -gt 0 ]; do
opt="$1"
shift
case "$opt" in
-b|--board)
case "$1" in
radxa-cm5) board="radxa-cm5" ;;
*) usage; exit 1;;
esac
shift
;;
-d|--device)
device="$1"
shift
;;
-i|--imagedir)
imagedir="$1"
shift
;;
-n|--dry-run)
dryrun="echo"
;;
--)
break
;;
-*)
usage
exit 1
;;
esac
done
get_defaults
if [ -z "$board" -o -z "$device" -o -z "$imagedir" -o ! -e "$imagedir" ]; then
usage
exit 1
fi
if [ -z "$dryrun" ]; then
echo "Updating $board u-boot in $device in 3 seconds..."
sleep 3
fi
(
set -e
case "$board" in
radxa-cm5)
[ -e "$imagedir/clockworkpi-uconsole-radxa-cm5/" ] || die "radxa-cm5 images not installed, apk add u-boot-clockworkpi-uconsole-radxa-cm5"
$dryrun dd if=$imagedir/clockworkpi-uconsole-radxa-cm5/idbloader.img of=$device seek=64 status=none
$dryrun dd if=$imagedir/clockworkpi-uconsole-radxa-cm5/u-boot.itb of=$device seek=16384 status=none
;;
esac
$dryrun sync
) || die "U-Boot installation in $device failed"
[ -z "$dryrun" ] && echo "Completed successfully."