12 #include <linux/kernel.h>
15 #include <linux/export.h>
17 #include <linux/types.h>
18 #include <linux/pci.h>
37 static int pci_initialized;
62 if (start < PCIBIOS_MIN_IO + hose->io_resource->start)
69 start = (start + 0x3ff) & ~0x3ff;
72 if (start < PCIBIOS_MIN_MEM + hose->mem_resource->start)
81 static int next_busno;
82 static int need_domain_info;
89 if (hose->get_busno && pci_has_flag(PCI_PROBE_ONLY))
90 next_busno = (*hose->get_busno)();
93 hose->mem_resource, hose->mem_offset);
102 need_domain_info = need_domain_info || hose->
index;
103 hose->need_domain_info = need_domain_info;
108 if (next_busno > 224) {
110 need_domain_info = 1;
113 if (!pci_has_flag(PCI_PROBE_ONLY)) {
118 bus->
dev.of_node = hose->of_node;
135 hose->of_node =
node;
137 while ((rlen -= np * 4) >= 0) {
144 size = of_read_number(ranges + pna + 3, 2);
146 switch ((pci_space >> 24) & 0x3) {
148 pr_info(
" IO 0x%016llx..0x%016llx\n",
149 addr, addr + size - 1);
152 res = hose->io_resource;
157 pr_info(
" MEM 0x%016llx..0x%016llx\n",
158 addr, addr + size - 1);
159 res = hose->mem_resource;
187 hose_tail = &hose->next;
192 if (!hose->io_map_base) {
194 "registering PCI controller with io_map_base unset\n");
201 if (pci_initialized) {
203 pcibios_scanbus(hose);
211 "Skipping PCI bus scan due to resource conflict\n");
214 static void __init pcibios_set_cache_line_size(
void)
224 lsize = c->
scache.linesz ? : lsize;
225 lsize = c->
tcache.linesz ? : lsize;
231 pr_debug(
"PCI: pci_cache_line_size set to %d bytes\n", lsize);
238 pcibios_set_cache_line_size();
241 for (hose = hose_head; hose; hose = hose->next)
242 pcibios_scanbus(hose);
263 if (!(mask & (1<<idx)))
274 "because of resource collisions\n",
283 if (cmd != old_cmd) {
284 printk(
"PCI: Enabling device %s (%04x -> %04x)\n",
285 pci_name(dev), old_cmd, cmd);
310 if (pci_has_flag(PCI_PROBE_ONLY) && dev &&
316 #ifdef CONFIG_HOTPLUG