All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: peter.maydell@linaro.org
Cc: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, lvivier@redhat.com,
	groug@kaod.org, clg@kaod.org, mark.cave-ayland@ilande.co.uk,
	David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PULL 09/14] uninorth: add ofw-addr property to allow correct fw path generation
Date: Fri,  7 Sep 2018 17:31:50 +1000	[thread overview]
Message-ID: <20180907073155.26200-10-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20180907073155.26200-1-david@gibson.dropbear.id.au>

From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 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)
     }
 }
 
+static char *pci_unin_main_ofw_unit_address(const SysBusDevice *dev)
+{
+    UNINHostState *s = 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 = UNI_NORTH_PCI_HOST_BRIDGE(dev);
@@ -455,12 +462,21 @@ static const TypeInfo unin_internal_pci_host_info = {
     },
 };
 
+static Property pci_unin_main_pci_host_props[] = {
+    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 = DEVICE_CLASS(klass);
+    SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
 
     dc->realize = pci_unin_main_realize;
+    dc->props = pci_unin_main_pci_host_props;
     set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
+    dc->fw_name = "pci";
+    sbc->explicit_ofw_unit_address = pci_unin_main_ofw_unit_address;
 }
 
 static const TypeInfo pci_unin_main_info = {
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)
 
         /* Uninorth main bus */
         dev = 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;
 
+    uint32_t ofw_addr;
     OpenPICState *pic;
     qemu_irq irqs[4];
     MemoryRegion pci_mmio;
-- 
2.17.1

  parent reply	other threads:[~2018-09-07  7:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-07  7:31 [Qemu-devel] [PULL 00/14] ppc-for-3.1 queue 20180907 David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 01/14] ppc: Remove deprecated ppcemb target David Gibson
2018-09-07 13:39   ` Eric Blake
2018-09-10  4:25     ` David Gibson
2018-09-10  6:32       ` Thomas Huth
2018-09-11  1:42         ` David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 02/14] spapr: fix leak of rev array David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 03/14] spapr_pci: fix potential NULL pointer dereference David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 04/14] macio: move MACIOIDEState type declarations to macio.h David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 05/14] macio: add macio bus to help with fw path generation David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 06/14] macio: add addr property to macio IDE object David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 07/14] grackle: set device fw_name and address for correct fw path generation David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 08/14] mac_oldworld: implement custom FWPathProvider David Gibson
2018-09-07  7:31 ` David Gibson [this message]
2018-09-07  7:31 ` [Qemu-devel] [PULL 10/14] mac_newworld: " David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 11/14] spapr: Correct reference count on spapr-cpu-core David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 12/14] Fix a deadlock case in the CPU hotplug flow David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 13/14] target/ppc/kvm: set vcpu as online/offline David Gibson
2018-09-07  7:31 ` [Qemu-devel] [PULL 14/14] target-ppc: Extend HWCAP2 bits for ISA 3.0 David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180907073155.26200-10-david@gibson.dropbear.id.au \
    --to=david@gibson.dropbear.id.au \
    --cc=clg@kaod.org \
    --cc=groug@kaod.org \
    --cc=lvivier@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.