From nobody Sat Oct 25 08:57:39 2025 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.zohomail.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 1520373883978838.6322728696834; Tue, 6 Mar 2018 14:04:43 -0800 (PST) Received: from localhost ([::1]:58549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etKhM-0001XX-8A for importer@patchew.org; Tue, 06 Mar 2018 17:04:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etKf9-00008F-Jw for qemu-devel@nongnu.org; Tue, 06 Mar 2018 17:02:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etKf8-0006tJ-EH for qemu-devel@nongnu.org; Tue, 06 Mar 2018 17:02:23 -0500 Received: from chuckie.co.uk ([82.165.15.123]:43195 helo=s16892447.onlinehome-server.info) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1etKf8-0006fI-5q; Tue, 06 Mar 2018 17:02:22 -0500 Received: from host86-138-240-5.range86-138.btcentralplus.com ([86.138.240.5] helo=kentang.home) by s16892447.onlinehome-server.info with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1etKfC-0007QL-OK; Tue, 06 Mar 2018 22:02:28 +0000 From: Mark Cave-Ayland To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Date: Tue, 6 Mar 2018 22:01:56 +0000 Message-Id: <20180306220159.4287-4-mark.cave-ayland@ilande.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180306220159.4287-1-mark.cave-ayland@ilande.co.uk> References: <20180306220159.4287-1-mark.cave-ayland@ilande.co.uk> X-SA-Exim-Connect-IP: 86.138.240.5 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk X-SA-Exim-Version: 4.2.1 (built Sun, 08 Jan 2012 02:45:44 +0000) X-SA-Exim-Scanned: Yes (on s16892447.onlinehome-server.info) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 82.165.15.123 Subject: [Qemu-devel] [PATCH 3/6] grackle: remove deprecated pci_grackle_init() function 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Instead wire up the grackle device inside the Mac Old World machine. Signed-off-by: Mark Cave-Ayland --- hw/pci-host/grackle.c | 28 +--------------------------- hw/ppc/mac.h | 3 --- hw/ppc/mac_oldworld.c | 21 ++++++++++++++++++--- 3 files changed, 19 insertions(+), 33 deletions(-) diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index f8935246c3..e4583d493b 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -66,33 +66,6 @@ static void grackle_init_irqs(GrackleState *s) } } =20 -PCIBus *pci_grackle_init(uint32_t base, DeviceState *pic_dev, - MemoryRegion *address_space_mem, - MemoryRegion *address_space_io) -{ - DeviceState *dev; - SysBusDevice *s; - PCIHostState *phb; - GrackleState *d; - - dev =3D qdev_create(NULL, TYPE_GRACKLE_PCI_HOST_BRIDGE); - object_property_set_link(OBJECT(dev), OBJECT(pic_dev), "pic", - &error_abort); - qdev_init_nofail(dev); - - s =3D SYS_BUS_DEVICE(dev); - phb =3D PCI_HOST_BRIDGE(dev); - d =3D GRACKLE_PCI_HOST_BRIDGE(dev); - - memory_region_add_subregion(address_space_mem, 0x80000000ULL, - &d->pci_hole); - - sysbus_mmio_map(s, 0, base); - sysbus_mmio_map(s, 1, base + 0x00200000); - - return phb->bus; -} - static void grackle_realize(DeviceState *dev, Error **errp) { GrackleState *s =3D GRACKLE_PCI_HOST_BRIDGE(dev); @@ -132,6 +105,7 @@ static void grackle_init(Object *obj) =20 sysbus_init_mmio(sbd, &phb->conf_mem); sysbus_init_mmio(sbd, &phb->data_mem); + sysbus_init_mmio(sbd, &s->pci_hole); } =20 static void grackle_pci_realize(PCIDevice *d, Error **errp) diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h index 2359deb1ec..04568c2a22 100644 --- a/hw/ppc/mac.h +++ b/hw/ppc/mac.h @@ -77,9 +77,6 @@ void macio_init(PCIDevice *dev, =20 /* Grackle PCI */ #define TYPE_GRACKLE_PCI_HOST_BRIDGE "grackle-pcihost" -PCIBus *pci_grackle_init(uint32_t base, DeviceState *pic_dev, - MemoryRegion *address_space_mem, - MemoryRegion *address_space_io); =20 /* UniNorth PCI */ PCIBus *pci_pmac_init(qemu_irq *pic, diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 17711971e6..b3c1f1bc1b 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -34,6 +34,7 @@ #include "net/net.h" #include "hw/isa/isa.h" #include "hw/pci/pci.h" +#include "hw/pci/pci_host.h" #include "hw/boards.h" #include "hw/nvram/fw_cfg.h" #include "hw/char/escc.h" @@ -56,6 +57,8 @@ =20 #define NDRV_VGA_FILENAME "qemu_vga.ndrv" =20 +#define GRACKLE_BASE 0xfec00000 + static void fw_cfg_boot_set(void *opaque, const char *boot_device, Error **errp) { @@ -95,6 +98,7 @@ static void ppc_heathrow_init(MachineState *machine) PCIBus *pci_bus; OldWorldMacIOState *macio; MACIOIDEState *macio_ide; + SysBusDevice *s; DeviceState *dev, *pic_dev; BusState *adb_bus; int bios_size, ndrv_size; @@ -262,9 +266,20 @@ static void ppc_heathrow_init(MachineState *machine) exit(1); } =20 - pci_bus =3D pci_grackle_init(0xfec00000, pic_dev, - get_system_memory(), - get_system_io()); + /* Grackle PCI host bridge */ + dev =3D qdev_create(NULL, TYPE_GRACKLE_PCI_HOST_BRIDGE); + object_property_set_link(OBJECT(dev), OBJECT(pic_dev), "pic", + &error_abort); + qdev_init_nofail(dev); + s =3D SYS_BUS_DEVICE(dev); + sysbus_mmio_map(s, 0, GRACKLE_BASE); + sysbus_mmio_map(s, 1, GRACKLE_BASE + 0x200000); + /* PCI hole */ + memory_region_add_subregion(get_system_memory(), 0x80000000ULL, + sysbus_mmio_get_region(s, 2)); + + pci_bus =3D PCI_HOST_BRIDGE(dev)->bus; + pci_vga_init(pci_bus); =20 for (i =3D 0; i < nb_nics; i++) { --=20 2.11.0