Lines Matching full:bus

32 #define TYPE_PXB_BUS "pxb-bus"
37 #define TYPE_PXB_PCIE_BUS "pxb-pcie-bus"
73 static int pxb_bus_num(PCIBus *bus) in pxb_bus_num() argument
75 PXBDev *pxb = PXB_DEV(bus->parent_dev); in pxb_bus_num()
80 static uint16_t pxb_bus_numa_node(PCIBus *bus) in pxb_bus_numa_node() argument
82 PXBDev *pxb = PXB_DEV(bus->parent_dev); in pxb_bus_numa_node()
132 PXBBus *bus = pci_bus_is_cxl(rootbus) ? in pxb_host_root_bus_path() local
137 snprintf(bus->bus_path, 8, "0000:%02x", pxb_bus_num(rootbus)); in pxb_host_root_bus_path()
138 return bus->bus_path; in pxb_host_root_bus_path()
152 pxb_bus = pxb_host->bus; in pxb_host_ofw_unit_address()
209 void pxb_cxl_hook_up_registers(CXLState *cxl_state, PCIBus *bus, Error **errp) in pxb_cxl_hook_up_registers() argument
211 PXBCXLDev *pxb = PXB_CXL_DEV(pci_bridge_get_device(bus)); in pxb_cxl_hook_up_registers()
251 * Registers the PXB bus as a child of pci host root bus.
255 PCIBus *bus = pci_get_bus(dev); in pxb_register_bus() local
258 if (bus->parent_dev) { in pxb_register_bus()
259 error_setg(errp, "PXB devices can be attached only to root bus"); in pxb_register_bus()
263 QLIST_FOREACH(bus, &bus->child, sibling) { in pxb_register_bus()
264 if (pci_bus_num(bus) == pxb_bus_num) { in pxb_register_bus()
265 error_setg(errp, "Bus %d is already in use", pxb_bus_num); in pxb_register_bus()
284 * it computes the IRQ because it resides on bus 0 in pxb_map_irq_fn()
285 * and not on the current bus. in pxb_map_irq_fn()
286 * However QEMU routes the irq through bus 0 and adds in pxb_map_irq_fn()
311 dsp_count = pcie_count_ds_ports(hb->bus); in pxb_cxl_dev_reset()
338 PCIBus *bus; in pxb_dev_realize_common() local
360 bus = pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_PCIE_BUS); in pxb_dev_realize_common()
362 bus = pci_root_bus_new(ds, dev_name, NULL, NULL, 0, TYPE_PXB_CXL_BUS); in pxb_dev_realize_common()
363 bus->flags |= PCI_BUS_CXL; in pxb_dev_realize_common()
366 bus = pci_root_bus_new(ds, "pxb-internal", NULL, NULL, 0, TYPE_PXB_BUS); in pxb_dev_realize_common()
373 bus->parent_dev = dev; in pxb_dev_realize_common()
374 bus->address_space_mem = pci_get_bus(dev)->address_space_mem; in pxb_dev_realize_common()
375 bus->address_space_io = pci_get_bus(dev)->address_space_io; in pxb_dev_realize_common()
376 bus->map_irq = pxb_map_irq_fn; in pxb_dev_realize_common()
378 PCI_HOST_BRIDGE(ds)->bus = bus; in pxb_dev_realize_common()
381 pxb_register_bus(dev, bus, &local_err); in pxb_dev_realize_common()
389 qdev_realize_and_unref(bds, &bus->qbus, &error_fatal); in pxb_dev_realize_common()
401 object_unparent(OBJECT(bus)); in pxb_dev_realize_common()
409 error_setg(errp, "pxb devices cannot reside on a PCIe bus"); in pxb_dev_realize()
424 /* Note: 0 is not a legal PXB bus number. */
461 error_setg(errp, "pxb-pcie devices cannot reside on a PCI bus"); in pxb_pcie_dev_realize()
497 /* A CXL PXB's parent bus is still PCIe */ in pxb_cxl_dev_realize()
499 error_setg(errp, "pxb-cxl devices cannot reside on a PCI bus"); in pxb_cxl_dev_realize()