2023-11-02 08:07:41 +00:00
|
|
|
# Maintainer: Arnav Singh <me@arnavion.dev>
|
|
|
|
# Co-Maintainer: Jan Jasper de Kroon <jajadekroon@gmail.com>
|
2020-03-10 10:58:36 +00:00
|
|
|
# U-boot with patches to make the PinePhone boot faster and have control over the ddr clock speed
|
|
|
|
pkgname=u-boot-pinephone
|
2023-01-12 16:28:48 +00:00
|
|
|
pkgver=2023.01
|
2024-02-04 08:03:50 +00:00
|
|
|
pkgrel=3
|
2021-06-08 21:36:42 +00:00
|
|
|
pkgdesc="U-Boot bootloader for the PINE64 PinePhone"
|
|
|
|
url="https://source.denx.de/u-boot"
|
2020-03-10 10:58:36 +00:00
|
|
|
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"
|
2021-05-27 12:06:40 +00:00
|
|
|
depends="linux-postmarketos-allwinner>=5.12"
|
2022-01-20 07:34:41 +00:00
|
|
|
makedepends="$depends_dev
|
|
|
|
arm-trusted-firmware
|
|
|
|
bc
|
|
|
|
bison
|
2024-02-04 08:03:50 +00:00
|
|
|
crust-pinephone
|
2022-01-20 07:34:41 +00:00
|
|
|
dtc
|
|
|
|
flex
|
|
|
|
openssl-dev
|
|
|
|
py3-setuptools
|
|
|
|
python3-dev
|
|
|
|
swig
|
|
|
|
"
|
2020-03-10 10:58:36 +00:00
|
|
|
options="!check"
|
2022-06-30 18:50:37 +00:00
|
|
|
source="https://source.denx.de/u-boot/u-boot/-/archive/v$pkgver/u-boot-v$pkgver.tar.gz
|
2020-06-17 07:36:00 +00:00
|
|
|
update-u-boot
|
2022-06-30 18:50:37 +00:00
|
|
|
0001-common-expose-DRAM-clock-speed.patch
|
|
|
|
0002-disable-bootdelay.patch
|
2020-07-16 09:11:53 +00:00
|
|
|
"
|
2021-06-08 21:36:42 +00:00
|
|
|
builddir="$srcdir/u-boot-v$pkgver"
|
2022-11-23 08:51:46 +00:00
|
|
|
_frequencies='528 552 624'
|
2021-03-29 22:01:38 +00:00
|
|
|
|
2020-03-10 10:58:36 +00:00
|
|
|
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
|
|
|
|
|
2021-06-08 21:36:42 +00:00
|
|
|
export BL31="/usr/share/arm-trusted-firmware/sun50i_a64/bl31.bin"
|
2020-06-17 07:36:00 +00:00
|
|
|
export SCP="/usr/share/crust/pinephone/scp.bin"
|
2020-03-10 10:58:36 +00:00
|
|
|
export BUILD_DIR="$builddir"/build
|
2021-08-26 06:31:17 +00:00
|
|
|
|
2022-11-23 08:51:46 +00:00
|
|
|
for freq in $_frequencies; do
|
2021-03-29 22:01:38 +00:00
|
|
|
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
|
2021-05-10 21:46:53 +00:00
|
|
|
sha512sum -b "$BUILD_DIR-$freq/u-boot-sunxi-with-spl.bin" > "$BUILD_DIR-$freq/u-boot-sunxi-with-spl.bin.sha512"
|
2021-03-29 22:01:38 +00:00
|
|
|
done
|
2021-01-02 15:12:19 +00:00
|
|
|
}
|
|
|
|
|
2020-03-10 10:58:36 +00:00
|
|
|
package() {
|
2022-11-23 08:51:46 +00:00
|
|
|
for freq in $_frequencies; do
|
2021-03-29 22:01:38 +00:00
|
|
|
install -D -m644 "build-$freq/u-boot-sunxi-with-spl.bin" \
|
2021-05-10 21:46:53 +00:00
|
|
|
"$pkgdir/usr/share/u-boot/pine64-pinephone/u-boot-sunxi-with-spl-$freq.bin"
|
|
|
|
install -D -m644 "build-$freq/u-boot-sunxi-with-spl.bin.sha512" \
|
|
|
|
"$pkgdir/usr/share/u-boot/pine64-pinephone/u-boot-sunxi-with-spl-$freq.bin.sha512"
|
2021-03-29 22:01:38 +00:00
|
|
|
done
|
2020-06-17 07:36:00 +00:00
|
|
|
install -D -m 755 "$srcdir"/update-u-boot "$pkgdir"/usr/sbin/update-u-boot
|
2020-03-10 10:58:36 +00:00
|
|
|
}
|
2020-07-16 09:11:53 +00:00
|
|
|
|
2021-05-10 20:51:07 +00:00
|
|
|
sha512sums="
|
2023-01-12 16:28:48 +00:00
|
|
|
c25aae1b0d2f677d295587c6d318f23d52bc3a79e968bed9093645943a9840c56b1f6f44e5649d236e76e3dc85f0473c1da4a5205c02dcf437bca820acaf6fb8 u-boot-v2023.01.tar.gz
|
2022-11-23 08:51:46 +00:00
|
|
|
8dc0a8847ed26d91d3acc9b7b9dd300f95a68049207b09c3cfca1ec485f6f976aa65e0d101a4b46ecc4e85e943cbdec35e81ab0da07b1d5d0b68b4b10858b44b update-u-boot
|
2023-01-12 16:28:48 +00:00
|
|
|
0a05291f5d544854b6e27c7c3290878c55382c50e0374c880d457e7c21425eaec23fd67047fd7e629dba3fa060aa041dec5880e7edc9e52dea897fb93af5d2aa 0001-common-expose-DRAM-clock-speed.patch
|
2022-06-30 18:50:37 +00:00
|
|
|
9b9a5bd2cb5c04715a5bb2d34bfc06e63817dba7ec40fa2b09000a0827590623e85ed5877d6b6bb39f2bb917e5e9d8e1379e3df9128e3304be06abc487c68df2 0002-disable-bootdelay.patch
|
2021-05-10 20:51:07 +00:00
|
|
|
"
|