aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2021-08-18 15:13:28 +0200
committerSören Tempel <soeren+git@soeren-tempel.net>2021-08-19 21:31:57 +0200
commitc4f09deff06876afbce73ffa7a9aaf82b562e5b7 (patch)
tree31a63a97fc31da9c41ddd9f589f8d6313140760b
parent9174ed5335d3dfc6df3676d0308af4ec0549eba2 (diff)
downloadaports-c4f09deff068.tar.gz
aports-c4f09deff068.tar.bz2
aports-c4f09deff068.tar.xz
main/u-boot: add support for the HiFive Unmatched
The HiFive Unmatched is a riscv64 development plattform developed by SiFive. The HiFive Unmatched has several boot loader stages which are described further in Chapter 6 of the FU740-C000 manual. From these boot loader stages Alpine needs to provide u-boot SPL and u-boot.itb. The former initializes hardware for the first stages of the boot flow, the later encapsulates OpenSBIs fw_dynamic payload, u-boot-nodtb.bin, and the device tree blob for the HiFive Unmatched. As such, OpenSBI also needs to be moved to main/ and is a makedependency of the u-boot package on riscv64. Furthermore, updates of the OpenSBI package now require rebuilds of the u-boot package on riscv64. The packaged u-boot bootloader stages can either be loaded from an SD card or from SPI flash. For Alpine purposes the SPI flash usecase is probably more interesting but hasn't been integrated with the update-u-boot script yet. Currently, the files shipped by the u-boot-unmatched package are primarily useful to (manually) create bootable SD card images. See https://u-boot.readthedocs.io/en/latest/board/sifive/unmatched.html
-rw-r--r--main/u-boot/APKBUILD16
1 files changed, 14 insertions, 2 deletions
diff --git a/main/u-boot/APKBUILD b/main/u-boot/APKBUILD
index 3aa6ae1a59..c09cacfeee 100644
--- a/main/u-boot/APKBUILD
+++ b/main/u-boot/APKBUILD
@@ -3,7 +3,7 @@
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=u-boot
pkgver=2021.07
-pkgrel=0
+pkgrel=1
pkgdesc="u-boot bootloader common files"
url="https://www.denx.de/wiki/U-Boot/"
arch="all !s390x !ppc64le"
@@ -20,6 +20,11 @@ source="https://ftp.denx.de/pub/u-boot/u-boot-${pkgver//_/-}.tar.bz2
"
builddir="$srcdir"/u-boot-${pkgver//_/-}
+if [ "$CARCH" = "riscv64" ]; then
+ makedepends="$makedepends opensbi"
+ export OPENSBI=/usr/share/opensbi/generic/firmware/fw_dynamic.bin
+fi
+
# secfixes:
# 2021.04-r0:
# - CVE-2021-27097
@@ -47,6 +52,7 @@ aarch64) board_configs="
";;
riscv64) board_configs="
qemu:qemu-riscv64
+ unmatched:sifive_unmatched
";;
esac
@@ -136,8 +142,14 @@ _split_boards() {
msg "Including board $board"
mkdir -p "$subpkgdir"/usr/share/$pkgname/$board
export BUILD_DIR="$builddir"/build/$board
+
+ local board_images=""
+ case "$board" in
+ "sifive_unmatched") board_images="u-boot.itb spl/u-boot-spl.bin --" ;;
+ esac
+
local ok=no
- for image in u-boot-sunxi-with-spl.bin -- MLO SPL u-boot.img -- u-boot.bin; do
+ for image in $board_images u-boot-sunxi-with-spl.bin -- MLO SPL u-boot.img -- u-boot.bin; do
if [ "$image" = "--" ]; then
[ "$ok" = yes ] && break
continue