diff options
Diffstat (limited to 'arch/x86/pci')
-rw-r--r-- | arch/x86/pci/Makefile_32 | 1 | ||||
-rw-r--r-- | arch/x86/pci/Makefile_64 | 2 | ||||
-rw-r--r-- | arch/x86/pci/acpi.c | 1 | ||||
-rw-r--r-- | arch/x86/pci/amd_bus.c (renamed from arch/x86/pci/k8-bus_64.c) | 32 | ||||
-rw-r--r-- | arch/x86/pci/direct.c | 25 | ||||
-rw-r--r-- | arch/x86/pci/i386.c | 4 | ||||
-rw-r--r-- | arch/x86/pci/irq.c | 261 | ||||
-rw-r--r-- | arch/x86/pci/mmconfig-shared.c | 2 | ||||
-rw-r--r-- | arch/x86/pci/pci.h | 1 |
9 files changed, 181 insertions, 148 deletions
diff --git a/arch/x86/pci/Makefile_32 b/arch/x86/pci/Makefile_32 index 962d96c0495a..a34fbf557926 100644 --- a/arch/x86/pci/Makefile_32 +++ b/arch/x86/pci/Makefile_32 | |||
@@ -23,3 +23,4 @@ pci-$(CONFIG_X86_NUMAQ) += numa.o | |||
23 | pci-$(CONFIG_NUMA) += mp_bus_to_node.o | 23 | pci-$(CONFIG_NUMA) += mp_bus_to_node.o |
24 | 24 | ||
25 | obj-y += $(pci-y) common.o early.o | 25 | obj-y += $(pci-y) common.o early.o |
26 | obj-y += amd_bus.o | ||
diff --git a/arch/x86/pci/Makefile_64 b/arch/x86/pci/Makefile_64 index 8fbd19832cf6..fd47068c95de 100644 --- a/arch/x86/pci/Makefile_64 +++ b/arch/x86/pci/Makefile_64 | |||
@@ -13,5 +13,5 @@ obj-y += legacy.o irq.o common.o early.o | |||
13 | # mmconfig has a 64bit special | 13 | # mmconfig has a 64bit special |
14 | obj-$(CONFIG_PCI_MMCONFIG) += mmconfig_64.o direct.o mmconfig-shared.o | 14 | obj-$(CONFIG_PCI_MMCONFIG) += mmconfig_64.o direct.o mmconfig-shared.o |
15 | 15 | ||
16 | obj-y += k8-bus_64.o | 16 | obj-y += amd_bus.o |
17 | 17 | ||
diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index d95de2f199cd..464279da49c4 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c | |||
@@ -218,7 +218,6 @@ struct pci_bus * __devinit pci_acpi_scan_root(struct acpi_device *device, int do | |||
218 | return bus; | 218 | return bus; |
219 | } | 219 | } |
220 | 220 | ||
221 | extern int pci_routeirq; | ||
222 | static int __init pci_acpi_init(void) | 221 | static int __init pci_acpi_init(void) |
223 | { | 222 | { |
224 | struct pci_dev *dev = NULL; | 223 | struct pci_dev *dev = NULL; |
diff --git a/arch/x86/pci/k8-bus_64.c b/arch/x86/pci/amd_bus.c index bfefdf0f40d4..d02c598451ec 100644 --- a/arch/x86/pci/k8-bus_64.c +++ b/arch/x86/pci/amd_bus.c | |||
@@ -1,5 +1,9 @@ | |||
1 | #include <linux/init.h> | 1 | #include <linux/init.h> |
2 | #include <linux/pci.h> | 2 | #include <linux/pci.h> |
3 | #include "pci.h" | ||
4 | |||
5 | #ifdef CONFIG_X86_64 | ||
6 | |||
3 | #include <asm/pci-direct.h> | 7 | #include <asm/pci-direct.h> |
4 | #include <asm/mpspec.h> | 8 | #include <asm/mpspec.h> |
5 | #include <linux/cpumask.h> | 9 | #include <linux/cpumask.h> |
@@ -526,3 +530,31 @@ static int __init early_fill_mp_bus_info(void) | |||
526 | } | 530 | } |
527 | 531 | ||
528 | postcore_initcall(early_fill_mp_bus_info); | 532 | postcore_initcall(early_fill_mp_bus_info); |
533 | |||
534 | #endif | ||
535 | |||
536 | /* common 32/64 bit code */ | ||
537 | |||
538 | #define ENABLE_CF8_EXT_CFG (1ULL << 46) | ||
539 | |||
540 | static void enable_pci_io_ecs_per_cpu(void *unused) | ||
541 | { | ||
542 | u64 reg; | ||
543 | rdmsrl(MSR_AMD64_NB_CFG, reg); | ||
544 | if (!(reg & ENABLE_CF8_EXT_CFG)) { | ||
545 | reg |= ENABLE_CF8_EXT_CFG; | ||
546 | wrmsrl(MSR_AMD64_NB_CFG, reg); | ||
547 | } | ||
548 | } | ||
549 | |||
550 | static int __init enable_pci_io_ecs(void) | ||
551 | { | ||
552 | /* assume all cpus from fam10h have IO ECS */ | ||
553 | if (boot_cpu_data.x86 < 0x10) | ||
554 | return 0; | ||
555 | on_each_cpu(enable_pci_io_ecs_per_cpu, NULL, 1, 1); | ||
556 | pci_probe |= PCI_HAS_IO_ECS; | ||
557 | return 0; | ||
558 | } | ||
559 | |||
560 | postcore_initcall(enable_pci_io_ecs); | ||
diff --git a/arch/x86/pci/direct.c b/arch/x86/pci/direct.c index 21d1e0e0d535..9915293500fb 100644 --- a/arch/x86/pci/direct.c +++ b/arch/x86/pci/direct.c | |||
@@ -8,18 +8,21 @@ | |||
8 | #include "pci.h" | 8 | #include "pci.h" |
9 | 9 | ||
10 | /* | 10 | /* |
11 | * Functions for accessing PCI configuration space with type 1 accesses | 11 | * Functions for accessing PCI base (first 256 bytes) and extended |
12 | * (4096 bytes per PCI function) configuration space with type 1 | ||
13 | * accesses. | ||
12 | */ | 14 | */ |
13 | 15 | ||
14 | #define PCI_CONF1_ADDRESS(bus, devfn, reg) \ | 16 | #define PCI_CONF1_ADDRESS(bus, devfn, reg) \ |
15 | (0x80000000 | (bus << 16) | (devfn << 8) | (reg & ~3)) | 17 | (0x80000000 | ((reg & 0xF00) << 16) | (bus << 16) \ |
18 | | (devfn << 8) | (reg & 0xFC)) | ||
16 | 19 | ||
17 | static int pci_conf1_read(unsigned int seg, unsigned int bus, | 20 | static int pci_conf1_read(unsigned int seg, unsigned int bus, |
18 | unsigned int devfn, int reg, int len, u32 *value) | 21 | unsigned int devfn, int reg, int len, u32 *value) |
19 | { | 22 | { |
20 | unsigned long flags; | 23 | unsigned long flags; |
21 | 24 | ||
22 | if ((bus > 255) || (devfn > 255) || (reg > 255)) { | 25 | if ((bus > 255) || (devfn > 255) || (reg > 4095)) { |
23 | *value = -1; | 26 | *value = -1; |
24 | return -EINVAL; | 27 | return -EINVAL; |
25 | } | 28 | } |
@@ -50,7 +53,7 @@ static int pci_conf1_write(unsigned int seg, unsigned int bus, | |||
50 | { | 53 | { |
51 | unsigned long flags; | 54 | unsigned long flags; |
52 | 55 | ||
53 | if ((bus > 255) || (devfn > 255) || (reg > 255)) | 56 | if ((bus > 255) || (devfn > 255) || (reg > 4095)) |
54 | return -EINVAL; | 57 | return -EINVAL; |
55 | 58 | ||
56 | spin_lock_irqsave(&pci_config_lock, flags); | 59 | spin_lock_irqsave(&pci_config_lock, flags); |
@@ -260,10 +263,18 @@ void __init pci_direct_init(int type) | |||
260 | return; | 263 | return; |
261 | printk(KERN_INFO "PCI: Using configuration type %d for base access\n", | 264 | printk(KERN_INFO "PCI: Using configuration type %d for base access\n", |
262 | type); | 265 | type); |
263 | if (type == 1) | 266 | if (type == 1) { |
264 | raw_pci_ops = &pci_direct_conf1; | 267 | raw_pci_ops = &pci_direct_conf1; |
265 | else | 268 | if (raw_pci_ext_ops) |
266 | raw_pci_ops = &pci_direct_conf2; | 269 | return; |
270 | if (!(pci_probe & PCI_HAS_IO_ECS)) | ||
271 | return; | ||
272 | printk(KERN_INFO "PCI: Using configuration type 1 " | ||
273 | "for extended access\n"); | ||
274 | raw_pci_ext_ops = &pci_direct_conf1; | ||
275 | return; | ||
276 | } | ||
277 | raw_pci_ops = &pci_direct_conf2; | ||
267 | } | 278 | } |
268 | 279 | ||
269 | int __init pci_direct_probe(void) | 280 | int __init pci_direct_probe(void) |
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index 10fb308fded8..6ccd7a108cd4 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c | |||
@@ -299,9 +299,9 @@ int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, | |||
299 | return -EINVAL; | 299 | return -EINVAL; |
300 | 300 | ||
301 | prot = pgprot_val(vma->vm_page_prot); | 301 | prot = pgprot_val(vma->vm_page_prot); |
302 | if (pat_wc_enabled && write_combine) | 302 | if (pat_enabled && write_combine) |
303 | prot |= _PAGE_CACHE_WC; | 303 | prot |= _PAGE_CACHE_WC; |
304 | else if (pat_wc_enabled || boot_cpu_data.x86 > 3) | 304 | else if (pat_enabled || boot_cpu_data.x86 > 3) |
305 | /* | 305 | /* |
306 | * ioremap() and ioremap_nocache() defaults to UC MINUS for now. | 306 | * ioremap() and ioremap_nocache() defaults to UC MINUS for now. |
307 | * To avoid attribute conflicts, request UC MINUS here | 307 | * To avoid attribute conflicts, request UC MINUS here |
diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c index ca8df9c260bc..f0859de23e20 100644 --- a/arch/x86/pci/irq.c +++ b/arch/x86/pci/irq.c | |||
@@ -11,8 +11,8 @@ | |||
11 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
12 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
13 | #include <linux/dmi.h> | 13 | #include <linux/dmi.h> |
14 | #include <asm/io.h> | 14 | #include <linux/io.h> |
15 | #include <asm/smp.h> | 15 | #include <linux/smp.h> |
16 | #include <asm/io_apic.h> | 16 | #include <asm/io_apic.h> |
17 | #include <linux/irq.h> | 17 | #include <linux/irq.h> |
18 | #include <linux/acpi.h> | 18 | #include <linux/acpi.h> |
@@ -61,7 +61,7 @@ void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL; | |||
61 | * and perform checksum verification. | 61 | * and perform checksum verification. |
62 | */ | 62 | */ |
63 | 63 | ||
64 | static inline struct irq_routing_table * pirq_check_routing_table(u8 *addr) | 64 | static inline struct irq_routing_table *pirq_check_routing_table(u8 *addr) |
65 | { | 65 | { |
66 | struct irq_routing_table *rt; | 66 | struct irq_routing_table *rt; |
67 | int i; | 67 | int i; |
@@ -74,7 +74,7 @@ static inline struct irq_routing_table * pirq_check_routing_table(u8 *addr) | |||
74 | rt->size < sizeof(struct irq_routing_table)) | 74 | rt->size < sizeof(struct irq_routing_table)) |
75 | return NULL; | 75 | return NULL; |
76 | sum = 0; | 76 | sum = 0; |
77 | for (i=0; i < rt->size; i++) | 77 | for (i = 0; i < rt->size; i++) |
78 | sum += addr[i]; | 78 | sum += addr[i]; |
79 | if (!sum) { | 79 | if (!sum) { |
80 | DBG(KERN_DEBUG "PCI: Interrupt Routing Table found at 0x%p\n", rt); | 80 | DBG(KERN_DEBUG "PCI: Interrupt Routing Table found at 0x%p\n", rt); |
@@ -100,7 +100,7 @@ static struct irq_routing_table * __init pirq_find_routing_table(void) | |||
100 | return rt; | 100 | return rt; |
101 | printk(KERN_WARNING "PCI: PIRQ table NOT found at pirqaddr\n"); | 101 | printk(KERN_WARNING "PCI: PIRQ table NOT found at pirqaddr\n"); |
102 | } | 102 | } |
103 | for(addr = (u8 *) __va(0xf0000); addr < (u8 *) __va(0x100000); addr += 16) { | 103 | for (addr = (u8 *) __va(0xf0000); addr < (u8 *) __va(0x100000); addr += 16) { |
104 | rt = pirq_check_routing_table(addr); | 104 | rt = pirq_check_routing_table(addr); |
105 | if (rt) | 105 | if (rt) |
106 | return rt; | 106 | return rt; |
@@ -122,20 +122,20 @@ static void __init pirq_peer_trick(void) | |||
122 | struct irq_info *e; | 122 | struct irq_info *e; |
123 | 123 | ||
124 | memset(busmap, 0, sizeof(busmap)); | 124 | memset(busmap, 0, sizeof(busmap)); |
125 | for(i=0; i < (rt->size - sizeof(struct irq_routing_table)) / sizeof(struct irq_info); i++) { | 125 | for (i = 0; i < (rt->size - sizeof(struct irq_routing_table)) / sizeof(struct irq_info); i++) { |
126 | e = &rt->slots[i]; | 126 | e = &rt->slots[i]; |
127 | #ifdef DEBUG | 127 | #ifdef DEBUG |
128 | { | 128 | { |
129 | int j; | 129 | int j; |
130 | DBG(KERN_DEBUG "%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot); | 130 | DBG(KERN_DEBUG "%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot); |
131 | for(j=0; j<4; j++) | 131 | for (j = 0; j < 4; j++) |
132 | DBG(" %d:%02x/%04x", j, e->irq[j].link, e->irq[j].bitmap); | 132 | DBG(" %d:%02x/%04x", j, e->irq[j].link, e->irq[j].bitmap); |
133 | DBG("\n"); | 133 | DBG("\n"); |
134 | } | 134 | } |
135 | #endif | 135 | #endif |
136 | busmap[e->bus] = 1; | 136 | busmap[e->bus] = 1; |
137 | } | 137 | } |
138 | for(i = 1; i < 256; i++) { | 138 | for (i = 1; i < 256; i++) { |
139 | int node; | 139 | int node; |
140 | if (!busmap[i] || pci_find_bus(0, i)) | 140 | if (!busmap[i] || pci_find_bus(0, i)) |
141 | continue; | 141 | continue; |
@@ -285,7 +285,7 @@ static int pirq_ite_get(struct pci_dev *router, struct pci_dev *dev, int pirq) | |||
285 | static const unsigned char pirqmap[4] = { 1, 0, 2, 3 }; | 285 | static const unsigned char pirqmap[4] = { 1, 0, 2, 3 }; |
286 | 286 | ||
287 | WARN_ON_ONCE(pirq > 4); | 287 | WARN_ON_ONCE(pirq > 4); |
288 | return read_config_nybble(router,0x43, pirqmap[pirq-1]); | 288 | return read_config_nybble(router, 0x43, pirqmap[pirq-1]); |
289 | } | 289 | } |
290 | 290 | ||
291 | static int pirq_ite_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) | 291 | static int pirq_ite_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) |
@@ -314,7 +314,7 @@ static int pirq_opti_set(struct pci_dev *router, struct pci_dev *dev, int pirq, | |||
314 | 314 | ||
315 | /* | 315 | /* |
316 | * Cyrix: nibble offset 0x5C | 316 | * Cyrix: nibble offset 0x5C |
317 | * 0x5C bits 7:4 is INTB bits 3:0 is INTA | 317 | * 0x5C bits 7:4 is INTB bits 3:0 is INTA |
318 | * 0x5D bits 7:4 is INTD bits 3:0 is INTC | 318 | * 0x5D bits 7:4 is INTD bits 3:0 is INTC |
319 | */ | 319 | */ |
320 | static int pirq_cyrix_get(struct pci_dev *router, struct pci_dev *dev, int pirq) | 320 | static int pirq_cyrix_get(struct pci_dev *router, struct pci_dev *dev, int pirq) |
@@ -350,7 +350,7 @@ static int pirq_cyrix_set(struct pci_dev *router, struct pci_dev *dev, int pirq, | |||
350 | * Apparently there are systems implementing PCI routing table using | 350 | * Apparently there are systems implementing PCI routing table using |
351 | * link values 0x01-0x04 and others using 0x41-0x44 for PCI INTA..D. | 351 | * link values 0x01-0x04 and others using 0x41-0x44 for PCI INTA..D. |
352 | * We try our best to handle both link mappings. | 352 | * We try our best to handle both link mappings. |
353 | * | 353 | * |
354 | * Currently (2003-05-21) it appears most SiS chipsets follow the | 354 | * Currently (2003-05-21) it appears most SiS chipsets follow the |
355 | * definition of routing registers from the SiS-5595 southbridge. | 355 | * definition of routing registers from the SiS-5595 southbridge. |
356 | * According to the SiS 5595 datasheets the revision id's of the | 356 | * According to the SiS 5595 datasheets the revision id's of the |
@@ -370,7 +370,7 @@ static int pirq_cyrix_set(struct pci_dev *router, struct pci_dev *dev, int pirq, | |||
370 | * | 370 | * |
371 | * 0x62: USBIRQ: | 371 | * 0x62: USBIRQ: |
372 | * bit 6 OHCI function disabled (0), enabled (1) | 372 | * bit 6 OHCI function disabled (0), enabled (1) |
373 | * | 373 | * |
374 | * 0x6a: ACPI/SCI IRQ: bits 4-6 reserved | 374 | * 0x6a: ACPI/SCI IRQ: bits 4-6 reserved |
375 | * | 375 | * |
376 | * 0x7e: Data Acq. Module IRQ - bits 4-6 reserved | 376 | * 0x7e: Data Acq. Module IRQ - bits 4-6 reserved |
@@ -487,9 +487,7 @@ static int pirq_amd756_get(struct pci_dev *router, struct pci_dev *dev, int pirq | |||
487 | u8 irq; | 487 | u8 irq; |
488 | irq = 0; | 488 | irq = 0; |
489 | if (pirq <= 4) | 489 | if (pirq <= 4) |
490 | { | ||
491 | irq = read_config_nybble(router, 0x56, pirq - 1); | 490 | irq = read_config_nybble(router, 0x56, pirq - 1); |
492 | } | ||
493 | printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d get irq : %2d\n", | 491 | printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d get irq : %2d\n", |
494 | dev->vendor, dev->device, pirq, irq); | 492 | dev->vendor, dev->device, pirq, irq); |
495 | return irq; | 493 | return irq; |
@@ -497,12 +495,10 @@ static int pirq_amd756_get(struct pci_dev *router, struct pci_dev *dev, int pirq | |||
497 | 495 | ||
498 | static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) | 496 | static int pirq_amd756_set(struct pci_dev *router, struct pci_dev *dev, int pirq, int irq) |
499 | { | 497 | { |
500 | printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d SET irq : %2d\n", | 498 | printk(KERN_INFO "AMD756: dev %04x:%04x, router pirq : %d SET irq : %2d\n", |
501 | dev->vendor, dev->device, pirq, irq); | 499 | dev->vendor, dev->device, pirq, irq); |
502 | if (pirq <= 4) | 500 | if (pirq <= 4) |
503 | { | ||
504 | write_config_nybble(router, 0x56, pirq - 1, irq); | 501 | write_config_nybble(router, 0x56, pirq - 1, irq); |
505 | } | ||
506 | return 1; | 502 | return 1; |
507 | } | 503 | } |
508 | 504 | ||
@@ -549,50 +545,49 @@ static __init int intel_router_probe(struct irq_router *r, struct pci_dev *route | |||
549 | if (pci_dev_present(pirq_440gx)) | 545 | if (pci_dev_present(pirq_440gx)) |
550 | return 0; | 546 | return 0; |
551 | 547 | ||
552 | switch(device) | 548 | switch (device) { |
553 | { | 549 | case PCI_DEVICE_ID_INTEL_82371FB_0: |
554 | case PCI_DEVICE_ID_INTEL_82371FB_0: | 550 | case PCI_DEVICE_ID_INTEL_82371SB_0: |
555 | case PCI_DEVICE_ID_INTEL_82371SB_0: | 551 | case PCI_DEVICE_ID_INTEL_82371AB_0: |
556 | case PCI_DEVICE_ID_INTEL_82371AB_0: | 552 | case PCI_DEVICE_ID_INTEL_82371MX: |
557 | case PCI_DEVICE_ID_INTEL_82371MX: | 553 | case PCI_DEVICE_ID_INTEL_82443MX_0: |
558 | case PCI_DEVICE_ID_INTEL_82443MX_0: | 554 | case PCI_DEVICE_ID_INTEL_82801AA_0: |
559 | case PCI_DEVICE_ID_INTEL_82801AA_0: | 555 | case PCI_DEVICE_ID_INTEL_82801AB_0: |
560 | case PCI_DEVICE_ID_INTEL_82801AB_0: | 556 | case PCI_DEVICE_ID_INTEL_82801BA_0: |
561 | case PCI_DEVICE_ID_INTEL_82801BA_0: | 557 | case PCI_DEVICE_ID_INTEL_82801BA_10: |
562 | case PCI_DEVICE_ID_INTEL_82801BA_10: | 558 | case PCI_DEVICE_ID_INTEL_82801CA_0: |
563 | case PCI_DEVICE_ID_INTEL_82801CA_0: | 559 | case PCI_DEVICE_ID_INTEL_82801CA_12: |
564 | case PCI_DEVICE_ID_INTEL_82801CA_12: | 560 | case PCI_DEVICE_ID_INTEL_82801DB_0: |
565 | case PCI_DEVICE_ID_INTEL_82801DB_0: | 561 | case PCI_DEVICE_ID_INTEL_82801E_0: |
566 | case PCI_DEVICE_ID_INTEL_82801E_0: | 562 | case PCI_DEVICE_ID_INTEL_82801EB_0: |
567 | case PCI_DEVICE_ID_INTEL_82801EB_0: | 563 | case PCI_DEVICE_ID_INTEL_ESB_1: |
568 | case PCI_DEVICE_ID_INTEL_ESB_1: | 564 | case PCI_DEVICE_ID_INTEL_ICH6_0: |
569 | case PCI_DEVICE_ID_INTEL_ICH6_0: | 565 | case PCI_DEVICE_ID_INTEL_ICH6_1: |
570 | case PCI_DEVICE_ID_INTEL_ICH6_1: | 566 | case PCI_DEVICE_ID_INTEL_ICH7_0: |
571 | case PCI_DEVICE_ID_INTEL_ICH7_0: | 567 | case PCI_DEVICE_ID_INTEL_ICH7_1: |
572 | case PCI_DEVICE_ID_INTEL_ICH7_1: | 568 | case PCI_DEVICE_ID_INTEL_ICH7_30: |
573 | case PCI_DEVICE_ID_INTEL_ICH7_30: | 569 | case PCI_DEVICE_ID_INTEL_ICH7_31: |
574 | case PCI_DEVICE_ID_INTEL_ICH7_31: | 570 | case PCI_DEVICE_ID_INTEL_ESB2_0: |
575 | case PCI_DEVICE_ID_INTEL_ESB2_0: | 571 | case PCI_DEVICE_ID_INTEL_ICH8_0: |
576 | case PCI_DEVICE_ID_INTEL_ICH8_0: | 572 | case PCI_DEVICE_ID_INTEL_ICH8_1: |
577 | case PCI_DEVICE_ID_INTEL_ICH8_1: | 573 | case PCI_DEVICE_ID_INTEL_ICH8_2: |
578 | case PCI_DEVICE_ID_INTEL_ICH8_2: | 574 | case PCI_DEVICE_ID_INTEL_ICH8_3: |
579 | case PCI_DEVICE_ID_INTEL_ICH8_3: | 575 | case PCI_DEVICE_ID_INTEL_ICH8_4: |
580 | case PCI_DEVICE_ID_INTEL_ICH8_4: | 576 | case PCI_DEVICE_ID_INTEL_ICH9_0: |
581 | case PCI_DEVICE_ID_INTEL_ICH9_0: | 577 | case PCI_DEVICE_ID_INTEL_ICH9_1: |
582 | case PCI_DEVICE_ID_INTEL_ICH9_1: | 578 | case PCI_DEVICE_ID_INTEL_ICH9_2: |
583 | case PCI_DEVICE_ID_INTEL_ICH9_2: | 579 | case PCI_DEVICE_ID_INTEL_ICH9_3: |
584 | case PCI_DEVICE_ID_INTEL_ICH9_3: | 580 | case PCI_DEVICE_ID_INTEL_ICH9_4: |
585 | case PCI_DEVICE_ID_INTEL_ICH9_4: | 581 | case PCI_DEVICE_ID_INTEL_ICH9_5: |
586 | case PCI_DEVICE_ID_INTEL_ICH9_5: | 582 | case PCI_DEVICE_ID_INTEL_TOLAPAI_0: |
587 | case PCI_DEVICE_ID_INTEL_TOLAPAI_0: | 583 | case PCI_DEVICE_ID_INTEL_ICH10_0: |
588 | case PCI_DEVICE_ID_INTEL_ICH10_0: | 584 | case PCI_DEVICE_ID_INTEL_ICH10_1: |
589 | case PCI_DEVICE_ID_INTEL_ICH10_1: | 585 | case PCI_DEVICE_ID_INTEL_ICH10_2: |
590 | case PCI_DEVICE_ID_INTEL_ICH10_2: | 586 | case PCI_DEVICE_ID_INTEL_ICH10_3: |
591 | case PCI_DEVICE_ID_INTEL_ICH10_3: | 587 | r->name = "PIIX/ICH"; |
592 | r->name = "PIIX/ICH"; | 588 | r->get = pirq_piix_get; |
593 | r->get = pirq_piix_get; | 589 | r->set = pirq_piix_set; |
594 | r->set = pirq_piix_set; | 590 | return 1; |
595 | return 1; | ||
596 | } | 591 | } |
597 | return 0; | 592 | return 0; |
598 | } | 593 | } |
@@ -606,7 +601,7 @@ static __init int via_router_probe(struct irq_router *r, | |||
606 | * workarounds for some buggy BIOSes | 601 | * workarounds for some buggy BIOSes |
607 | */ | 602 | */ |
608 | if (device == PCI_DEVICE_ID_VIA_82C586_0) { | 603 | if (device == PCI_DEVICE_ID_VIA_82C586_0) { |
609 | switch(router->device) { | 604 | switch (router->device) { |
610 | case PCI_DEVICE_ID_VIA_82C686: | 605 | case PCI_DEVICE_ID_VIA_82C686: |
611 | /* | 606 | /* |
612 | * Asus k7m bios wrongly reports 82C686A | 607 | * Asus k7m bios wrongly reports 82C686A |
@@ -631,7 +626,7 @@ static __init int via_router_probe(struct irq_router *r, | |||
631 | } | 626 | } |
632 | } | 627 | } |
633 | 628 | ||
634 | switch(device) { | 629 | switch (device) { |
635 | case PCI_DEVICE_ID_VIA_82C586_0: | 630 | case PCI_DEVICE_ID_VIA_82C586_0: |
636 | r->name = "VIA"; | 631 | r->name = "VIA"; |
637 | r->get = pirq_via586_get; | 632 | r->get = pirq_via586_get; |
@@ -654,13 +649,12 @@ static __init int via_router_probe(struct irq_router *r, | |||
654 | 649 | ||
655 | static __init int vlsi_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 650 | static __init int vlsi_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
656 | { | 651 | { |
657 | switch(device) | 652 | switch (device) { |
658 | { | 653 | case PCI_DEVICE_ID_VLSI_82C534: |
659 | case PCI_DEVICE_ID_VLSI_82C534: | 654 | r->name = "VLSI 82C534"; |
660 | r->name = "VLSI 82C534"; | 655 | r->get = pirq_vlsi_get; |
661 | r->get = pirq_vlsi_get; | 656 | r->set = pirq_vlsi_set; |
662 | r->set = pirq_vlsi_set; | 657 | return 1; |
663 | return 1; | ||
664 | } | 658 | } |
665 | return 0; | 659 | return 0; |
666 | } | 660 | } |
@@ -668,14 +662,13 @@ static __init int vlsi_router_probe(struct irq_router *r, struct pci_dev *router | |||
668 | 662 | ||
669 | static __init int serverworks_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 663 | static __init int serverworks_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
670 | { | 664 | { |
671 | switch(device) | 665 | switch (device) { |
672 | { | 666 | case PCI_DEVICE_ID_SERVERWORKS_OSB4: |
673 | case PCI_DEVICE_ID_SERVERWORKS_OSB4: | 667 | case PCI_DEVICE_ID_SERVERWORKS_CSB5: |
674 | case PCI_DEVICE_ID_SERVERWORKS_CSB5: | 668 | r->name = "ServerWorks"; |
675 | r->name = "ServerWorks"; | 669 | r->get = pirq_serverworks_get; |
676 | r->get = pirq_serverworks_get; | 670 | r->set = pirq_serverworks_set; |
677 | r->set = pirq_serverworks_set; | 671 | return 1; |
678 | return 1; | ||
679 | } | 672 | } |
680 | return 0; | 673 | return 0; |
681 | } | 674 | } |
@@ -684,7 +677,7 @@ static __init int sis_router_probe(struct irq_router *r, struct pci_dev *router, | |||
684 | { | 677 | { |
685 | if (device != PCI_DEVICE_ID_SI_503) | 678 | if (device != PCI_DEVICE_ID_SI_503) |
686 | return 0; | 679 | return 0; |
687 | 680 | ||
688 | r->name = "SIS"; | 681 | r->name = "SIS"; |
689 | r->get = pirq_sis_get; | 682 | r->get = pirq_sis_get; |
690 | r->set = pirq_sis_set; | 683 | r->set = pirq_sis_set; |
@@ -693,47 +686,43 @@ static __init int sis_router_probe(struct irq_router *r, struct pci_dev *router, | |||
693 | 686 | ||
694 | static __init int cyrix_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 687 | static __init int cyrix_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
695 | { | 688 | { |
696 | switch(device) | 689 | switch (device) { |
697 | { | 690 | case PCI_DEVICE_ID_CYRIX_5520: |
698 | case PCI_DEVICE_ID_CYRIX_5520: | 691 | r->name = "NatSemi"; |
699 | r->name = "NatSemi"; | 692 | r->get = pirq_cyrix_get; |
700 | r->get = pirq_cyrix_get; | 693 | r->set = pirq_cyrix_set; |
701 | r->set = pirq_cyrix_set; | 694 | return 1; |
702 | return 1; | ||
703 | } | 695 | } |
704 | return 0; | 696 | return 0; |
705 | } | 697 | } |
706 | 698 | ||
707 | static __init int opti_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 699 | static __init int opti_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
708 | { | 700 | { |
709 | switch(device) | 701 | switch (device) { |
710 | { | 702 | case PCI_DEVICE_ID_OPTI_82C700: |
711 | case PCI_DEVICE_ID_OPTI_82C700: | 703 | r->name = "OPTI"; |
712 | r->name = "OPTI"; | 704 | r->get = pirq_opti_get; |
713 | r->get = pirq_opti_get; | 705 | r->set = pirq_opti_set; |
714 | r->set = pirq_opti_set; | 706 | return 1; |
715 | return 1; | ||
716 | } | 707 | } |
717 | return 0; | 708 | return 0; |
718 | } | 709 | } |
719 | 710 | ||
720 | static __init int ite_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 711 | static __init int ite_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
721 | { | 712 | { |
722 | switch(device) | 713 | switch (device) { |
723 | { | 714 | case PCI_DEVICE_ID_ITE_IT8330G_0: |
724 | case PCI_DEVICE_ID_ITE_IT8330G_0: | 715 | r->name = "ITE"; |
725 | r->name = "ITE"; | 716 | r->get = pirq_ite_get; |
726 | r->get = pirq_ite_get; | 717 | r->set = pirq_ite_set; |
727 | r->set = pirq_ite_set; | 718 | return 1; |
728 | return 1; | ||
729 | } | 719 | } |
730 | return 0; | 720 | return 0; |
731 | } | 721 | } |
732 | 722 | ||
733 | static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 723 | static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
734 | { | 724 | { |
735 | switch(device) | 725 | switch (device) { |
736 | { | ||
737 | case PCI_DEVICE_ID_AL_M1533: | 726 | case PCI_DEVICE_ID_AL_M1533: |
738 | case PCI_DEVICE_ID_AL_M1563: | 727 | case PCI_DEVICE_ID_AL_M1563: |
739 | printk(KERN_DEBUG "PCI: Using ALI IRQ Router\n"); | 728 | printk(KERN_DEBUG "PCI: Using ALI IRQ Router\n"); |
@@ -747,25 +736,24 @@ static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, | |||
747 | 736 | ||
748 | static __init int amd_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 737 | static __init int amd_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
749 | { | 738 | { |
750 | switch(device) | 739 | switch (device) { |
751 | { | 740 | case PCI_DEVICE_ID_AMD_VIPER_740B: |
752 | case PCI_DEVICE_ID_AMD_VIPER_740B: | 741 | r->name = "AMD756"; |
753 | r->name = "AMD756"; | 742 | break; |
754 | break; | 743 | case PCI_DEVICE_ID_AMD_VIPER_7413: |
755 | case PCI_DEVICE_ID_AMD_VIPER_7413: | 744 | r->name = "AMD766"; |
756 | r->name = "AMD766"; | 745 | break; |
757 | break; | 746 | case PCI_DEVICE_ID_AMD_VIPER_7443: |
758 | case PCI_DEVICE_ID_AMD_VIPER_7443: | 747 | r->name = "AMD768"; |
759 | r->name = "AMD768"; | 748 | break; |
760 | break; | 749 | default: |
761 | default: | 750 | return 0; |
762 | return 0; | ||
763 | } | 751 | } |
764 | r->get = pirq_amd756_get; | 752 | r->get = pirq_amd756_get; |
765 | r->set = pirq_amd756_set; | 753 | r->set = pirq_amd756_set; |
766 | return 1; | 754 | return 1; |
767 | } | 755 | } |
768 | 756 | ||
769 | static __init int pico_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) | 757 | static __init int pico_router_probe(struct irq_router *r, struct pci_dev *router, u16 device) |
770 | { | 758 | { |
771 | switch (device) { | 759 | switch (device) { |
@@ -807,7 +795,7 @@ static struct pci_dev *pirq_router_dev; | |||
807 | * FIXME: should we have an option to say "generic for | 795 | * FIXME: should we have an option to say "generic for |
808 | * chipset" ? | 796 | * chipset" ? |
809 | */ | 797 | */ |
810 | 798 | ||
811 | static void __init pirq_find_router(struct irq_router *r) | 799 | static void __init pirq_find_router(struct irq_router *r) |
812 | { | 800 | { |
813 | struct irq_routing_table *rt = pirq_table; | 801 | struct irq_routing_table *rt = pirq_table; |
@@ -826,7 +814,7 @@ static void __init pirq_find_router(struct irq_router *r) | |||
826 | r->name = "default"; | 814 | r->name = "default"; |
827 | r->get = NULL; | 815 | r->get = NULL; |
828 | r->set = NULL; | 816 | r->set = NULL; |
829 | 817 | ||
830 | DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for %04x:%04x\n", | 818 | DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for %04x:%04x\n", |
831 | rt->rtr_vendor, rt->rtr_device); | 819 | rt->rtr_vendor, rt->rtr_device); |
832 | 820 | ||
@@ -837,7 +825,7 @@ static void __init pirq_find_router(struct irq_router *r) | |||
837 | return; | 825 | return; |
838 | } | 826 | } |
839 | 827 | ||
840 | for( h = pirq_routers; h->vendor; h++) { | 828 | for (h = pirq_routers; h->vendor; h++) { |
841 | /* First look for a router match */ | 829 | /* First look for a router match */ |
842 | if (rt->rtr_vendor == h->vendor && h->probe(r, pirq_router_dev, rt->rtr_device)) | 830 | if (rt->rtr_vendor == h->vendor && h->probe(r, pirq_router_dev, rt->rtr_device)) |
843 | break; | 831 | break; |
@@ -889,7 +877,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
889 | 877 | ||
890 | if (!pirq_table) | 878 | if (!pirq_table) |
891 | return 0; | 879 | return 0; |
892 | 880 | ||
893 | DBG(KERN_DEBUG "IRQ for %s[%c]", pci_name(dev), 'A' + pin); | 881 | DBG(KERN_DEBUG "IRQ for %s[%c]", pci_name(dev), 'A' + pin); |
894 | info = pirq_get_info(dev); | 882 | info = pirq_get_info(dev); |
895 | if (!info) { | 883 | if (!info) { |
@@ -928,8 +916,10 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
928 | */ | 916 | */ |
929 | newirq = dev->irq; | 917 | newirq = dev->irq; |
930 | if (newirq && !((1 << newirq) & mask)) { | 918 | if (newirq && !((1 << newirq) & mask)) { |
931 | if ( pci_probe & PCI_USE_PIRQ_MASK) newirq = 0; | 919 | if (pci_probe & PCI_USE_PIRQ_MASK) |
932 | else printk("\n" KERN_WARNING | 920 | newirq = 0; |
921 | else | ||
922 | printk("\n" KERN_WARNING | ||
933 | "PCI: IRQ %i for device %s doesn't match PIRQ mask " | 923 | "PCI: IRQ %i for device %s doesn't match PIRQ mask " |
934 | "- try pci=usepirqmask\n" KERN_DEBUG, newirq, | 924 | "- try pci=usepirqmask\n" KERN_DEBUG, newirq, |
935 | pci_name(dev)); | 925 | pci_name(dev)); |
@@ -949,8 +939,8 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
949 | irq = pirq & 0xf; | 939 | irq = pirq & 0xf; |
950 | DBG(" -> hardcoded IRQ %d\n", irq); | 940 | DBG(" -> hardcoded IRQ %d\n", irq); |
951 | msg = "Hardcoded"; | 941 | msg = "Hardcoded"; |
952 | } else if ( r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \ | 942 | } else if (r->get && (irq = r->get(pirq_router_dev, dev, pirq)) && \ |
953 | ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask)) ) { | 943 | ((!(pci_probe & PCI_USE_PIRQ_MASK)) || ((1 << irq) & mask))) { |
954 | DBG(" -> got IRQ %d\n", irq); | 944 | DBG(" -> got IRQ %d\n", irq); |
955 | msg = "Found"; | 945 | msg = "Found"; |
956 | eisa_set_level_irq(irq); | 946 | eisa_set_level_irq(irq); |
@@ -985,15 +975,15 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
985 | continue; | 975 | continue; |
986 | if (info->irq[pin].link == pirq) { | 976 | if (info->irq[pin].link == pirq) { |
987 | /* We refuse to override the dev->irq information. Give a warning! */ | 977 | /* We refuse to override the dev->irq information. Give a warning! */ |
988 | if ( dev2->irq && dev2->irq != irq && \ | 978 | if (dev2->irq && dev2->irq != irq && \ |
989 | (!(pci_probe & PCI_USE_PIRQ_MASK) || \ | 979 | (!(pci_probe & PCI_USE_PIRQ_MASK) || \ |
990 | ((1 << dev2->irq) & mask)) ) { | 980 | ((1 << dev2->irq) & mask))) { |
991 | #ifndef CONFIG_PCI_MSI | 981 | #ifndef CONFIG_PCI_MSI |
992 | printk(KERN_INFO "IRQ routing conflict for %s, have irq %d, want irq %d\n", | 982 | printk(KERN_INFO "IRQ routing conflict for %s, have irq %d, want irq %d\n", |
993 | pci_name(dev2), dev2->irq, irq); | 983 | pci_name(dev2), dev2->irq, irq); |
994 | #endif | 984 | #endif |
995 | continue; | 985 | continue; |
996 | } | 986 | } |
997 | dev2->irq = irq; | 987 | dev2->irq = irq; |
998 | pirq_penalty[irq]++; | 988 | pirq_penalty[irq]++; |
999 | if (dev != dev2) | 989 | if (dev != dev2) |
@@ -1031,8 +1021,7 @@ static void __init pcibios_fixup_irqs(void) | |||
1031 | /* | 1021 | /* |
1032 | * Recalculate IRQ numbers if we use the I/O APIC. | 1022 | * Recalculate IRQ numbers if we use the I/O APIC. |
1033 | */ | 1023 | */ |
1034 | if (io_apic_assign_pci_irqs) | 1024 | if (io_apic_assign_pci_irqs) { |
1035 | { | ||
1036 | int irq; | 1025 | int irq; |
1037 | 1026 | ||
1038 | if (pin) { | 1027 | if (pin) { |
@@ -1045,10 +1034,10 @@ static void __init pcibios_fixup_irqs(void) | |||
1045 | * busses itself so we should get into this branch reliably. | 1034 | * busses itself so we should get into this branch reliably. |
1046 | */ | 1035 | */ |
1047 | if (irq < 0 && dev->bus->parent) { /* go back to the bridge */ | 1036 | if (irq < 0 && dev->bus->parent) { /* go back to the bridge */ |
1048 | struct pci_dev * bridge = dev->bus->self; | 1037 | struct pci_dev *bridge = dev->bus->self; |
1049 | 1038 | ||
1050 | pin = (pin + PCI_SLOT(dev->devfn)) % 4; | 1039 | pin = (pin + PCI_SLOT(dev->devfn)) % 4; |
1051 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, | 1040 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, |
1052 | PCI_SLOT(bridge->devfn), pin); | 1041 | PCI_SLOT(bridge->devfn), pin); |
1053 | if (irq >= 0) | 1042 | if (irq >= 0) |
1054 | printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n", | 1043 | printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n", |
@@ -1138,7 +1127,7 @@ static int __init pcibios_irq_init(void) | |||
1138 | pirq_find_router(&pirq_router); | 1127 | pirq_find_router(&pirq_router); |
1139 | if (pirq_table->exclusive_irqs) { | 1128 | if (pirq_table->exclusive_irqs) { |
1140 | int i; | 1129 | int i; |
1141 | for (i=0; i<16; i++) | 1130 | for (i = 0; i < 16; i++) |
1142 | if (!(pirq_table->exclusive_irqs & (1 << i))) | 1131 | if (!(pirq_table->exclusive_irqs & (1 << i))) |
1143 | pirq_penalty[i] += 100; | 1132 | pirq_penalty[i] += 100; |
1144 | } | 1133 | } |
@@ -1203,10 +1192,10 @@ static int pirq_enable_irq(struct pci_dev *dev) | |||
1203 | */ | 1192 | */ |
1204 | temp_dev = dev; | 1193 | temp_dev = dev; |
1205 | while (irq < 0 && dev->bus->parent) { /* go back to the bridge */ | 1194 | while (irq < 0 && dev->bus->parent) { /* go back to the bridge */ |
1206 | struct pci_dev * bridge = dev->bus->self; | 1195 | struct pci_dev *bridge = dev->bus->self; |
1207 | 1196 | ||
1208 | pin = (pin + PCI_SLOT(dev->devfn)) % 4; | 1197 | pin = (pin + PCI_SLOT(dev->devfn)) % 4; |
1209 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, | 1198 | irq = IO_APIC_get_PCI_irq_vector(bridge->bus->number, |
1210 | PCI_SLOT(bridge->devfn), pin); | 1199 | PCI_SLOT(bridge->devfn), pin); |
1211 | if (irq >= 0) | 1200 | if (irq >= 0) |
1212 | printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n", | 1201 | printk(KERN_WARNING "PCI: using PPB %s[%c] to get irq %d\n", |
diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 0cfebecf2a8f..23faaa890ffc 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c | |||
@@ -374,7 +374,7 @@ reject: | |||
374 | 374 | ||
375 | static int __initdata known_bridge; | 375 | static int __initdata known_bridge; |
376 | 376 | ||
377 | void __init __pci_mmcfg_init(int early) | 377 | static void __init __pci_mmcfg_init(int early) |
378 | { | 378 | { |
379 | /* MMCONFIG disabled */ | 379 | /* MMCONFIG disabled */ |
380 | if ((pci_probe & PCI_PROBE_MMCONF) == 0) | 380 | if ((pci_probe & PCI_PROBE_MMCONF) == 0) |
diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h index 720c4c554534..ba263e626a68 100644 --- a/arch/x86/pci/pci.h +++ b/arch/x86/pci/pci.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #define PCI_CAN_SKIP_ISA_ALIGN 0x8000 | 27 | #define PCI_CAN_SKIP_ISA_ALIGN 0x8000 |
28 | #define PCI_USE__CRS 0x10000 | 28 | #define PCI_USE__CRS 0x10000 |
29 | #define PCI_CHECK_ENABLE_AMD_MMCONF 0x20000 | 29 | #define PCI_CHECK_ENABLE_AMD_MMCONF 0x20000 |
30 | #define PCI_HAS_IO_ECS 0x40000 | ||
30 | 31 | ||
31 | extern unsigned int pci_probe; | 32 | extern unsigned int pci_probe; |
32 | extern unsigned long pirq_table_addr; | 33 | extern unsigned long pirq_table_addr; |