[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v4 05/57] hw/apb: fix PCI bus initialization
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v4 05/57] hw/apb: fix PCI bus initialization |
Date: |
Thu, 21 Jul 2016 19:26:25 +0300 |
From: Marcel Apfelbaum <address@hidden>
Create and connect the PCI root bus to the
host bridge before the later is 'realized'.
Signed-off-by: Marcel Apfelbaum <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Tested-by: Mark Cave-Ayland <address@hidden>
---
hw/pci-host/apb.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/hw/pci-host/apb.c b/hw/pci-host/apb.c
index babbbef..16587f8 100644
--- a/hw/pci-host/apb.c
+++ b/hw/pci-host/apb.c
@@ -670,6 +670,13 @@ PCIBus *pci_apb_init(hwaddr special_base,
/* Ultrasparc PBM main bus */
dev = qdev_create(NULL, TYPE_APB);
+ d = APB_DEVICE(dev);
+ phb = PCI_HOST_BRIDGE(dev);
+ phb->bus = pci_register_bus(DEVICE(phb), "pci",
+ pci_apb_set_irq, pci_pbm_map_irq, d,
+ &d->pci_mmio,
+ get_system_io(),
+ 0, 32, TYPE_PCI_BUS);
qdev_init_nofail(dev);
s = SYS_BUS_DEVICE(dev);
/* apb_config */
@@ -678,18 +685,10 @@ PCIBus *pci_apb_init(hwaddr special_base,
sysbus_mmio_map(s, 1, special_base + 0x1000000ULL);
/* pci_ioport */
sysbus_mmio_map(s, 2, special_base + 0x2000000ULL);
- d = APB_DEVICE(dev);
memory_region_init(&d->pci_mmio, OBJECT(s), "pci-mmio", 0x100000000ULL);
memory_region_add_subregion(get_system_memory(), mem_base, &d->pci_mmio);
- phb = PCI_HOST_BRIDGE(dev);
- phb->bus = pci_register_bus(DEVICE(phb), "pci",
- pci_apb_set_irq, pci_pbm_map_irq, d,
- &d->pci_mmio,
- get_system_io(),
- 0, 32, TYPE_PCI_BUS);
-
*pbm_irqs = d->pbm_irqs;
d->ivec_irqs = ivec_irqs;
--
MST
- [Qemu-devel] [PULL v4 00/57] pc, pci, virtio: new features, cleanups, fixes, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 01/57] nvdimm: fix memory leak in error code path, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 02/57] tests/prom-env-test: increase the test timeout, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 03/57] hw/alpha: fix PCI bus initialization, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 04/57] hw/mips: fix PCI bus initialization, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 05/57] hw/apb: fix PCI bus initialization,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL v4 06/57] hw/grackle: fix PCI bus initialization, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 07/57] hw/prep: realize the PCI root bus as part of the prep init, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 08/57] hw/versatile: realize the PCI root bus as part of the versatile init, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 09/57] x86-iommu: introduce parent class, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 10/57] intel_iommu: rename VTD_PCI_DEVFN_MAX to x86-iommu, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 11/57] x86-iommu: provide x86_iommu_get_default, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 12/57] x86-iommu: introduce "intremap" property, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 13/57] acpi: enable INTR for DMAR report structure, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 14/57] intel_iommu: allow queued invalidation for IR, Michael S. Tsirkin, 2016/07/21
- [Qemu-devel] [PULL v4 15/57] intel_iommu: set IR bit for ECAP register, Michael S. Tsirkin, 2016/07/21