aboutsummaryrefslogtreecommitdiff
path: root/hw/riscv/spike.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/riscv/spike.c')
-rw-r--r--hw/riscv/spike.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
index 5668fe0694..60e2912be5 100644
--- a/hw/riscv/spike.c
+++ b/hw/riscv/spike.c
@@ -179,10 +179,6 @@ static void create_fdt(SpikeState *s, const MemMapEntry *memmap,
qemu_fdt_add_subnode(fdt, "/chosen");
qemu_fdt_setprop_string(fdt, "/chosen", "stdout-path", "/htif");
-
- if (cmdline && *cmdline) {
- qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline);
- }
}
static bool spike_test_elf_image(char *filename)
@@ -319,6 +315,11 @@ static void spike_board_init(MachineState *machine)
riscv_load_initrd(machine->initrd_filename, machine->ram_size,
kernel_entry, machine->fdt);
}
+
+ if (machine->kernel_cmdline && *machine->kernel_cmdline) {
+ qemu_fdt_setprop_string(machine->fdt, "/chosen", "bootargs",
+ machine->kernel_cmdline);
+ }
} else {
/*
* If dynamic firmware is used, it doesn't know where is the next mode