Index: head/sysutils/opensbi/Makefile =================================================================== --- head/sysutils/opensbi/Makefile (revision 564035) +++ head/sysutils/opensbi/Makefile (revision 564036) @@ -1,60 +1,60 @@ # $FreeBSD$ PORTNAME= opensbi DISTVERSIONPREFIX=v -DISTVERSION= 0.8 +DISTVERSION= 0.9 CATEGORIES= sysutils MAINTAINER= mhorne@FreeBSD.org 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 OPTIONS_GROUP= PLATFORMS OPTIONS_GROUP_PLATFORMS=GENERIC SIFIVE_FU540 OPTIONS_SUB= yes OPTIONS_DEFAULT= GENERIC SIFIVE_FU540 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} 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} install_firmwares ${MAKE_CMD} -C ${WRKSRC} PLATFORM=${${platform}_PLATFORM} ${MAKE_ARGS} \ I=${STAGEDIR}${PREFIX} 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 Index: head/sysutils/opensbi/distinfo =================================================================== --- head/sysutils/opensbi/distinfo (revision 564035) +++ head/sysutils/opensbi/distinfo (revision 564036) @@ -1,3 +1,3 @@ -TIMESTAMP = 1592679770 -SHA256 (riscv-opensbi-v0.8_GH0.tar.gz) = 17e048ac765e92e15f7436b604452614cf88dc2bcbbaab18cdc024f3fdd4c575 -SIZE (riscv-opensbi-v0.8_GH0.tar.gz) = 172450 +TIMESTAMP = 1610993580 +SHA256 (riscv-opensbi-v0.9_GH0.tar.gz) = 60f995cb3cd03e3cf5e649194d3395d0fe67499fd960a36cf7058a4efde686f0 +SIZE (riscv-opensbi-v0.9_GH0.tar.gz) = 189688 Index: head/sysutils/opensbi/files/patch-Makefile =================================================================== --- head/sysutils/opensbi/files/patch-Makefile (revision 564035) +++ head/sysutils/opensbi/files/patch-Makefile (nonexistent) @@ -1,11 +0,0 @@ ---- Makefile.orig 2019-10-09 02:45:51 UTC -+++ Makefile -@@ -180,7 +180,7 @@ ASFLAGS += $(firmware-asflags-y) - - ARFLAGS = rcs - --ELFFLAGS += -Wl,--build-id=none -N -static-libgcc -lgcc -+ELFFLAGS += -Wl,--build-id=none -N -static-libgcc - ELFFLAGS += $(platform-ldflags-y) - ELFFLAGS += $(firmware-ldflags-y) - Property changes on: head/sysutils/opensbi/files/patch-Makefile ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c =================================================================== --- head/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c (nonexistent) +++ head/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c (revision 564036) @@ -0,0 +1,19 @@ +--- lib/sbi/sbi_hart.c.orig 2021-01-30 20:30:32 UTC ++++ lib/sbi/sbi_hart.c +@@ -188,6 +188,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_gran_log2 = log2roundup(sbi_hart_pmp_granularity(scratch)); + pmp_bits = sbi_hart_pmp_addrbits(scratch) - 1; + pmp_addr_max = (1UL << pmp_bits) | ((1UL << pmp_bits) - 1); Property changes on: head/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sysutils/opensbi/files/patch-platform_generic_platform.c =================================================================== --- head/sysutils/opensbi/files/patch-platform_generic_platform.c (nonexistent) +++ head/sysutils/opensbi/files/patch-platform_generic_platform.c (revision 564036) @@ -0,0 +1,11 @@ +--- platform/generic/platform.c.orig 2021-01-30 20:29:48 UTC ++++ platform/generic/platform.c +@@ -22,6 +22,8 @@ + #include + #include + ++int need_pmp_war = FALSE; ++ + extern const struct platform_override sifive_fu540; + + static const struct platform_override *special_platforms[] = { Property changes on: head/sysutils/opensbi/files/patch-platform_generic_platform.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sysutils/opensbi/files/patch-platform_sifive_fu540_platform.c =================================================================== --- head/sysutils/opensbi/files/patch-platform_sifive_fu540_platform.c (nonexistent) +++ head/sysutils/opensbi/files/patch-platform_sifive_fu540_platform.c (revision 564036) @@ -0,0 +1,10 @@ +--- platform/sifive/fu540/platform.c.orig 2021-01-30 20:28:07 UTC ++++ platform/sifive/fu540/platform.c +@@ -20,6 +20,7 @@ + #include + + /* clang-format off */ ++int need_pmp_war = TRUE; + + #define FU540_HART_COUNT 5 + Property changes on: head/sysutils/opensbi/files/patch-platform_sifive_fu540_platform.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sysutils/opensbi/pkg-plist =================================================================== --- head/sysutils/opensbi/pkg-plist (revision 564035) +++ head/sysutils/opensbi/pkg-plist (revision 564036) @@ -1,64 +1,66 @@ include/sbi/fw_dynamic.h include/sbi/riscv_asm.h include/sbi/riscv_atomic.h include/sbi/riscv_barrier.h include/sbi/riscv_encoding.h include/sbi/riscv_fp.h include/sbi/riscv_io.h include/sbi/riscv_locks.h include/sbi/sbi_bitmap.h include/sbi/sbi_bitops.h include/sbi/sbi_console.h include/sbi/sbi_const.h include/sbi/sbi_csr_detect.h +include/sbi/sbi_domain.h include/sbi/sbi_ecall.h include/sbi/sbi_ecall_interface.h include/sbi/sbi_emulate_csr.h include/sbi/sbi_error.h include/sbi/sbi_fifo.h include/sbi/sbi_hart.h include/sbi/sbi_hartmask.h include/sbi/sbi_hfence.h include/sbi/sbi_hsm.h include/sbi/sbi_illegal_insn.h include/sbi/sbi_init.h include/sbi/sbi_ipi.h include/sbi/sbi_list.h include/sbi/sbi_math.h include/sbi/sbi_misaligned_ldst.h include/sbi/sbi_platform.h include/sbi/sbi_scratch.h include/sbi/sbi_string.h include/sbi/sbi_system.h include/sbi/sbi_timer.h include/sbi/sbi_tlb.h include/sbi/sbi_trap.h include/sbi/sbi_types.h include/sbi/sbi_unpriv.h 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/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/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/fdt_timer.h lib64/%%RISCV_ABI%%/libsbi.a lib64/%%RISCV_ABI%%/libsbiutils.a %%GENERIC%%lib64/%%RISCV_ABI%%/opensbi/generic/lib/libplatsbi.a %%GENERIC%%%%DATADIR%%/%%RISCV_ABI%%/generic/firmware/fw_dynamic.bin %%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 Index: head/sysutils/u-boot-sifive-fu540/Makefile =================================================================== --- head/sysutils/u-boot-sifive-fu540/Makefile (revision 564035) +++ head/sysutils/u-boot-sifive-fu540/Makefile (revision 564036) @@ -1,18 +1,20 @@ # $FreeBSD$ MASTERDIR= ${.CURDIR}/../u-boot-master +U_BOOT_SLAVE_PORTREVISION_2020.10= 1 + MODEL= sifive-fu540 BOARD_CONFIG= sifive_fu540_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 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"