From patchwork Fri Apr 26 18:19:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 239900 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2B6CC2C00B4 for ; Sat, 27 Apr 2013 04:20:15 +1000 (EST) Received: from localhost ([::1]:47663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVnFl-0007oI-6m for incoming@patchwork.ozlabs.org; Fri, 26 Apr 2013 14:20:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVnFA-0007n2-CS for qemu-devel@nongnu.org; Fri, 26 Apr 2013 14:19:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVnF9-0004Al-2b for qemu-devel@nongnu.org; Fri, 26 Apr 2013 14:19:36 -0400 Received: from cantor2.suse.de ([195.135.220.15]:38699 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVnF8-0004AU-T0; Fri, 26 Apr 2013 14:19:35 -0400 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 49B1D5E000205; Fri, 26 Apr 2013 20:19:34 +0200 (CEST) From: Alexander Graf To: qemu-ppc@nongnu.org Date: Fri, 26 Apr 2013 20:19:11 +0200 Message-Id: <1367000373-7972-3-git-send-email-agraf@suse.de> X-Mailer: git-send-email 1.6.0.2 In-Reply-To: <1367000373-7972-1-git-send-email-agraf@suse.de> References: <1367000373-7972-1-git-send-email-agraf@suse.de> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-Received-From: 195.135.220.15 Cc: Blue Swirl , qemu-devel@nongnu.org, Aurelien Jarno Subject: [Qemu-devel] [PATCH 02/24] S390: IPL: Support ELF firmware X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Our firmware blob is always a raw file that we load at a fixed address today. Support loading an ELF blob instead that we can map high up in memory. This way we don't have to be so conscious about size constraints. Signed-off-by: Alexander Graf --- hw/s390x/ipl.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c index c43dfcd..d1f7acd 100644 --- a/hw/s390x/ipl.c +++ b/hw/s390x/ipl.c @@ -82,17 +82,21 @@ static int s390_ipl_init(SysBusDevice *dev) } bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); - bios_size = load_image_targphys(bios_filename, ZIPL_IMAGE_START, 4096); - ipl->start_addr = ZIPL_IMAGE_START; + bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL, + NULL, 1, ELF_MACHINE, 0); + if (bios_size == -1UL) { + bios_size = load_image_targphys(bios_filename, ZIPL_IMAGE_START, + 4096); + ipl->start_addr = ZIPL_IMAGE_START; + if (bios_size > 4096) { + hw_error("stage1 bootloader is > 4k\n"); + } + } g_free(bios_filename); if ((long)bios_size < 0) { hw_error("could not load bootloader '%s'\n", bios_name); } - - if (bios_size > 4096) { - hw_error("stage1 bootloader is > 4k\n"); - } return 0; } else { kernel_size = load_elf(ipl->kernel, NULL, NULL, NULL, NULL,