From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53208) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfUtf-0004S7-AA for qemu-devel@nongnu.org; Thu, 01 Sep 2016 12:31:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bfUta-0005Fe-Vz for qemu-devel@nongnu.org; Thu, 01 Sep 2016 12:31:22 -0400 Received: from 9.mo179.mail-out.ovh.net ([46.105.76.148]:59309) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bfUta-0005FC-NU for qemu-devel@nongnu.org; Thu, 01 Sep 2016 12:31:18 -0400 Received: from player698.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo179.mail-out.ovh.net (Postfix) with ESMTP id 90C0B1008B6B for ; Thu, 1 Sep 2016 18:31:16 +0200 (CEST) Date: Thu, 1 Sep 2016 18:31:04 +0200 From: Greg Kurz Message-ID: <20160901183104.683bea88@bahia.lan> In-Reply-To: <1472661255-20160-2-git-send-email-clg@kaod.org> References: <1472661255-20160-1-git-send-email-clg@kaod.org> <1472661255-20160-2-git-send-email-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 1/7] ppc/pnv: add skeleton PowerNV platform List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?Q8OpZHJpYw==?= Le Goater Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, David Gibson , Benjamin Herrenschmidt On Wed, 31 Aug 2016 18:34:09 +0200 C=C3=A9dric Le Goater wrote: > From: Benjamin Herrenschmidt >=20 > The goal is to emulate a PowerNV system at the level of the skiboot > firmware, which loads the OS and provides some runtime services. Power > Systems have a lower firmware (HostBoot) that does low level system > initialization, like DRAM training. This is beyond the scope of what > qemu will address in a PowerNV guest. >=20 > No devices yet, not even an interrupt controller. Just to get started, > some RAM to load the skiboot firmware, the kernel and initrd. The > device tree is fully created in the machine reset op. >=20 > Signed-off-by: Benjamin Herrenschmidt > [clg: - updated for qemu-2.7 > - replaced fprintf by error_report > - used a common definition of _FDT macro > - removed VMStateDescription as migration is not yet supported > - added IBM Copyright statements > - reworked kernel_filename handling > - merged PnvSystem and sPowerNVMachineState > - removed PHANDLE_XICP > - added ppc_create_page_sizes_prop helper > - removed nmi support > - removed kvm support > - updated powernv machine to version 2.8 > - removed chips and cpus, They will be provided in another patches > - added a machine reset routine to initialize the device tree (also) > - french has a squelette and english a skeleton. > - improved commit log. > - reworked prototypes parameters > - added a check on the ram size (thanks to Michael Ellerman) > - fixed chip-id cell > - changed MAX_CPUS to 2048 > - simplified memory node creation to one node only > - removed machine version > - rewrote the device tree creation with the fdt "rw" routines > - s/sPowerNVMachineState/PnvMachineState/ > - etc. > ] > Signed-off-by: C=C3=A9dric Le Goater > --- >=20 > Changes since v1: >=20 > - changed MAX_CPUS to 2048 > - simplified memory node creation to one node only > - removed machine version=20 > - rewrote the device tree creation with the fdt "rw" routines > - s/sPowerNVMachineState/PnvMachineState/ > - block_default_type is back to IF_IDE because of the AHCI device >=20 > default-configs/ppc64-softmmu.mak | 1 + > hw/ppc/Makefile.objs | 2 + > hw/ppc/pnv.c | 244 ++++++++++++++++++++++++++++++++= ++++++ > include/hw/ppc/pnv.h | 37 ++++++ > 4 files changed, 284 insertions(+) > create mode 100644 hw/ppc/pnv.c > create mode 100644 include/hw/ppc/pnv.h >=20 > diff --git a/default-configs/ppc64-softmmu.mak b/default-configs/ppc64-so= ftmmu.mak > index c4be59f638ed..516a6e25aba3 100644 > --- a/default-configs/ppc64-softmmu.mak > +++ b/default-configs/ppc64-softmmu.mak > @@ -40,6 +40,7 @@ CONFIG_I8259=3Dy > CONFIG_XILINX=3Dy > CONFIG_XILINX_ETHLITE=3Dy > CONFIG_PSERIES=3Dy > +CONFIG_POWERNV=3Dy > CONFIG_PREP=3Dy > CONFIG_MAC=3Dy > CONFIG_E500=3Dy > diff --git a/hw/ppc/Makefile.objs b/hw/ppc/Makefile.objs > index 99a0d4e581bf..8105db7d5600 100644 > --- a/hw/ppc/Makefile.objs > +++ b/hw/ppc/Makefile.objs > @@ -5,6 +5,8 @@ obj-$(CONFIG_PSERIES) +=3D spapr.o spapr_vio.o spapr_even= ts.o > obj-$(CONFIG_PSERIES) +=3D spapr_hcall.o spapr_iommu.o spapr_rtas.o > obj-$(CONFIG_PSERIES) +=3D spapr_pci.o spapr_rtc.o spapr_drc.o spapr_rng= .o > obj-$(CONFIG_PSERIES) +=3D spapr_cpu_core.o > +# IBM PowerNV > +obj-$(CONFIG_POWERNV) +=3D pnv.o > ifeq ($(CONFIG_PCI)$(CONFIG_PSERIES)$(CONFIG_LINUX), yyy) > obj-y +=3D spapr_pci_vfio.o > endif > diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c > new file mode 100644 > index 000000000000..70413e3c5740 > --- /dev/null > +++ b/hw/ppc/pnv.c > @@ -0,0 +1,244 @@ > +/* > + * QEMU PowerPC PowerNV model > + * > + * Copyright (c) 2004-2007 Fabrice Bellard > + * Copyright (c) 2007 Jocelyn Mayer > + * Copyright (c) 2010 David Gibson, IBM Corporation. > + * Copyright (c) 2014-2016 BenH, IBM Corporation. > + * > + * Permission is hereby granted, free of charge, to any person obtaining= a copy > + * of this software and associated documentation files (the "Software"),= to deal > + * in the Software without restriction, including without limitation the= rights > + * to use, copy, modify, merge, publish, distribute, sublicense, and/or = sell > + * copies of the Software, and to permit persons to whom the Software is > + * furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice shall be includ= ed in > + * all copies or substantial portions of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRE= SS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILI= TY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHA= LL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR = OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISI= NG FROM, > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALING= S IN > + * THE SOFTWARE. > + * > + */ This file is a new contribution to QEMU. According to the LICENSE file, it = should be released under GPL version 2 or later. If Ben agrees, probably better to= have the same text as in include/hw/ppc/pnv.h below. > [...] > --- /dev/null > +++ b/include/hw/ppc/pnv.h > @@ -0,0 +1,37 @@ > +/* > + * QEMU PowerNV various definitions > + * > + * Copyright (c) 2014-2016 BenH, IBM Corporation. > + * > + * This library is free software; you can redistribute it and/or > + * modify it under the terms of the GNU Lesser General Public > + * License as published by the Free Software Foundation; either > + * version 2 of the License, or (at your option) any later version. > + * > + * This library is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + * Lesser General Public License for more details. > + * > + * You should have received a copy of the GNU Lesser General Public > + * License along with this library; if not, see . > + */