From nobody Mon Feb 9 10:52:22 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=eik.bme.hu Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1634242494465144.71176680235624; Thu, 14 Oct 2021 13:14:54 -0700 (PDT) Received: from localhost ([::1]:43640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb77t-0001zG-Eh for importer@patchew.org; Thu, 14 Oct 2021 16:14:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb75V-0006Ve-EU; Thu, 14 Oct 2021 16:12:25 -0400 Received: from zero.eik.bme.hu ([2001:738:2001:2001::2001]:12167) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb75R-0002Qb-Vy; Thu, 14 Oct 2021 16:12:25 -0400 Received: from zero.eik.bme.hu (blah.eik.bme.hu [152.66.115.182]) by localhost (Postfix) with SMTP id A944B756072; Thu, 14 Oct 2021 22:12:18 +0200 (CEST) Received: by zero.eik.bme.hu (Postfix, from userid 432) id 551BA75604D; Thu, 14 Oct 2021 22:12:18 +0200 (CEST) Message-Id: <9bd8e84d02d91693b71082a1fadeb86e6bce3025.1634241019.git.balaton@eik.bme.hu> In-Reply-To: References: From: BALATON Zoltan Subject: [PATCH 5/6] ppc/pegasos2: Add constants for PCI config addresses Date: Thu, 14 Oct 2021 21:50:19 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org X-Spam-Probability: 8% Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=2001:738:2001:2001::2001; envelope-from=balaton@eik.bme.hu; helo=zero.eik.bme.hu X-Spam_score_int: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1634242496707100001 Content-Type: text/plain; charset="utf-8" Define a constant for PCI config addresses to make it clearer what these numbers are. Signed-off-by: BALATON Zoltan --- hw/ppc/pegasos2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/ppc/pegasos2.c b/hw/ppc/pegasos2.c index a861bf16b8..39e96d323f 100644 --- a/hw/ppc/pegasos2.c +++ b/hw/ppc/pegasos2.c @@ -54,11 +54,13 @@ =20 #define BUS_FREQ_HZ 133333333 =20 +#define PCI0_CFG_ADDR 0xcf8 #define PCI0_MEM_BASE 0xc0000000 #define PCI0_MEM_SIZE 0x20000000 #define PCI0_IO_BASE 0xf8000000 #define PCI0_IO_SIZE 0x10000 =20 +#define PCI1_CFG_ADDR 0xc78 #define PCI1_MEM_BASE 0x80000000 #define PCI1_MEM_SIZE 0x40000000 #define PCI1_IO_BASE 0xfe000000 @@ -226,7 +228,7 @@ static void pegasos2_mv_reg_write(Pegasos2MachineState = *pm, uint32_t addr, static uint32_t pegasos2_pci_config_read(Pegasos2MachineState *pm, int bus, uint32_t addr, uint32_t len) { - hwaddr pcicfg =3D bus ? 0xc78 : 0xcf8; + hwaddr pcicfg =3D bus ? PCI1_CFG_ADDR : PCI0_CFG_ADDR; uint64_t val =3D 0xffffffffULL; =20 if (len <=3D 4) { @@ -239,7 +241,7 @@ static uint32_t pegasos2_pci_config_read(Pegasos2Machin= eState *pm, int bus, static void pegasos2_pci_config_write(Pegasos2MachineState *pm, int bus, uint32_t addr, uint32_t len, uint32_= t val) { - hwaddr pcicfg =3D bus ? 0xc78 : 0xcf8; + hwaddr pcicfg =3D bus ? PCI1_CFG_ADDR : PCI0_CFG_ADDR; =20 pegasos2_mv_reg_write(pm, pcicfg, 4, addr | BIT(31)); pegasos2_mv_reg_write(pm, pcicfg + 4, len, val); --=20 2.21.4