qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: qemu-devel@nongnu.org, peter.maydell@linaro.org
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: [Qemu-devel] [PATCH] hw/arm/boot: load device tree to base of DRAM if no -kernel option was passed
Date: Tue, 26 Aug 2014 17:31:02 +0200	[thread overview]
Message-ID: <1409067062-1729-1-git-send-email-ard.biesheuvel@linaro.org> (raw)

If we are running the 'virt' machine, we may have a device tree blob but no
kernel to supply it to if no -kernel option was passed. In that case, copy it
to the base of DRAM where it can be picked up by a bootloader executing from
NOR flash.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 hw/arm/boot.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 3d1f4a255b48..ff6a727613aa 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -455,6 +455,14 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info)
 
     /* Load the kernel.  */
     if (!info->kernel_filename) {
+        /*
+         * If we have a device tree blob, but no kernel to supply it to, copy it
+         * to the base of DRAM for a bootloader executing from NOR flash to
+         * pick up.
+         */
+        if (have_dtb(info))
+            load_dtb(info->loader_start, info);
+
         /* If no kernel specified, do nothing; we will start from address 0
          * (typically a boot ROM image) in the same way as hardware.
          */
-- 
1.8.3.2

             reply	other threads:[~2014-08-26 15:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-26 15:31 Ard Biesheuvel [this message]
2014-09-01 17:36 ` [Qemu-devel] [PATCH] hw/arm/boot: load device tree to base of DRAM if no -kernel option was passed Peter Maydell
2014-09-01 17:46   ` Ard Biesheuvel
2014-09-01 17:50     ` Peter Maydell
2014-09-01 18:04       ` Ard Biesheuvel
2014-09-01 18:27         ` Peter Maydell
  -- strict thread matches above, loose matches on Subject: below --
2014-09-03 12:01 Ard Biesheuvel
2014-09-03 12:32 ` Peter Crosthwaite

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409067062-1729-1-git-send-email-ard.biesheuvel@linaro.org \
    --to=ard.biesheuvel@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).