Lines Matching refs:root

60  * acpi_is_root_bridge - determine whether an ACPI CA node is a PCI root bridge
154 static void decode_osc_bits(struct acpi_pci_root *root, char *msg, u32 word,
167 dev_info(&root->device->dev, "_OSC: %s [%s]\n", msg, buf);
170 static void decode_osc_support(struct acpi_pci_root *root, char *msg, u32 word)
172 decode_osc_bits(root, msg, word, pci_osc_support_bit,
176 static void decode_osc_control(struct acpi_pci_root *root, char *msg, u32 word)
178 decode_osc_bits(root, msg, word, pci_osc_control_bit,
182 static void decode_cxl_osc_support(struct acpi_pci_root *root, char *msg, u32 word)
184 decode_osc_bits(root, msg, word, cxl_osc_support_bit,
188 static void decode_cxl_osc_control(struct acpi_pci_root *root, char *msg, u32 word)
190 decode_osc_bits(root, msg, word, cxl_osc_control_bit,
194 static inline bool is_pcie(struct acpi_pci_root *root)
196 return root->bridge_type == ACPI_BRIDGE_TYPE_PCIE;
199 static inline bool is_cxl(struct acpi_pci_root *root)
201 return root->bridge_type == ACPI_BRIDGE_TYPE_CXL;
207 static char *to_uuid(struct acpi_pci_root *root)
209 if (is_cxl(root))
214 static int cap_length(struct acpi_pci_root *root)
216 if (is_cxl(root))
221 static acpi_status acpi_pci_run_osc(struct acpi_pci_root *root,
226 .uuid_str = to_uuid(root),
228 .cap.length = cap_length(root),
233 status = acpi_run_osc(root->device->handle, &context);
236 if (is_cxl(root))
243 static acpi_status acpi_pci_query_osc(struct acpi_pci_root *root, u32 support,
250 support |= root->osc_support_set;
254 capbuf[OSC_CONTROL_DWORD] = *control | root->osc_control_set;
256 if (is_cxl(root)) {
257 cxl_support |= root->osc_ext_support_set;
259 capbuf[OSC_EXT_CONTROL_DWORD] = *cxl_control | root->osc_ext_control_set;
263 status = acpi_pci_run_osc(root, capbuf, &pci_result, &cxl_result);
265 root->osc_support_set = support;
267 if (is_cxl(root)) {
268 root->osc_ext_support_set = cxl_support;
271 } else if (is_cxl(root)) {
276 root->bridge_type = ACPI_BRIDGE_TYPE_PCIE;
285 struct acpi_pci_root *root;
290 root = acpi_driver_data(device);
292 return root;
339 * acpi_pci_osc_control_set - Request control of PCI root _OSC features.
340 * @handle: ACPI handle of a PCI root bridge (or PCIe Root Complex).
360 struct acpi_pci_root *root;
367 root = acpi_pci_find_root(handle);
368 if (!root)
372 *mask |= root->osc_control_set;
374 if (is_cxl(root)) {
376 *cxl_mask |= root->osc_ext_control_set;
383 status = acpi_pci_query_osc(root, support, mask, cxl_support,
387 if (is_cxl(root)) {
398 decode_osc_control(root, "platform does not support",
401 decode_cxl_osc_control(root, "CXL platform does not support",
408 if ((root->osc_control_set & ctrl) == ctrl &&
409 (root->osc_ext_control_set & cxl_ctrl) == cxl_ctrl)
413 decode_osc_control(root, "not requesting control; platform does not support",
419 capbuf[OSC_SUPPORT_DWORD] = root->osc_support_set;
421 if (is_cxl(root)) {
422 capbuf[OSC_EXT_SUPPORT_DWORD] = root->osc_ext_support_set;
426 status = acpi_pci_run_osc(root, capbuf, mask, cxl_mask);
430 root->osc_control_set = *mask;
431 root->osc_ext_control_set = *cxl_mask;
546 static bool os_control_query_checks(struct acpi_pci_root *root, u32 support)
548 struct acpi_device *device = root->device;
556 decode_osc_support(root, "not requesting OS control; OS requires",
564 static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm)
569 struct acpi_device *device = root->device;
578 root->osc_control_set = ~OSC_PCI_EXPRESS_PME_CONTROL;
579 decode_osc_control(root, "OS assumes control of",
580 root->osc_control_set);
586 decode_osc_support(root, "OS supports", support);
588 if (os_control_query_checks(root, support))
591 if (is_cxl(root)) {
593 decode_cxl_osc_support(root, "OS supports", cxl_support);
601 decode_osc_control(root, "OS now controls", control);
603 decode_cxl_osc_control(root, "OS now controls",
621 * root scan.
626 if (status == AE_NOT_FOUND && !is_pcie(root))
630 decode_osc_control(root, "OS requested", requested);
631 decode_osc_control(root, "platform willing to grant", control);
634 decode_cxl_osc_control(root, "OS requested", cxl_requested);
635 decode_cxl_osc_control(root, "platform willing to grant",
650 struct acpi_pci_root *root;
656 root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL);
657 if (!root)
670 root->secondary.flags = IORESOURCE_BUS;
671 status = try_get_root_bridge_busnr(handle, &root->secondary);
679 root->secondary.end = 0xFF;
685 root->secondary.start = bus;
687 root->secondary.start = 0;
695 root->device = device;
696 root->segment = segment & 0xFFFF;
699 device->driver_data = root;
708 root->segment, &root->secondary);
710 root->mcfg_addr = acpi_pci_root_get_mcfg_addr(handle);
712 acpi_hid = acpi_device_hid(root->device);
714 root->bridge_type = ACPI_BRIDGE_TYPE_PCIE;
716 root->bridge_type = ACPI_BRIDGE_TYPE_CXL;
720 negotiate_os_control(root, &no_aspm);
729 * Must do this prior to any attempt to bind the root device, as the
731 * thus the root bridge's pci_dev does not exist).
733 root->bus = pci_acpi_scan_root(root);
734 if (!root->bus) {
737 root->segment, (unsigned int)root->secondary.start);
747 device_set_wakeup_capable(root->bus->bridge, device->wakeup.flags.valid);
750 pcibios_resource_survey_bus(root->bus);
751 pci_assign_unassigned_root_bus_resources(root->bus);
762 acpi_ioapic_add(root->device->handle);
766 pci_bus_add_devices(root->bus);
774 kfree(root);
780 struct acpi_pci_root *root = acpi_driver_data(device);
784 pci_stop_root_bus(root->bus);
786 pci_ioapic_remove(root);
787 device_set_wakeup_capable(root->bus->bridge, false);
790 pci_remove_root_bus(root->bus);
791 WARN_ON(acpi_ioapic_remove(root));
797 kfree(root);
810 struct resource *res1, *res2, *root = NULL;
814 root = (type & IORESOURCE_MEM) ? &iomem_resource : &ioport_resource;
826 end = min(res1->end, root->end);
938 struct resource *res, *conflict, *root = NULL;
943 root = &iomem_resource;
945 root = &ioport_resource;
953 if (res == root)
956 conflict = insert_resource_conflict(root, res);
1001 struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root,
1006 int ret, busnum = root->secondary.start;
1007 struct acpi_device *device = root->device;
1013 info->root = root;
1018 root->segment, busnum);
1030 pci_add_resource(&info->resources, &root->secondary);
1037 if (!(root->osc_control_set & OSC_PCI_EXPRESS_NATIVE_HP_CONTROL))
1039 if (!(root->osc_control_set & OSC_PCI_SHPC_NATIVE_HP_CONTROL))
1041 if (!(root->osc_control_set & OSC_PCI_EXPRESS_AER_CONTROL))
1043 if (!(root->osc_control_set & OSC_PCI_EXPRESS_PME_CONTROL))
1045 if (!(root->osc_control_set & OSC_PCI_EXPRESS_LTR_CONTROL))
1047 if (!(root->osc_control_set & OSC_PCI_EXPRESS_DPC_CONTROL))
1050 if (!(root->osc_ext_control_set & OSC_CXL_ERROR_REPORTING_CONTROL))