diff --git a/sysutils/opensbi/Makefile b/sysutils/opensbi/Makefile index 703e9218ed9f..48d1f5e554a9 100644 --- a/sysutils/opensbi/Makefile +++ b/sysutils/opensbi/Makefile @@ -1,37 +1,37 @@ PORTNAME= opensbi DISTVERSIONPREFIX=v -DISTVERSION= 1.6 +DISTVERSION= 1.7 CATEGORIES= sysutils MAINTAINER= mhorne@FreeBSD.org COMMENT= RISC-V SBI bootloader and firmware WWW= https://github.com/riscv-software-src/opensbi LICENSE= BSD2CLAUSE BUILD_DEPENDS= bash:shells/bash \ dtc:sysutils/dtc USES= gmake python:build shebangfix SHEBANG_FILES= scripts/Kconfiglib/*.py USE_GITHUB= yes GH_ACCOUNT= riscv-software-src MAKE_ARGS= LLVM=1 I=${STAGEDIR}${PREFIX} V=1 \ FW_PAYLOAD=n FW_TEXT_START=0x80000000 \ OPENSBI_VERSION_GIT= PLATFORM=generic GENERIC_STRIP_ARGS= -K tohost -K fromhost INSTALL_TARGET= install PLIST_SUB+= RISCV_ABI=${PLATFORM_RISCV_ABI} PLATFORM_RISCV_ABI= lp64 post-install: ${STRIP_CMD} ${GENERIC_STRIP_ARGS} \ ${STAGEDIR}${DATADIR}/${PLATFORM_RISCV_ABI}/generic/firmware/fw_*.elf .include diff --git a/sysutils/opensbi/distinfo b/sysutils/opensbi/distinfo index 27de00840a02..4c670b9b189d 100644 --- a/sysutils/opensbi/distinfo +++ b/sysutils/opensbi/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1735930463 -SHA256 (riscv-software-src-opensbi-v1.6_GH0.tar.gz) = d11702103f177a2914e94eec57ce5ed820296d874f6b6525c4482e55d71a3667 -SIZE (riscv-software-src-opensbi-v1.6_GH0.tar.gz) = 476631 +TIMESTAMP = 1751304581 +SHA256 (riscv-software-src-opensbi-v1.7_GH0.tar.gz) = 2cf856a4e5e2e052948ddb54ba48232b1f698b7f52e0374fc7d17d51e8c8f7ce +SIZE (riscv-software-src-opensbi-v1.7_GH0.tar.gz) = 490131 diff --git a/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c b/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c index 73263b9d2715..e22fa1ab8d57 100644 --- a/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c +++ b/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c @@ -1,19 +1,19 @@ ---- lib/sbi/sbi_hart.c.orig 2023-12-27 03:02:58.000000000 -0400 -+++ lib/sbi/sbi_hart.c 2024-01-11 14:10:09.723340000 -0400 -@@ -523,6 +523,16 @@ +--- lib/sbi/sbi_hart.c.orig 2025-06-30 03:07:30 UTC ++++ lib/sbi/sbi_hart.c +@@ -567,6 +567,16 @@ int sbi_hart_pmp_configure(struct sbi_scratch *scratch if (!pmp_count) return 0; + /* + * Disable the PMP for the sifive/fu540 platform, required to work + * around a hardware errata. + */ + extern int need_pmp_war; + if (need_pmp_war) { + pmp_set(0, PMP_R | PMP_W | PMP_X, -1, __riscv_xlen); + return 0; + } + pmp_log2gran = sbi_hart_pmp_log2gran(scratch); pmp_bits = sbi_hart_pmp_addrbits(scratch) - 1; pmp_addr_max = (1UL << pmp_bits) | ((1UL << pmp_bits) - 1); diff --git a/sysutils/opensbi/files/patch-platform_generic_platform.c b/sysutils/opensbi/files/patch-platform_generic_platform.c index 2e6ed1159868..c4e535de59b5 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 2022-06-25 03:42:10 UTC +--- platform/generic/platform.c.orig 2025-06-30 03:07:30 UTC +++ platform/generic/platform.c -@@ -24,6 +24,8 @@ - #include - #include +@@ -30,6 +30,8 @@ + #include + #include +int need_pmp_war = false; + /* List of platform override modules generated at compile time */ - extern const struct platform_override *platform_override_modules[]; - extern unsigned long platform_override_modules_size; + extern const struct fdt_driver *const platform_override_modules[]; + diff --git a/sysutils/opensbi/files/patch-platform_generic_sifive_fu540.c b/sysutils/opensbi/files/patch-platform_generic_sifive_fu540.c index 9f776d796e1b..d721c7224afa 100644 --- a/sysutils/opensbi/files/patch-platform_generic_sifive_fu540.c +++ b/sysutils/opensbi/files/patch-platform_generic_sifive_fu540.c @@ -1,27 +1,26 @@ ---- platform/generic/sifive/fu540.c.orig 2022-06-26 14:27:30 UTC +--- platform/generic/sifive/fu540.c.orig 2025-06-30 03:07:30 UTC +++ platform/generic/sifive/fu540.c -@@ -11,6 +11,16 @@ +@@ -11,6 +11,15 @@ #include #include +extern int need_pmp_war; + -+static int sifive_fu540_early_init(bool cold_boot, const void *fdt, -+ const struct fdt_match *match) ++static int sifive_fu540_early_init(bool cold_boot) +{ + need_pmp_war = true; + + return 0; +} + - static u64 sifive_fu540_tlbr_flush_limit(const struct fdt_match *match) + static u64 sifive_fu540_tlbr_flush_limit(void) { /* -@@ -41,6 +50,7 @@ const struct platform_override sifive_fu540 = { - }; +@@ -22,6 +31,7 @@ static int sifive_fu540_platform_init(const void *fdt, - 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, + static int sifive_fu540_platform_init(const void *fdt, int nodeoff, const struct fdt_match *match) + { ++ generic_platform_ops.early_init = sifive_fu540_early_init; + generic_platform_ops.get_tlbr_flush_limit = sifive_fu540_tlbr_flush_limit; + + return 0; diff --git a/sysutils/u-boot-sifive-fu540/Makefile b/sysutils/u-boot-sifive-fu540/Makefile index 51643c092390..ea3f4d044cb0 100644 --- a/sysutils/u-boot-sifive-fu540/Makefile +++ b/sysutils/u-boot-sifive-fu540/Makefile @@ -1,18 +1,18 @@ MASTERDIR= ${.CURDIR}/../u-boot-master -U_BOOT_SLAVE_PORTREVISION_2024.07=1 +U_BOOT_SLAVE_PORTREVISION_2025.04=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/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 98d38e935010..9fd0f9a3a8a2 100644 --- a/sysutils/u-boot-sifive-fu740/Makefile +++ b/sysutils/u-boot-sifive-fu740/Makefile @@ -1,18 +1,18 @@ MASTERDIR= ${.CURDIR}/../u-boot-master -U_BOOT_SLAVE_PORTREVISION_2024.07=1 +U_BOOT_SLAVE_PORTREVISION_2025.04=1 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-starfive-visionfive2/Makefile b/sysutils/u-boot-starfive-visionfive2/Makefile index 391d3b2321e6..52e8559b7713 100644 --- a/sysutils/u-boot-starfive-visionfive2/Makefile +++ b/sysutils/u-boot-starfive-visionfive2/Makefile @@ -1,18 +1,18 @@ MASTERDIR= ${.CURDIR}/../u-boot-master -U_BOOT_SLAVE_PORTREVISION_2024.07=1 +U_BOOT_SLAVE_PORTREVISION_2025.04=1 MODEL= starfive-visionfive2 BOARD_CONFIG= starfive_visionfive2_defconfig FAMILY= starfive 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.normal.out UBOOT_PLIST= u-boot.itb u-boot-spl.bin.normal.out .include "${MASTERDIR}/Makefile"