qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] hw/arm/boot: allow using a command line specified dtb without a kernel
@ 2016-09-10 15:07 Michael Olbrich
  2016-09-22 16:23 ` Peter Maydell
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Olbrich @ 2016-09-10 15:07 UTC (permalink / raw)
  To: peter.maydell, pbonzini; +Cc: qemu-arm, qemu-devel, Michael Olbrich

When kernel and device tree are specified in the QEMU commandline, then
this device tree may be modified e.g. to add virtio_mmio devices.
With a bootloader e.g. on a flash device these extra devices are not
available.
With this change, the device tree can be specified at the QEMU commandline.
The modified device tree made available to the bootloader with the same
mechanism already supported by device trees fully generated by QEMU.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 hw/arm/boot.c | 4 ++--
 vl.c          | 5 -----
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 1b913a43ca65..942416d95a6f 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -773,6 +773,8 @@ static void arm_load_kernel_notify(Notifier *notifier, void *data)
      */
     assert(!(info->secure_board_setup && kvm_enabled()));
 
+    info->dtb_filename = qemu_opt_get(qemu_get_machine_opts(), "dtb");
+
     /* Load the kernel.  */
     if (!info->kernel_filename || info->firmware_loaded) {
 
@@ -833,8 +835,6 @@ static void arm_load_kernel_notify(Notifier *notifier, void *data)
         elf_machine = EM_ARM;
     }
 
-    info->dtb_filename = qemu_opt_get(qemu_get_machine_opts(), "dtb");
-
     if (!info->secondary_cpu_reset_hook) {
         info->secondary_cpu_reset_hook = default_reset_secondary;
     }
diff --git a/vl.c b/vl.c
index ee557a1d3f8a..bbea51e0ce7d 100644
--- a/vl.c
+++ b/vl.c
@@ -4335,11 +4335,6 @@ int main(int argc, char **argv, char **envp)
         exit(1);
     }
 
-    if (!linux_boot && qemu_opt_get(machine_opts, "dtb")) {
-        error_report("-dtb only allowed with -kernel option");
-        exit(1);
-    }
-
     if (semihosting_enabled() && !semihosting_get_argc() && kernel_filename) {
         /* fall back to the -kernel/-append */
         semihosting_arg_fallback(kernel_filename, kernel_cmdline);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-10-07 14:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-10 15:07 [Qemu-devel] [PATCH] hw/arm/boot: allow using a command line specified dtb without a kernel Michael Olbrich
2016-09-22 16:23 ` Peter Maydell
2016-09-23  6:33   ` Michael Olbrich
2016-09-30  1:58     ` Peter Maydell
2016-10-07 14:09       ` Stefan Hajnoczi
2016-10-07 14:33         ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).