mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 18:23:57 -06:00
hw/riscv/virt.c: use s->memmap in virt_machine_done()
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-ID: <20250429125811.224803-4-dbarboza@ventanamicro.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
fb8cf3fd98
commit
47e51e5d12
1 changed files with 7 additions and 8 deletions
|
@ -1425,9 +1425,8 @@ static void virt_machine_done(Notifier *notifier, void *data)
|
||||||
{
|
{
|
||||||
RISCVVirtState *s = container_of(notifier, RISCVVirtState,
|
RISCVVirtState *s = container_of(notifier, RISCVVirtState,
|
||||||
machine_done);
|
machine_done);
|
||||||
const MemMapEntry *memmap = virt_memmap;
|
|
||||||
MachineState *machine = MACHINE(s);
|
MachineState *machine = MACHINE(s);
|
||||||
hwaddr start_addr = memmap[VIRT_DRAM].base;
|
hwaddr start_addr = s->memmap[VIRT_DRAM].base;
|
||||||
target_ulong firmware_end_addr, kernel_start_addr;
|
target_ulong firmware_end_addr, kernel_start_addr;
|
||||||
const char *firmware_name = riscv_default_firmware_name(&s->soc[0]);
|
const char *firmware_name = riscv_default_firmware_name(&s->soc[0]);
|
||||||
uint64_t fdt_load_addr;
|
uint64_t fdt_load_addr;
|
||||||
|
@ -1471,14 +1470,14 @@ static void virt_machine_done(Notifier *notifier, void *data)
|
||||||
* let's overwrite the address we jump to after reset to
|
* let's overwrite the address we jump to after reset to
|
||||||
* the base of the flash.
|
* the base of the flash.
|
||||||
*/
|
*/
|
||||||
start_addr = virt_memmap[VIRT_FLASH].base;
|
start_addr = s->memmap[VIRT_FLASH].base;
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* Pflash was supplied but either KVM guest or bios is not none.
|
* Pflash was supplied but either KVM guest or bios is not none.
|
||||||
* In this case, base of the flash would contain S-mode payload.
|
* In this case, base of the flash would contain S-mode payload.
|
||||||
*/
|
*/
|
||||||
riscv_setup_firmware_boot(machine);
|
riscv_setup_firmware_boot(machine);
|
||||||
kernel_entry = virt_memmap[VIRT_FLASH].base;
|
kernel_entry = s->memmap[VIRT_FLASH].base;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1492,15 +1491,15 @@ static void virt_machine_done(Notifier *notifier, void *data)
|
||||||
kernel_entry = boot_info.image_low_addr;
|
kernel_entry = boot_info.image_low_addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
fdt_load_addr = riscv_compute_fdt_addr(memmap[VIRT_DRAM].base,
|
fdt_load_addr = riscv_compute_fdt_addr(s->memmap[VIRT_DRAM].base,
|
||||||
memmap[VIRT_DRAM].size,
|
s->memmap[VIRT_DRAM].size,
|
||||||
machine, &boot_info);
|
machine, &boot_info);
|
||||||
riscv_load_fdt(fdt_load_addr, machine->fdt);
|
riscv_load_fdt(fdt_load_addr, machine->fdt);
|
||||||
|
|
||||||
/* load the reset vector */
|
/* load the reset vector */
|
||||||
riscv_setup_rom_reset_vec(machine, &s->soc[0], start_addr,
|
riscv_setup_rom_reset_vec(machine, &s->soc[0], start_addr,
|
||||||
virt_memmap[VIRT_MROM].base,
|
s->memmap[VIRT_MROM].base,
|
||||||
virt_memmap[VIRT_MROM].size, kernel_entry,
|
s->memmap[VIRT_MROM].size, kernel_entry,
|
||||||
fdt_load_addr);
|
fdt_load_addr);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue