summary refs log tree commit diff stats
path: root/hw/pci-host/sabre.c
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2018-08-29 17:33:45 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2018-09-14 09:18:05 +0100
commit09af820e49ba7ff56d6b04d19e5637703c74e8ec (patch)
tree7d4ebaba0d589958f93a2f973fce947049680e04 /hw/pci-host/sabre.c
parent19b599f7664b2ebfd0f405fb79c14dd241557452 (diff)
downloadfocaccia-qemu-09af820e49ba7ff56d6b04d19e5637703c74e8ec.tar.gz
focaccia-qemu-09af820e49ba7ff56d6b04d19e5637703c74e8ec.zip
sabre: generate correct fw path for sabre PCI host bridge
Set the fw_name property to "pci" and also set an explicit OFW address
using the value of the special_base property.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw/pci-host/sabre.c')
-rw-r--r--hw/pci-host/sabre.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/pci-host/sabre.c b/hw/pci-host/sabre.c
index e2f4ee480e..e33bd46967 100644
--- a/hw/pci-host/sabre.c
+++ b/hw/pci-host/sabre.c
@@ -496,6 +496,15 @@ static const TypeInfo sabre_pci_info = {
     },
 };
 
+static char *sabre_ofw_unit_address(const SysBusDevice *dev)
+{
+    SabreState *s = SABRE_DEVICE(dev);
+
+    return g_strdup_printf("%x,%x",
+               (uint32_t)((s->special_base >> 32) & 0xffffffff),
+               (uint32_t)(s->special_base & 0xffffffff));
+}
+
 static Property sabre_properties[] = {
     DEFINE_PROP_UINT64("special-base", SabreState, special_base, 0),
     DEFINE_PROP_UINT64("mem-base", SabreState, mem_base, 0),
@@ -505,11 +514,14 @@ static Property sabre_properties[] = {
 static void sabre_class_init(ObjectClass *klass, void *data)
 {
     DeviceClass *dc = DEVICE_CLASS(klass);
+    SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
 
     dc->realize = sabre_realize;
     dc->reset = sabre_reset;
     dc->props = sabre_properties;
     set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
+    dc->fw_name = "pci";
+    sbc->explicit_ofw_unit_address = sabre_ofw_unit_address;
 }
 
 static const TypeInfo sabre_info = {