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 1520374139502629.1950212146564; Tue, 6 Mar 2018 14:08:59 -0800 (PST) Received: from localhost ([::1]:58585 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etKlW-0005oy-Oj for importer@patchew.org; Tue, 06 Mar 2018 17:08:58 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1etKf9-00008N-T7 for qemu-devel@nongnu.org; Tue, 06 Mar 2018 17:02:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1etKf8-0006u6-So for qemu-devel@nongnu.org; Tue, 06 Mar 2018 17:02:23 -0500 Received: from chuckie.co.uk ([82.165.15.123]:43197 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-0006fc-Jj; 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 1etKfE-0007QL-9g; Tue, 06 Mar 2018 22:02:30 +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:57 +0000 Message-Id: <20180306220159.4287-5-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 4/6] grackle: move PCI IO (ISA) memory region into the grackle device 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" This simplifies the Old World machine to simply mapping the ISA memory regi= on into the main address space. Signed-off-by: Mark Cave-Ayland --- hw/pci-host/grackle.c | 7 ++++++- hw/ppc/mac_oldworld.c | 9 +++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index e4583d493b..4810a4de79 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -41,6 +41,7 @@ typedef struct GrackleState { qemu_irq irqs[4]; MemoryRegion pci_mmio; MemoryRegion pci_hole; + MemoryRegion pci_io; } GrackleState; =20 /* Don't know if this matches real hardware, but it agrees with OHW. */ @@ -76,7 +77,7 @@ static void grackle_realize(DeviceState *dev, Error **err= p) pci_grackle_map_irq, s, &s->pci_mmio, - get_system_io(), + &s->pci_io, 0, 4, TYPE_PCI_BUS); =20 pci_create_simple(phb->bus, 0, "grackle"); @@ -90,6 +91,9 @@ static void grackle_init(Object *obj) PCIHostState *phb =3D PCI_HOST_BRIDGE(obj); =20 memory_region_init(&s->pci_mmio, OBJECT(s), "pci-mmio", 0x100000000ULL= ); + memory_region_init_io(&s->pci_io, OBJECT(s), &unassigned_io_ops, obj, + "pci-isa-mmio", 0x00200000); + memory_region_init_alias(&s->pci_hole, OBJECT(s), "pci-hole", &s->pci_= mmio, 0x80000000ULL, 0x7e000000ULL); =20 @@ -106,6 +110,7 @@ static void grackle_init(Object *obj) sysbus_init_mmio(sbd, &phb->conf_mem); sysbus_init_mmio(sbd, &phb->data_mem); sysbus_init_mmio(sbd, &s->pci_hole); + sysbus_init_mmio(sbd, &s->pci_io); } =20 static void grackle_pci_realize(PCIDevice *d, Error **errp) diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index b3c1f1bc1b..2bf70c4375 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -92,7 +92,6 @@ static void ppc_heathrow_init(MachineState *machine) int linux_boot, i; MemoryRegion *ram =3D g_new(MemoryRegion, 1); MemoryRegion *bios =3D g_new(MemoryRegion, 1); - MemoryRegion *isa =3D g_new(MemoryRegion, 1); uint32_t kernel_base, initrd_base, cmdline_base =3D 0; int32_t kernel_size, initrd_size; PCIBus *pci_bus; @@ -226,11 +225,6 @@ static void ppc_heathrow_init(MachineState *machine) } } =20 - /* Register 2 MB of ISA IO space */ - memory_region_init_alias(isa, NULL, "isa_mmio", - get_system_io(), 0, 0x00200000); - memory_region_add_subregion(sysmem, 0xfe000000, isa); - /* XXX: we register only 1 output pin for heathrow PIC */ pic_dev =3D qdev_create(NULL, TYPE_HEATHROW); qdev_init_nofail(pic_dev); @@ -277,6 +271,9 @@ static void ppc_heathrow_init(MachineState *machine) /* PCI hole */ memory_region_add_subregion(get_system_memory(), 0x80000000ULL, sysbus_mmio_get_region(s, 2)); + /* Register 2 MB of ISA IO space */ + memory_region_add_subregion(get_system_memory(), 0xfe000000, + sysbus_mmio_get_region(s, 3)); =20 pci_bus =3D PCI_HOST_BRIDGE(dev)->bus; =20 --=20 2.11.0