From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAOYn-0002IO-I5 for qemu-devel@nongnu.org; Mon, 03 Feb 2014 13:48:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAOYh-0003gX-Cd for qemu-devel@nongnu.org; Mon, 03 Feb 2014 13:47:57 -0500 Message-ID: <52EFE453.8020705@suse.de> Date: Mon, 03 Feb 2014 19:47:47 +0100 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1391440820-4736-1-git-send-email-edgar.iglesias@gmail.com> In-Reply-To: <1391440820-4736-1-git-send-email-edgar.iglesias@gmail.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v1] virtex_ml507: Add support for loading initrd images List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" , qemu-devel@nongnu.org, agraf@suse.de Cc: qemu-ppc@nongnu.org Am 03.02.2014 16:20, schrieb Edgar E. Iglesias: > From: "Edgar E. Iglesias" >=20 > Signed-off-by: Edgar E. Iglesias > --- > hw/ppc/virtex_ml507.c | 34 +++++++++++++++++++++++++++++++++- > 1 file changed, 33 insertions(+), 1 deletion(-) >=20 > diff --git a/hw/ppc/virtex_ml507.c b/hw/ppc/virtex_ml507.c > index bdb057e..19083d4 100644 > --- a/hw/ppc/virtex_ml507.c > +++ b/hw/ppc/virtex_ml507.c > @@ -166,6 +166,19 @@ static int xilinx_load_device_tree(hwaddr addr, > if (!fdt) { > return 0; > } > + > + r =3D qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-start", > + initrd_base); > + if (r < 0) { > + error_report("couldn't set /chosen/linux,initrd-start'"); Both this ... > + } > + > + r =3D qemu_fdt_setprop_cell(fdt, "/chosen", "linux,initrd-end", > + (initrd_base + initrd_size)); > + if (r < 0) { > + error_report("couldn't set /chosen/linux,initrd-end'"); ... and the other error_report() have either a stray trailing single-quote or one missing before the path. > + } > + > r =3D qemu_fdt_setprop_string(fdt, "/chosen", "bootargs", kernel_c= mdline); > if (r < 0) > fprintf(stderr, "couldn't set /chosen/bootargs\n"); > @@ -179,6 +192,8 @@ static void virtex_init(QEMUMachineInitArgs *args) > const char *cpu_model =3D args->cpu_model; > const char *kernel_filename =3D args->kernel_filename; > const char *kernel_cmdline =3D args->kernel_cmdline; > + hwaddr initrd_base =3D 0; > + int initrd_size =3D 0; > MemoryRegion *address_space_mem =3D get_system_memory(); > DeviceState *dev; > PowerPCCPU *cpu; > @@ -242,10 +257,27 @@ static void virtex_init(QEMUMachineInitArgs *args= ) > =20 > boot_info.ima_size =3D kernel_size; > =20 > + /* Load initrd. */ > + if (args->initrd_filename) { > + initrd_base =3D high =3D ROUND_UP(high, 4); > + initrd_size =3D load_image_targphys(args->initrd_filename, > + high, ram_size - high); > + > + if (initrd_size < 0) { > + error_report("couldn't load ram disk '%s'\n", And here's a stray \n. Andreas > + args->initrd_filename); > + exit(1); > + } > + high =3D ROUND_UP(high + initrd_size, 4); > + } > + > /* Provide a device-tree. */ > boot_info.fdt =3D high + (8192 * 2); > boot_info.fdt &=3D ~8191; > - xilinx_load_device_tree(boot_info.fdt, ram_size, 0, 0, kernel_= cmdline); > + > + xilinx_load_device_tree(boot_info.fdt, ram_size, > + initrd_base, initrd_size, > + kernel_cmdline); > } > env->load_info =3D &boot_info; > } --=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