[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 17/25] hw/pci-host/xilinx: QOM'ify the AXI-PCIe host
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 17/25] hw/pci-host/xilinx: QOM'ify the AXI-PCIe host bridge |
Date: |
Thu, 21 Dec 2017 16:29:33 +0200 |
From: Philippe Mathieu-Daudé <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Marcel Apfelbaum <address@hidden>
---
hw/pci-host/xilinx-pcie.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/hw/pci-host/xilinx-pcie.c b/hw/pci-host/xilinx-pcie.c
index d2f88d1..53b561f 100644
--- a/hw/pci-host/xilinx-pcie.c
+++ b/hw/pci-host/xilinx-pcie.c
@@ -18,6 +18,7 @@
*/
#include "qemu/osdep.h"
+#include "qapi/error.h"
#include "hw/pci/pci_bridge.h"
#include "hw/pci-host/xilinx-pcie.h"
@@ -267,24 +268,22 @@ static void xilinx_pcie_root_config_write(PCIDevice *d,
uint32_t address,
}
}
-static int xilinx_pcie_root_init(PCIDevice *dev)
+static void xilinx_pcie_root_realize(PCIDevice *pci_dev, Error **errp)
{
- BusState *bus = qdev_get_parent_bus(DEVICE(dev));
+ BusState *bus = qdev_get_parent_bus(DEVICE(pci_dev));
XilinxPCIEHost *s = XILINX_PCIE_HOST(bus->parent);
- pci_set_word(dev->config + PCI_COMMAND,
+ pci_set_word(pci_dev->config + PCI_COMMAND,
PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
- pci_set_word(dev->config + PCI_MEMORY_BASE, s->mmio_base >> 16);
- pci_set_word(dev->config + PCI_MEMORY_LIMIT,
+ pci_set_word(pci_dev->config + PCI_MEMORY_BASE, s->mmio_base >> 16);
+ pci_set_word(pci_dev->config + PCI_MEMORY_LIMIT,
((s->mmio_base + s->mmio_size - 1) >> 16) & 0xfff0);
- pci_bridge_initfn(dev, TYPE_PCI_BUS);
+ pci_bridge_initfn(pci_dev, TYPE_PCI_BUS);
- if (pcie_endpoint_cap_v1_init(dev, 0x80) < 0) {
- hw_error("Failed to initialize PCIe capability");
+ if (pcie_endpoint_cap_v1_init(pci_dev, 0x80) < 0) {
+ error_setg(errp, "Failed to initialize PCIe capability");
}
-
- return 0;
}
static void xilinx_pcie_root_class_init(ObjectClass *klass, void *data)
@@ -300,7 +299,7 @@ static void xilinx_pcie_root_class_init(ObjectClass *klass,
void *data)
k->class_id = PCI_CLASS_BRIDGE_HOST;
k->is_express = true;
k->is_bridge = true;
- k->init = xilinx_pcie_root_init;
+ k->realize = xilinx_pcie_root_realize;
k->exit = pci_bridge_exitfn;
dc->reset = pci_bridge_reset;
k->config_read = xilinx_pcie_root_config_read;
--
MST
- [Qemu-devel] [PULL 10/25] virtio_error: don't invoke status callbacks, (continued)
- [Qemu-devel] [PULL 10/25] virtio_error: don't invoke status callbacks, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 09/25] pci: Eliminate pci_find_primary_bus(), Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 11/25] tests/pxe-test: Remove unnecessary special case test functions, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 14/25] tests/pxe-test: Add some extra tests, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 08/25] pci: Eliminate redundant PCIDevice::bus pointer, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 12/25] tests/pxe-test: Use table of testcases rather than open-coding, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 13/25] tests/pxe-test: Test net booting over IPv6 in some cases, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 15/25] hw/block/nvme: QOM'ify PCI NVME, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 16/25] hw/pci-host/piix: QOM'ify the IGD Passthrough host bridge, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 17/25] hw/pci-host/xilinx: QOM'ify the AXI-PCIe host bridge,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 18/25] hw/pci: remove obsolete PCIDevice->init(), Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 19/25] vhost-user: fix indentation in protocol specification, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 20/25] vhost-user: document memory accesses, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 23/25] virtio-pci: Don't force Subsystem Vendor ID = Vendor ID, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 25/25] smbus: do not immediately complete commands, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 24/25] dump-guest-memory.py: fix "You can't do that without a process to debug", Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 21/25] intel_iommu: remove X86_IOMMU_PCI_DEVFN_MAX, Michael S. Tsirkin, 2017/12/21
- [Qemu-devel] [PULL 22/25] intel_iommu: fix error param in string, Michael S. Tsirkin, 2017/12/21
- Re: [Qemu-devel] [PULL 00/25] pc, pci, virtio: features, fixes, cleanups, Peter Maydell, 2017/12/21