Received: from eggs.gnu.org ([2001:4830:134:3::10]:37640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c41Sq-0003EQ-7Z for qemu-devel@nongnu.org; Tue, 08 Nov 2016 03:09:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c41Sn-0007mu-2f for qemu-devel@nongnu.org; Tue, 08 Nov 2016 03:09:04 -0500 Received: from 3.mo5.mail-out.ovh.net ([46.105.40.108]:55578) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c41Sm-0007lx-T8 for qemu-devel@nongnu.org; Tue, 08 Nov 2016 03:09:01 -0500 Received: from player688.ha.ovh.net (b7.ovh.net [213.186.33.57]) by mo5.mail-out.ovh.net (Postfix) with ESMTP id B21323F525 for ; Tue, 8 Nov 2016 09:08:59 +0100 (CET) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Date: Tue, 8 Nov 2016 09:08:05 +0100 Message-Id: <1478592490-29673-6-git-send-email-clg@kaod.org> In-Reply-To: <1478592490-29673-1-git-send-email-clg@kaod.org> References: <1478592490-29673-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v6 05/10] ppc/pnv: add a XICS object to the PowerNV machine List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-ppc@nongnu.org Cc: David Gibson , Benjamin Herrenschmidt , qemu-devel@nongnu.org, Alexander Graf , Cedric Le Goater Nothing more than a simple container object for the ICP and ICS. ICPs are still created by the XICS object for the moment. Signed-off-by: C=C3=A9dric Le Goater --- David, Please note the qdev_set_parent_bus(). That is how the reset should be handled. I had done that before for the Aspeed SoC machine but I had forgotten ... hw/ppc/pnv.c | 10 ++++++++++ include/hw/ppc/pnv.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 6af34241f248..435af7cf4e48 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -411,6 +411,16 @@ static void ppc_powernv_init(MachineState *machine) } } =20 + /* Create XICS which holds all the ICPs for each thread */ + object_initialize(&pnv->xics, sizeof(pnv->xics), TYPE_XICS_COMMON); + object_property_add_child(OBJECT(machine), "xics", OBJECT(&pnv->xics= ), + &error_fatal); + qdev_set_parent_bus(DEVICE(&pnv->xics), sysbus_get_default()); + object_property_set_int(OBJECT(&pnv->xics), smp_cores * smp_threads, + "nr_servers", &error_fatal); + object_property_set_bool(OBJECT(&pnv->xics), true, "realized", + &error_fatal); + /* We need some cpu model to instantiate the PnvChip class */ if (machine->cpu_model =3D=3D NULL) { machine->cpu_model =3D "POWER8"; diff --git a/include/hw/ppc/pnv.h b/include/hw/ppc/pnv.h index 7bee658733db..cb9499728fda 100644 --- a/include/hw/ppc/pnv.h +++ b/include/hw/ppc/pnv.h @@ -22,6 +22,7 @@ #include "hw/boards.h" #include "hw/sysbus.h" #include "hw/ppc/pnv_lpc.h" +#include "hw/ppc/xics.h" =20 #define TYPE_PNV_CHIP "powernv-chip" #define PNV_CHIP(obj) OBJECT_CHECK(PnvChip, (obj), TYPE_PNV_CHIP) @@ -113,6 +114,8 @@ typedef struct PnvMachineState { PnvChip **chips; =20 ISABus *isa_bus; + + XICSState xics; } PnvMachineState; =20 #define PNV_FDT_ADDR 0x01000000 --=20 2.7.4