/* * If PCI_PROBE_ONLY in pci_flags is set, we don't change any PCI resource * assignments.
*/
/* * The PCI controller list.
*/ static LIST_HEAD(controllers);
staticint pci_initialized;
unsignedlong pci_address_to_pio(phys_addr_t address)
{ if (address > IO_SPACE_LIMIT) return (unsignedlong)-1;
return (unsignedlong) address;
}
/* * We need to avoid collisions with `mirrored' VGA ports * and other strange ISA hardware, so we always want the * addresses to be allocated in the 0x000-0x0ff region * modulo 0x400. * * Why? Because some silly external IO cards only decode * the low 10 bits of the IO address. The 0x00-0xff region * is reserved for motherboard devices that decode all 16 * bits, so it's ok to allocate at, say, 0x2800-0x28ff, * but we want to try to avoid allocating at 0x2900-0x2bff * which might have be mirrored at 0x0100-0x03ff..
*/
resource_size_t
pcibios_align_resource(void *data, conststruct resource *res,
resource_size_t size, resource_size_t align)
{ struct pci_dev *dev = data; struct pci_controller *hose = dev->sysdata;
resource_size_t start = res->start;
if (res->flags & IORESOURCE_IO) { /* Make sure we start at our min on all hoses */ if (start < PCIBIOS_MIN_IO + hose->io_resource->start)
start = PCIBIOS_MIN_IO + hose->io_resource->start;
/* * Put everything into 0x00-0xff region modulo 0x400
*/ if (start & 0x300)
start = (start + 0x3ff) & ~0x3ff;
} elseif (res->flags & IORESOURCE_MEM) { /* Make sure we start at our min on all hoses */ if (start < PCIBIOS_MIN_MEM + hose->mem_resource->start)
start = PCIBIOS_MIN_MEM + hose->mem_resource->start;
}
next_busno = bus->busn_res.end + 1; /* Don't allow 8-bit bus number overflow inside the hose -
reserve some space for bridges. */ if (next_busno > 224) {
next_busno = 0;
need_domain_info = 1;
}
/* * We insert PCI resources into the iomem_resource and * ioport_resource trees in either pci_bus_claim_resources() * or pci_bus_assign_resources().
*/ if (pci_has_flag(PCI_PROBE_ONLY)) {
pci_bus_claim_resources(bus);
} else { struct pci_bus *child;
/* * Do not panic here but later - this might happen before console init.
*/ if (!hose->io_map_base) {
printk(KERN_WARNING "registering PCI controller with io_map_base unset\n");
}
/* * Scan the bus if it is register after the PCI subsystem * initialization.
*/ if (pci_initialized) {
mutex_lock(&pci_scan_mutex);
pcibios_scanbus(hose);
mutex_unlock(&pci_scan_mutex);
}
return;
out:
printk(KERN_WARNING "Skipping PCI bus scan due to resource conflict\n");
}
/* Scan all of the recorded PCI controllers. */
list_for_each_entry(hose, &controllers, list)
pcibios_scanbus(hose);
pci_initialized = 1;
return 0;
}
subsys_initcall(pcibios_init);
staticint pcibios_enable_resources(struct pci_dev *dev, int mask)
{
u16 cmd, old_cmd; int idx; struct resource *r;
pci_read_config_word(dev, PCI_COMMAND, &cmd);
old_cmd = cmd;
pci_dev_for_each_resource(dev, r, idx) { /* Only set up the requested stuff */ if (!(mask & (1<<idx))) continue;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.