diff options
author | Sören Tempel <tempel@uni-bremen.de> | 2020-03-08 10:35:32 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2020-03-08 10:35:32 +0530 |
commit | e1a5b737ef1eab8b7ada2f091548355949341315 (patch) | |
tree | 3ef5d1a117069683be8a07e7bcbe15373992ac0b /platform | |
parent | 82ae8e8fe2a3234a4cec90ec880ec5509cbaa79f (diff) |
platform: sifive: fu540: allow sv32 as an mmu-type
There has already been a commit to master which added 32-bit specific
fdt/payload addresses for the sifive/fu540 platform [0]. This commit
introduces another change for using sifive/fu540 as a 32-bit platform.
On 32-bit platforms, cores with the SV32 MMU type should not be
disabled. For this reason, this commit also allows using this MMU type
on the sifive/fu540 platform.
Alternatively it would also be possible to only allow SV39 and SV48 if
`__riscv_xlen == 64` and SV32 if `__riscv_xlen == 32`. Removing the
check entirely would also be an option.
[0]: 66fb729a1e46a9a46e809f3b7867fef91477e494
Signed-off-by: Sören Tempel <tempel@uni-bremen.de>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'platform')
-rw-r--r-- | platform/sifive/fu540/platform.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/platform/sifive/fu540/platform.c b/platform/sifive/fu540/platform.c index 48bcf54..5f3d3ce 100644 --- a/platform/sifive/fu540/platform.c +++ b/platform/sifive/fu540/platform.c @@ -75,7 +75,8 @@ static void fu540_modify_dt(void *fdt) sbi_sprintf(cpu_node, "/cpus/cpu@%d", i); cpu_offset = fdt_path_offset(fdt, cpu_node); mmu_type = fdt_getprop(fdt, cpu_offset, "mmu-type", NULL); - if (mmu_type && (!strcmp(mmu_type, "riscv,sv39") || + if (mmu_type && (!strcmp(mmu_type, "riscv,sv32") || + !strcmp(mmu_type, "riscv,sv39") || !strcmp(mmu_type, "riscv,sv48"))) continue; else |