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>
This commit is contained in:
parent
77ff5bba31
commit
6b01e3277e
|
@ -341,11 +341,11 @@ static void riscv_virt_board_init(MachineState *machine)
|
||||||
};
|
};
|
||||||
|
|
||||||
/* copy in the reset vector */
|
/* 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 */
|
/* copy in the device tree */
|
||||||
qemu_fdt_dumpdtb(s->fdt, s->fdt_size);
|
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);
|
s->fdt, s->fdt_size);
|
||||||
|
|
||||||
/* create PLIC hart topology configuration string */
|
/* create PLIC hart topology configuration string */
|
||||||
|
|
|
@ -23,8 +23,6 @@
|
||||||
#define VIRT(obj) \
|
#define VIRT(obj) \
|
||||||
OBJECT_CHECK(RISCVVirtState, (obj), TYPE_RISCV_VIRT_BOARD)
|
OBJECT_CHECK(RISCVVirtState, (obj), TYPE_RISCV_VIRT_BOARD)
|
||||||
|
|
||||||
enum { ROM_BASE = 0x1000 };
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
SysBusDevice parent_obj;
|
SysBusDevice parent_obj;
|
||||||
|
|
Loading…
Reference in a new issue