blob: 16207bef9f52586dee90548d6c472e318dbc3a68 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#include <linux/kernel.h>
2#include <linux/init.h>
3#include <linux/types.h>
4#include <linux/pci.h>
Paul Mundt58796ce2012-05-18 17:42:29 +09005#include <linux/sh_intc.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
Ralf Baechled5341942011-06-10 15:30:21 +01007int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin)
Linus Torvalds1da177e2005-04-16 15:20:36 -07008{
9 int irq;
10
11 if (dev->bus->number == 0) {
12 switch (slot) {
Paul Mundt58796ce2012-05-18 17:42:29 +090013 case 4: return evt2irq(0x2a0); /* eth0 */
14 case 8: return evt2irq(0x2a0); /* eth1 */
15 case 6: return evt2irq(0x240); /* PCI bridge */
Linus Torvalds1da177e2005-04-16 15:20:36 -070016 default:
Paul Mundt959f85f2006-09-27 16:43:28 +090017 printk(KERN_ERR "PCI: Bad IRQ mapping request "
18 "for slot %d\n", slot);
Paul Mundt58796ce2012-05-18 17:42:29 +090019 return evt2irq(0x240);
Linus Torvalds1da177e2005-04-16 15:20:36 -070020 }
21 } else {
22 switch (pin) {
Paul Mundt58796ce2012-05-18 17:42:29 +090023 case 0: irq = evt2irq(0x240); break;
24 case 1: irq = evt2irq(0x240); break;
25 case 2: irq = evt2irq(0x240); break;
26 case 3: irq = evt2irq(0x240); break;
27 case 4: irq = evt2irq(0x240); break;
Linus Torvalds1da177e2005-04-16 15:20:36 -070028 default: irq = -1; break;
29 }
30 }
31 return irq;
32}