From patchwork Thu Jun 14 14:00:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 10464183 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 838FE60348 for ; Thu, 14 Jun 2018 14:04:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72C5E28A4E for ; Thu, 14 Jun 2018 14:04:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6770E28A55; Thu, 14 Jun 2018 14:04:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 08C6128A4E for ; Thu, 14 Jun 2018 14:04:19 +0000 (UTC) Received: from localhost ([::1]:40861 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTSrK-0000ve-7j for patchwork-qemu-devel@patchwork.kernel.org; Thu, 14 Jun 2018 10:04:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTSoM-0007oL-AQ for qemu-devel@nongnu.org; Thu, 14 Jun 2018 10:01:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTSoI-000088-EG for qemu-devel@nongnu.org; Thu, 14 Jun 2018 10:01:14 -0400 Received: from 20.mo7.mail-out.ovh.net ([46.105.49.208]:58053) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fTSoI-00007p-6y for qemu-devel@nongnu.org; Thu, 14 Jun 2018 10:01:10 -0400 Received: from player738.ha.ovh.net (unknown [10.109.108.37]) by mo7.mail-out.ovh.net (Postfix) with ESMTP id 9043FB3829 for ; Thu, 14 Jun 2018 16:01:08 +0200 (CEST) Received: from zorba.kaod.org.com (LFbn-TOU-1-49-10.w86-201.abo.wanadoo.fr [86.201.141.10]) (Authenticated sender: clg@kaod.org) by player738.ha.ovh.net (Postfix) with ESMTPSA id 55774592B; Thu, 14 Jun 2018 16:01:04 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: qemu-ppc@nongnu.org Date: Thu, 14 Jun 2018 16:00:40 +0200 Message-Id: <20180614140043.9231-4-clg@kaod.org> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180614140043.9231-1-clg@kaod.org> References: <20180614140043.9231-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 8440871603320032083 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedthedrleefgdejudcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 46.105.49.208 Subject: [Qemu-devel] [PATCH 3/6] ppc/pnv: introduce an 'isa_bus_name' field under the LPC model 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: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , qemu-devel@nongnu.org, David Gibson Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP This is again a small cleanup to hide to the machine the details of the ISA bus. The ISA bus device tree nodename will be different on Power9. Signed-off-by: Cédric Le Goater --- include/hw/ppc/pnv_lpc.h | 1 + hw/ppc/pnv.c | 9 +-------- hw/ppc/pnv_lpc.c | 4 ++++ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/hw/ppc/pnv_lpc.h b/include/hw/ppc/pnv_lpc.h index fb4b7b83d798..e8f7dcb9bfe9 100644 --- a/include/hw/ppc/pnv_lpc.h +++ b/include/hw/ppc/pnv_lpc.h @@ -70,6 +70,7 @@ typedef struct PnvLpcController { PnvPsi *psi; bool primary; + char *isa_bus_name; } PnvLpcController; ISABus *pnv_lpc_isa_create(PnvLpcController *lpc, int chip_type); diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c index d2126ee4affc..72cfe4c2627c 100644 --- a/hw/ppc/pnv.c +++ b/hw/ppc/pnv.c @@ -267,14 +267,7 @@ static void pnv_dt_icp(PnvChip *chip, void *fdt, uint32_t pir, static int pnv_chip_lpc_offset(PnvChip *chip, void *fdt) { - char *name; - int offset; - - name = g_strdup_printf("/xscom@%" PRIx64 "/isa@%x", - (uint64_t) PNV_XSCOM_BASE(chip), PNV_XSCOM_LPC_BASE); - offset = fdt_path_offset(fdt, name); - g_free(name); - return offset; + return fdt_path_offset(fdt, chip->lpc.isa_bus_name); } static void pnv_dt_chip(PnvChip *chip, void *fdt) diff --git a/hw/ppc/pnv_lpc.c b/hw/ppc/pnv_lpc.c index 7c6c012d5176..7f13c4bcf52c 100644 --- a/hw/ppc/pnv_lpc.c +++ b/hw/ppc/pnv_lpc.c @@ -481,6 +481,10 @@ static void pnv_lpc_realize(DeviceState *dev, Error **errp) pnv_xscom_region_init(&lpc->xscom_regs, OBJECT(dev), &pnv_lpc_xscom_ops, lpc, "xscom-lpc", PNV_XSCOM_LPC_SIZE); + + lpc->isa_bus_name = g_strdup_printf("/xscom@%" PRIx64 "/isa@%x", + (uint64_t) PNV_XSCOM_BASE(chip), + PNV_XSCOM_LPC_BASE); } static void pnv_lpc_class_init(ObjectClass *klass, void *data)