2 * linux/arch/arm/kernel/ftv-pci.c
4 * PCI bios-type initialisation for PCI machines
6 * Bits taken from various places.
8 #include <linux/kernel.h>
10 #include <linux/init.h>
13 #include <asm/mach/pci.h>
14 #include <asm/mach-types.h>
17 * Owing to a PCB cockup, issue A backplanes are wired thus:
19 * Slot 1 2 3 4 5 Bridge S1 S2 S3 S4
20 * IRQ D C B A A C B A D
25 * ID A31 A30 A29 A28 A27 A26 DEV4 DEV5 DEV6 DEV7
27 * Actually, this isn't too bad, because with the processor card
28 * in slot 5 on the primary bus, the IRQs rotate on both sides
32 static int irqmap_ftv[] __initdata = { IRQ_PCI_D, IRQ_PCI_C, IRQ_PCI_B, IRQ_PCI_A };
34 static int __init ftv_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
38 return irqmap_ftv[(slot - pin) & 3];
41 static u8 __init ftv_swizzle(struct pci_dev *dev, u8 *pin)
43 return PCI_SLOT(dev->devfn);
46 /* ftv host-specific stuff */
47 static struct hw_pci ftv_pci __initdata = {
49 .swizzle = ftv_swizzle,
50 .map_irq = ftv_map_irq,
53 static int __init ftv_pci_init(void)
55 if (machine_is_ftvpci())
56 pci_common_init(&ftv_pci);
60 subsys_initcall(ftv_pci_init);