diff --git a/sysutils/opensbi/Makefile b/sysutils/opensbi/Makefile index e488d185ae4c..efd368442ccf 100644 --- a/sysutils/opensbi/Makefile +++ b/sysutils/opensbi/Makefile @@ -1,56 +1,56 @@ PORTNAME= opensbi DISTVERSIONPREFIX=v -DISTVERSION= 1.2 +DISTVERSION= 1.3.1 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= CC=clang I=${STAGEDIR}${PREFIX} V=1 FW_PAYLOAD=n +MAKE_ARGS= LLVM=1 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 do-install: # only need install_firmwares target .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 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 d88fd9dc680e..a0ad587457f6 100644 --- a/sysutils/opensbi/distinfo +++ b/sysutils/opensbi/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1672591798 -SHA256 (riscv-software-src-opensbi-v1.2_GH0.tar.gz) = 8fcbce598a73acc2c7f7d5607d46b9d5107d3ecbede8f68f42631dcfc25ef2b2 -SIZE (riscv-software-src-opensbi-v1.2_GH0.tar.gz) = 356905 +TIMESTAMP = 1691077727 +SHA256 (riscv-software-src-opensbi-v1.3.1_GH0.tar.gz) = ee5be2c582f9a837e9db88368220758e014dd694b566bb6c8efe1e50cfad0004 +SIZE (riscv-software-src-opensbi-v1.3.1_GH0.tar.gz) = 399131 diff --git a/sysutils/opensbi/files/patch-firmware_fw__base.S b/sysutils/opensbi/files/patch-firmware_fw__base.S new file mode 100644 index 000000000000..44185f571360 --- /dev/null +++ b/sysutils/opensbi/files/patch-firmware_fw__base.S @@ -0,0 +1,22 @@ +--- firmware/fw_base.S.orig 2023-07-17 15:17:18 UTC ++++ firmware/fw_base.S +@@ -309,8 +309,8 @@ _scratch_init: + REG_S a5, SBI_SCRATCH_FW_SIZE_OFFSET(tp) + + /* Store R/W section's offset in scratch space */ +- lla a4, __fw_rw_offset +- REG_L a5, 0(a4) ++ lla a5, _fw_rw_start ++ sub a5, a5, a4 + REG_S a5, SBI_SCRATCH_FW_RW_OFFSET(tp) + + /* Store fw_heap_offset and fw_heap_size in scratch space */ +@@ -536,8 +536,6 @@ _link_end: + RISCV_PTR FW_TEXT_START + _link_end: + RISCV_PTR _fw_reloc_end +-__fw_rw_offset: +- RISCV_PTR _fw_rw_start - _fw_start + + .section .entry, "ax", %progbits + .align 3 diff --git a/sysutils/opensbi/files/patch-platform_generic_platform.c b/sysutils/opensbi/files/patch-platform_generic_platform.c index 46fe653c5bc9..2e6ed1159868 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 @@ -24,6 +24,8 @@ #include #include -+int need_pmp_war = FALSE; ++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; diff --git a/sysutils/opensbi/files/patch-platform_generic_sifive_fu540.c b/sysutils/opensbi/files/patch-platform_generic_sifive_fu540.c index 29fd138f269e..fa402a00203b 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 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; ++ need_pmp_war = true; + + return 0; +} + static u64 sifive_fu540_tlbr_flush_limit(const struct fdt_match *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 05550af0388c..7bd809ba6b4d 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_2022.10= 1 +U_BOOT_SLAVE_PORTREVISION_2023.01= 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 f053b48e6897..6f5fc07ca8a3 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_2022.10= 1 +U_BOOT_SLAVE_PORTREVISION_2023.01= 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"