Import changeset
[linux-flexiantxendom0-3.2.10.git] / arch / arm / mach-footbridge / cats-pci.c
1 /*
2  * linux/arch/arm/mach-footbridge/cats-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
15 /* cats host-specific stuff */
16 static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 };
17
18 static int __init cats_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
19 {
20         if (dev->irq >= 128)
21                 return dev->irq & 0x1f;
22
23         if (dev->irq >= 1 && dev->irq <= 4)
24                 return irqmap_cats[dev->irq - 1];
25
26         if (dev->irq != 0)
27                 printk("PCI: device %02x:%02x has unknown irq line %x\n",
28                        dev->bus->number, dev->devfn, dev->irq);
29
30         return -1;
31 }
32
33 struct hw_pci cats_pci __initdata = {
34         init:           dc21285_init,
35         swizzle:        no_swizzle,
36         map_irq:        cats_map_irq,
37 };