From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:44090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjEFO-0001ik-7U for qemu-devel@nongnu.org; Fri, 06 Jan 2012 13:10:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RjEFM-0005Tt-Ju for qemu-devel@nongnu.org; Fri, 06 Jan 2012 13:10:34 -0500 Received: from cantor2.suse.de ([195.135.220.15]:53732 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RjEFM-0005Th-53 for qemu-devel@nongnu.org; Fri, 06 Jan 2012 13:10:32 -0500 Message-ID: <4F0738BD.6000105@suse.de> Date: Fri, 06 Jan 2012 19:09:01 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1325793761-10249-1-git-send-email-mark.langsdorf@calxeda.com> <1325793761-10249-6-git-send-email-mark.langsdorf@calxeda.com> In-Reply-To: <1325793761-10249-6-git-send-email-mark.langsdorf@calxeda.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 5/5] arm: SoC model for Calxeda Highbank List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Langsdorf Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, Rob Herring Am 05.01.2012 21:02, schrieb Mark Langsdorf: > From: Rob Herring >=20 > Adds support for Calxeda's Highbank SoC. >=20 > Signed-off-by: Rob Herring > Signed-off-by: Mark Langsdorf > --- > diff --git a/hw/highbank.c b/hw/highbank.c > new file mode 100644 > index 0000000..73b6564 > --- /dev/null > +++ b/hw/highbank.c > + sysram =3D g_new(MemoryRegion, 1); > + memory_region_init_ram(sysram, "highbank.sysram", 0x8000); > + memory_region_add_subregion(sysmem, 0xfff88000, sysram); > + if (load_image_targphys("sysram.bin", 0xfff88000, 0x8000) < 0) { > + fprintf(stderr, "Unable to load sysram.bin\n"); > + } This should be something like: char* filename; if (bios_name =3D=3D NULL) { bios_name =3D "sysram.bin"; } filename =3D qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); if (filename !=3D NULL) { load_image_targpyhs(filename, ...); g_free(filename); } Not knowing ARM boot well myself, you might also want to check and use get_image_size(filename) rather than hardcoding 0x8000? Also I'm wondering what the use case here is. I can imagine two scenarios= : 1) User wants to boot a -bios, which in turn may at runtime search for a kernel on the emulated storage, like it would on real hardware. Then loading a too large or missing BIOS should fail. 2) User wants to boot a -kernel. Then this should probably not complain about issues with -bios at all, unless explicitly specified by the user. Andreas --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg