From nobody Wed Oct 29 09:27:44 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; dkim=fail; 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 1524821570283883.1340376625717; Fri, 27 Apr 2018 02:32:50 -0700 (PDT) Received: from localhost ([::1]:46724 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBzkH-0002rs-Dz for importer@patchew.org; Fri, 27 Apr 2018 05:32:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59167) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fBzZe-00015Y-8k for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:21:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fBzZa-0001tJ-5a for qemu-devel@nongnu.org; Fri, 27 Apr 2018 05:21:50 -0400 Received: from ozlabs.org ([203.11.71.1]:43563) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fBzZZ-0001so-OP; Fri, 27 Apr 2018 05:21:46 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 40XT2l2rN6z9s4Y; Fri, 27 Apr 2018 19:21:33 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1524820895; bh=wQyoB4ok2iTaTj9wBFGtihFhdEAPJCSCnE9P3epo/Nc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=daypHgUbwoXZI0nQLWzXSUBvI3ntRbVf+oTKVTBaNKHriwp4iFOgHt5C5z+4+CvL7 XlBdEfsps9rMQG84q9mhxbe7aSF2DEDX0ab1NMEvbBqSObrJErURTw83F1wIGAwul9 NrXwKSIS95yDfHppD8/zzv8EAOkDrQDTsnkgclGo= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 27 Apr 2018 19:20:53 +1000 Message-Id: <20180427092126.24812-17-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180427092126.24812-1-david@gibson.dropbear.id.au> References: <20180427092126.24812-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 16/49] uninorth: fix PCI and AGP bus mixup 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: Mark Cave-Ayland , David Gibson , qemu-ppc@nongnu.org, groug@kaod.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland Somewhere in the history of time, the initialisation of the PCI buses for t= he AGP and PCI host bridges got mixed up in that the PCI host bridge was creating an instance of the AGP PCI bus, and the AGP PCI bus was missing. Swap the PCI host bridge over to use the correct PCI bus (including setting the kMacRISCPCIAddressSelect register used by MacOS X) and add the missing reference to the AGP PCI bus. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/pci-host/uninorth.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index 426b3c4e33..1f6752c294 100644 --- a/hw/pci-host/uninorth.c +++ b/hw/pci-host/uninorth.c @@ -121,7 +121,7 @@ static void pci_unin_main_realize(DeviceState *dev, Err= or **errp) get_system_io(), PCI_DEVFN(11, 0), 4, TYPE_PCI_BUS); =20 - pci_create_simple(h->bus, PCI_DEVFN(11, 0), "uni-north-agp"); + pci_create_simple(h->bus, PCI_DEVFN(11, 0), "uni-north-pci"); =20 /* DEC 21154 bridge */ #if 0 @@ -195,6 +195,8 @@ static void pci_unin_agp_realize(DeviceState *dev, Erro= r **errp) &s->pci_mmio, get_system_io(), PCI_DEVFN(11, 0), 4, TYPE_PCI_BUS); + + pci_create_simple(h->bus, PCI_DEVFN(11, 0), "uni-north-agp"); } =20 static void pci_unin_agp_init(Object *obj) @@ -303,16 +305,6 @@ static void unin_main_pci_host_realize(PCIDevice *d, E= rror **errp) d->config[0x0D] =3D 0x10; /* capabilities_pointer */ d->config[0x34] =3D 0x00; -} - -static void unin_agp_pci_host_realize(PCIDevice *d, Error **errp) -{ - /* cache_line_size */ - d->config[0x0C] =3D 0x08; - /* latency_timer */ - d->config[0x0D] =3D 0x10; - /* capabilities_pointer - d->config[0x34] =3D 0x80; */ =20 /* * Set kMacRISCPCIAddressSelect (0x48) register to indicate PCI @@ -325,6 +317,16 @@ static void unin_agp_pci_host_realize(PCIDevice *d, Er= ror **errp) d->config[0x4b] =3D 0x1; } =20 +static void unin_agp_pci_host_realize(PCIDevice *d, Error **errp) +{ + /* cache_line_size */ + d->config[0x0C] =3D 0x08; + /* latency_timer */ + d->config[0x0D] =3D 0x10; + /* capabilities_pointer + d->config[0x34] =3D 0x80; */ +} + static void u3_agp_pci_host_realize(PCIDevice *d, Error **errp) { /* cache line size */ --=20 2.14.3