hw/pci-host/raven: Simplify creating PCI facing part
There is no need to init and realize the PCI facing part of the host bridge separately as it does not expose any properties that need to be available before realize. It can be simpilfied using pci_create_simple. Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Message-ID: <5a60e395d72e5eb4d01093434fbb645d72ac567a.1761232472.git.balaton@eik.bme.hu> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
58341158d0
commit
2984218aea
1 changed files with 1 additions and 10 deletions
|
|
@ -65,7 +65,6 @@ struct PRePPCIState {
|
|||
MemoryRegion bm_ram_alias;
|
||||
MemoryRegion bm_pci_memory_alias;
|
||||
AddressSpace bm_as;
|
||||
RavenPCIState pci_dev;
|
||||
|
||||
int contiguous_map;
|
||||
};
|
||||
|
|
@ -260,8 +259,7 @@ static void raven_pcihost_realizefn(DeviceState *d, Error **errp)
|
|||
"pci-intack", 1);
|
||||
memory_region_add_subregion(address_space_mem, 0xbffffff0, &s->pci_intack);
|
||||
|
||||
/* TODO Remove once realize propagates to child devices. */
|
||||
qdev_realize(DEVICE(&s->pci_dev), BUS(&s->pci_bus), errp);
|
||||
pci_create_simple(&s->pci_bus, PCI_DEVFN(0, 0), TYPE_RAVEN_PCI_DEVICE);
|
||||
}
|
||||
|
||||
static void raven_pcihost_initfn(Object *obj)
|
||||
|
|
@ -269,7 +267,6 @@ static void raven_pcihost_initfn(Object *obj)
|
|||
PCIHostState *h = PCI_HOST_BRIDGE(obj);
|
||||
PREPPCIState *s = RAVEN_PCI_HOST_BRIDGE(obj);
|
||||
MemoryRegion *address_space_mem = get_system_memory();
|
||||
DeviceState *pci_dev;
|
||||
|
||||
memory_region_init(&s->pci_io, obj, "pci-io", 0x3f800000);
|
||||
memory_region_init_io(&s->pci_io_non_contiguous, obj, &raven_io_ops, s,
|
||||
|
|
@ -306,12 +303,6 @@ static void raven_pcihost_initfn(Object *obj)
|
|||
pci_setup_iommu(&s->pci_bus, &raven_iommu_ops, s);
|
||||
|
||||
h->bus = &s->pci_bus;
|
||||
|
||||
object_initialize(&s->pci_dev, sizeof(s->pci_dev), TYPE_RAVEN_PCI_DEVICE);
|
||||
pci_dev = DEVICE(&s->pci_dev);
|
||||
object_property_set_int(OBJECT(&s->pci_dev), "addr", PCI_DEVFN(0, 0),
|
||||
NULL);
|
||||
qdev_prop_set_bit(pci_dev, "multifunction", false);
|
||||
}
|
||||
|
||||
static void raven_realize(PCIDevice *d, Error **errp)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue