Date: Wed, 19 Jan 2022 21:19:31 GMT From: Mitchell Horne <mhorne@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: b0216f3b4482 - main - sysutils/opensbi: update to version v1.0 Message-ID: <202201192119.20JLJVWj059762@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by mhorne (src committer): URL: https://cgit.FreeBSD.org/ports/commit/?id=b0216f3b4482137d573f9d6f7789504d302fc47b commit b0216f3b4482137d573f9d6f7789504d302fc47b Author: Mitchell Horne <mhorne@FreeBSD.org> AuthorDate: 2022-01-19 21:15:34 +0000 Commit: Mitchell Horne <mhorne@FreeBSD.org> CommitDate: 2022-01-19 21:15:34 +0000 sysutils/opensbi: update to version v1.0 As the fu540 platform has been removed with this version, fall back to building the generic platform only. Keep the platform logic around in the Makefile in case we need it in the future. Switch to building with base system clang+binutils. Bump the PORTREVISION for sysutils/u-boot-sifive-fu540. Reviewed by: jrtc27, lwhsu (previous version both) Approved by: lwhsu (ports) Tested by: Klaus Küchemann <maciphone2@googlemail.com> Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D33845 --- sysutils/opensbi/Makefile | 20 +++++------------ sysutils/opensbi/distinfo | 6 ++--- sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c | 4 ++-- .../files/patch-platform_generic_platform.c | 6 ++--- .../files/patch-platform_generic_sifive__fu540.c | 26 ++++++++++++++++++++++ .../files/patch-platform_sifive_fu540_platform.c | 10 --------- sysutils/opensbi/pkg-plist | 17 +++++++++----- sysutils/u-boot-sifive-fu540/Makefile | 4 +++- 8 files changed, 54 insertions(+), 39 deletions(-) diff --git a/sysutils/opensbi/Makefile b/sysutils/opensbi/Makefile index 1391f5099c90..fb8b248abac6 100644 --- a/sysutils/opensbi/Makefile +++ b/sysutils/opensbi/Makefile @@ -1,6 +1,6 @@ PORTNAME= opensbi DISTVERSIONPREFIX=v -DISTVERSION= 0.9 +DISTVERSION= 1.0 CATEGORIES= sysutils MAINTAINER= mhorne@FreeBSD.org @@ -8,29 +8,21 @@ COMMENT= RISC-V SBI bootloader and firmware LICENSE= BSD2CLAUSE -BUILD_DEPENDS= ${RISCV_PREFIX}gcc:devel/riscv64-none-elf-gcc \ - ${RISCV_PREFIX}ld:devel/binutils@riscv64_none_elf - USES= gmake USE_GITHUB= yes GH_ACCOUNT= riscv -RISCV_PREFIX= riscv64-none-elf- - -MAKE_ARGS= CROSS_COMPILE=${RISCV_PREFIX} I=${STAGEDIR}${PREFIX} FW_PAYLOAD=n +MAKE_ARGS= CC=clang I=${STAGEDIR}${PREFIX} V=1 FW_PAYLOAD=n OPTIONS_GROUP= PLATFORMS -OPTIONS_GROUP_PLATFORMS=GENERIC SIFIVE_FU540 +OPTIONS_GROUP_PLATFORMS=GENERIC OPTIONS_SUB= yes -OPTIONS_DEFAULT= GENERIC SIFIVE_FU540 +OPTIONS_DEFAULT= GENERIC GENERIC_DESC= Support for generic platform GENERIC_PLATFORM= generic GENERIC_STRIP_ARGS= -K tohost -K fromhost -SIFIVE_FU540_DESC= Support for SiFive U540 platform -SIFIVE_FU540_PLATFORM= sifive/fu540 - INSTALL_TARGET= install PLIST_SUB+= RISCV_ABI=${PLATFORM_RISCV_ABI} @@ -45,9 +37,9 @@ post-build-${platform}-on: do-install-${platform}-on: ${MKDIR} ${STAGEDIR}${PREFIX} ${MAKE_CMD} -C ${WRKSRC} PLATFORM=${${platform}_PLATFORM} ${MAKE_ARGS} \ - I=${STAGEDIR}${PREFIX} install_firmwares + I=${STAGEDIR}${PREFIX} V=1 install_firmwares ${MAKE_CMD} -C ${WRKSRC} PLATFORM=${${platform}_PLATFORM} ${MAKE_ARGS} \ - I=${STAGEDIR}${PREFIX} install_libplatsbi + I=${STAGEDIR}${PREFIX} V=1 install_libplatsbi post-install-${platform}-on: ${STRIP_CMD} ${${platform}_STRIP_ARGS} \ diff --git a/sysutils/opensbi/distinfo b/sysutils/opensbi/distinfo index e7c663bbcc9c..6a679cea4bfb 100644 --- a/sysutils/opensbi/distinfo +++ b/sysutils/opensbi/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1610993580 -SHA256 (riscv-opensbi-v0.9_GH0.tar.gz) = 60f995cb3cd03e3cf5e649194d3395d0fe67499fd960a36cf7058a4efde686f0 -SIZE (riscv-opensbi-v0.9_GH0.tar.gz) = 189688 +TIMESTAMP = 1641325249 +SHA256 (riscv-opensbi-v1.0_GH0.tar.gz) = a5efaeb24f5ee88d13d5788e4e00623ff312ee12c0bf736aa75a6ad9a850fb76 +SIZE (riscv-opensbi-v1.0_GH0.tar.gz) = 225774 diff --git a/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c b/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c index 184d17771466..e9b4ed6abde2 100644 --- a/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c +++ b/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c @@ -1,6 +1,6 @@ ---- lib/sbi/sbi_hart.c.orig 2021-01-30 20:30:32 UTC +--- lib/sbi/sbi_hart.c.orig 2021-12-24 11:57:44 UTC +++ lib/sbi/sbi_hart.c -@@ -188,6 +188,16 @@ int sbi_hart_pmp_configure(struct sbi_scratch *scratch +@@ -203,6 +203,16 @@ int sbi_hart_pmp_configure(struct sbi_scratch *scratch if (!pmp_count) return 0; diff --git a/sysutils/opensbi/files/patch-platform_generic_platform.c b/sysutils/opensbi/files/patch-platform_generic_platform.c index 39a427424842..5d39f954ee76 100644 --- a/sysutils/opensbi/files/patch-platform_generic_platform.c +++ b/sysutils/opensbi/files/patch-platform_generic_platform.c @@ -1,11 +1,11 @@ ---- platform/generic/platform.c.orig 2021-01-30 20:29:48 UTC +--- platform/generic/platform.c.orig 2021-12-24 11:57:44 UTC +++ platform/generic/platform.c -@@ -22,6 +22,8 @@ +@@ -23,6 +23,8 @@ #include <sbi_utils/ipi/fdt_ipi.h> #include <sbi_utils/reset/fdt_reset.h> +int need_pmp_war = FALSE; + extern const struct platform_override sifive_fu540; + extern const struct platform_override sifive_fu740; - static const struct platform_override *special_platforms[] = { diff --git a/sysutils/opensbi/files/patch-platform_generic_sifive__fu540.c b/sysutils/opensbi/files/patch-platform_generic_sifive__fu540.c new file mode 100644 index 000000000000..bdd0dce39569 --- /dev/null +++ b/sysutils/opensbi/files/patch-platform_generic_sifive__fu540.c @@ -0,0 +1,26 @@ +--- platform/generic/sifive_fu540.c.orig 2021-12-24 11:57:44 UTC ++++ platform/generic/sifive_fu540.c +@@ -11,6 +11,15 @@ + #include <sbi_utils/fdt/fdt_helper.h> + #include <sbi_utils/fdt/fdt_fixup.h> + ++extern int need_pmp_war; ++ ++static int sifive_fu540_early_init(bool cold_boot, const struct fdt_match *match) ++{ ++ need_pmp_war = TRUE; ++ ++ return 0; ++} ++ + static u64 sifive_fu540_tlbr_flush_limit(const struct fdt_match *match) + { + /* +@@ -41,6 +50,7 @@ static const struct fdt_match sifive_fu540_match[] = { + }; + + const struct platform_override sifive_fu540 = { ++ .early_init = sifive_fu540_early_init, + .match_table = sifive_fu540_match, + .tlbr_flush_limit = sifive_fu540_tlbr_flush_limit, + .fdt_fixup = sifive_fu540_fdt_fixup, diff --git a/sysutils/opensbi/files/patch-platform_sifive_fu540_platform.c b/sysutils/opensbi/files/patch-platform_sifive_fu540_platform.c deleted file mode 100644 index b0662361545d..000000000000 --- a/sysutils/opensbi/files/patch-platform_sifive_fu540_platform.c +++ /dev/null @@ -1,10 +0,0 @@ ---- platform/sifive/fu540/platform.c.orig 2021-01-30 20:28:07 UTC -+++ platform/sifive/fu540/platform.c -@@ -20,6 +20,7 @@ - #include <sbi_utils/sys/clint.h> - - /* clang-format off */ -+int need_pmp_war = TRUE; - - #define FU540_HART_COUNT 5 - diff --git a/sysutils/opensbi/pkg-plist b/sysutils/opensbi/pkg-plist index c28e264b8902..6a660f894053 100644 --- a/sysutils/opensbi/pkg-plist +++ b/sysutils/opensbi/pkg-plist @@ -2,6 +2,7 @@ include/sbi/fw_dynamic.h include/sbi/riscv_asm.h include/sbi/riscv_atomic.h include/sbi/riscv_barrier.h +include/sbi/riscv_elf.h include/sbi/riscv_encoding.h include/sbi/riscv_fp.h include/sbi/riscv_io.h @@ -28,6 +29,7 @@ include/sbi/sbi_list.h include/sbi/sbi_math.h include/sbi/sbi_misaligned_ldst.h include/sbi/sbi_platform.h +include/sbi/sbi_pmu.h include/sbi/sbi_scratch.h include/sbi/sbi_string.h include/sbi/sbi_system.h @@ -40,17 +42,25 @@ include/sbi/sbi_version.h include/sbi_utils/fdt/fdt_domain.h include/sbi_utils/fdt/fdt_fixup.h include/sbi_utils/fdt/fdt_helper.h +include/sbi_utils/fdt/fdt_pmu.h +include/sbi_utils/gpio/fdt_gpio.h +include/sbi_utils/gpio/gpio.h +include/sbi_utils/i2c/fdt_i2c.h +include/sbi_utils/i2c/i2c.h +include/sbi_utils/ipi/aclint_mswi.h include/sbi_utils/ipi/fdt_ipi.h include/sbi_utils/irqchip/fdt_irqchip.h include/sbi_utils/irqchip/plic.h include/sbi_utils/reset/fdt_reset.h include/sbi_utils/serial/fdt_serial.h +include/sbi_utils/serial/gaisler-uart.h +include/sbi_utils/serial/litex-uart.h include/sbi_utils/serial/shakti-uart.h include/sbi_utils/serial/sifive-uart.h include/sbi_utils/serial/uart8250.h -include/sbi_utils/sys/clint.h include/sbi_utils/sys/htif.h include/sbi_utils/sys/sifive_test.h +include/sbi_utils/timer/aclint_mtimer.h include/sbi_utils/timer/fdt_timer.h lib64/%%RISCV_ABI%%/libsbi.a lib64/%%RISCV_ABI%%/libsbiutils.a @@ -59,8 +69,3 @@ lib64/%%RISCV_ABI%%/libsbiutils.a %%GENERIC%%%%DATADIR%%/%%RISCV_ABI%%/generic/firmware/fw_dynamic.elf %%GENERIC%%%%DATADIR%%/%%RISCV_ABI%%/generic/firmware/fw_jump.bin %%GENERIC%%%%DATADIR%%/%%RISCV_ABI%%/generic/firmware/fw_jump.elf -%%SIFIVE_FU540%%lib64/%%RISCV_ABI%%/opensbi/sifive/fu540/lib/libplatsbi.a -%%SIFIVE_FU540%%%%DATADIR%%/%%RISCV_ABI%%/sifive/fu540/firmware/fw_dynamic.bin -%%SIFIVE_FU540%%%%DATADIR%%/%%RISCV_ABI%%/sifive/fu540/firmware/fw_dynamic.elf -%%SIFIVE_FU540%%%%DATADIR%%/%%RISCV_ABI%%/sifive/fu540/firmware/fw_jump.bin -%%SIFIVE_FU540%%%%DATADIR%%/%%RISCV_ABI%%/sifive/fu540/firmware/fw_jump.elf diff --git a/sysutils/u-boot-sifive-fu540/Makefile b/sysutils/u-boot-sifive-fu540/Makefile index be02869fb2ac..3fba52d998dc 100644 --- a/sysutils/u-boot-sifive-fu540/Makefile +++ b/sysutils/u-boot-sifive-fu540/Makefile @@ -1,12 +1,14 @@ MASTERDIR= ${.CURDIR}/../u-boot-master +U_BOOT_SLAVE_PORTREVISION_2021.07=1 + MODEL= sifive-fu540 BOARD_CONFIG= sifive_unleashed_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 +OPENSBI_FIRM= ${LOCALBASE}/share/opensbi/lp64/generic/firmware/fw_dynamic.bin BUILD_DEPENDS+= ${OPENSBI_FIRM}:sysutils/opensbi MAKE_ENV+= OPENSBI=${OPENSBI_FIRM}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202201192119.20JLJVWj059762>