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 (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1536306055478755.9835855317928; Fri, 7 Sep 2018 00:40:55 -0700 (PDT) Received: from localhost ([::1]:37153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fyBNp-0007mG-WD for importer@patchew.org; Fri, 07 Sep 2018 03:40:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45807) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fyBFo-0000EZ-6H for qemu-devel@nongnu.org; Fri, 07 Sep 2018 03:32:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fyBFn-0005Gw-CT for qemu-devel@nongnu.org; Fri, 07 Sep 2018 03:32:32 -0400 Received: from ozlabs.org ([203.11.71.1]:55941) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fyBFn-00053t-02; Fri, 07 Sep 2018 03:32:31 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 4268Jy4Wb2z9shh; 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=5tm5QQGAdFppdKH4sm3zeSrKzHhhhb9lq5Li7DDZOSg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nngOMCqBsifN/jmSX6YZ6G7TXXYR8pLvncFqzASVb/8OFmc84+Bzv1ezO9fJ7E/qT XDdpb5yfqcC0wV+UVAo2hhCf0JpItaulZiI0VMuzB950d/VUffG6O/lhu6uGH2rkxy 6IAGB9/ox11JPYZgnqGpn1Xs/F14vvx7nN5Me4Wo= From: David Gibson To: peter.maydell@linaro.org Date: Fri, 7 Sep 2018 17:31:48 +1000 Message-Id: <20180907073155.26200-8-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 07/14] grackle: set device fw_name and address for 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/grackle.c | 17 +++++++++++++++++ hw/ppc/mac_oldworld.c | 1 + 2 files changed, 18 insertions(+) diff --git a/hw/pci-host/grackle.c b/hw/pci-host/grackle.c index 4810a4de79..5a151e93e9 100644 --- a/hw/pci-host/grackle.c +++ b/hw/pci-host/grackle.c @@ -37,6 +37,7 @@ typedef struct GrackleState { PCIHostState parent_obj; =20 + uint32_t ofw_addr; HeathrowState *pic; qemu_irq irqs[4]; MemoryRegion pci_mmio; @@ -146,12 +147,28 @@ static const TypeInfo grackle_pci_info =3D { }, }; =20 +static char *grackle_ofw_unit_address(const SysBusDevice *dev) +{ + GrackleState *s =3D GRACKLE_PCI_HOST_BRIDGE(dev); + + return g_strdup_printf("%x", s->ofw_addr); +} + +static Property grackle_properties[] =3D { + DEFINE_PROP_UINT32("ofw-addr", GrackleState, ofw_addr, -1), + DEFINE_PROP_END_OF_LIST() +}; + static void grackle_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); + SysBusDeviceClass *sbc =3D SYS_BUS_DEVICE_CLASS(klass); =20 dc->realize =3D grackle_realize; + dc->props =3D grackle_properties; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); + dc->fw_name =3D "pci"; + sbc->explicit_ofw_unit_address =3D grackle_ofw_unit_address; } =20 static const TypeInfo grackle_host_info =3D { diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c index 80b5525775..c7b73e274f 100644 --- a/hw/ppc/mac_oldworld.c +++ b/hw/ppc/mac_oldworld.c @@ -254,6 +254,7 @@ static void ppc_heathrow_init(MachineState *machine) =20 /* Grackle PCI host bridge */ dev =3D qdev_create(NULL, TYPE_GRACKLE_PCI_HOST_BRIDGE); + qdev_prop_set_uint32(dev, "ofw-addr", 0x80000000); object_property_set_link(OBJECT(dev), OBJECT(pic_dev), "pic", &error_abort); qdev_init_nofail(dev); --=20 2.17.1