Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #include <linux/kernel.h> |
| 2 | #include <linux/init.h> |
| 3 | #include <linux/types.h> |
| 4 | #include <linux/pci.h> |
Paul Mundt | 58796ce | 2012-05-18 17:42:29 +0900 | [diff] [blame] | 5 | #include <linux/sh_intc.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | |
Ralf Baechle | d534194 | 2011-06-10 15:30:21 +0100 | [diff] [blame] | 7 | int __init pcibios_map_platform_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | { |
| 9 | int irq; |
| 10 | |
| 11 | if (dev->bus->number == 0) { |
| 12 | switch (slot) { |
Paul Mundt | 58796ce | 2012-05-18 17:42:29 +0900 | [diff] [blame] | 13 | case 4: return evt2irq(0x2a0); /* eth0 */ |
| 14 | case 8: return evt2irq(0x2a0); /* eth1 */ |
| 15 | case 6: return evt2irq(0x240); /* PCI bridge */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | default: |
Paul Mundt | 959f85f | 2006-09-27 16:43:28 +0900 | [diff] [blame] | 17 | printk(KERN_ERR "PCI: Bad IRQ mapping request " |
| 18 | "for slot %d\n", slot); |
Paul Mundt | 58796ce | 2012-05-18 17:42:29 +0900 | [diff] [blame] | 19 | return evt2irq(0x240); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | } |
| 21 | } else { |
| 22 | switch (pin) { |
Paul Mundt | 58796ce | 2012-05-18 17:42:29 +0900 | [diff] [blame] | 23 | 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | default: irq = -1; break; |
| 29 | } |
| 30 | } |
| 31 | return irq; |
| 32 | } |