Skip to content
Snippets Groups Projects
Commit c4f09def authored by Sören Tempel's avatar Sören Tempel
Browse files

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
parent 9174ed53
No related merge requests found
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Maintainer: Milan P. Stanić <mps@arvanta.net> # Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=u-boot pkgname=u-boot
pkgver=2021.07 pkgver=2021.07
pkgrel=0 pkgrel=1
pkgdesc="u-boot bootloader common files" pkgdesc="u-boot bootloader common files"
url="https://www.denx.de/wiki/U-Boot/" url="https://www.denx.de/wiki/U-Boot/"
arch="all !s390x !ppc64le" arch="all !s390x !ppc64le"
...@@ -20,6 +20,11 @@ source="https://ftp.denx.de/pub/u-boot/u-boot-${pkgver//_/-}.tar.bz2 ...@@ -20,6 +20,11 @@ source="https://ftp.denx.de/pub/u-boot/u-boot-${pkgver//_/-}.tar.bz2
" "
builddir="$srcdir"/u-boot-${pkgver//_/-} builddir="$srcdir"/u-boot-${pkgver//_/-}
if [ "$CARCH" = "riscv64" ]; then
makedepends="$makedepends opensbi"
export OPENSBI=/usr/share/opensbi/generic/firmware/fw_dynamic.bin
fi
# secfixes: # secfixes:
# 2021.04-r0: # 2021.04-r0:
# - CVE-2021-27097 # - CVE-2021-27097
...@@ -47,6 +52,7 @@ aarch64) board_configs=" ...@@ -47,6 +52,7 @@ aarch64) board_configs="
";; ";;
riscv64) board_configs=" riscv64) board_configs="
qemu:qemu-riscv64 qemu:qemu-riscv64
unmatched:sifive_unmatched
";; ";;
esac esac
...@@ -136,8 +142,14 @@ _split_boards() { ...@@ -136,8 +142,14 @@ _split_boards() {
msg "Including board $board" msg "Including board $board"
mkdir -p "$subpkgdir"/usr/share/$pkgname/$board mkdir -p "$subpkgdir"/usr/share/$pkgname/$board
export BUILD_DIR="$builddir"/build/$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 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 if [ "$image" = "--" ]; then
[ "$ok" = yes ] && break [ "$ok" = yes ] && break
continue continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment