From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuOkb-0002NP-Dm for qemu-devel@nongnu.org; Tue, 10 Jun 2014 12:18:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuOkT-0003il-Pq for qemu-devel@nongnu.org; Tue, 10 Jun 2014 12:18:17 -0400 Received: from mail-la0-f53.google.com ([209.85.215.53]:53028) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuOkT-0003iW-Ix for qemu-devel@nongnu.org; Tue, 10 Jun 2014 12:18:09 -0400 Received: by mail-la0-f53.google.com with SMTP id ty20so4039978lab.26 for ; Tue, 10 Jun 2014 09:18:08 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <53972F12.4030900@redhat.com> References: <1402411908-25821-1-git-send-email-peter.maydell@linaro.org> <1402411908-25821-2-git-send-email-peter.maydell@linaro.org> <53972F12.4030900@redhat.com> From: Peter Maydell Date: Tue, 10 Jun 2014 17:17:48 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 1/2] hw/arm/virt: Provide flash devices for boot ROMs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Michael Casadevall , QEMU Developers , Christoffer Dall , Patch Tracking On 10 June 2014 17:15, Paolo Bonzini wrote: > Il 10/06/2014 16:51, Peter Maydell ha scritto: > >> + /* Create two flash devices to fill the VIRT_FLASH space in the >> memmap. >> + * Any file passed via -bios goes in the first of these. >> + */ >> + hwaddr flashsize = vbi->memmap[VIRT_FLASH].size / 2; >> + hwaddr flashbase = vbi->memmap[VIRT_FLASH].base; >> + char *nodename; >> + >> + if (bios_name) { >> + const char *fn = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); >> + if (!fn || load_image_targphys(fn, flashbase, flashsize) < 0) { >> + error_report("Could not load ROM image '%s'", bios_name); >> + exit(1); >> + } >> + } >> + >> + create_one_flash("virt.flash0", flashbase, flashsize); >> + create_one_flash("virt.flash1", flashbase + flashsize, flashsize); > > > What happens if you specify both -bios and -drive if=pflash? Can you check > that the user does not specify both? We'll create the device and then overlay it with the "ROM" image, same as for vexpress. (If the bios image is short then the underlying pflash contents will be visible.) thanks -- PMM