aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Horne <mhorne@FreeBSD.org>2022-05-11 17:43:33 +0000
committerMitchell Horne <mhorne@FreeBSD.org>2022-05-11 17:43:33 +0000
commit14d576f78a297fd3443887c4f2ab9ceb76466433 (patch)
treec4be52a2b16fc6f7f70af1f3ed71abb2fe963c36
parent16a11f626221ce37e4951d0e1d6946ab75f47aac (diff)
downloadports-14d576f78a297fd3443887c4f2ab9ceb76466433.tar.gz
ports-14d576f78a297fd3443887c4f2ab9ceb76466433.zip
sysutils/u-boot-sifive-fu740: add new port
This adds a u-boot variant for the HiFive Unmatched board. Reviewed by: manu Approved by: manu (ports, uboot) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35171
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/u-boot-sifive-fu740/Makefile16
-rw-r--r--sysutils/u-boot-sifive-fu740/pkg-descr19
3 files changed, 36 insertions, 0 deletions
diff --git a/sysutils/Makefile b/sysutils/Makefile
index 05c47d0bffe8..26ee0452a5a6 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -1454,6 +1454,7 @@
SUBDIR += u-boot-rpi3-32
SUBDIR += u-boot-rpi4
SUBDIR += u-boot-sifive-fu540
+ SUBDIR += u-boot-sifive-fu740
SUBDIR += u-boot-sinovoip-bpi-m3
SUBDIR += u-boot-sopine
SUBDIR += u-boot-sopine-spi
diff --git a/sysutils/u-boot-sifive-fu740/Makefile b/sysutils/u-boot-sifive-fu740/Makefile
new file mode 100644
index 000000000000..3902e50d6394
--- /dev/null
+++ b/sysutils/u-boot-sifive-fu740/Makefile
@@ -0,0 +1,16 @@
+MASTERDIR= ${.CURDIR}/../u-boot-master
+
+MODEL= sifive-fu740
+BOARD_CONFIG= sifive_unmatched_defconfig
+FAMILY= sifive
+UBOOT_ARCH= riscv64
+
+# The FIT image will embed an OpenSBI firmware binary
+OPENSBI_FIRM= ${LOCALBASE}/share/opensbi/lp64/generic/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-fu740/pkg-descr b/sysutils/u-boot-sifive-fu740/pkg-descr
new file mode 100644
index 000000000000..9f7f8a753ab1
--- /dev/null
+++ b/sysutils/u-boot-sifive-fu740/pkg-descr
@@ -0,0 +1,19 @@
+U-Boot loader and related files for the HiFive Unmatched (FU740).
+
+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
+the sysutils/gdisk port or package.
+
+Assuming an SD card device in /dev/da2, execute:
+sgdisk -g --clear --set-alignment=1 \
+ --new=1:34:2081 --change-name=1:spl --typecode=1:5B193300-FC78-40CD-8002-E86C45580B47 \
+ --new=2:2082:10273 --change-name=2:uboot --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-fu740/u-boot-spl.bin of=/dev/da2p1 conv=sync
+dd if=/usr/local/share/u-boot/u-boot-sifive-fu740/u-boot.itb of=/dev/da2p2 conv=sync
+
+WWW: https://www.denx.de/wiki/U-Boot