From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49218) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiDG8-0001tx-Qa for qemu-devel@nongnu.org; Wed, 07 May 2014 21:36:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiDG2-0007KE-SZ for qemu-devel@nongnu.org; Wed, 07 May 2014 21:36:28 -0400 Received: from mail-qa0-x232.google.com ([2607:f8b0:400d:c00::232]:55806) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiDG2-0007KA-O5 for qemu-devel@nongnu.org; Wed, 07 May 2014 21:36:22 -0400 Received: by mail-qa0-f50.google.com with SMTP id j15so1826964qaq.37 for ; Wed, 07 May 2014 18:36:22 -0700 (PDT) From: "Edgar E. Iglesias" Date: Thu, 8 May 2014 11:35:04 +1000 Message-Id: <1399512908-23925-2-git-send-email-edgar.iglesias@gmail.com> In-Reply-To: <1399512908-23925-1-git-send-email-edgar.iglesias@gmail.com> References: <1399512908-23925-1-git-send-email-edgar.iglesias@gmail.com> Subject: [Qemu-devel] [PATCH v1 1/5] microblaze: Support loading of u-boot initrd images List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.crosthwaite@xilinx.com, linux@roeck-us.net From: "Edgar E. Iglesias" Signed-off-by: Edgar E. Iglesias --- hw/microblaze/boot.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c index 48d9e7a..deeecfc 100644 --- a/hw/microblaze/boot.c +++ b/hw/microblaze/boot.c @@ -174,9 +174,15 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu, hwaddr ddr_base, high = ROUND_UP(high + kernel_size, 4); boot_info.initrd_start = high; initrd_offset = boot_info.initrd_start - ddr_base; - initrd_size = load_image_targphys(initrd_filename, - boot_info.initrd_start, - ram_size - initrd_offset); + + initrd_size = load_ramdisk(initrd_filename, + boot_info.initrd_start, + ram_size - initrd_offset); + if (initrd_size < 0) { + initrd_size = load_image_targphys(initrd_filename, + boot_info.initrd_start, + ram_size - initrd_offset); + } if (initrd_size < 0) { error_report("qemu: could not load initrd '%s'\n", initrd_filename); -- 1.8.3.2