diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2018-08-29 17:59:08 +0100 |
---|---|---|
committer | David Gibson <david@gibson.dropbear.id.au> | 2018-08-30 10:42:18 +1000 |
commit | ac43eb2e1397e897660384fef24f633fcdb3255d (patch) | |
tree | e2d7c37d611ec5cdbfc39936b1612fcd448ac71f /hw/pci-host/grackle.c | |
parent | 5c8e3d17eda655ee7644a41cc0df646c7280ab2f (diff) |
grackle: set device fw_name and address for correct fw path generation
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/pci-host/grackle.c')
-rw-r--r-- | hw/pci-host/grackle.c | 17 |
1 files changed, 17 insertions, 0 deletions
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; + uint32_t ofw_addr; HeathrowState *pic; qemu_irq irqs[4]; MemoryRegion pci_mmio; @@ -146,12 +147,28 @@ static const TypeInfo grackle_pci_info = { }, }; +static char *grackle_ofw_unit_address(const SysBusDevice *dev) +{ + GrackleState *s = GRACKLE_PCI_HOST_BRIDGE(dev); + + return g_strdup_printf("%x", s->ofw_addr); +} + +static Property grackle_properties[] = { + 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 = DEVICE_CLASS(klass); + SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass); dc->realize = grackle_realize; + dc->props = grackle_properties; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); + dc->fw_name = "pci"; + sbc->explicit_ofw_unit_address = grackle_ofw_unit_address; } static const TypeInfo grackle_host_info = { |