[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 5/5] RISC-V: Don't add NULL bootargs to device-tree
From: |
Palmer Dabbelt |
Subject: |
[Qemu-devel] [PULL 5/5] RISC-V: Don't add NULL bootargs to device-tree |
Date: |
Wed, 17 Oct 2018 14:54:22 -0700 |
From: Michael Clark <address@hidden>
Signed-off-by: Michael Clark <address@hidden>
Reviewed-by: Alistair Francis <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Palmer Dabbelt <address@hidden>
Signed-off-by: Alistair Francis <address@hidden>
Signed-off-by: Palmer Dabbelt <address@hidden>
---
hw/riscv/sifive_u.c | 4 +++-
hw/riscv/spike.c | 6 ++++--
hw/riscv/virt.c | 4 +++-
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 862f8ff5f758..ef07df244241 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -230,7 +230,9 @@ static void create_fdt(SiFiveUState *s, const struct
MemmapEntry *memmap,
qemu_fdt_add_subnode(fdt, "/chosen");
qemu_fdt_setprop_string(fdt, "/chosen", "stdout-path", nodename);
- qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline);
+ if (cmdline) {
+ qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline);
+ }
g_free(nodename);
}
diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
index be5ef85e8109..8a712ed49026 100644
--- a/hw/riscv/spike.c
+++ b/hw/riscv/spike.c
@@ -156,8 +156,10 @@ static void create_fdt(SpikeState *s, const struct
MemmapEntry *memmap,
g_free(cells);
g_free(nodename);
- qemu_fdt_add_subnode(fdt, "/chosen");
- qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline);
+ if (cmdline) {
+ qemu_fdt_add_subnode(fdt, "/chosen");
+ qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline);
+ }
}
static void spike_v1_10_0_board_init(MachineState *machine)
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 6bd723dc3ad9..4a137a503c8a 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -254,7 +254,9 @@ static void *create_fdt(RISCVVirtState *s, const struct
MemmapEntry *memmap,
qemu_fdt_add_subnode(fdt, "/chosen");
qemu_fdt_setprop_string(fdt, "/chosen", "stdout-path", nodename);
- qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline);
+ if (cmdline) {
+ qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", cmdline);
+ }
g_free(nodename);
return fdt;
--
2.18.1
- [Qemu-devel] [PULL] First RISC-V Patch Set for the 3.1 Soft Freeze, Palmer Dabbelt, 2018/10/17
- [Qemu-devel] [PULL 2/5] RISC-V: Move non-ops from op_helper to cpu_helper, Palmer Dabbelt, 2018/10/17
- [Qemu-devel] [PULL 1/5] RISC-V: Allow setting and clearing multiple irqs, Palmer Dabbelt, 2018/10/17
- [Qemu-devel] [PULL 5/5] RISC-V: Don't add NULL bootargs to device-tree,
Palmer Dabbelt <=
- [Qemu-devel] [PULL 4/5] RISC-V: Add missing free for plic_hart_config, Palmer Dabbelt, 2018/10/17
- [Qemu-devel] [PULL 3/5] RISC-V: Update CSR and interrupt definitions, Palmer Dabbelt, 2018/10/17
- Re: [Qemu-devel] [PULL] First RISC-V Patch Set for the 3.1 Soft Freeze, Eric Blake, 2018/10/17
- Re: [Qemu-devel] [PULL] First RISC-V Patch Set for the 3.1 Soft Freeze, Peter Maydell, 2018/10/25