diff --git a/sysutils/opensbi/Makefile b/sysutils/opensbi/Makefile index fb8b248abac6..090a90e55c67 100644 --- a/sysutils/opensbi/Makefile +++ b/sysutils/opensbi/Makefile @@ -1,50 +1,54 @@ PORTNAME= opensbi DISTVERSIONPREFIX=v -DISTVERSION= 1.0 +DISTVERSION= 1.1 CATEGORIES= sysutils MAINTAINER= mhorne@FreeBSD.org COMMENT= RISC-V SBI bootloader and firmware LICENSE= BSD2CLAUSE -USES= gmake +BUILD_DEPENDS= bash:shells/bash + +USES= gmake shebangfix +SHEBANG_FILES= scripts/*.sh + USE_GITHUB= yes GH_ACCOUNT= riscv MAKE_ARGS= CC=clang I=${STAGEDIR}${PREFIX} V=1 FW_PAYLOAD=n OPTIONS_GROUP= PLATFORMS OPTIONS_GROUP_PLATFORMS=GENERIC OPTIONS_SUB= yes OPTIONS_DEFAULT= GENERIC GENERIC_DESC= Support for generic platform GENERIC_PLATFORM= generic GENERIC_STRIP_ARGS= -K tohost -K fromhost INSTALL_TARGET= install PLIST_SUB+= RISCV_ABI=${PLATFORM_RISCV_ABI} PLATFORM_RISCV_ABI= lp64 .for platform in ${OPTIONS_GROUP_PLATFORMS} post-build-${platform}-on: ${MAKE_CMD} -C ${WRKSRC} ${MAKE_ARGS} PLATFORM=${${platform}_PLATFORM} do-install-${platform}-on: ${MKDIR} ${STAGEDIR}${PREFIX} ${MAKE_CMD} -C ${WRKSRC} PLATFORM=${${platform}_PLATFORM} ${MAKE_ARGS} \ I=${STAGEDIR}${PREFIX} V=1 install_firmwares ${MAKE_CMD} -C ${WRKSRC} PLATFORM=${${platform}_PLATFORM} ${MAKE_ARGS} \ I=${STAGEDIR}${PREFIX} V=1 install_libplatsbi post-install-${platform}-on: ${STRIP_CMD} ${${platform}_STRIP_ARGS} \ ${STAGEDIR}${DATADIR}/${PLATFORM_RISCV_ABI}/${${platform}_PLATFORM}/firmware/fw_*.elf .endfor # OPTIONS_GROUP_PLATFORMS .include diff --git a/sysutils/opensbi/distinfo b/sysutils/opensbi/distinfo index 6a679cea4bfb..393e22ea3ab1 100644 --- a/sysutils/opensbi/distinfo +++ b/sysutils/opensbi/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1641325249 -SHA256 (riscv-opensbi-v1.0_GH0.tar.gz) = a5efaeb24f5ee88d13d5788e4e00623ff312ee12c0bf736aa75a6ad9a850fb76 -SIZE (riscv-opensbi-v1.0_GH0.tar.gz) = 225774 +TIMESTAMP = 1656188838 +SHA256 (riscv-opensbi-v1.1_GH0.tar.gz) = d183cb890130983a4f01e75fc03ee4f7ea0e16a7923b8af9c6dff7deb2fedaec +SIZE (riscv-opensbi-v1.1_GH0.tar.gz) = 241383 diff --git a/sysutils/opensbi/files/patch-platform_generic_platform.c b/sysutils/opensbi/files/patch-platform_generic_platform.c index 5d39f954ee76..46fe653c5bc9 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-12-24 11:57:44 UTC +--- platform/generic/platform.c.orig 2022-06-25 03:42:10 UTC +++ platform/generic/platform.c -@@ -23,6 +23,8 @@ +@@ -24,6 +24,8 @@ #include #include +int need_pmp_war = FALSE; + - extern const struct platform_override sifive_fu540; - extern const struct platform_override sifive_fu740; - + /* List of platform override modules generated at compile time */ + extern const struct platform_override *platform_override_modules[]; + extern unsigned long platform_override_modules_size; diff --git a/sysutils/opensbi/files/patch-platform_generic_sifive__fu540.c b/sysutils/opensbi/files/patch-platform_generic_sifive_fu540.c similarity index 76% rename from sysutils/opensbi/files/patch-platform_generic_sifive__fu540.c rename to sysutils/opensbi/files/patch-platform_generic_sifive_fu540.c index bdd0dce39569..29fd138f269e 100644 --- a/sysutils/opensbi/files/patch-platform_generic_sifive__fu540.c +++ b/sysutils/opensbi/files/patch-platform_generic_sifive_fu540.c @@ -1,26 +1,26 @@ ---- platform/generic/sifive_fu540.c.orig 2021-12-24 11:57:44 UTC -+++ platform/generic/sifive_fu540.c +--- platform/generic/sifive/fu540.c.orig 2022-06-26 14:27:30 UTC ++++ platform/generic/sifive/fu540.c @@ -11,6 +11,15 @@ #include #include +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[] = { +@@ -41,6 +50,7 @@ const struct platform_override sifive_fu540 = { }; 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/u-boot-sifive-fu540/Makefile b/sysutils/u-boot-sifive-fu540/Makefile index 5f79e53b93d8..bdbf228d4178 100644 --- a/sysutils/u-boot-sifive-fu540/Makefile +++ b/sysutils/u-boot-sifive-fu540/Makefile @@ -1,16 +1,18 @@ MASTERDIR= ${.CURDIR}/../u-boot-master MODEL= sifive-fu540 BOARD_CONFIG= sifive_unleashed_defconfig FAMILY= sifive UBOOT_ARCH= riscv64 +U_BOOT_SLAVE_PORTREVISION_2022.04= 2 + # 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/Makefile b/sysutils/u-boot-sifive-fu740/Makefile index 3902e50d6394..64008f9bfa0d 100644 --- a/sysutils/u-boot-sifive-fu740/Makefile +++ b/sysutils/u-boot-sifive-fu740/Makefile @@ -1,16 +1,18 @@ MASTERDIR= ${.CURDIR}/../u-boot-master MODEL= sifive-fu740 BOARD_CONFIG= sifive_unmatched_defconfig FAMILY= sifive UBOOT_ARCH= riscv64 +U_BOOT_SLAVE_PORTREVISION_2022.04= 2 + # 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"