aboutsummaryrefslogtreecommitdiffstats
path: root/sys-boot/u-boot
diff options
context:
space:
mode:
Diffstat (limited to 'sys-boot/u-boot')
-rw-r--r--sys-boot/u-boot/Manifest5
-rw-r--r--sys-boot/u-boot/files/efi-priority.patch16
-rw-r--r--sys-boot/u-boot/metadata.xml19
-rw-r--r--sys-boot/u-boot/u-boot-2021.01_rc5.ebuild89
4 files changed, 129 insertions, 0 deletions
diff --git a/sys-boot/u-boot/Manifest b/sys-boot/u-boot/Manifest
new file mode 100644
index 0000000..bec3d4c
--- /dev/null
+++ b/sys-boot/u-boot/Manifest
@@ -0,0 +1,5 @@
+AUX efi-priority.patch 1008 BLAKE2B f054f8f6a06f81bfbb79ef87e5ade7f6df8d7fe11bff4742a7988deaa4bfa0f64332571a30a475689b0e86994462b4e66750d3059e594bd5d72067ae0be97e2c SHA512 d7266dd81e6c1bd20f27513ac046a70d88d064238e250ff3a430c6c588f2ff594512d4374ced7cf9edabbaeacd6f1d901ac679edacb47f5dee76b17f45193f50
+DIST meta-sifive-2021.05.zip 664346 BLAKE2B ca98d75c4fc255f3ec99c3e9667e1a5e43fc1db88b83010db3766ff8e70acfaf2741dde96da65265aeef5ca82e1cc93a96ea771dd48cc2c9ff4af24d3feb4b82 SHA512 e60052fc183ddd89a4b0a2a443aedfe22c20ce1134925d6c0d52946ce9a5ca04750408fcb7b191ecc30b4d4b21c9e2f262d0d2b89527923a7cd82dc01a7f2345
+DIST u-boot-2021.01_rc5.tar.gz 20920395 BLAKE2B ba28811074191d97cdfa2e1e70083a113531a69285ad5e1f662f9d9715007b5441a043adf2592ab406295b1f85089aab7193068bf6f5a92af224bdde4aae21c7 SHA512 1c215c1b71e24d24838249e72ca2d97e3b857176d761a99a6a94597a3ab65940dc3f302c451559411691c716a4c73267f280a46a52d1f4ad97fec7eb13951444
+EBUILD u-boot-2021.01_rc5.ebuild 2659 BLAKE2B 0db14b146e2b876ccfe602fa2b3a6a1693717b8d7e4669b0b02c1b4787466ae7e136798ca85767c3c9613684fc541de1e3ec8eae17de26abe859e95b525c04da SHA512 edf949380cf957797e6e41790f440ad8351edba0037970767eafc28a1ed77b82b63f23900994c3746a4c7ebe28f77a426e8a3fd6a243ecde797f8294b5d80bda
+MISC metadata.xml 785 BLAKE2B fcfc4e1be03d1b5d8c03200e016576c99b31a415ec1a7177993ca9629bd4c979c68bafe2dbfe57cae5eefae4140349e2984f43ed0e1a183606b3e3235ea93062 SHA512 f5d6160b664ec093929760ed4c83ad9505dc2f0c285d05e2a63b403f7e9674af6a96f9eedbf6b692fb4a56336365f822f96e6608d0aaea50400d9615c995297d
diff --git a/sys-boot/u-boot/files/efi-priority.patch b/sys-boot/u-boot/files/efi-priority.patch
new file mode 100644
index 0000000..aee2f94
--- /dev/null
+++ b/sys-boot/u-boot/files/efi-priority.patch
@@ -0,0 +1,16 @@
+diff -Naur u-boot-2021.01_rc5/include/config_distro_bootcmd.h u-boot-2021.01_rc5-mod/include/config_distro_bootcmd.h
+--- u-boot-2021.01_rc5/include/config_distro_bootcmd.h 2021-07-04 11:32:47.978321442 +0200
++++ u-boot-2021.01_rc5-mod/include/config_distro_bootcmd.h 2021-07-04 11:34:05.930534226 +0200
+@@ -462,11 +462,11 @@
+ "scan_dev_for_boot=" \
+ "echo Scanning ${devtype} " \
+ "${devnum}:${distro_bootpart}...; " \
++ SCAN_DEV_FOR_EFI \
+ "for prefix in ${boot_prefixes}; do " \
+ "run scan_dev_for_extlinux; " \
+ "run scan_dev_for_scripts; " \
+ "done;" \
+- SCAN_DEV_FOR_EFI \
+ "\0" \
+ \
+ "scan_dev_for_boot_part=" \
diff --git a/sys-boot/u-boot/metadata.xml b/sys-boot/u-boot/metadata.xml
new file mode 100644
index 0000000..125d2ed
--- /dev/null
+++ b/sys-boot/u-boot/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+<email>root@localhost</email>
+<name>root</name>
+</maintainer>
+ <use>
+ <flag name="1000">Set CPU frequency to 1000 MHz</flag>
+ <flag name="1100">Set CPU frequency to 1100 MHz</flag>
+ <flag name="1200">Set CPU frequency to 1200 MHz</flag>
+ <flag name="1300">Set CPU frequency to 1300 MHz</flag>
+ <flag name="1400">Set CPU frequency to 1400 MHz</flag>
+ <flag name="1500">Set CPU frequency to 1500 MHz</flag>
+ <flag name="1600">Set CPU frequency to 1600 MHz</flag>
+ <flag name="1700">Set CPU frequency to 1700 MHz</flag>
+ <flag name="efi-priority">Try EFI boot before other methods</flag>
+ </use>
+</pkgmetadata>
diff --git a/sys-boot/u-boot/u-boot-2021.01_rc5.ebuild b/sys-boot/u-boot/u-boot-2021.01_rc5.ebuild
new file mode 100644
index 0000000..7f293a6
--- /dev/null
+++ b/sys-boot/u-boot/u-boot-2021.01_rc5.ebuild
@@ -0,0 +1,89 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+META_SIFIVE="2021.05"
+UBOOT_COMMIT="c4fddedc48f336eabc4ce3f74940e6aa372de18c"
+
+DESCRIPTION="U-Boot with meta-sifive-${META_SIFIVE} patches"
+HOMEPAGE="https://source.denx.de/u-boot/u-boot"
+SRC_URI="https://source.denx.de/u-boot/u-boot/-/archive/${UBOOT_COMMIT}/u-boot-${UBOOT_COMMIT}.tar.gz -> ${P}.tar.gz
+ https://github.com/sifive/meta-sifive/archive/refs/heads/${META_SIFIVE}.zip -> meta-sifive-${META_SIFIVE}.zip"
+
+LICENSE="GPL-2+"
+SLOT="0"
+KEYWORDS="~riscv"
+
+DEPEND="sys-boot/opensbi sys-apps/dtc"
+RDEPEND="${DEPEND}"
+BDEPEND=""
+
+IUSE="-1000 -1100 +1200 -1300 -1400 -1500 -1600 -1700 efi-priority"
+REQUIRED_USE="^^ ( 1000 1100 1200 1300 1400 1500 1600 1700 )"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+ unpack meta-sifive-${META_SIFIVE}.zip
+ mv "${WORKDIR}/u-boot-${UBOOT_COMMIT}" "${WORKDIR}/${P}"
+}
+
+src_prepare() {
+ eapply "${WORKDIR}/meta-sifive-${META_SIFIVE}/recipes-bsp/u-boot/files/unmatched"
+
+ # A default, just to be sure
+ CONFIG_SPEED=1200000000
+
+ # Check use flags
+ use 1000 && CONFIG_SPEED=1000000000
+ use 1100 && CONFIG_SPEED=1100000000
+ use 1200 && CONFIG_SPEED=1200000000
+ use 1300 && CONFIG_SPEED=1300000000
+ use 1400 && CONFIG_SPEED=1400000000
+ use 1500 && CONFIG_SPEED=1500000000
+ use 1600 && CONFIG_SPEED=1600000000
+ use 1700 && CONFIG_SPEED=1700000000
+
+ # Actaually modify the dtsi file
+ sed -i -E -e "/cpus/,/cpu0/ s/assigned-clock-rates = <[0-9]+>/assigned-clock-rates = <${CONFIG_SPEED}>/" "${WORKDIR}/${P}/arch/riscv/dts/fu740-c000-u-boot.dtsi"
+ elog "Set CPU frquency to $((CONFIG_SPEED/1000000)) Mhz"
+
+ if use efi-priority; then
+ eapply "${FILESDIR}/efi-priority.patch"
+ fi
+
+ eapply_user
+}
+
+src_configure()
+{
+ # Apply Unmatched defconfig
+ emake sifive_hifive_unmatched_fu740_defconfig
+}
+
+src_compile() {
+ # Find opensbi
+ export OPENSBI=`find /usr/share/opensbi-* -name fw_dynamic.bin | sort | tail -n 1`
+ if [ -z "$OPENSBI" ]; then
+ die "Can't find OpenSBI, is sys-boot/opensbi installed?"
+ fi
+ elog "Using OpenSBI at ${OPENSBI}"
+
+ # Start the build
+ emake
+}
+
+src_install() {
+ mkdir -p "${D}/usr/share/${P}"
+ cp "${WORKDIR}/${P}/u-boot.itb" "${D}/usr/share/${P}"
+ cp "${WORKDIR}/${P}/spl/u-boot-spl.bin" "${D}/usr/share/${P}"
+}
+
+pkg_postinst()
+{
+ einfo "U-Boot files have been installed in /usr/share/${P}. In order"
+ einfo "to boot with this U-Boot you need to install it to the correct partitions with"
+ einfo "dd. For example:"
+ einfo "dd if=/usr/share/${P}/u-boot-spl.bin of=<partition with type \"HiFive Unleashed FSBL\">"
+ einfo "dd if=/usr/share/${P}/u-boot.itb of=<partition with type \"HiFive Unleashed BBL\">"
+}