From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwCqG-0001HS-VL for qemu-devel@nongnu.org; Mon, 17 Oct 2016 14:40:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwCqF-00018F-NF for qemu-devel@nongnu.org; Mon, 17 Oct 2016 14:40:56 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:47359) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bwCqF-000163-HF for qemu-devel@nongnu.org; Mon, 17 Oct 2016 14:40:55 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1bwCqA-00054h-UQ for qemu-devel@nongnu.org; Mon, 17 Oct 2016 19:40:50 +0100 From: Peter Maydell Date: Mon, 17 Oct 2016 19:40:29 +0100 Message-Id: <1476729644-4595-11-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1476729644-4595-1-git-send-email-peter.maydell@linaro.org> References: <1476729644-4595-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 10/25] hw/arm/boot: allow using a command line specified dtb without a kernel List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: 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 Message-id: 1473520054-402-1-git-send-email-m.olbrich@pengutronix.de Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- 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 1b913a4..942416d 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 c657acd..2569ec2 100644 --- a/vl.c +++ b/vl.c @@ -4389,11 +4389,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.7.4