qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Soren Brinkmann <soren.brinkmann@xilinx.com>
To: Paul Brook <paul@codesourcery.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: Edgar Iglesias <edgari@xilinx.com>,
	qemu-devel@nongnu.org,
	Soren Brinkmann <soren.brinkmann@xilinx.com>
Subject: [Qemu-devel] [PATCH v3 2/2] hw/arm: Use 'load_ramdisk()' for loading ramdisks w/ U-Boot header
Date: Mon,  8 Jul 2013 15:40:02 -0700	[thread overview]
Message-ID: <1373323202-17083-3-git-send-email-soren.brinkmann@xilinx.com> (raw)
In-Reply-To: <1373323202-17083-1-git-send-email-soren.brinkmann@xilinx.com>

The load_ramdisk function is used to load ramdisk featuring a U-Boot
header.

Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
---
v2:
 - try to load a u-boot ramdisk using the new load_ramdisk() function
   first. And then, in case of an error, fall back to the traditional
   way for loading a ramdisk. In order to keep ramdisk and kernel
   loading symmetrical.

 hw/arm/boot.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/hw/arm/boot.c b/hw/arm/boot.c
index 7c0090f..a356b53 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -425,10 +425,16 @@ void arm_load_kernel(ARMCPU *cpu, struct arm_boot_info *info)
     info->entry = entry;
     if (is_linux) {
         if (info->initrd_filename) {
-            initrd_size = load_image_targphys(info->initrd_filename,
-                                              info->initrd_start,
-                                              info->ram_size -
-                                              info->initrd_start);
+            initrd_size = load_ramdisk(info->initrd_filename,
+                                       info->initrd_start,
+                                       info->ram_size -
+                                       info->initrd_start);
+            if (initrd_size < 0) {
+                initrd_size = load_image_targphys(info->initrd_filename,
+                                                  info->initrd_start,
+                                                  info->ram_size -
+                                                  info->initrd_start);
+            }
             if (initrd_size < 0) {
                 fprintf(stderr, "qemu: could not load initrd '%s'\n",
                         info->initrd_filename);
-- 
1.8.3.2

  parent reply	other threads:[~2013-07-08 22:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08 22:40 [Qemu-devel] [PATCH v3 0/2] Support ramdisks with U-Boot header Soren Brinkmann
2013-07-08 22:40 ` [Qemu-devel] [PATCH v3 1/2] hw/loader: Support ramdisk with u-boot header Soren Brinkmann
2013-07-19 12:04   ` Peter Maydell
2013-07-19 17:39     ` Sören Brinkmann
2013-07-19 17:46       ` Peter Maydell
2013-07-19 17:53         ` Sören Brinkmann
2013-07-19 23:20           ` Peter Maydell
2013-07-19 23:36             ` Sören Brinkmann
2013-07-08 22:40 ` Soren Brinkmann [this message]
2013-07-19 12:05   ` [Qemu-devel] [PATCH v3 2/2] hw/arm: Use 'load_ramdisk()' for loading ramdisks w/ U-Boot header Peter Maydell
2013-07-17 16:43 ` [Qemu-devel] [PATCH v3 0/2] Support ramdisks with " Sören Brinkmann

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=1373323202-17083-3-git-send-email-soren.brinkmann@xilinx.com \
    --to=soren.brinkmann@xilinx.com \
    --cc=edgari@xilinx.com \
    --cc=paul@codesourcery.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --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).