14 #include <linux/kernel.h>
16 #include <linux/pci.h>
18 #include <linux/types.h>
23 #include <linux/export.h>
33 static int pci_initialized;
35 static void __devinit pcibios_scanbus(
struct pci_channel *hose)
37 static int next_busno;
38 static int need_domain_info;
45 for (i = 0; i < hose->nr_resources; i++) {
46 res = hose->resources +
i;
49 offset = hose->io_offset;
51 offset = hose->mem_offset;
59 need_domain_info = need_domain_info || hose->index;
60 hose->need_domain_info = need_domain_info;
65 if (next_busno > 224) {
89 for (i = 0; i < hose->nr_resources; i++) {
107 if (!hose->io_map_base) {
109 "registering PCI controller with io_map_base unset\n");
121 if (pci_initialized) {
123 pcibios_scanbus(hose);
130 for (--i; i >= 0; i--)
139 struct pci_channel *hose;
142 for (hose =
hose_head; hose; hose = hose->next)
143 pcibios_scanbus(hose);
173 struct pci_channel *hose = dev->
sysdata;
177 if (start < PCIBIOS_MIN_IO + hose->
resources[0].start)
184 start = (start + 0x3ff) & ~0x3ff;
196 pcibios_bus_report_status_early(
struct pci_channel *hose,
197 int top_bus,
int current_bus,
198 unsigned int status_mask,
int warn)
200 unsigned int pci_devfn;
204 for (pci_devfn = 0; pci_devfn < 0xff; pci_devfn++) {
207 ret = early_read_config_word(hose, top_bus, current_bus,
211 if (status == 0xffff)
214 early_write_config_word(hose, top_bus, current_bus,
216 status & status_mask);
218 printk(
"(%02x:%02x: %04X) ", current_bus,
228 pcibios_bus_report_status(
struct pci_bus *
bus,
unsigned int status_mask,
240 if (dev->
bus->number == 0 && dev->
devfn == 0)
243 pci_read_config_word(dev,
PCI_STATUS, &status);
244 if (status == 0xffff)
247 if ((status & status_mask) == 0)
251 pci_write_config_word(dev,
PCI_STATUS, status & status_mask);
254 printk(
"(%s: %04X) ", pci_name(dev), status);
259 pcibios_bus_report_status(dev->
subordinate, status_mask, warn);
264 struct pci_channel *hose;
266 for (hose =
hose_head; hose; hose = hose->next) {
268 pcibios_bus_report_status_early(hose,
hose_head->index,
269 hose->index, status_mask, warn);
271 pcibios_bus_report_status(hose->bus, status_mask, warn);
296 #ifndef CONFIG_GENERIC_IOMAP
299 unsigned long port,
unsigned int nr)
304 chan->io_map_base = sh_io_port_base;
306 if (pci_domains_supported)
307 panic(
"To avoid data corruption io_map_base MUST be "
308 "set with multiple PCI domains.");
322 #ifdef CONFIG_HOTPLUG