mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
hw/riscv: Support to load DTB after 3GB memory on 64-bit system.
Larger initrd image will overlap the DTB at 3GB address. Since 64-bit system doesn't have 32-bit addressable issue, we just load DTB to the end of dram in 64-bit system. Signed-off-by: Jim Shu <jim.shu@sifive.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com> Message-ID: <20241120153935.24706-2-jim.shu@sifive.com> [ Changes by AF - Store fdt_load_addr_hi32 in the reset vector ] Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This commit is contained in:
parent
d2ed9fffba
commit
b4132a9e62
6 changed files with 20 additions and 14 deletions
|
@ -518,8 +518,9 @@ static void sifive_u_machine_init(MachineState *machine)
|
|||
target_ulong firmware_end_addr, kernel_start_addr;
|
||||
const char *firmware_name;
|
||||
uint32_t start_addr_hi32 = 0x00000000;
|
||||
uint32_t fdt_load_addr_hi32 = 0x00000000;
|
||||
int i;
|
||||
uint32_t fdt_load_addr;
|
||||
uint64_t fdt_load_addr;
|
||||
uint64_t kernel_entry;
|
||||
DriveInfo *dinfo;
|
||||
BlockBackend *blk;
|
||||
|
@ -606,11 +607,12 @@ static void sifive_u_machine_init(MachineState *machine)
|
|||
|
||||
fdt_load_addr = riscv_compute_fdt_addr(memmap[SIFIVE_U_DEV_DRAM].base,
|
||||
memmap[SIFIVE_U_DEV_DRAM].size,
|
||||
machine);
|
||||
machine, &s->soc.u_cpus);
|
||||
riscv_load_fdt(fdt_load_addr, machine->fdt);
|
||||
|
||||
if (!riscv_is_32bit(&s->soc.u_cpus)) {
|
||||
start_addr_hi32 = (uint64_t)start_addr >> 32;
|
||||
fdt_load_addr_hi32 = fdt_load_addr >> 32;
|
||||
}
|
||||
|
||||
/* reset vector */
|
||||
|
@ -625,7 +627,7 @@ static void sifive_u_machine_init(MachineState *machine)
|
|||
start_addr, /* start: .dword */
|
||||
start_addr_hi32,
|
||||
fdt_load_addr, /* fdt_laddr: .dword */
|
||||
0x00000000,
|
||||
fdt_load_addr_hi32,
|
||||
0x00000000,
|
||||
/* fw_dyn: */
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue