diff --git a/sysutils/opensbi/Makefile b/sysutils/opensbi/Makefile index efd368442ccf..745ca761c7de 100644 --- a/sysutils/opensbi/Makefile +++ b/sysutils/opensbi/Makefile @@ -1,56 +1,56 @@ PORTNAME= opensbi DISTVERSIONPREFIX=v -DISTVERSION= 1.3.1 +DISTVERSION= 1.4 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 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 a0ad587457f6..fbed4ec056d0 100644 --- a/sysutils/opensbi/distinfo +++ b/sysutils/opensbi/distinfo @@ -1,3 +1,3 @@ -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 +TIMESTAMP = 1704470709 +SHA256 (riscv-software-src-opensbi-v1.4_GH0.tar.gz) = 319b62a4186fbce9b81a0c5f0ec9f003a10c808397a72138bc9745d9b87b1eb1 +SIZE (riscv-software-src-opensbi-v1.4_GH0.tar.gz) = 409903 diff --git a/sysutils/opensbi/files/patch-firmware_fw__base.S b/sysutils/opensbi/files/patch-firmware_fw__base.S deleted file mode 100644 index 44185f571360..000000000000 --- a/sysutils/opensbi/files/patch-firmware_fw__base.S +++ /dev/null @@ -1,22 +0,0 @@ ---- 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-lib_sbi_sbi__hart.c b/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c index e9b4ed6abde2..73263b9d2715 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 2021-12-24 11:57:44 UTC -+++ lib/sbi/sbi_hart.c -@@ -203,6 +203,16 @@ int sbi_hart_pmp_configure(struct sbi_scratch *scratch +--- 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 @@ 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_gran_log2 = log2roundup(sbi_hart_pmp_granularity(scratch)); + 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/u-boot-sifive-fu540/Makefile b/sysutils/u-boot-sifive-fu540/Makefile index 7bd809ba6b4d..f6f4a81b6e4b 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_2023.01= 1 +U_BOOT_SLAVE_PORTREVISION_2024.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 3902e50d6394..93e585e7659f 100644 --- a/sysutils/u-boot-sifive-fu740/Makefile +++ b/sysutils/u-boot-sifive-fu740/Makefile @@ -1,16 +1,18 @@ MASTERDIR= ${.CURDIR}/../u-boot-master +U_BOOT_SLAVE_PORTREVISION_2024.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"