diff options
Diffstat (limited to 'arch/x86/pci')
-rw-r--r-- | arch/x86/pci/Makefile | 12 | ||||
-rw-r--r-- | arch/x86/pci/early.c | 16 | ||||
-rw-r--r-- | arch/x86/pci/fixup.c | 3 | ||||
-rw-r--r-- | arch/x86/pci/i386.c | 27 | ||||
-rw-r--r-- | arch/x86/pci/irq.c | 108 | ||||
-rw-r--r-- | arch/x86/pci/legacy.c | 11 | ||||
-rw-r--r-- | arch/x86/pci/numaq_32.c (renamed from arch/x86/pci/numa.c) | 9 | ||||
-rw-r--r-- | arch/x86/pci/pci.h | 3 | ||||
-rw-r--r-- | arch/x86/pci/visws.c | 23 |
9 files changed, 98 insertions, 114 deletions
diff --git a/arch/x86/pci/Makefile b/arch/x86/pci/Makefile index e515e8db842a..d49202e740ea 100644 --- a/arch/x86/pci/Makefile +++ b/arch/x86/pci/Makefile | |||
@@ -5,13 +5,13 @@ obj-$(CONFIG_PCI_MMCONFIG) += mmconfig_$(BITS).o direct.o mmconfig-shared.o | |||
5 | obj-$(CONFIG_PCI_DIRECT) += direct.o | 5 | obj-$(CONFIG_PCI_DIRECT) += direct.o |
6 | obj-$(CONFIG_PCI_OLPC) += olpc.o | 6 | obj-$(CONFIG_PCI_OLPC) += olpc.o |
7 | 7 | ||
8 | pci-y := fixup.o | 8 | obj-y += fixup.o |
9 | pci-$(CONFIG_ACPI) += acpi.o | 9 | obj-$(CONFIG_ACPI) += acpi.o |
10 | pci-y += legacy.o irq.o | 10 | obj-y += legacy.o irq.o |
11 | 11 | ||
12 | pci-$(CONFIG_X86_VISWS) += visws.o | 12 | obj-$(CONFIG_X86_VISWS) += visws.o |
13 | 13 | ||
14 | pci-$(CONFIG_X86_NUMAQ) += numa.o | 14 | obj-$(CONFIG_X86_NUMAQ) += numaq_32.o |
15 | 15 | ||
16 | obj-y += $(pci-y) common.o early.o | 16 | obj-y += common.o early.o |
17 | obj-y += amd_bus.o | 17 | obj-y += amd_bus.o |
diff --git a/arch/x86/pci/early.c b/arch/x86/pci/early.c index 858dbe3399f9..86631ccbc25a 100644 --- a/arch/x86/pci/early.c +++ b/arch/x86/pci/early.c | |||
@@ -7,15 +7,13 @@ | |||
7 | /* Direct PCI access. This is used for PCI accesses in early boot before | 7 | /* Direct PCI access. This is used for PCI accesses in early boot before |
8 | the PCI subsystem works. */ | 8 | the PCI subsystem works. */ |
9 | 9 | ||
10 | #define PDprintk(x...) | ||
11 | |||
12 | u32 read_pci_config(u8 bus, u8 slot, u8 func, u8 offset) | 10 | u32 read_pci_config(u8 bus, u8 slot, u8 func, u8 offset) |
13 | { | 11 | { |
14 | u32 v; | 12 | u32 v; |
15 | outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); | 13 | outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); |
16 | v = inl(0xcfc); | 14 | v = inl(0xcfc); |
17 | if (v != 0xffffffff) | 15 | if (v != 0xffffffff) |
18 | PDprintk("%x reading 4 from %x: %x\n", slot, offset, v); | 16 | pr_debug("%x reading 4 from %x: %x\n", slot, offset, v); |
19 | return v; | 17 | return v; |
20 | } | 18 | } |
21 | 19 | ||
@@ -24,7 +22,7 @@ u8 read_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset) | |||
24 | u8 v; | 22 | u8 v; |
25 | outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); | 23 | outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); |
26 | v = inb(0xcfc + (offset&3)); | 24 | v = inb(0xcfc + (offset&3)); |
27 | PDprintk("%x reading 1 from %x: %x\n", slot, offset, v); | 25 | pr_debug("%x reading 1 from %x: %x\n", slot, offset, v); |
28 | return v; | 26 | return v; |
29 | } | 27 | } |
30 | 28 | ||
@@ -33,28 +31,28 @@ u16 read_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset) | |||
33 | u16 v; | 31 | u16 v; |
34 | outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); | 32 | outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); |
35 | v = inw(0xcfc + (offset&2)); | 33 | v = inw(0xcfc + (offset&2)); |
36 | PDprintk("%x reading 2 from %x: %x\n", slot, offset, v); | 34 | pr_debug("%x reading 2 from %x: %x\n", slot, offset, v); |
37 | return v; | 35 | return v; |
38 | } | 36 | } |
39 | 37 | ||
40 | void write_pci_config(u8 bus, u8 slot, u8 func, u8 offset, | 38 | void write_pci_config(u8 bus, u8 slot, u8 func, u8 offset, |
41 | u32 val) | 39 | u32 val) |
42 | { | 40 | { |
43 | PDprintk("%x writing to %x: %x\n", slot, offset, val); | 41 | pr_debug("%x writing to %x: %x\n", slot, offset, val); |
44 | outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); | 42 | outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); |
45 | outl(val, 0xcfc); | 43 | outl(val, 0xcfc); |
46 | } | 44 | } |
47 | 45 | ||
48 | void write_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset, u8 val) | 46 | void write_pci_config_byte(u8 bus, u8 slot, u8 func, u8 offset, u8 val) |
49 | { | 47 | { |
50 | PDprintk("%x writing to %x: %x\n", slot, offset, val); | 48 | pr_debug("%x writing to %x: %x\n", slot, offset, val); |
51 | outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); | 49 | outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); |
52 | outb(val, 0xcfc + (offset&3)); | 50 | outb(val, 0xcfc + (offset&3)); |
53 | } | 51 | } |
54 | 52 | ||
55 | void write_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset, u16 val) | 53 | void write_pci_config_16(u8 bus, u8 slot, u8 func, u8 offset, u16 val) |
56 | { | 54 | { |
57 | PDprintk("%x writing to %x: %x\n", slot, offset, val); | 55 | pr_debug("%x writing to %x: %x\n", slot, offset, val); |
58 | outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); | 56 | outl(0x80000000 | (bus<<16) | (slot<<11) | (func<<8) | offset, 0xcf8); |
59 | outw(val, 0xcfc + (offset&2)); | 57 | outw(val, 0xcfc + (offset&2)); |
60 | } | 58 | } |
@@ -71,7 +69,7 @@ void early_dump_pci_device(u8 bus, u8 slot, u8 func) | |||
71 | int j; | 69 | int j; |
72 | u32 val; | 70 | u32 val; |
73 | 71 | ||
74 | printk("PCI: %02x:%02x:%02x", bus, slot, func); | 72 | printk(KERN_INFO "PCI: %02x:%02x:%02x", bus, slot, func); |
75 | 73 | ||
76 | for (i = 0; i < 256; i += 4) { | 74 | for (i = 0; i < 256; i += 4) { |
77 | if (!(i & 0x0f)) | 75 | if (!(i & 0x0f)) |
diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index ff3a6a336342..4bdaa590375d 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c | |||
@@ -23,7 +23,8 @@ static void __devinit pci_fixup_i450nx(struct pci_dev *d) | |||
23 | pci_read_config_byte(d, reg++, &busno); | 23 | pci_read_config_byte(d, reg++, &busno); |
24 | pci_read_config_byte(d, reg++, &suba); | 24 | pci_read_config_byte(d, reg++, &suba); |
25 | pci_read_config_byte(d, reg++, &subb); | 25 | pci_read_config_byte(d, reg++, &subb); |
26 | DBG("i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, suba, subb); | 26 | dev_dbg(&d->dev, "i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, |
27 | suba, subb); | ||
27 | if (busno) | 28 | if (busno) |
28 | pci_scan_bus_with_sysdata(busno); /* Bus A */ | 29 | pci_scan_bus_with_sysdata(busno); /* Bus A */ |
29 | if (suba < subb) | 30 | if (suba < subb) |
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index 2aafb67dc5f1..5807d1bc73f7 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c | |||
@@ -128,10 +128,8 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list) | |||
128 | pr = pci_find_parent_resource(dev, r); | 128 | pr = pci_find_parent_resource(dev, r); |
129 | if (!r->start || !pr || | 129 | if (!r->start || !pr || |
130 | request_resource(pr, r) < 0) { | 130 | request_resource(pr, r) < 0) { |
131 | printk(KERN_ERR "PCI: Cannot allocate " | 131 | dev_err(&dev->dev, "BAR %d: can't " |
132 | "resource region %d " | 132 | "allocate resource\n", idx); |
133 | "of bridge %s\n", | ||
134 | idx, pci_name(dev)); | ||
135 | /* | 133 | /* |
136 | * Something is wrong with the region. | 134 | * Something is wrong with the region. |
137 | * Invalidate the resource to prevent | 135 | * Invalidate the resource to prevent |
@@ -166,15 +164,15 @@ static void __init pcibios_allocate_resources(int pass) | |||
166 | else | 164 | else |
167 | disabled = !(command & PCI_COMMAND_MEMORY); | 165 | disabled = !(command & PCI_COMMAND_MEMORY); |
168 | if (pass == disabled) { | 166 | if (pass == disabled) { |
169 | DBG("PCI: Resource %08lx-%08lx " | 167 | dev_dbg(&dev->dev, "resource %#08llx-%#08llx " |
170 | "(f=%lx, d=%d, p=%d)\n", | 168 | "(f=%lx, d=%d, p=%d)\n", |
171 | r->start, r->end, r->flags, disabled, pass); | 169 | (unsigned long long) r->start, |
170 | (unsigned long long) r->end, | ||
171 | r->flags, disabled, pass); | ||
172 | pr = pci_find_parent_resource(dev, r); | 172 | pr = pci_find_parent_resource(dev, r); |
173 | if (!pr || request_resource(pr, r) < 0) { | 173 | if (!pr || request_resource(pr, r) < 0) { |
174 | printk(KERN_ERR "PCI: Cannot allocate " | 174 | dev_err(&dev->dev, "BAR %d: can't " |
175 | "resource region %d " | 175 | "allocate resource\n", idx); |
176 | "of device %s\n", | ||
177 | idx, pci_name(dev)); | ||
178 | /* We'll assign a new address later */ | 176 | /* We'll assign a new address later */ |
179 | r->end -= r->start; | 177 | r->end -= r->start; |
180 | r->start = 0; | 178 | r->start = 0; |
@@ -187,8 +185,7 @@ static void __init pcibios_allocate_resources(int pass) | |||
187 | /* Turn the ROM off, leave the resource region, | 185 | /* Turn the ROM off, leave the resource region, |
188 | * but keep it unregistered. */ | 186 | * but keep it unregistered. */ |
189 | u32 reg; | 187 | u32 reg; |
190 | DBG("PCI: Switching off ROM of %s\n", | 188 | dev_dbg(&dev->dev, "disabling ROM\n"); |
191 | pci_name(dev)); | ||
192 | r->flags &= ~IORESOURCE_ROM_ENABLE; | 189 | r->flags &= ~IORESOURCE_ROM_ENABLE; |
193 | pci_read_config_dword(dev, | 190 | pci_read_config_dword(dev, |
194 | dev->rom_base_reg, ®); | 191 | dev->rom_base_reg, ®); |
@@ -257,8 +254,7 @@ void pcibios_set_master(struct pci_dev *dev) | |||
257 | lat = pcibios_max_latency; | 254 | lat = pcibios_max_latency; |
258 | else | 255 | else |
259 | return; | 256 | return; |
260 | printk(KERN_DEBUG "PCI: Setting latency timer of device %s to %d\n", | 257 | dev_printk(KERN_DEBUG, &dev->dev, "setting latency timer to %d\n", lat); |
261 | pci_name(dev), lat); | ||
262 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); | 258 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); |
263 | } | 259 | } |
264 | 260 | ||
@@ -280,6 +276,7 @@ static void pci_track_mmap_page_range(struct vm_area_struct *vma) | |||
280 | static struct vm_operations_struct pci_mmap_ops = { | 276 | static struct vm_operations_struct pci_mmap_ops = { |
281 | .open = pci_track_mmap_page_range, | 277 | .open = pci_track_mmap_page_range, |
282 | .close = pci_unmap_page_range, | 278 | .close = pci_unmap_page_range, |
279 | .access = generic_access_phys, | ||
283 | }; | 280 | }; |
284 | 281 | ||
285 | int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | 282 | int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, |
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c index 6a06a2eb0597..8e077185e185 100644 --- a/arch/x86/pci/irq.c +++ b/arch/x86/pci/irq.c | |||
@@ -436,7 +436,7 @@ static int pirq_vlsi_get(struct pci_dev *router, struct pci_dev *dev, int pirq) | |||
436 | { | 436 | { |
437 | WARN_ON_ONCE(pirq >= 9); | 437 | WARN_ON_ONCE(pirq >= 9); |
438 | if (pirq > 8) { | 438 | if (pirq > 8) { |
439 | printk(KERN_INFO "VLSI router pirq escape (%d)\n", pirq); | 439 | dev_info(&dev->dev, "VLSI router PIRQ escape (%d)\n", pirq); |
440 | return 0; | 440 | return 0; |
441 | } | 441 | } |
442 | return read_config_nybble(router, 0x74, pirq-1); | 442 | return read_config_nybble(router, 0x74, pirq-1); |
@@ -446,7 +446,7 @@ static int pirq_vlsi_set(struct pci_dev *router, struct pci_dev *dev, int pirq, | |||
446 | { | 446 | { |
447 | WARN_ON_ONCE(pirq >= 9); | 447 | WARN_ON_ONCE(pirq >= 9); |
448 | if (pirq > 8) { | 448 | if (pirq > 8) { |
449 | printk(KERN_INFO "VLSI router pirq escape (%d)\n", pirq); | 449 | dev_info(&dev->dev, "VLSI router PIRQ escape (%d)\n", pirq); |
450 | return 0; | 450 | return 0; |
451 | } | 451 | } |
452 | write_config_nybble(router, 0x74, pirq-1, irq); | 452 | write_config_nybble(router, 0x74, pirq-1, irq); |
@@ -492,15 +492,17 @@ static int pirq_amd756_get(struct pci_dev *router, struct pci_dev *dev, int pirq | |||
492 | irq = 0; | 492 | irq = 0; |
493 | if (pirq <= 4) | 493 | if (pirq <= 4) |
494 | irq = read_config_nybble(router, 0x56, pirq - 1); | 494 | irq = read_config_nybble(router, 0x56, pirq - 1); |
495 | printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d get irq : %2d\n", | 495 | dev_info(&dev->dev, |
496 | dev->vendor, dev->device, pirq, irq); | 496 | "AMD756: dev [%04x/%04x], router PIRQ %d get IRQ %d\n", |
497 | dev->vendor, dev->device, pirq, irq); | ||
497 | return irq; | 498 | return irq; |
498 | } | 499 | } |
499 | 500 | ||
500 | static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) | 501 | static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) |
501 | { | 502 | { |
502 | printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d SET irq : %2d\n", | 503 | dev_info(&dev->dev, |
503 | dev->vendor, dev->device, pirq, irq); | 504 | "AMD756: dev [%04x/%04x], router PIRQ %d set IRQ %d\n", |
505 | dev->vendor, dev->device, pirq, irq); | ||
504 | if (pirq <= 4) | 506 | if (pirq <= 4) |
505 | write_config_nybble(router, 0x56, pirq - 1, irq); | 507 | write_config_nybble(router, 0x56, pirq - 1, irq); |
506 | return 1; | 508 | return 1; |
@@ -588,6 +590,8 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route | |||
588 | case PCI_DEVICE_ID_INTEL_ICH10_1: | 590 | case PCI_DEVICE_ID_INTEL_ICH10_1: |
589 | case PCI_DEVICE_ID_INTEL_ICH10_2: | 591 | case PCI_DEVICE_ID_INTEL_ICH10_2: |
590 | case PCI_DEVICE_ID_INTEL_ICH10_3: | 592 | case PCI_DEVICE_ID_INTEL_ICH10_3: |
593 | case PCI_DEVICE_ID_INTEL_PCH_0: | ||
594 | case PCI_DEVICE_ID_INTEL_PCH_1: | ||
591 | r->name = "PIIX/ICH"; | 595 | r->name = "PIIX/ICH"; |
592 | r->get = pirq_piix_get; | 596 | r->get = pirq_piix_get; |
593 | r->set = pirq_piix_set; | 597 | r->set = pirq_piix_set; |
@@ -730,7 +734,6 @@ static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, | |||
730 | switch (device) { | 734 | switch (device) { |
731 | case PCI_DEVICE_ID_AL_M1533: | 735 | case PCI_DEVICE_ID_AL_M1533: |
732 | case PCI_DEVICE_ID_AL_M1563: | 736 | case PCI_DEVICE_ID_AL_M1563: |
733 | printk(KERN_DEBUG "PCI: Using ALI IRQ Router\n"); | ||
734 | r->name = "ALI"; | 737 | r->name = "ALI"; |
735 | r->get = pirq_ali_get; | 738 | r->get = pirq_ali_get; |
736 | r->set = pirq_ali_set; | 739 | r->set = pirq_ali_set; |
@@ -840,11 +843,9 @@ static void __init pirq_find_router(struct irq_router *r) | |||
840 | h->probe(r, pirq_router_dev, pirq_router_dev->device)) | 843 | h->probe(r, pirq_router_dev, pirq_router_dev->device)) |
841 | break; | 844 | break; |
842 | } | 845 | } |
843 | printk(KERN_INFO "PCI: Using IRQ router %s [%04x/%04x] at %s\n", | 846 | dev_info(&pirq_router_dev->dev, "%s IRQ router [%04x/%04x]\n", |
844 | pirq_router.name, | 847 | pirq_router.name, |
845 | pirq_router_dev->vendor, | 848 | pirq_router_dev->vendor, pirq_router_dev->device); |
846 | pirq_router_dev->device, | ||
847 | pci_name(pirq_router_dev)); | ||
848 | 849 | ||
849 | /* The device remains referenced for the kernel lifetime */ | 850 | /* The device remains referenced for the kernel lifetime */ |
850 | } | 851 | } |
@@ -877,7 +878,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
877 | /* Find IRQ pin */ | 878 | /* Find IRQ pin */ |
878 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); | 879 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); |
879 | if (!pin) { | 880 | if (!pin) { |
880 | DBG(KERN_DEBUG " -> no interrupt pin\n"); | 881 | dev_dbg(&dev->dev, "no interrupt pin\n"); |
881 | return 0; | 882 | return 0; |
882 | } | 883 | } |
883 | pin = pin - 1; | 884 | pin = pin - 1; |
@@ -887,20 +888,20 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
887 | if (!pirq_table) | 888 | if (!pirq_table) |
888 | return 0; | 889 | return 0; |
889 | 890 | ||
890 | DBG(KERN_DEBUG "IRQ for %s[%c]", pci_name(dev), 'A' + pin); | ||
891 | info = pirq_get_info(dev); | 891 | info = pirq_get_info(dev); |
892 | if (!info) { | 892 | if (!info) { |
893 | DBG(" -> not found in routing table\n" KERN_DEBUG); | 893 | dev_dbg(&dev->dev, "PCI INT %c not found in routing table\n", |
894 | 'A' + pin); | ||
894 | return 0; | 895 | return 0; |
895 | } | 896 | } |
896 | pirq = info->irq[pin].link; | 897 | pirq = info->irq[pin].link; |
897 | mask = info->irq[pin].bitmap; | 898 | mask = info->irq[pin].bitmap; |
898 | if (!pirq) { | 899 | if (!pirq) { |
899 | DBG(" -> not routed\n" KERN_DEBUG); | 900 | dev_dbg(&dev->dev, "PCI INT %c not routed\n", 'A' + pin); |
900 | return 0; | 901 | return 0; |
901 | } | 902 | } |
902 | DBG(" -> PIRQ %02x, mask %04x, excl %04x", pirq, mask, | 903 | dev_dbg(&dev->dev, "PCI INT %c -> PIRQ %02x, mask %04x, excl %04x", |
903 | pirq_table->exclusive_irqs); | 904 | 'A' + pin, pirq, mask, pirq_table->exclusive_irqs); |
904 | mask &= pcibios_irq_mask; | 905 | mask &= pcibios_irq_mask; |
905 | 906 | ||
906 | /* Work around broken HP Pavilion Notebooks which assign USB to | 907 | /* Work around broken HP Pavilion Notebooks which assign USB to |
@@ -930,10 +931,8 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
930 | if (pci_probe & PCI_USE_PIRQ_MASK) | 931 | if (pci_probe & PCI_USE_PIRQ_MASK) |
931 | newirq = 0; | 932 | newirq = 0; |
932 | else | 933 | else |
933 | printk("\n" KERN_WARNING | 934 | dev_warn(&dev->dev, "IRQ %d doesn't match PIRQ mask " |
934 | "PCI: IRQ %i for device %s doesn't match PIRQ mask - try pci=usepirqmask\n" | 935 | "%#x; try pci=usepirqmask\n", newirq, mask); |
935 | KERN_DEBUG, newirq, | ||
936 | pci_name(dev)); | ||
937 | } | 936 | } |
938 | if (!newirq && assign) { | 937 | if (!newirq && assign) { |
939 | for (i = 0; i < 16; i++) { | 938 | for (i = 0; i < 16; i++) { |
@@ -944,39 +943,35 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
944 | newirq = i; | 943 | newirq = i; |
945 | } | 944 | } |
946 | } | 945 | } |
947 | DBG(" -> newirq=%d", newirq); | 946 | dev_dbg(&dev->dev, "PCI INT %c -> newirq %d", 'A' + pin, newirq); |
948 | 947 | ||
949 | /* Check if it is hardcoded */ | 948 | /* Check if it is hardcoded */ |
950 | if ((pirq & 0xf0) == 0xf0) { | 949 | if ((pirq & 0xf0) == 0xf0) { |
951 | irq = pirq & 0xf; | 950 | irq = pirq & 0xf; |
952 | DBG(" -> hardcoded IRQ %d\n", irq); | 951 | msg = "hardcoded"; |
953 | msg = "Hardcoded"; | ||
954 | } else if (r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \ | 952 | } else if (r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \ |
955 | ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask))) { | 953 | ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask))) { |
956 | DBG(" -> got IRQ %d\n", irq); | 954 | msg = "found"; |
957 | msg = "Found"; | ||
958 | eisa_set_level_irq(irq); | 955 | eisa_set_level_irq(irq); |
959 | } else if (newirq && r->set && | 956 | } else if (newirq && r->set && |
960 | (dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) { | 957 | (dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) { |
961 | DBG(" -> assigning IRQ %d", newirq); | ||
962 | if (r->set(pirq_router_dev, dev, pirq, newirq)) { | 958 | if (r->set(pirq_router_dev, dev, pirq, newirq)) { |
963 | eisa_set_level_irq(newirq); | 959 | eisa_set_level_irq(newirq); |
964 | DBG(" ... OK\n"); | 960 | msg = "assigned"; |
965 | msg = "Assigned"; | ||
966 | irq = newirq; | 961 | irq = newirq; |
967 | } | 962 | } |
968 | } | 963 | } |
969 | 964 | ||
970 | if (!irq) { | 965 | if (!irq) { |
971 | DBG(" ... failed\n"); | ||
972 | if (newirq && mask == (1 << newirq)) { | 966 | if (newirq && mask == (1 << newirq)) { |
973 | msg = "Guessed"; | 967 | msg = "guessed"; |
974 | irq = newirq; | 968 | irq = newirq; |
975 | } else | 969 | } else { |
970 | dev_dbg(&dev->dev, "can't route interrupt\n"); | ||
976 | return 0; | 971 | return 0; |
972 | } | ||
977 | } | 973 | } |
978 | printk(KERN_INFO "PCI: %s IRQ %d for device %s\n", msg, irq, | 974 | dev_info(&dev->dev, "%s PCI INT %c -> IRQ %d\n", msg, 'A' + pin, irq); |
979 | pci_name(dev)); | ||
980 | 975 | ||
981 | /* Update IRQ for all devices with the same pirq value */ | 976 | /* Update IRQ for all devices with the same pirq value */ |
982 | while ((dev2 = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev2)) != NULL) { | 977 | while ((dev2 = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev2)) != NULL) { |
@@ -996,17 +991,17 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
996 | (!(pci_probe & PCI_USE_PIRQ_MASK) || \ | 991 | (!(pci_probe & PCI_USE_PIRQ_MASK) || \ |
997 | ((1 << dev2->irq) & mask))) { | 992 | ((1 << dev2->irq) & mask))) { |
998 | #ifndef CONFIG_PCI_MSI | 993 | #ifndef CONFIG_PCI_MSI |
999 | printk(KERN_INFO "IRQ routing conflict for %s, have irq %d, want irq %d\n", | 994 | dev_info(&dev2->dev, "IRQ routing conflict: " |
1000 | pci_name(dev2), dev2->irq, irq); | 995 | "have IRQ %d, want IRQ %d\n", |
996 | dev2->irq, irq); | ||
1001 | #endif | 997 | #endif |
1002 | continue; | 998 | continue; |
1003 | } | 999 | } |
1004 | dev2->irq = irq; | 1000 | dev2->irq = irq; |
1005 | pirq_penalty[irq]++; | 1001 | pirq_penalty[irq]++; |
1006 | if (dev != dev2) | 1002 | if (dev != dev2) |
1007 | printk(KERN_INFO | 1003 | dev_info(&dev->dev, "sharing IRQ %d with %s\n", |
1008 | "PCI: Sharing IRQ %d with %s\n", | 1004 | irq, pci_name(dev2)); |
1009 | irq, pci_name(dev2)); | ||
1010 | } | 1005 | } |
1011 | } | 1006 | } |
1012 | return 1; | 1007 | return 1; |
@@ -1025,8 +1020,7 @@ static void __init pcibios_fixup_irqs(void) | |||
1025 | * already in use. | 1020 | * already in use. |
1026 | */ | 1021 | */ |
1027 | if (dev->irq >= 16) { | 1022 | if (dev->irq >= 16) { |
1028 | DBG(KERN_DEBUG "%s: ignoring bogus IRQ %d\n", | 1023 | dev_dbg(&dev->dev, "ignoring bogus IRQ %d\n", dev->irq); |
1029 | pci_name(dev), dev->irq); | ||
1030 | dev->irq = 0; | 1024 | dev->irq = 0; |
1031 | } | 1025 | } |
1032 | /* | 1026 | /* |
@@ -1070,12 +1064,12 @@ static void __init pcibios_fixup_irqs(void) | |||
1070 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, | 1064 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, |
1071 | PCI_SLOT(bridge->devfn), pin); | 1065 | PCI_SLOT(bridge->devfn), pin); |
1072 | if (irq >= 0) | 1066 | if (irq >= 0) |
1073 | printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n", | 1067 | dev_warn(&dev->dev, "using bridge %s INT %c to get IRQ %d\n", |
1074 | pci_name(bridge), 'A' + pin, irq); | 1068 | pci_name(bridge), |
1069 | 'A' + pin, irq); | ||
1075 | } | 1070 | } |
1076 | if (irq >= 0) { | 1071 | if (irq >= 0) { |
1077 | printk(KERN_INFO "PCI->APIC IRQ transform: %s[%c] -> IRQ %d\n", | 1072 | dev_info(&dev->dev, "PCI->APIC IRQ transform: INT %c -> IRQ %d\n", 'A' + pin, irq); |
1078 | pci_name(dev), 'A' + pin, irq); | ||
1079 | dev->irq = irq; | 1073 | dev->irq = irq; |
1080 | } | 1074 | } |
1081 | } | 1075 | } |
@@ -1231,25 +1225,24 @@ static int pirq_enable_irq(struct pci_dev *dev) | |||
1231 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, | 1225 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, |
1232 | PCI_SLOT(bridge->devfn), pin); | 1226 | PCI_SLOT(bridge->devfn), pin); |
1233 | if (irq >= 0) | 1227 | if (irq >= 0) |
1234 | printk(KERN_WARNING | 1228 | dev_warn(&dev->dev, "using bridge %s " |
1235 | "PCI: using PPB %s[%c] to get irq %d\n", | 1229 | "INT %c to get IRQ %d\n", |
1236 | pci_name(bridge), | 1230 | pci_name(bridge), 'A' + pin, |
1237 | 'A' + pin, irq); | 1231 | irq); |
1238 | dev = bridge; | 1232 | dev = bridge; |
1239 | } | 1233 | } |
1240 | dev = temp_dev; | 1234 | dev = temp_dev; |
1241 | if (irq >= 0) { | 1235 | if (irq >= 0) { |
1242 | printk(KERN_INFO | 1236 | dev_info(&dev->dev, "PCI->APIC IRQ transform: " |
1243 | "PCI->APIC IRQ transform: %s[%c] -> IRQ %d\n", | 1237 | "INT %c -> IRQ %d\n", 'A' + pin, irq); |
1244 | pci_name(dev), 'A' + pin, irq); | ||
1245 | dev->irq = irq; | 1238 | dev->irq = irq; |
1246 | return 0; | 1239 | return 0; |
1247 | } else | 1240 | } else |
1248 | msg = " Probably buggy MP table."; | 1241 | msg = "; probably buggy MP table"; |
1249 | } else if (pci_probe & PCI_BIOS_IRQ_SCAN) | 1242 | } else if (pci_probe & PCI_BIOS_IRQ_SCAN) |
1250 | msg = ""; | 1243 | msg = ""; |
1251 | else | 1244 | else |
1252 | msg = " Please try using pci=biosirq."; | 1245 | msg = "; please try using pci=biosirq"; |
1253 | 1246 | ||
1254 | /* | 1247 | /* |
1255 | * With IDE legacy devices the IRQ lookup failure is not | 1248 | * With IDE legacy devices the IRQ lookup failure is not |
@@ -1259,9 +1252,8 @@ static int pirq_enable_irq(struct pci_dev *dev) | |||
1259 | !(dev->class & 0x5)) | 1252 | !(dev->class & 0x5)) |
1260 | return 0; | 1253 | return 0; |
1261 | 1254 | ||
1262 | printk(KERN_WARNING | 1255 | dev_warn(&dev->dev, "can't find IRQ for PCI INT %c%s\n", |
1263 | "PCI: No IRQ known for interrupt pin %c of device %s.%s\n", | 1256 | 'A' + pin, msg); |
1264 | 'A' + pin, pci_name(dev), msg); | ||
1265 | } | 1257 | } |
1266 | return 0; | 1258 | return 0; |
1267 | } | 1259 | } |
diff --git a/arch/x86/pci/legacy.c b/arch/x86/pci/legacy.c index 132876cc6fca..b722dd481b39 100644 --- a/arch/x86/pci/legacy.c +++ b/arch/x86/pci/legacy.c | |||
@@ -14,7 +14,7 @@ static void __devinit pcibios_fixup_peer_bridges(void) | |||
14 | int n, devfn; | 14 | int n, devfn; |
15 | long node; | 15 | long node; |
16 | 16 | ||
17 | if (pcibios_last_bus <= 0 || pcibios_last_bus >= 0xff) | 17 | if (pcibios_last_bus <= 0 || pcibios_last_bus > 0xff) |
18 | return; | 18 | return; |
19 | DBG("PCI: Peer bridge fixup\n"); | 19 | DBG("PCI: Peer bridge fixup\n"); |
20 | 20 | ||
@@ -57,14 +57,17 @@ static int __init pci_legacy_init(void) | |||
57 | 57 | ||
58 | int __init pci_subsys_init(void) | 58 | int __init pci_subsys_init(void) |
59 | { | 59 | { |
60 | #ifdef CONFIG_X86_NUMAQ | ||
61 | pci_numaq_init(); | ||
62 | #endif | ||
60 | #ifdef CONFIG_ACPI | 63 | #ifdef CONFIG_ACPI |
61 | pci_acpi_init(); | 64 | pci_acpi_init(); |
62 | #endif | 65 | #endif |
66 | #ifdef CONFIG_X86_VISWS | ||
67 | pci_visws_init(); | ||
68 | #endif | ||
63 | pci_legacy_init(); | 69 | pci_legacy_init(); |
64 | pcibios_irq_init(); | 70 | pcibios_irq_init(); |
65 | #ifdef CONFIG_X86_NUMAQ | ||
66 | pci_numa_init(); | ||
67 | #endif | ||
68 | pcibios_init(); | 71 | pcibios_init(); |
69 | 72 | ||
70 | return 0; | 73 | return 0; |
diff --git a/arch/x86/pci/numa.c b/arch/x86/pci/numaq_32.c index 8b5ca1966731..1177845d3186 100644 --- a/arch/x86/pci/numa.c +++ b/arch/x86/pci/numaq_32.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * numa.c - Low-level PCI access for NUMA-Q machines | 2 | * numaq_32.c - Low-level PCI access for NUMA-Q machines |
3 | */ | 3 | */ |
4 | 4 | ||
5 | #include <linux/pci.h> | 5 | #include <linux/pci.h> |
@@ -131,13 +131,14 @@ static void __devinit pci_fixup_i450nx(struct pci_dev *d) | |||
131 | u8 busno, suba, subb; | 131 | u8 busno, suba, subb; |
132 | int quad = BUS2QUAD(d->bus->number); | 132 | int quad = BUS2QUAD(d->bus->number); |
133 | 133 | ||
134 | printk("PCI: Searching for i450NX host bridges on %s\n", pci_name(d)); | 134 | dev_info(&d->dev, "searching for i450NX host bridges\n"); |
135 | reg = 0xd0; | 135 | reg = 0xd0; |
136 | for(pxb=0; pxb<2; pxb++) { | 136 | for(pxb=0; pxb<2; pxb++) { |
137 | pci_read_config_byte(d, reg++, &busno); | 137 | pci_read_config_byte(d, reg++, &busno); |
138 | pci_read_config_byte(d, reg++, &suba); | 138 | pci_read_config_byte(d, reg++, &suba); |
139 | pci_read_config_byte(d, reg++, &subb); | 139 | pci_read_config_byte(d, reg++, &subb); |
140 | DBG("i450NX PXB %d: %02x/%02x/%02x\n", pxb, busno, suba, subb); | 140 | dev_dbg(&d->dev, "i450NX PXB %d: %02x/%02x/%02x\n", |
141 | pxb, busno, suba, subb); | ||
141 | if (busno) { | 142 | if (busno) { |
142 | /* Bus A */ | 143 | /* Bus A */ |
143 | pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, busno)); | 144 | pci_scan_bus_with_sysdata(QUADLOCAL2BUS(quad, busno)); |
@@ -151,7 +152,7 @@ static void __devinit pci_fixup_i450nx(struct pci_dev *d) | |||
151 | } | 152 | } |
152 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX, pci_fixup_i450nx); | 153 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX, pci_fixup_i450nx); |
153 | 154 | ||
154 | int __init pci_numa_init(void) | 155 | int __init pci_numaq_init(void) |
155 | { | 156 | { |
156 | int quad; | 157 | int quad; |
157 | 158 | ||
diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h index 3e25deb821ac..15b9cf6be729 100644 --- a/arch/x86/pci/pci.h +++ b/arch/x86/pci/pci.h | |||
@@ -108,7 +108,8 @@ extern void __init dmi_check_skip_isa_align(void); | |||
108 | /* some common used subsys_initcalls */ | 108 | /* some common used subsys_initcalls */ |
109 | extern int __init pci_acpi_init(void); | 109 | extern int __init pci_acpi_init(void); |
110 | extern int __init pcibios_irq_init(void); | 110 | extern int __init pcibios_irq_init(void); |
111 | extern int __init pci_numa_init(void); | 111 | extern int __init pci_visws_init(void); |
112 | extern int __init pci_numaq_init(void); | ||
112 | extern int __init pcibios_init(void); | 113 | extern int __init pcibios_init(void); |
113 | 114 | ||
114 | /* pci-mmconfig.c */ | 115 | /* pci-mmconfig.c */ |
diff --git a/arch/x86/pci/visws.c b/arch/x86/pci/visws.c index 1a7bed492bb1..42f4cb19faca 100644 --- a/arch/x86/pci/visws.c +++ b/arch/x86/pci/visws.c | |||
@@ -86,8 +86,14 @@ void __init pcibios_update_irq(struct pci_dev *dev, int irq) | |||
86 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); | 86 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, irq); |
87 | } | 87 | } |
88 | 88 | ||
89 | static int __init pci_visws_init(void) | 89 | int __init pci_visws_init(void) |
90 | { | 90 | { |
91 | if (!is_visws_box()) | ||
92 | return -1; | ||
93 | |||
94 | pcibios_enable_irq = &pci_visws_enable_irq; | ||
95 | pcibios_disable_irq = &pci_visws_disable_irq; | ||
96 | |||
91 | /* The VISWS supports configuration access type 1 only */ | 97 | /* The VISWS supports configuration access type 1 only */ |
92 | pci_probe = (pci_probe | PCI_PROBE_CONF1) & | 98 | pci_probe = (pci_probe | PCI_PROBE_CONF1) & |
93 | ~(PCI_PROBE_BIOS | PCI_PROBE_CONF2); | 99 | ~(PCI_PROBE_BIOS | PCI_PROBE_CONF2); |
@@ -105,18 +111,3 @@ static int __init pci_visws_init(void) | |||
105 | pcibios_resource_survey(); | 111 | pcibios_resource_survey(); |
106 | return 0; | 112 | return 0; |
107 | } | 113 | } |
108 | |||
109 | static __init int pci_subsys_init(void) | ||
110 | { | ||
111 | if (!is_visws_box()) | ||
112 | return -1; | ||
113 | |||
114 | pcibios_enable_irq = &pci_visws_enable_irq; | ||
115 | pcibios_disable_irq = &pci_visws_disable_irq; | ||
116 | |||
117 | pci_visws_init(); | ||
118 | pcibios_init(); | ||
119 | |||
120 | return 0; | ||
121 | } | ||
122 | subsys_initcall(pci_subsys_init); | ||