aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/pci_64.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-07-31 20:37:25 -0400
committerPaul Mackerras <paulus@samba.org>2006-07-31 20:37:25 -0400
commit57cad8084e0837e0f2c97da789ec9b3f36809be9 (patch)
treee9c790afb4286f78cb08d9664f58baa7e876fe55 /arch/powerpc/kernel/pci_64.c
parentcb18bd40030c879cd93fef02fd579f74dbab473d (diff)
parent49b1e3ea19b1c95c2f012b8331ffb3b169e4c042 (diff)
Merge branch 'merge'
Diffstat (limited to 'arch/powerpc/kernel/pci_64.c')
-rw-r--r--arch/powerpc/kernel/pci_64.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index e795a7e2a38e..d51be7c7a2ef 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -21,13 +21,13 @@
21#include <linux/mm.h> 21#include <linux/mm.h>
22#include <linux/list.h> 22#include <linux/list.h>
23#include <linux/syscalls.h> 23#include <linux/syscalls.h>
24#include <linux/irq.h>
24 25
25#include <asm/processor.h> 26#include <asm/processor.h>
26#include <asm/io.h> 27#include <asm/io.h>
27#include <asm/prom.h> 28#include <asm/prom.h>
28#include <asm/pci-bridge.h> 29#include <asm/pci-bridge.h>
29#include <asm/byteorder.h> 30#include <asm/byteorder.h>
30#include <asm/irq.h>
31#include <asm/machdep.h> 31#include <asm/machdep.h>
32#include <asm/ppc-pci.h> 32#include <asm/ppc-pci.h>
33 33
@@ -1254,15 +1254,37 @@ int pci_read_irq_line(struct pci_dev *pci_dev)
1254 1254
1255 DBG("Try to map irq for %s...\n", pci_name(pci_dev)); 1255 DBG("Try to map irq for %s...\n", pci_name(pci_dev));
1256 1256
1257 /* Try to get a mapping from the device-tree */
1257 if (of_irq_map_pci(pci_dev, &oirq)) { 1258 if (of_irq_map_pci(pci_dev, &oirq)) {
1258 DBG(" -> failed !\n"); 1259 u8 line, pin;
1259 return -1; 1260
1260 } 1261 /* If that fails, lets fallback to what is in the config
1262 * space and map that through the default controller. We
1263 * also set the type to level low since that's what PCI
1264 * interrupts are. If your platform does differently, then
1265 * either provide a proper interrupt tree or don't use this
1266 * function.
1267 */
1268 if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &pin))
1269 return -1;
1270 if (pin == 0)
1271 return -1;
1272 if (pci_read_config_byte(pci_dev, PCI_INTERRUPT_LINE, &line) ||
1273 line == 0xff) {
1274 return -1;
1275 }
1276 DBG(" -> no map ! Using irq line %d from PCI config\n", line);
1261 1277
1262 DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", 1278 virq = irq_create_mapping(NULL, line);
1263 oirq.size, oirq.specifier[0], oirq.controller->full_name); 1279 if (virq != NO_IRQ)
1280 set_irq_type(virq, IRQ_TYPE_LEVEL_LOW);
1281 } else {
1282 DBG(" -> got one, spec %d cells (0x%08x...) on %s\n",
1283 oirq.size, oirq.specifier[0], oirq.controller->full_name);
1264 1284
1265 virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size); 1285 virq = irq_create_of_mapping(oirq.controller, oirq.specifier,
1286 oirq.size);
1287 }
1266 if(virq == NO_IRQ) { 1288 if(virq == NO_IRQ) {
1267 DBG(" -> failed to map !\n"); 1289 DBG(" -> failed to map !\n");
1268 return -1; 1290 return -1;