aboutsummaryrefslogtreecommitdiff
path: root/hw/riscv
diff options
context:
space:
mode:
authorMichael Clark <mjc@sifive.com>2018-03-04 11:15:09 +1300
committerMichael Clark <mjc@sifive.com>2018-05-06 10:39:38 +1200
commit6b01e3277e0e189a8f064b94c4f761e4efadd758 (patch)
tree71087fecc3f2d577198824f480645a6f9089915d /hw/riscv
parent77ff5bba315d4453ae97ff90ba7698fb1ccc077c (diff)
downloadqemu-6b01e3277e0e189a8f064b94c4f761e4efadd758.zip
qemu-6b01e3277e0e189a8f064b94c4f761e4efadd758.tar.gz
qemu-6b01e3277e0e189a8f064b94c4f761e4efadd758.tar.bz2
RISC-V: Use ROM base address and size from memmap
Another case of replacing hard coded constants, this time referring to the definition in the virt machine's memmap. Cc: Sagar Karandikar <sagark@eecs.berkeley.edu> Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Signed-off-by: Michael Clark <mjc@sifive.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'hw/riscv')
-rw-r--r--hw/riscv/virt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index df06fc7..3cc9c80 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -341,11 +341,11 @@ static void riscv_virt_board_init(MachineState *machine)
};
/* copy in the reset vector */
- copy_le32_to_phys(ROM_BASE, reset_vec, sizeof(reset_vec));
+ copy_le32_to_phys(memmap[VIRT_MROM].base, reset_vec, sizeof(reset_vec));
/* copy in the device tree */
qemu_fdt_dumpdtb(s->fdt, s->fdt_size);
- cpu_physical_memory_write(ROM_BASE + sizeof(reset_vec),
+ cpu_physical_memory_write(memmap[VIRT_MROM].base + sizeof(reset_vec),
s->fdt, s->fdt_size);
/* create PLIC hart topology configuration string */