diff options
author | Paul Mackerras <paulus@samba.org> | 2006-07-31 20:37:25 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-07-31 20:37:25 -0400 |
commit | 57cad8084e0837e0f2c97da789ec9b3f36809be9 (patch) | |
tree | e9c790afb4286f78cb08d9664f58baa7e876fe55 /arch/powerpc/kernel/pci_32.c | |
parent | cb18bd40030c879cd93fef02fd579f74dbab473d (diff) | |
parent | 49b1e3ea19b1c95c2f012b8331ffb3b169e4c042 (diff) |
Merge branch 'merge'
Diffstat (limited to 'arch/powerpc/kernel/pci_32.c')
-rw-r--r-- | arch/powerpc/kernel/pci_32.c | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c index 3f6bd36e9e14..9b49f8691d29 100644 --- a/arch/powerpc/kernel/pci_32.c +++ b/arch/powerpc/kernel/pci_32.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/sched.h> | 11 | #include <linux/sched.h> |
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/bootmem.h> | 13 | #include <linux/bootmem.h> |
14 | #include <linux/irq.h> | ||
14 | 15 | ||
15 | #include <asm/processor.h> | 16 | #include <asm/processor.h> |
16 | #include <asm/io.h> | 17 | #include <asm/io.h> |
@@ -18,7 +19,6 @@ | |||
18 | #include <asm/sections.h> | 19 | #include <asm/sections.h> |
19 | #include <asm/pci-bridge.h> | 20 | #include <asm/pci-bridge.h> |
20 | #include <asm/byteorder.h> | 21 | #include <asm/byteorder.h> |
21 | #include <asm/irq.h> | ||
22 | #include <asm/uaccess.h> | 22 | #include <asm/uaccess.h> |
23 | #include <asm/machdep.h> | 23 | #include <asm/machdep.h> |
24 | 24 | ||
@@ -1423,15 +1423,37 @@ int pci_read_irq_line(struct pci_dev *pci_dev) | |||
1423 | 1423 | ||
1424 | DBG("Try to map irq for %s...\n", pci_name(pci_dev)); | 1424 | DBG("Try to map irq for %s...\n", pci_name(pci_dev)); |
1425 | 1425 | ||
1426 | /* Try to get a mapping from the device-tree */ | ||
1426 | if (of_irq_map_pci(pci_dev, &oirq)) { | 1427 | if (of_irq_map_pci(pci_dev, &oirq)) { |
1427 | DBG(" -> failed !\n"); | 1428 | u8 line, pin; |
1428 | return -1; | 1429 | |
1429 | } | 1430 | /* If that fails, lets fallback to what is in the config |
1431 | * space and map that through the default controller. We | ||
1432 | * also set the type to level low since that's what PCI | ||
1433 | * interrupts are. If your platform does differently, then | ||
1434 | * either provide a proper interrupt tree or don't use this | ||
1435 | * function. | ||
1436 | */ | ||
1437 | if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin)) | ||
1438 | return -1; | ||
1439 | if (pin == 0) | ||
1440 | return -1; | ||
1441 | if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) || | ||
1442 | line == 0xff) { | ||
1443 | return -1; | ||
1444 | } | ||
1445 | DBG(" -> no map ! Using irq line %d from PCI config\n", line); | ||
1430 | 1446 | ||
1431 | DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", | 1447 | virq = irq_create_mapping(NULL, line); |
1432 | oirq.size, oirq.specifier[0], oirq.controller->full_name); | 1448 | if (virq != NO_IRQ) |
1449 | set_irq_type(virq, IRQ_TYPE_LEVEL_LOW); | ||
1450 | } else { | ||
1451 | DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", | ||
1452 | oirq.size, oirq.specifier[0], oirq.controller->full_name); | ||
1433 | 1453 | ||
1434 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size); | 1454 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, |
1455 | oirq.size); | ||
1456 | } | ||
1435 | if(virq == NO_IRQ) { | 1457 | if(virq == NO_IRQ) { |
1436 | DBG(" -> failed to map !\n"); | 1458 | DBG(" -> failed to map !\n"); |
1437 | return -1; | 1459 | return -1; |