# U-boot with patches to make the PinePhone boot faster and have control over the ddr clock speed pkgname=u-boot-pinephone pkgver=2021.01_git20201228 pkgrel=1 # Last commit from "crust" branch, as used in "crust-meta": # https://gitlab.com/pine64-org/crust-meta/-/blob/8886bcc829179bf77216fade71f0ede9bd014e67/Makefile#L78 _commit="7492749fec31b1086bc8933bf113a766aea021aa" pkgdesc="u-boot bootloader for the PINE64 PinePhone" url="https://gitlab.com/pine64-org/u-boot" arch="aarch64" license="GPL-2.0-or-later OFL-1.1 BSD-2-Clause BSD-3-Clause eCos-2.0 IBM-pibs ISC LGPL-2.0-only LGPL-2.1-only X11" makedepends="$depends_dev bc dtc python3-dev py3-setuptools swig bison flex openssl-dev arm-trusted-firmware-sun50i crust" options="!check" source="https://gitlab.com/pine64-org/u-boot/-/archive/$_commit/u-boot-$_commit.tar.gz update-u-boot " builddir="$srcdir/u-boot-$_commit" frequencies='528 552 624' build() { touch include/config.h 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 export BL31="/usr/share/arm-trusted-firmware-sun50i/bl31.bin" export SCP="/usr/share/crust/pinephone/scp.bin" export BUILD_DIR="$builddir"/build for freq in $frequencies; do mkdir -p "$BUILD_DIR-$freq" sed -rie "s/^(CONFIG_DRAM_CLK=).*$/CONFIG_DRAM_CLK=$freq/" configs/pinephone_defconfig cat configs/pinephone_defconfig | grep CONFIG_DRAM_CLK make O="$BUILD_DIR-$freq" HOSTCC=gcc ARCH=arm pinephone_defconfig make O="$BUILD_DIR-$freq" HOSTCC=gcc ARCH=arm all done } package() { for freq in $frequencies; do install -D -m644 "build-$freq/u-boot-sunxi-with-spl.bin" \ "$pkgdir"/usr/share/u-boot/pine64-pinephone/u-boot-sunxi-with-spl-$freq.bin done install -D -m 755 "$srcdir"/update-u-boot "$pkgdir"/usr/sbin/update-u-boot } sha512sums="73b132cdc26113a83d060f0d243320ca989b4efa98fe95a2205526a42f615ced7046bb9d4878c67a9a550b04c2519d90be3c2272be97c878d759bf5d027cf536 u-boot-7492749fec31b1086bc8933bf113a766aea021aa.tar.gz f45b86839992472f2264d3651b28ef7ebe84c77c00fb557db1b381e48350f9687eac1555be8f0c6b1dc5a62299f06010208c73daa9422d58c344ba6bb8c7e22a update-u-boot"