From nobody Mon Feb 9 18:44:45 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; 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 1491832753149418.44802722819816; Mon, 10 Apr 2017 06:59:13 -0700 (PDT) Received: from localhost ([::1]:34589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxZqa-0000LZ-7Q for importer@patchew.org; Mon, 10 Apr 2017 09:59:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxZot-0007Vi-7T for qemu-devel@nongnu.org; Mon, 10 Apr 2017 09:57:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxZor-0002S9-Ld for qemu-devel@nongnu.org; Mon, 10 Apr 2017 09:57:27 -0400 Received: from 5.mo179.mail-out.ovh.net ([46.105.43.140]:50245) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cxZor-0002RJ-8d for qemu-devel@nongnu.org; Mon, 10 Apr 2017 09:57:25 -0400 Received: from player690.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo179.mail-out.ovh.net (Postfix) with ESMTP id 2AFA135710 for ; Mon, 10 Apr 2017 15:57:24 +0200 (CEST) Received: from zorba.kaod.org.com (LFbn-1-10647-27.w90-89.abo.wanadoo.fr [90.89.233.27]) (Authenticated sender: clg@kaod.org) by player690.ha.ovh.net (Postfix) with ESMTPSA id 09C9454008F; Mon, 10 Apr 2017 15:57:20 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: David Gibson Date: Mon, 10 Apr 2017 15:56:53 +0200 Message-Id: <1491832618-27536-4-git-send-email-clg@kaod.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491832618-27536-1-git-send-email-clg@kaod.org> References: <1491832618-27536-1-git-send-email-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 10323376247487368166 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrfeeliedruddvgdejtdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.43.140 Subject: [Qemu-devel] [PATCH v2 3/8] 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: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 --- hw/ppc/pnv.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index 7d742b6e34e1..2d32b20f2d6e 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -281,6 +281,36 @@ 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; + + lpc_offset =3D fdt_node_offset_by_compatible(fdt, -1, "ibm,lpc"); + if (lpc_offset < 0) { + error_report("Could not find the lpc node !?"); + return; + } + + args.fdt =3D fdt; + args.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"; @@ -328,6 +358,8 @@ static void *powernv_create_fdt(MachineState *machine) for (i =3D 0; i < pnv->num_chips; i++) { powernv_populate_chip(pnv->chips[i], fdt); } + + powernv_populate_isa(pnv->isa_bus, fdt); return fdt; } =20 --=20 2.7.4