Lines Matching refs:root
146 static void decode_osc_bits(struct acpi_pci_root *root, char *msg, u32 word, in decode_osc_bits() argument
159 dev_info(&root->device->dev, "_OSC: %s [%s]\n", msg, buf); in decode_osc_bits()
162 static void decode_osc_support(struct acpi_pci_root *root, char *msg, u32 word) in decode_osc_support() argument
164 decode_osc_bits(root, msg, word, pci_osc_support_bit, in decode_osc_support()
168 static void decode_osc_control(struct acpi_pci_root *root, char *msg, u32 word) in decode_osc_control() argument
170 decode_osc_bits(root, msg, word, pci_osc_control_bit, in decode_osc_control()
195 static acpi_status acpi_pci_query_osc(struct acpi_pci_root *root, in acpi_pci_query_osc() argument
203 support |= root->osc_support_set; in acpi_pci_query_osc()
209 capbuf[OSC_CONTROL_DWORD] = *control | root->osc_control_set; in acpi_pci_query_osc()
212 capbuf[OSC_CONTROL_DWORD] = root->osc_control_set; in acpi_pci_query_osc()
215 status = acpi_pci_run_osc(root->device->handle, capbuf, &result); in acpi_pci_query_osc()
217 root->osc_support_set = support; in acpi_pci_query_osc()
224 static acpi_status acpi_pci_osc_support(struct acpi_pci_root *root, u32 flags) in acpi_pci_osc_support() argument
229 status = acpi_pci_query_osc(root, flags, NULL); in acpi_pci_osc_support()
236 struct acpi_pci_root *root; in acpi_pci_find_root() local
243 root = acpi_driver_data(device); in acpi_pci_find_root()
245 return root; in acpi_pci_find_root()
275 struct acpi_pci_root *root; in acpi_get_pci_dev() local
296 root = acpi_pci_find_root(phandle); in acpi_get_pci_dev()
297 if (!root) in acpi_get_pci_dev()
300 pbus = root->bus; in acpi_get_pci_dev()
358 struct acpi_pci_root *root; in acpi_pci_osc_control_set() local
369 root = acpi_pci_find_root(handle); in acpi_pci_osc_control_set()
370 if (!root) in acpi_pci_osc_control_set()
375 *mask = ctrl | root->osc_control_set; in acpi_pci_osc_control_set()
377 if ((root->osc_control_set & ctrl) == ctrl) in acpi_pci_osc_control_set()
382 status = acpi_pci_query_osc(root, root->osc_support_set, mask); in acpi_pci_osc_control_set()
387 decode_osc_control(root, "platform does not support", in acpi_pci_osc_control_set()
393 decode_osc_control(root, "not requesting control; platform does not support", in acpi_pci_osc_control_set()
400 capbuf[OSC_SUPPORT_DWORD] = root->osc_support_set; in acpi_pci_osc_control_set()
404 root->osc_control_set = *mask; in acpi_pci_osc_control_set()
411 static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm, in negotiate_os_control() argument
416 struct acpi_device *device = root->device; in negotiate_os_control()
425 root->osc_control_set = ~OSC_PCI_EXPRESS_PME_CONTROL; in negotiate_os_control()
426 decode_osc_control(root, "OS assumes control of", in negotiate_os_control()
427 root->osc_control_set); in negotiate_os_control()
444 decode_osc_support(root, "OS supports", support); in negotiate_os_control()
445 status = acpi_pci_osc_support(root, support); in negotiate_os_control()
465 decode_osc_support(root, "not requesting OS control; OS requires", in negotiate_os_control()
494 decode_osc_control(root, "OS now controls", control); in negotiate_os_control()
505 decode_osc_control(root, "OS requested", requested); in negotiate_os_control()
506 decode_osc_control(root, "platform willing to grant", control); in negotiate_os_control()
527 struct acpi_pci_root *root; in acpi_pci_root_add() local
533 root = kzalloc(sizeof(struct acpi_pci_root), GFP_KERNEL); in acpi_pci_root_add()
534 if (!root) in acpi_pci_root_add()
547 root->secondary.flags = IORESOURCE_BUS; in acpi_pci_root_add()
548 status = try_get_root_bridge_busnr(handle, &root->secondary); in acpi_pci_root_add()
556 root->secondary.end = 0xFF; in acpi_pci_root_add()
562 root->secondary.start = bus; in acpi_pci_root_add()
564 root->secondary.start = 0; in acpi_pci_root_add()
572 root->device = device; in acpi_pci_root_add()
573 root->segment = segment & 0xFFFF; in acpi_pci_root_add()
576 device->driver_data = root; in acpi_pci_root_add()
585 root->segment, &root->secondary); in acpi_pci_root_add()
587 root->mcfg_addr = acpi_pci_root_get_mcfg_addr(handle); in acpi_pci_root_add()
590 negotiate_os_control(root, &no_aspm, is_pcie); in acpi_pci_root_add()
603 root->bus = pci_acpi_scan_root(root); in acpi_pci_root_add()
604 if (!root->bus) { in acpi_pci_root_add()
607 root->segment, (unsigned int)root->secondary.start); in acpi_pci_root_add()
617 device_set_wakeup_capable(root->bus->bridge, device->wakeup.flags.valid); in acpi_pci_root_add()
620 pcibios_resource_survey_bus(root->bus); in acpi_pci_root_add()
621 pci_assign_unassigned_root_bus_resources(root->bus); in acpi_pci_root_add()
632 acpi_ioapic_add(root->device->handle); in acpi_pci_root_add()
636 pci_bus_add_devices(root->bus); in acpi_pci_root_add()
644 kfree(root); in acpi_pci_root_add()
650 struct acpi_pci_root *root = acpi_driver_data(device); in acpi_pci_root_remove() local
654 pci_stop_root_bus(root->bus); in acpi_pci_root_remove()
656 pci_ioapic_remove(root); in acpi_pci_root_remove()
657 device_set_wakeup_capable(root->bus->bridge, false); in acpi_pci_root_remove()
660 pci_remove_root_bus(root->bus); in acpi_pci_root_remove()
661 WARN_ON(acpi_ioapic_remove(root)); in acpi_pci_root_remove()
667 kfree(root); in acpi_pci_root_remove()
680 struct resource *res1, *res2, *root = NULL; in acpi_pci_root_validate_resources() local
684 root = (type & IORESOURCE_MEM) ? &iomem_resource : &ioport_resource; in acpi_pci_root_validate_resources()
696 end = min(res1->end, root->end); in acpi_pci_root_validate_resources()
810 struct resource *res, *conflict, *root = NULL; in pci_acpi_root_add_resources() local
815 root = &iomem_resource; in pci_acpi_root_add_resources()
817 root = &ioport_resource; in pci_acpi_root_add_resources()
825 if (res == root) in pci_acpi_root_add_resources()
828 conflict = insert_resource_conflict(root, res); in pci_acpi_root_add_resources()
873 struct pci_bus *acpi_pci_root_create(struct acpi_pci_root *root, in acpi_pci_root_create() argument
878 int ret, busnum = root->secondary.start; in acpi_pci_root_create()
879 struct acpi_device *device = root->device; in acpi_pci_root_create()
885 info->root = root; in acpi_pci_root_create()
890 root->segment, busnum); in acpi_pci_root_create()
902 pci_add_resource(&info->resources, &root->secondary); in acpi_pci_root_create()
909 if (!(root->osc_control_set & OSC_PCI_EXPRESS_NATIVE_HP_CONTROL)) in acpi_pci_root_create()
911 if (!(root->osc_control_set & OSC_PCI_SHPC_NATIVE_HP_CONTROL)) in acpi_pci_root_create()
913 if (!(root->osc_control_set & OSC_PCI_EXPRESS_AER_CONTROL)) in acpi_pci_root_create()
915 if (!(root->osc_control_set & OSC_PCI_EXPRESS_PME_CONTROL)) in acpi_pci_root_create()
917 if (!(root->osc_control_set & OSC_PCI_EXPRESS_LTR_CONTROL)) in acpi_pci_root_create()