8 #include <linux/export.h>
9 #include <linux/kernel.h>
10 #include <linux/pci.h>
11 #include <linux/slab.h>
36 if (dev->
bus->number == 0 && dev->
devfn == 0)
39 pci_read_config_word(dev,
PCI_STATUS, &status);
43 if ((status & status_mask) == 0)
47 pci_write_config_word(dev,
PCI_STATUS, status & status_mask);
50 printk(
"(%s: %04X) ", pci_name(dev), status);
55 pcibios_bus_report_status(dev->
subordinate, status_mask, warn);
65 pcibios_bus_report_status(bus, status_mask, warn);
95 pci_write_config_byte(dev, 0x48, 0xff);
102 pci_write_config_byte(dev, 0x42, 0x01);
107 pci_write_config_byte(dev, 0x40, 0x22);
115 pci_write_config_byte(dev, 0x83, 0x02);
121 pci_write_config_byte(dev, 0x80, 0x11);
122 pci_write_config_byte(dev, 0x81, 0x00);
128 pci_write_config_word(dev, 0x44, 0xb000);
149 if (dev->
devfn == 0) {
174 if ((r->
start & ~0x80) == 0x374) {
187 pci_write_config_dword(dev, 0x40, 0x80000000);
212 if (dev->
class & 0x80) {
236 pci_write_config_byte(dev, 0x4b, 14);
237 pci_write_config_byte(dev, 0x4c, 15);
242 pci_write_config_byte(dev, 0x4d, 0x41);
247 pci_write_config_byte(dev, 0x44, 0x17);
252 pci_write_config_byte(dev, 0x45, 0x03);
263 dev->
class == 0x68000 ||
264 dev->
class == 0x80103) {
278 static inline int pdev_bad_for_parity(
struct pci_dev *dev)
304 pci_read_config_word(dev,
PCI_STATUS, &status);
315 if (pdev_bad_for_parity(dev))
318 switch (dev->
class >> 8) {
364 #ifdef CONFIG_HOTPLUG
394 printk(
"PCI: %s swizzling pin %d => pin %d slot %d\n",
395 pci_name(dev), oldpin, *pin, slot);
403 static int pcibios_map_irq(
const struct pci_dev *dev,
u8 slot,
u8 pin)
409 irq = sys->
map_irq(dev, slot, pin);
412 printk(
"PCI: %s mapping slot %d pin %d => irq %d\n",
413 pci_name(dev), slot, pin, irq);
433 sys->
io_res.start = (busnr *
SZ_64K) ? : pcibios_min_io;
441 pr_err(
"PCI: unable to allocate I/O port region (%d)\n", ret);
459 panic(
"PCI: unable to allocate sys data!");
461 #ifdef CONFIG_PCI_DOMAINS
462 sys->domain = hw->domain;
469 ret = hw->
setup(nr, sys);
472 ret = pcibios_init_resources(nr, sys);
485 panic(
"PCI: unable to scan bus!");
487 busnr = sys->
bus->busn_res.end + 1;
489 list_add(&sys->
node, head);
503 pci_add_flags(PCI_REASSIGN_ALL_RSRC);
506 pcibios_init_hw(hw, &head);
515 if (!pci_has_flag(PCI_PROBE_ONLY)) {
539 #ifndef CONFIG_PCI_HOST_ITE8152
548 if (!
strcmp(str,
"debug")) {
551 }
else if (!
strcmp(str,
"firmware")) {
552 pci_add_flags(PCI_PROBE_ONLY);
579 start = (start + 0x3ff) & ~0x3ff;
581 start = (start + align - 1) & ~(align - 1);
598 for (idx = 0; idx < 6; idx++) {
600 if (!(mask & (1 << idx)))
606 " of resource collisions\n", pci_name(dev));
621 if (cmd != old_cmd) {
622 printk(
"PCI: enabling device %s (%04x -> %04x)\n",
623 pci_name(dev), old_cmd, cmd);