aboutsummaryrefslogtreecommitdiff
path: root/sysutils/opensbi
diff options
context:
space:
mode:
authorMitchell Horne <mhorne@FreeBSD.org>2021-02-04 15:27:38 +0000
committerMitchell Horne <mhorne@FreeBSD.org>2021-02-04 15:27:38 +0000
commitcd45ca02e43d3248589ff9470a8457345e321fe0 (patch)
tree634e4325cfd25a547141e9d4e69c2dc29be463b1 /sysutils/opensbi
parent30d4b929fdf6cecf4fe0c43453e326ff85f6f64f (diff)
downloadports-cd45ca02e43d3248589ff9470a8457345e321fe0.tar.gz
ports-cd45ca02e43d3248589ff9470a8457345e321fe0.zip
sysutils/opensbi: update to v0.9
This change adds a patch to disable the PMP for the sifive/fu540 target, which is a workaround to a PMP errata in the chip. The OpenSBI update itself is quite minor. Bump the dependent port, sysutils/u-boot-sifive-fu540. Reviewed by: lwhsu, kp Approved by: lwhsu (ports) Tested by: Klaus Küchemann (maciphone2@googlemail.com) Differential Revision: https://reviews.freebsd.org/D28471
Notes
Notes: svn path=/head/; revision=564036
Diffstat (limited to 'sysutils/opensbi')
-rw-r--r--sysutils/opensbi/Makefile2
-rw-r--r--sysutils/opensbi/distinfo6
-rw-r--r--sysutils/opensbi/files/patch-Makefile11
-rw-r--r--sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c19
-rw-r--r--sysutils/opensbi/files/patch-platform_generic_platform.c11
-rw-r--r--sysutils/opensbi/files/patch-platform_sifive_fu540_platform.c10
-rw-r--r--sysutils/opensbi/pkg-plist2
7 files changed, 46 insertions, 15 deletions
diff --git a/sysutils/opensbi/Makefile b/sysutils/opensbi/Makefile
index d6a551ab1503..07fe4f9e70b8 100644
--- a/sysutils/opensbi/Makefile
+++ b/sysutils/opensbi/Makefile
@@ -2,7 +2,7 @@
PORTNAME= opensbi
DISTVERSIONPREFIX=v
-DISTVERSION= 0.8
+DISTVERSION= 0.9
CATEGORIES= sysutils
MAINTAINER= mhorne@FreeBSD.org
diff --git a/sysutils/opensbi/distinfo b/sysutils/opensbi/distinfo
index d3a963eb4e58..e7c663bbcc9c 100644
--- a/sysutils/opensbi/distinfo
+++ b/sysutils/opensbi/distinfo
@@ -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
diff --git a/sysutils/opensbi/files/patch-Makefile b/sysutils/opensbi/files/patch-Makefile
deleted file mode 100644
index 711663f04731..000000000000
--- a/sysutils/opensbi/files/patch-Makefile
+++ /dev/null
@@ -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)
-
diff --git a/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c b/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c
new file mode 100644
index 000000000000..184d17771466
--- /dev/null
+++ b/sysutils/opensbi/files/patch-lib_sbi_sbi__hart.c
@@ -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);
diff --git a/sysutils/opensbi/files/patch-platform_generic_platform.c b/sysutils/opensbi/files/patch-platform_generic_platform.c
new file mode 100644
index 000000000000..39a427424842
--- /dev/null
+++ b/sysutils/opensbi/files/patch-platform_generic_platform.c
@@ -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 <sbi_utils/ipi/fdt_ipi.h>
+ #include <sbi_utils/reset/fdt_reset.h>
+
++int need_pmp_war = FALSE;
++
+ extern const struct platform_override sifive_fu540;
+
+ static const struct platform_override *special_platforms[] = {
diff --git a/sysutils/opensbi/files/patch-platform_sifive_fu540_platform.c b/sysutils/opensbi/files/patch-platform_sifive_fu540_platform.c
new file mode 100644
index 000000000000..b0662361545d
--- /dev/null
+++ b/sysutils/opensbi/files/patch-platform_sifive_fu540_platform.c
@@ -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 <sbi_utils/sys/clint.h>
+
+ /* clang-format off */
++int need_pmp_war = TRUE;
+
+ #define FU540_HART_COUNT 5
+
diff --git a/sysutils/opensbi/pkg-plist b/sysutils/opensbi/pkg-plist
index 3146aac8be5f..c28e264b8902 100644
--- a/sysutils/opensbi/pkg-plist
+++ b/sysutils/opensbi/pkg-plist
@@ -11,6 +11,7 @@ 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
@@ -36,6 +37,7 @@ 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