aboutsummaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorMitchell Horne <mhorne@FreeBSD.org>2020-12-17 18:12:01 +0000
committerMitchell Horne <mhorne@FreeBSD.org>2020-12-17 18:12:01 +0000
commitb94bc0e787745dc2a801f7321c160a8115c121ca (patch)
tree986fc249f0147b64db965efb6522fb07aa186186 /sysutils
parentd04c38c335c949f5914f100bdbc8b9daa2559a52 (diff)
downloadports-b94bc0e787745dc2a801f7321c160a8115c121ca.tar.gz
ports-b94bc0e787745dc2a801f7321c160a8115c121ca.zip
Add sysutils/u-boot-sifive-fu540: u-boot for the HiFive Unleashed
Tested by: Klaus Küchemann <maciphone2@googlemail.com> Reviewed by: manu, Klaus Küchemann Approved by: manu (uboot, ports) Differential Revision: https://reviews.freebsd.org/D25737
Notes
Notes: svn path=/head/; revision=558309
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/u-boot-sifive-fu540/Makefile18
-rw-r--r--sysutils/u-boot-sifive-fu540/pkg-descr19
3 files changed, 38 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 3a351d091306..97920246243c 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -1407,6 +1407,7 @@
SUBDIR += u-boot-rpi3-32
SUBDIR += u-boot-rpi4
SUBDIR += u-boot-rpi-arm64
+ SUBDIR += u-boot-sifive-fu540
SUBDIR += u-boot-sinovoip-bpi-m3
SUBDIR += u-boot-sopine
SUBDIR += u-boot-sopine-spi
diff --git a/sysutils/u-boot-sifive-fu540/Makefile b/sysutils/u-boot-sifive-fu540/Makefile
new file mode 100644
index 000000000000..849869fa0d2d
--- /dev/null
+++ b/sysutils/u-boot-sifive-fu540/Makefile
@@ -0,0 +1,18 @@
+# $FreeBSD$
+
+MASTERDIR= ${.CURDIR}/../u-boot-master
+
+MODEL= sifive-fu540
+BOARD_CONFIG= sifive_fu540_defconfig
+FAMILY= sifive
+UBOOT_ARCH= riscv64
+
+# The FIT image will embed an OpenSBI firmware binary
+OPENSBI_FIRM= ${LOCALBASE}/share/opensbi/lp64/sifive/fu540/firmware/fw_dynamic.bin
+BUILD_DEPENDS+= ${OPENSBI_FIRM}:sysutils/opensbi
+MAKE_ENV+= OPENSBI=${OPENSBI_FIRM}
+
+UBOOT_MOVE= ${WRKSRC}/spl/u-boot-spl.bin
+UBOOT_PLIST= u-boot.itb u-boot-spl.bin
+
+.include "${MASTERDIR}/Makefile"
diff --git a/sysutils/u-boot-sifive-fu540/pkg-descr b/sysutils/u-boot-sifive-fu540/pkg-descr
new file mode 100644
index 000000000000..80cff00b7540
--- /dev/null
+++ b/sysutils/u-boot-sifive-fu540/pkg-descr
@@ -0,0 +1,19 @@
+U-Boot loader and related files for the HiFive Unleashed (FU540).
+
+The SD card must be formatted with a GPT partition scheme, and expects two
+specific GUID partition types for the SPL and FIT image.
+
+Note: due to limitations in gpart(8), sgdisk(8) should be used instead. Install
+it with the sysutils/gdisk port or package.
+
+Assuming an SD card device in /dev/da2, execute:
+sgdisk --clear --set-alignment=2 \
+ --new=1:34:2081 --change-name=1:loader1 --typecode=1:5B193300-FC78-40CD-8002-E86C45580B47 \
+ --new=2:2082:10273 --change-name=2:loader2 --typecode=2:2E54B353-1271-4842-806F-E436D6AF6985 \
+ /dev/da2
+
+Now, copy the u-boot files to the SD card with dd(1).
+dd if=/usr/local/share/u-boot/u-boot-sifive-fu540/u-boot-spl.bin of=/dev/da2p1 conv=sync
+dd if=/usr/local/share/u-boot/u-boot-sifive-fu540/u-boot.itb of=/dev/da2p2 conv=sync
+
+WWW: https://www.denx.de/wiki/U-Boot