From nobody Tue Feb 10 02:55:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; dkim=fail spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1493191299925932.8886029599777; Wed, 26 Apr 2017 00:21:39 -0700 (PDT) Received: from localhost ([::1]:53083 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3HGc-000669-KV for importer@patchew.org; Wed, 26 Apr 2017 03:21:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d3Gwx-0005Tb-BN for qemu-devel@nongnu.org; Wed, 26 Apr 2017 03:01:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d3Gwn-00087x-4t for qemu-devel@nongnu.org; Wed, 26 Apr 2017 03:01:19 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:33379) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d3Gwm-00085R-NE; Wed, 26 Apr 2017 03:01:09 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 3wCWFN091dz9sNV; Wed, 26 Apr 2017 17:00:54 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1493190056; bh=ZbPFfo1cYUSW4++dlBF45X0GCsFoJWhsceqtvlWmTeg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ttt+9D0H5hMXcWFlzAlrIKGYFSdBIxmCvcQT82wXqEh4SSeCb1A3n+ma7eZmLkcJe h9VLCpWS+iZi1MCHj3RbPt5pUwex2YwzvsM76v80poW3bs1uBG0LUmNeoq/W0KphEv S7VhAHsmtUODELwf1o3M19bUJ1W3Yzkeiknv8mfs= From: David Gibson To: peter.maydell@linaro.org Date: Wed, 26 Apr 2017 17:00:24 +1000 Message-Id: <20170426070034.10727-39-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170426070034.10727-1-david@gibson.dropbear.id.au> References: <20170426070034.10727-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2401:3900:2:1::2 Subject: [Qemu-devel] [PULL 38/48] ppc/pnv: scan ISA bus to populate device tree X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mdroth@linux.vnet.ibm.com, aik@ozlabs.ru, qemu-devel@nongnu.org, agraf@suse.de, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: C=C3=A9dric Le Goater This is an empty shell that we will use to include nodes in the device tree for ISA devices. We expect RTC, UART and IPMI BT devices. Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: David Gibson Signed-off-by: David Gibson --- hw/ppc/pnv.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 9468e99..c445906 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -303,6 +303,29 @@ static void powernv_populate_chip(PnvChip *chip, void = *fdt) g_free(typename); } =20 +typedef struct ForeachPopulateArgs { + void *fdt; + int offset; +} ForeachPopulateArgs; + +static int powernv_populate_isa_device(DeviceState *dev, void *opaque) +{ + return 0; +} + +static void powernv_populate_isa(ISABus *bus, void *fdt, int lpc_offset) +{ + ForeachPopulateArgs args =3D { + .fdt =3D fdt, + .offset =3D lpc_offset, + }; + + /* ISA devices are not necessarily parented to the ISA bus so we + * can not use object_child_foreach() */ + qbus_walk_children(BUS(bus), powernv_populate_isa_device, + NULL, NULL, NULL, &args); +} + static void *powernv_create_fdt(MachineState *machine) { const char plat_compat[] =3D "qemu,powernv\0ibm,powernv"; @@ -311,6 +334,7 @@ static void *powernv_create_fdt(MachineState *machine) char *buf; int off; int i; + int lpc_offset; =20 fdt =3D g_malloc0(FDT_MAX_SIZE); _FDT((fdt_create_empty_tree(fdt, FDT_MAX_SIZE))); @@ -350,6 +374,10 @@ static void *powernv_create_fdt(MachineState *machine) for (i =3D 0; i < pnv->num_chips; i++) { powernv_populate_chip(pnv->chips[i], fdt); } + + /* Populate ISA devices on chip 0 */ + lpc_offset =3D pnv_chip_lpc_offset(pnv->chips[0], fdt); + powernv_populate_isa(pnv->isa_bus, fdt, lpc_offset); return fdt; } =20 --=20 2.9.3