From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SljZL-0006Aa-Hi for qemu-devel@nongnu.org; Mon, 02 Jul 2012 12:33:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SljZG-0008Jx-E5 for qemu-devel@nongnu.org; Mon, 02 Jul 2012 12:33:47 -0400 MIME-Version: 1.0 In-Reply-To: <20120627235104.GD9149@tyr.buserror.net> References: <20120627234639.GA8974@tyr.buserror.net> <20120627235104.GD9149@tyr.buserror.net> Date: Mon, 2 Jul 2012 11:33:38 -0500 Message-ID: From: Stuart Yoder Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 4/4] PPC: e500: add generic e500 platform List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Scott Wood Cc: qemu-ppc@nongnu.org, agraf@suse.de, qemu-devel@nongnu.org On Wed, Jun 27, 2012 at 6:51 PM, Scott Wood wrote= : > This gives the kernel a paravirtualized machine to target, without > requiring both sides to pretend to be targeting a specific board > that likely has little to do with the host in KVM scenarios. =A0This > avoids the need to add new boards to QEMU, just to be able to > run KVM on new CPUs. > > Signed-off-by: Scott Wood > --- > =A0hw/ppc/Makefile.objs | =A0 =A03 +- > =A0hw/ppc/e500plat.c =A0 =A0| =A0 60 ++++++++++++++++++++++++++++++++++++= ++++++++++++++ > =A02 files changed, 62 insertions(+), 1 deletions(-) > =A0create mode 100644 hw/ppc/e500plat.c > > diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs > index 23eb8ca..58d82c9 100644 > --- a/hw/ppc/Makefile.objs > +++ b/hw/ppc/Makefile.objs > @@ -15,7 +15,8 @@ obj-$(CONFIG_PSERIES) +=3D spapr_pci.o pci-hotplug.o sp= apr_iommu.o > =A0obj-y +=3D ppc4xx_devs.o ppc4xx_pci.o ppc405_uc.o ppc405_boards.o > =A0obj-y +=3D ppc440_bamboo.o > =A0# PowerPC E500 boards > -obj-$(CONFIG_FDT) +=3D ppc/e500.o mpc8544_guts.o ppce500_spin.o ppc/mpc8= 544ds.o > +obj-$(CONFIG_FDT) +=3D ppc/e500.o mpc8544_guts.o ppce500_spin.o ppc/mpc8= 544ds.o \ > + =A0 =A0 =A0 ppc/e500plat.o > =A0# PowerPC 440 Xilinx ML507 reference board. > =A0obj-y +=3D virtex_ml507.o > =A0# PowerPC OpenPIC > diff --git a/hw/ppc/e500plat.c b/hw/ppc/e500plat.c > new file mode 100644 > index 0000000..a9ef5f8 > --- /dev/null > +++ b/hw/ppc/e500plat.c > @@ -0,0 +1,60 @@ > +/* > + * Generic device-tree-driven paravirt PPC e500 platform > + * > + * Copyright 2012 Freescale Semiconductor, Inc. > + * > + * This is free software; you can redistribute it and/or modify > + * it under the terms of =A0the GNU General =A0Public License as publish= ed by > + * the Free Software Foundation; =A0either version 2 of the =A0License, = or > + * (at your option) any later version. > + */ > + > +#include "config.h" > +#include "qemu-common.h" > +#include "e500.h" > +#include "../boards.h" > +#include "device_tree.h" > + > +static void e500plat_fixup_devtree(PPCE500Params *params, void *fdt) > +{ > + =A0 =A0const char model[] =3D "QEMU e500plat"; > + =A0 =A0const char compatible[] =3D "fsl,qemu-e500"; > + > + =A0 =A0qemu_devtree_setprop(fdt, "/", "model", model, sizeof(model)); > + =A0 =A0qemu_devtree_setprop(fdt, "/", "compatible", compatible, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sizeof(compatible)); > +} > + > +static void e500plat_init(ram_addr_t ram_size, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 const char *boot_de= vice, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 const char *kernel_= filename, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 const char *kernel_= cmdline, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 const char *initrd_= filename, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 const char *cpu_mod= el) > +{ > + =A0 =A0PPCE500Params params =3D { > + =A0 =A0 =A0 =A0.ram_size =3D ram_size, > + =A0 =A0 =A0 =A0.boot_device =3D boot_device, > + =A0 =A0 =A0 =A0.kernel_filename =3D kernel_filename, > + =A0 =A0 =A0 =A0.kernel_cmdline =3D kernel_cmdline, > + =A0 =A0 =A0 =A0.initrd_filename =3D initrd_filename, > + =A0 =A0 =A0 =A0.cpu_model =3D cpu_model, > + =A0 =A0 =A0 =A0.fixup_devtree =3D e500plat_fixup_devtree, > + =A0 =A0}; > + > + =A0 =A0ppce500_init(¶ms); > +} > + > +static QEMUMachine e500plat_machine =3D { > + =A0 =A0.name =3D "e500plat", > + =A0 =A0.desc =3D "e500plat", > + =A0 =A0.init =3D e500plat_init, > + =A0 =A0.max_cpus =3D 15, > +}; Can we call the generic e500 machine "ppce500"? I like that better as it denotes both the "Power/PPC" architecture and "e500". I aesthetically like -M ppce500 over -M e500plat when running QEMU. Stuart