From nobody Mon Feb 9 19:54:04 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155220794514297.44435351179948; Sun, 10 Mar 2019 00:52:25 -0800 (PST) Received: from localhost ([127.0.0.1]:42082 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2uBx-0005UT-QI for importer@patchew.org; Sun, 10 Mar 2019 04:52:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h2toU-0001LE-1d for qemu-devel@nongnu.org; Sun, 10 Mar 2019 04:28:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h2toT-0001Yh-2u for qemu-devel@nongnu.org; Sun, 10 Mar 2019 04:28:05 -0400 Received: from ozlabs.org ([2401:3900:2:1::2]:45309) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h2toR-0001Jo-Ga; Sun, 10 Mar 2019 04:28:04 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 44HDqq1Lftz9sPH; Sun, 10 Mar 2019 19:27:17 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1552206439; bh=dgTpVd1xtOPl2wAzFapWU6j2Abxb/+l4cstcBEND5BQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PAOsl5UrRo4IhHiN8T/vCgx2b/LTLRiXVARHsu4EsLcKFPtDpXXxZylOKhGATRepA GbC32u0TiPPtPDhfHAbBZbjxkDR5ikcVenfKNOMrceDqu2I6j603GY9/seUgu88NVs j1MZexeo1PR3boreTVUrBgEpuHGPCIf1Au9tRWbg= From: David Gibson To: peter.maydell@linaro.org Date: Sun, 10 Mar 2019 19:26:34 +1100 Message-Id: <20190310082703.1245-32-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190310082703.1245-1-david@gibson.dropbear.id.au> References: <20190310082703.1245-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 31/60] ppc/pnv: psi: add a PSIHB_REG macro 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: lvivier@redhat.com, groug@kaod.org, qemu-devel@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: C=C3=A9dric Le Goater This is a simple helper to translate XSCOM addresses to MMIO addresses Signed-off-by: C=C3=A9dric Le Goater Message-Id: <20190306085032.15744-13-clg@kaod.org> Signed-off-by: David Gibson --- hw/ppc/pnv_psi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c index c872be0b9c..a2f8d0dece 100644 --- a/hw/ppc/pnv_psi.c +++ b/hw/ppc/pnv_psi.c @@ -114,6 +114,8 @@ #define PSIHB_BAR_MASK 0x0003fffffff00000ull #define PSIHB_FSPBAR_MASK 0x0003ffff00000000ull =20 +#define PSIHB_REG(addr) (((addr) >> 3) + PSIHB_XSCOM_BAR) + static void pnv_psi_set_bar(PnvPsi *psi, uint64_t bar) { MemoryRegion *sysmem =3D get_system_memory(); @@ -392,13 +394,13 @@ static void pnv_psi_reg_write(PnvPsi *psi, uint32_t o= ffset, uint64_t val, */ static uint64_t pnv_psi_mmio_read(void *opaque, hwaddr addr, unsigned size) { - return pnv_psi_reg_read(opaque, (addr >> 3) + PSIHB_XSCOM_BAR, true); + return pnv_psi_reg_read(opaque, PSIHB_REG(addr), true); } =20 static void pnv_psi_mmio_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { - pnv_psi_reg_write(opaque, (addr >> 3) + PSIHB_XSCOM_BAR, val, true); + pnv_psi_reg_write(opaque, PSIHB_REG(addr), val, true); } =20 static const MemoryRegionOps psi_mmio_ops =3D { --=20 2.20.1