diff options
author | Alistair Francis <alistair.francis@wdc.com> | 2019-06-24 15:11:52 -0700 |
---|---|---|
committer | Palmer Dabbelt <palmer@sifive.com> | 2019-06-27 02:47:06 -0700 |
commit | b30422231b90c089ce73aa4b40461bfdc1be0371 (patch) | |
tree | 1ec04199f6c7fce8f1f5b66e8ff467fdecd4f309 /hw/riscv/sifive_u.c | |
parent | 0ac24d56c5e7d32423ea78ac58a06b444d1df04d (diff) |
hw/riscv: Add support for loading a firmware
Add support for loading a firmware file for the virt machine and the
SiFive U. This can be run with the following command:
qemu-system-riscv64 -machine virt -bios fw_jump.bin -kernel vmlinux
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'hw/riscv/sifive_u.c')
-rw-r--r-- | hw/riscv/sifive_u.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c index f6b9c12e60..4208671552 100644 --- a/hw/riscv/sifive_u.c +++ b/hw/riscv/sifive_u.c @@ -269,6 +269,10 @@ static void riscv_sifive_u_init(MachineState *machine) /* create device tree */ create_fdt(s, memmap, machine->ram_size, machine->kernel_cmdline); + if (machine->firmware) { + riscv_load_firmware(machine->firmware, memmap[SIFIVE_U_DRAM].base); + } + if (machine->kernel_filename) { riscv_load_kernel(machine->kernel_filename); } |