From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
To: peter.maydell@linaro.org, qemu-devel@nongnu.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: Wed, 3 Sep 2014 14:01:27 +0200 [thread overview]
Message-ID: <1409745687-15705-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>
---
v2: comment style, call exit(1) on load_dtb() failure
hw/arm/boot.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index e32f2f415885..a32ff28d9be1 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -459,6 +459,17 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info)
/* Load the kernel. */
if (!info->kernel_filename) {
+
+ if (have_dtb(info)) {
+ /* 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 (load_dtb(info->loader_start, info)) {
+ exit(1);
+ }
+ }
+
/* 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
next reply other threads:[~2014-09-03 12:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-03 12:01 Ard Biesheuvel [this message]
2014-09-03 12:32 ` [Qemu-devel] [PATCH] hw/arm/boot: load device tree to base of DRAM if no -kernel option was passed Peter Crosthwaite
-- strict thread matches above, loose matches on Subject: below --
2014-08-26 15:31 Ard Biesheuvel
2014-09-01 17:36 ` 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
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=1409745687-15705-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).