Path: blob/master/arch/arm/mach-footbridge/cats-pci.c
10817 views
/*1* linux/arch/arm/mach-footbridge/cats-pci.c2*3* PCI bios-type initialisation for PCI machines4*5* Bits taken from various places.6*/7#include <linux/kernel.h>8#include <linux/pci.h>9#include <linux/init.h>1011#include <asm/irq.h>12#include <asm/mach/pci.h>13#include <asm/mach-types.h>1415/* cats host-specific stuff */16static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 };1718static int __init cats_map_irq(struct pci_dev *dev, u8 slot, u8 pin)19{20if (dev->irq >= 255)21return -1; /* not a valid interrupt. */2223if (dev->irq >= 128)24return dev->irq & 0x1f;2526if (dev->irq >= 1 && dev->irq <= 4)27return irqmap_cats[dev->irq - 1];2829if (dev->irq != 0)30printk("PCI: device %02x:%02x has unknown irq line %x\n",31dev->bus->number, dev->devfn, dev->irq);3233return -1;34}3536/*37* why not the standard PCI swizzle? does this prevent 4-port tulip38* cards being used (ie, pci-pci bridge based cards)?39*/40static struct hw_pci cats_pci __initdata = {41.swizzle = NULL,42.map_irq = cats_map_irq,43.nr_controllers = 1,44.setup = dc21285_setup,45.scan = dc21285_scan_bus,46.preinit = dc21285_preinit,47.postinit = dc21285_postinit,48};4950static int __init cats_pci_init(void)51{52if (machine_is_cats())53pci_common_init(&cats_pci);54return 0;55}5657subsys_initcall(cats_pci_init);585960