From: Soren Brinkmann <soren.brinkm...@xilinx.com>

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

Signed-off-by: Soren Brinkmann <soren.brinkm...@xilinx.com>
Reviewed-by: Peter Maydell <peter.mayd...@linaro.org>
Message-id: 1373323202-17083-3-git-send-email-soren.brinkm...@xilinx.com
Signed-off-by: Peter Maydell <peter.mayd...@linaro.org>
---
 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 9fbe5d2..2cbeefd 100644
--- a/hw/arm/boot.c
+++ b/hw/arm/boot.c
@@ -411,10 +411,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.7.9.5


Reply via email to