20 #include <linux/kernel.h>
21 #include <linux/pci.h>
23 #include <linux/string.h>
25 #include <linux/sched.h>
26 #include <linux/errno.h>
29 #include <asm/pci-bridge.h>
35 #define DBG(x...) printk(x)
56 static int pci_bus_count;
81 " (%ld bytes)\n", pci_name(dev),
86 start = (start + 0x3ff) & ~0x3ff;
101 for(idx=0; idx<6; idx++) {
105 "of resource collisions\n", pci_name(dev));
115 if (cmd != old_cmd) {
116 printk(
"PCI: Enabling device %s (%04x -> %04x)\n",
117 pci_name(dev), old_cmd, cmd);
130 *pci_ctrl_tail = pci_ctrl;
131 pci_ctrl_tail = &pci_ctrl->next;
140 unsigned long io_offset;
143 io_offset = (
unsigned long)pci_ctrl->io_space.base;
144 res = &pci_ctrl->io_resource;
148 " bridge %d\n", pci_ctrl->
index);
153 res->
start += io_offset;
154 res->
end += io_offset;
157 for (i = 0; i < 3; i++) {
163 "host bridge %d\n", pci_ctrl->
index);
177 int next_busno = 0,
i;
179 printk(
"PCI: Probing PCI hardware\n");
182 for (pci_ctrl = pci_ctrl_head; pci_ctrl; pci_ctrl = pci_ctrl->next) {
184 INIT_LIST_HEAD(&resources);
185 pci_controller_apertures(pci_ctrl, &resources);
187 pci_ctrl->
ops, pci_ctrl, &resources);
190 if (next_busno <= pci_ctrl->last_busno)
193 pci_bus_count = next_busno;
221 for (idx=0; idx<6; idx++) {
225 "of resource collisions\n", pci_name(dev));
233 if (cmd != old_cmd) {
234 printk(
"PCI: Enabling device %s (%04x -> %04x)\n",
235 pci_name(dev), old_cmd, cmd);
242 #ifdef CONFIG_PROC_FS
252 return pci_ctrl->
index;
280 unsigned long io_offset = 0;
290 io_offset = (
unsigned long)pci_ctrl->io_space.base;
308 if ((flags & res_bit) == 0)
317 offset += pci_ctrl->io_space.start - io_offset;
360 ret = __pci_mmap_make_offset(dev, vma, mmap_state);
364 __pci_mmap_set_pgprot(dev, vma, mmap_state, write_combine);