aboutsummaryrefslogtreecommitdiff
path: root/hw/riscv
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2020-11-02 09:44:36 -0500
committerPaolo Bonzini <pbonzini@redhat.com>2020-12-15 12:51:55 -0500
commitf2ce39b4f067fe8b8de6104a2d8ac558d35c330b (patch)
tree0d6c327eb7b5522347c7f465d403829af4f2ec6e /hw/riscv
parent55810e90cc9a5ca18289c25aa5c1e0e2dc77eadb (diff)
downloadqemu-f2ce39b4f067fe8b8de6104a2d8ac558d35c330b.zip
qemu-f2ce39b4f067fe8b8de6104a2d8ac558d35c330b.tar.gz
qemu-f2ce39b4f067fe8b8de6104a2d8ac558d35c330b.tar.bz2
vl: make qemu_get_machine_opts static
Machine options can be retrieved as properties of the machine object. Encourage that by removing the "easy" accessor to machine options. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/riscv')
-rw-r--r--hw/riscv/sifive_u.c6
-rw-r--r--hw/riscv/virt.c6
2 files changed, 4 insertions, 8 deletions
diff --git a/hw/riscv/sifive_u.c b/hw/riscv/sifive_u.c
index 2f19a9c..e7f6dc5 100644
--- a/hw/riscv/sifive_u.c
+++ b/hw/riscv/sifive_u.c
@@ -100,14 +100,12 @@ static void create_fdt(SiFiveUState *s, const struct MemmapEntry *memmap,
int cpu;
uint32_t *cells;
char *nodename;
- const char *dtb_filename;
char ethclk_names[] = "pclk\0hclk";
uint32_t plic_phandle, prci_phandle, gpio_phandle, phandle = 1;
uint32_t hfclk_phandle, rtcclk_phandle, phy_phandle;
- dtb_filename = qemu_opt_get(qemu_get_machine_opts(), "dtb");
- if (dtb_filename) {
- fdt = s->fdt = load_device_tree(dtb_filename, &s->fdt_size);
+ if (ms->dtb) {
+ fdt = s->fdt = load_device_tree(ms->dtb, &s->fdt_size);
if (!fdt) {
error_report("load_device_tree() failed");
exit(1);
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index 25cea7a..3cc18a7 100644
--- a/hw/riscv/virt.c
+++ b/hw/riscv/virt.c
@@ -181,7 +181,6 @@ static void create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,
{
void *fdt;
int i, cpu, socket;
- const char *dtb_filename;
MachineState *mc = MACHINE(s);
uint64_t addr, size;
uint32_t *clint_cells, *plic_cells;
@@ -195,9 +194,8 @@ static void create_fdt(RISCVVirtState *s, const struct MemmapEntry *memmap,
hwaddr flashsize = virt_memmap[VIRT_FLASH].size / 2;
hwaddr flashbase = virt_memmap[VIRT_FLASH].base;
- dtb_filename = qemu_opt_get(qemu_get_machine_opts(), "dtb");
- if (dtb_filename) {
- fdt = s->fdt = load_device_tree(dtb_filename, &s->fdt_size);
+ if (mc->dtb) {
+ fdt = s->fdt = load_device_tree(mc->dtb, &s->fdt_size);
if (!fdt) {
error_report("load_device_tree() failed");
exit(1);