From nobody Wed Nov 5 18:39:28 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 (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 15363060355071001.6242181243667; Fri, 7 Sep 2018 00:40:35 -0700 (PDT) Received: from localhost ([::1]:37150 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fyBNZ-0007Xs-Ug for importer@patchew.org; Fri, 07 Sep 2018 03:40:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fyBFU-0007UI-8B for qemu-devel@nongnu.org; Fri, 07 Sep 2018 03:32:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fyBFT-00054g-5r for qemu-devel@nongnu.org; Fri, 07 Sep 2018 03:32:12 -0400 Received: from ozlabs.org ([203.11.71.1]:41763) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fyBFS-00053m-Og; Fri, 07 Sep 2018 03:32:11 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4268Jy1q6jz9sDb; Fri, 7 Sep 2018 17:32:02 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1536305522; bh=R2fUo14ityREdZk/fimERlRX641ueRhmJ+zVtC/HaRc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=inxMnw6efTNwhPed1znL5eTXxQU83BN1u4IaiXtH+ufCPtjRkIasEfgb+x8RpSzet +Vzi8jSINIxDQ5Jlj6qvS8wCMSwQyNZDM7zLSJuQhEjqNwsn39P6gTe189LARi7c6M l/mNsrWv7SoY7LCkdGGQm2/bGLeGr4TbJP6MqSIs= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 7 Sep 2018 17:31:50 +1000 Message-Id: <20180907073155.26200-10-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180907073155.26200-1-david@gibson.dropbear.id.au> References: <20180907073155.26200-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 09/14] uninorth: add ofw-addr property to allow correct fw path generation 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, mark.cave-ayland@ilande.co.uk, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson 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 Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/pci-host/uninorth.c | 16 ++++++++++++++++ hw/ppc/mac_newworld.c | 1 + include/hw/pci-host/uninorth.h | 1 + 3 files changed, 18 insertions(+) diff --git a/hw/pci-host/uninorth.c b/hw/pci-host/uninorth.c index a843aa7b36..1378c5c7fb 100644 --- a/hw/pci-host/uninorth.c +++ b/hw/pci-host/uninorth.c @@ -118,6 +118,13 @@ static void pci_unin_init_irqs(UNINHostState *s) } } =20 +static char *pci_unin_main_ofw_unit_address(const SysBusDevice *dev) +{ + UNINHostState *s =3D UNI_NORTH_PCI_HOST_BRIDGE(dev); + + return g_strdup_printf("%x", s->ofw_addr); +} + static void pci_unin_main_realize(DeviceState *dev, Error **errp) { UNINHostState *s =3D UNI_NORTH_PCI_HOST_BRIDGE(dev); @@ -455,12 +462,21 @@ static const TypeInfo unin_internal_pci_host_info =3D= { }, }; =20 +static Property pci_unin_main_pci_host_props[] =3D { + DEFINE_PROP_UINT32("ofw-addr", UNINHostState, ofw_addr, -1), + DEFINE_PROP_END_OF_LIST() +}; + static void pci_unin_main_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + SysBusDeviceClass *sbc =3D SYS_BUS_DEVICE_CLASS(klass); =20 dc->realize =3D pci_unin_main_realize; + dc->props =3D pci_unin_main_pci_host_props; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); + dc->fw_name =3D "pci"; + sbc->explicit_ofw_unit_address =3D pci_unin_main_ofw_unit_address; } =20 static const TypeInfo pci_unin_main_info =3D { diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c index a6b95f024c..325013f563 100644 --- a/hw/ppc/mac_newworld.c +++ b/hw/ppc/mac_newworld.c @@ -344,6 +344,7 @@ static void ppc_core99_init(MachineState *machine) =20 /* Uninorth main bus */ dev =3D qdev_create(NULL, TYPE_UNI_NORTH_PCI_HOST_BRIDGE); + qdev_prop_set_uint32(dev, "ofw-addr", 0xf2000000); object_property_set_link(OBJECT(dev), OBJECT(pic_dev), "pic", &error_abort); qdev_init_nofail(dev); diff --git a/include/hw/pci-host/uninorth.h b/include/hw/pci-host/uninorth.h index 2a1cf9f284..060324536a 100644 --- a/include/hw/pci-host/uninorth.h +++ b/include/hw/pci-host/uninorth.h @@ -49,6 +49,7 @@ typedef struct UNINHostState { PCIHostState parent_obj; =20 + uint32_t ofw_addr; OpenPICState *pic; qemu_irq irqs[4]; MemoryRegion pci_mmio; --=20 2.17.1