aboutsummaryrefslogtreecommitdiff
path: root/machine
diff options
context:
space:
mode:
authorGokturk Yuksek <gokturk@gentoo.org>2019-10-31 13:45:00 -0400
committerAndrew Waterman <andrew@sifive.com>2019-10-31 10:45:00 -0700
commitb1bdf5bb995ada25f4855279e90ac2c54c7162fa (patch)
tree6c9398c9982d4c9d5a9c4a84673909d575a55f91 /machine
parent92d3a34a9b8d70e08b52164a5ca24dfd93a76af1 (diff)
downloadriscv-pk-b1bdf5bb995ada25f4855279e90ac2c54c7162fa.zip
riscv-pk-b1bdf5bb995ada25f4855279e90ac2c54c7162fa.tar.gz
riscv-pk-b1bdf5bb995ada25f4855279e90ac2c54c7162fa.tar.bz2
fdt: allow mmu type "riscv,32" on rv32 systems (#177)
SV32 is presented in RISC-V Privileged Architecture Manual (version 20190608-Priv-MSU-Ratified) Section 4.3 for RV32 systems. However, BBL responds to sv32 with: hart_filter_mask saw unknown hart type: status="okay", mmu_type="riscv,sv32" and hangs. This patch is adopted from the original 'riscv-pk.diff' patch written by Fabrice Bellard, distributed as part of the following tarball: https://bellard.org/tinyemu/diskimage-linux-riscv-2018-09-23.tar.gz Closes: https://github.com/riscv/riscv-pk/issues/160
Diffstat (limited to 'machine')
-rw-r--r--machine/fdt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/machine/fdt.c b/machine/fdt.c
index d5beda1..fee3ae9 100644
--- a/machine/fdt.c
+++ b/machine/fdt.c
@@ -651,8 +651,12 @@ static bool hart_filter_mask(const struct hart_filter *filter)
{
if (filter->mmu_type == NULL) return true;
if (strcmp(filter->status, "okay")) return true;
+#if __riscv_xlen == 32
+ if (!strcmp(filter->mmu_type, "riscv,sv32")) return false;
+#else
if (!strcmp(filter->mmu_type, "riscv,sv39")) return false;
if (!strcmp(filter->mmu_type, "riscv,sv48")) return false;
+#endif
printm("hart_filter_mask saw unknown hart type: status=\"%s\", mmu_type=\"%s\"\n",
filter->status, filter->mmu_type);
return true;