diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-03 18:28:34 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-03 18:28:34 -0400 |
commit | 912b2539e1e062cec73e2e61448e507f7719bd08 (patch) | |
tree | 233807569ee5e0ab3118dd54c0ae9164fec8343e /arch/powerpc/kernel/pci_64.c | |
parent | 70b97a7f0b19cf1f2619deb5cc41e8b78c591aa7 (diff) | |
parent | 39ab9c212aac48f2744f2fd7722fa639ec048eb7 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
powerpc: add defconfig for Freescale MPC8349E-mITX board
powerpc: Add base support for the Freescale MPC8349E-mITX eval board
Documentation: correct values in MPC8548E SEC example node
[POWERPC] Actually copy over i8259.c to arch/ppc/syslib this time
[POWERPC] Add new interrupt mapping core and change platforms to use it
[POWERPC] Copy i8259 code back to arch/ppc
[POWERPC] New device-tree interrupt parsing code
[POWERPC] Use the genirq framework
[PATCH] genirq: Allow fasteoi handler to retrigger disabled interrupts
[POWERPC] Update the SWIM3 (powermac) floppy driver
[POWERPC] Fix error handling in detecting legacy serial ports
[POWERPC] Fix booting on Momentum "Apache" board (a Maple derivative)
[POWERPC] Fix various offb and BootX-related issues
[POWERPC] Add a default config for 32-bit CHRP machines
[POWERPC] fix implicit declaration on cell.
[POWERPC] change get_property to return void *
Diffstat (limited to 'arch/powerpc/kernel/pci_64.c')
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index bea8451fb57b..efc0b5559ee0 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -398,12 +398,8 @@ struct pci_dev *of_create_pci_dev(struct device_node *node, | |||
398 | } else { | 398 | } else { |
399 | dev->hdr_type = PCI_HEADER_TYPE_NORMAL; | 399 | dev->hdr_type = PCI_HEADER_TYPE_NORMAL; |
400 | dev->rom_base_reg = PCI_ROM_ADDRESS; | 400 | dev->rom_base_reg = PCI_ROM_ADDRESS; |
401 | /* Maybe do a default OF mapping here */ | ||
401 | dev->irq = NO_IRQ; | 402 | dev->irq = NO_IRQ; |
402 | if (node->n_intrs > 0) { | ||
403 | dev->irq = node->intrs[0].line; | ||
404 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, | ||
405 | dev->irq); | ||
406 | } | ||
407 | } | 403 | } |
408 | 404 | ||
409 | pci_parse_of_addrs(node, dev); | 405 | pci_parse_of_addrs(node, dev); |
@@ -1288,23 +1284,26 @@ EXPORT_SYMBOL(pcibios_fixup_bus); | |||
1288 | */ | 1284 | */ |
1289 | int pci_read_irq_line(struct pci_dev *pci_dev) | 1285 | int pci_read_irq_line(struct pci_dev *pci_dev) |
1290 | { | 1286 | { |
1291 | u8 intpin; | 1287 | struct of_irq oirq; |
1292 | struct device_node *node; | 1288 | unsigned int virq; |
1293 | |||
1294 | pci_read_config_byte(pci_dev, PCI_INTERRUPT_PIN, &intpin); | ||
1295 | if (intpin == 0) | ||
1296 | return 0; | ||
1297 | 1289 | ||
1298 | node = pci_device_to_OF_node(pci_dev); | 1290 | DBG("Try to map irq for %s...\n", pci_name(pci_dev)); |
1299 | if (node == NULL) | ||
1300 | return -1; | ||
1301 | 1291 | ||
1302 | if (node->n_intrs == 0) | 1292 | if (of_irq_map_pci(pci_dev, &oirq)) { |
1293 | DBG(" -> failed !\n"); | ||
1303 | return -1; | 1294 | return -1; |
1295 | } | ||
1304 | 1296 | ||
1305 | pci_dev->irq = node->intrs[0].line; | 1297 | DBG(" -> got one, spec %d cells (0x%08x...) on %s\n", |
1298 | oirq.size, oirq.specifier[0], oirq.controller->full_name); | ||
1306 | 1299 | ||
1307 | pci_write_config_byte(pci_dev, PCI_INTERRUPT_LINE, pci_dev->irq); | 1300 | virq = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size); |
1301 | if(virq == NO_IRQ) { | ||
1302 | DBG(" -> failed to map !\n"); | ||
1303 | return -1; | ||
1304 | } | ||
1305 | pci_dev->irq = virq; | ||
1306 | pci_write_config_byte(pci_dev, PCI_INTERRUPT_LINE, virq); | ||
1308 | 1307 | ||
1309 | return 0; | 1308 | return 0; |
1310 | } | 1309 | } |