Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-footbridge/ebsa285-pci.c |
| 3 | * |
| 4 | * PCI bios-type initialisation for PCI machines |
| 5 | * |
| 6 | * Bits taken from various places. |
| 7 | */ |
| 8 | #include <linux/kernel.h> |
| 9 | #include <linux/pci.h> |
| 10 | #include <linux/init.h> |
| 11 | |
| 12 | #include <asm/irq.h> |
| 13 | #include <asm/mach/pci.h> |
| 14 | #include <asm/mach-types.h> |
| 15 | |
| 16 | static int irqmap_ebsa285[] __initdata = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI }; |
| 17 | |
Ralf Baechle | d534194 | 2011-06-10 15:30:21 +0100 | [diff] [blame] | 18 | static int __init ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | { |
| 20 | if (dev->vendor == PCI_VENDOR_ID_CONTAQ && |
| 21 | dev->device == PCI_DEVICE_ID_CONTAQ_82C693) |
| 22 | switch (PCI_FUNC(dev->devfn)) { |
Andrea Gelmini | 49b95e2 | 2010-05-23 21:55:44 +0200 | [diff] [blame] | 23 | case 1: return 14; |
| 24 | case 2: return 15; |
| 25 | case 3: return 12; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | return irqmap_ebsa285[(slot + pin) & 3]; |
| 29 | } |
| 30 | |
| 31 | static struct hw_pci ebsa285_pci __initdata = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | .map_irq = ebsa285_map_irq, |
| 33 | .nr_controllers = 1, |
Russell King | c23bfc3 | 2012-03-10 12:49:16 +0000 | [diff] [blame] | 34 | .ops = &dc21285_ops, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | .setup = dc21285_setup, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | .preinit = dc21285_preinit, |
| 37 | .postinit = dc21285_postinit, |
| 38 | }; |
| 39 | |
| 40 | static int __init ebsa285_init_pci(void) |
| 41 | { |
| 42 | if (machine_is_ebsa285()) |
| 43 | pci_common_init(&ebsa285_pci); |
| 44 | return 0; |
| 45 | } |
| 46 | |
| 47 | subsys_initcall(ebsa285_init_pci); |