Skip to content

Commit

Permalink
platforms: add support for qemu-riscv32-virt
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Martins <josemartins90@gmail.com>
  • Loading branch information
josecm committed May 23, 2024
1 parent 9f8bfe5 commit 5861033
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/platform/qemu-riscv32-virt/inc
1 change: 1 addition & 0 deletions src/platform/qemu-riscv32-virt/objects.mk
2 changes: 2 additions & 0 deletions src/platform/qemu-riscv32-virt/platform.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ARCH_SUB:=riscv32
include $(current_directory)/../qemu-riscv64-virt/platform.mk
1 change: 1 addition & 0 deletions src/platform/qemu-riscv32-virt/virt_desc.c
11 changes: 10 additions & 1 deletion src/platform/qemu-riscv64-virt/virt_desc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
#include <platform.h>
#include <interrupts.h>

#if RV32
// We use only 1 GiB for the rv32, due to limitations on how the physical memory must
// be identity mapped by the hypervisor and the fact that the hypervisor reserves for
// itsel the upper GB of the 4GB address space.
#define QEMU_VIRT_MEM_REG_SIZE (0x40000000 - 0x200000)
#else
#define QEMU_VIRT_MEM_REG_SIZE (0x100000000 - 0x200000)
#endif

struct platform platform = {

.cpu_num = 4,
Expand All @@ -14,7 +23,7 @@ struct platform platform = {
.regions = (struct mem_region[]) {
{
.base = 0x80200000,
.size = 0x100000000 - 0x200000,
.size = QEMU_VIRT_MEM_REG_SIZE,
},
},

Expand Down

0 comments on commit 5861033

Please sign in to comment.