Lines Matching +full:pci +full:- +full:domain

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Low-Level PCI Support for PC
5 * (c) 1999--2000 Martin Mares <mj@ucw.cz>
9 #include <linux/pci.h>
10 #include <linux/pci-acpi.h>
35 int pcibios_last_bus = -1;
40 int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, in raw_pci_read() argument
43 if (domain == 0 && reg < 256 && raw_pci_ops) in raw_pci_read()
44 return raw_pci_ops->read(domain, bus, devfn, reg, len, val); in raw_pci_read()
46 return raw_pci_ext_ops->read(domain, bus, devfn, reg, len, val); in raw_pci_read()
47 return -EINVAL; in raw_pci_read()
50 int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, in raw_pci_write() argument
53 if (domain == 0 && reg < 256 && raw_pci_ops) in raw_pci_write()
54 return raw_pci_ops->write(domain, bus, devfn, reg, len, val); in raw_pci_write()
56 return raw_pci_ext_ops->write(domain, bus, devfn, reg, len, val); in raw_pci_write()
57 return -EINVAL; in raw_pci_write()
62 return raw_pci_read(pci_domain_nr(bus), bus->number, in pci_read()
68 return raw_pci_write(pci_domain_nr(bus), bus->number, in pci_write()
78 * This interrupt-safe spinlock protects all accesses to PCI configuration
86 printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", d->ident); in can_skip_ioresource_align()
92 * Systems where PCI IO resource ISA alignment can be skipped
129 struct resource *rom_r = &dev->resource[PCI_ROM_RESOURCE]; in pcibios_fixup_device_resources()
140 bar_r = &dev->resource[bar]; in pcibios_fixup_device_resources()
141 if (bar_r->start == 0 && bar_r->end != 0) { in pcibios_fixup_device_resources()
142 bar_r->flags = 0; in pcibios_fixup_device_resources()
143 bar_r->end = 0; in pcibios_fixup_device_resources()
149 if (rom_r->parent) in pcibios_fixup_device_resources()
151 if (rom_r->start) { in pcibios_fixup_device_resources()
155 rom_r->start = rom_r->end = rom_r->flags = 0; in pcibios_fixup_device_resources()
169 list_for_each_entry(dev, &b->devices, bus_list) in pcibios_fixup_bus()
192 printk(KERN_INFO "PCI: %s detected, enabling pci=bfsort.\n", d->ident); in set_bf_sort()
202 if (dm->type != 0xB1) in read_dmi_type_b1()
215 * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus)
221 printk(KERN_INFO "%s detected: enabling PCI bus# renumbering" in assign_all_busses()
222 " (pci=assign-busses)\n", d->ident); in assign_all_busses()
229 printk(KERN_INFO "PCI: %s detected, enabling pci=pcie_scan_all\n", in set_scan_all()
230 d->ident); in set_scan_all()
238 * Laptops which need pci=assign-busses to see Cardbus cards
466 printk(KERN_ERR "PCI: OOM, skipping PCI bus %02x\n", busnum); in pcibios_scan_root()
469 sd->node = x86_pci_root_bus_node(busnum); in pcibios_scan_root()
471 printk(KERN_DEBUG "PCI: Probing PCI hardware (bus %02x)\n", busnum); in pcibios_scan_root()
486 * Set PCI cacheline size to that of the CPU if the CPU has reported it. in pcibios_set_cache_line_size()
489 * as quite a few PCI devices do not support smaller values. in pcibios_set_cache_line_size()
491 if (c->x86_clflush_size > 0) { in pcibios_set_cache_line_size()
492 pci_dfl_cache_line_size = c->x86_clflush_size >> 2; in pcibios_set_cache_line_size()
493 printk(KERN_DEBUG "PCI: pci_cache_line_size set to %d bytes\n", in pcibios_set_cache_line_size()
497 printk(KERN_DEBUG "PCI: Unknown cacheline size. Setting to 32 bytes\n"); in pcibios_set_cache_line_size()
504 printk(KERN_WARNING "PCI: System does not support PCI\n"); in pcibios_init()
589 } else if (!strcmp(str, "assign-busses")) { in pcibios_setup()
621 if (noioapicreroute != -1) in pcibios_setup()
625 if (noioapicreroute != -1) in pcibios_setup()
639 if (is_vmd(pdev->bus)) in set_dev_domain_options()
640 pdev->hotplug_user_indicators = 1; in set_dev_domain_options()
654 return -ENOMEM; in pcibios_device_add()
656 if (data->type == SETUP_PCI) { in pcibios_device_add()
659 if ((pci_domain_nr(dev->bus) == rom->segment) && in pcibios_device_add()
660 (dev->bus->number == rom->bus) && in pcibios_device_add()
661 (PCI_SLOT(dev->devfn) == rom->device) && in pcibios_device_add()
662 (PCI_FUNC(dev->devfn) == rom->function) && in pcibios_device_add()
663 (dev->vendor == rom->vendor) && in pcibios_device_add()
664 (dev->device == rom->devid)) { in pcibios_device_add()
665 dev->rom = pa_data + in pcibios_device_add()
667 dev->romlen = rom->pcilen; in pcibios_device_add()
670 pa_data = data->next; in pcibios_device_add()
676 * Setup the initial MSI domain of the device. If the underlying in pcibios_device_add()
677 * bus has a PCI/MSI irqdomain associated use the bus domain, in pcibios_device_add()
678 * otherwise set the default domain. This ensures that special irq in pcibios_device_add()
681 * active it will overwrite the domain pointer when the device is in pcibios_device_add()
682 * associated to a remapping domain. in pcibios_device_add()
684 msidom = dev_get_msi_domain(&dev->bus->dev); in pcibios_device_add()
687 dev_set_msi_domain(&dev->dev, msidom); in pcibios_device_add()
712 if (atomic_dec_return(&dev->enable_cnt) >= 0) in pcibios_release_device()
729 if (is_vmd(dev->bus)) in pci_real_dma_dev()
730 return to_pci_sysdata(dev->bus)->vmd_dev; in pci_real_dma_dev()