cats-pci.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #include <asm/irq.h>
  12. #include <asm/mach/pci.h>
  13. #include <asm/mach-types.h>
  14. /* cats host-specific stuff */
  15. static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 };
  16. static int __init cats_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
  17. {
  18. if (dev->irq >= 128)
  19. return dev->irq & 0x1f;
  20. if (dev->irq >= 1 && dev->irq <= 4)
  21. return irqmap_cats[dev->irq - 1];
  22. if (dev->irq != 0)
  23. printk("PCI: device %02x:%02x has unknown irq line %x\n",
  24. dev->bus->number, dev->devfn, dev->irq);
  25. return -1;
  26. }
  27. /*
  28. * why not the standard PCI swizzle? does this prevent 4-port tulip
  29. * cards being used (ie, pci-pci bridge based cards)?
  30. */
  31. static struct hw_pci cats_pci __initdata = {
  32. .swizzle = NULL,
  33. .map_irq = cats_map_irq,
  34. .nr_controllers = 1,
  35. .setup = dc21285_setup,
  36. .scan = dc21285_scan_bus,
  37. .preinit = dc21285_preinit,
  38. .postinit = dc21285_postinit,
  39. };
  40. static int cats_pci_init(void)
  41. {
  42. if (machine_is_cats())
  43. pci_common_init(&cats_pci);
  44. return 0;
  45. }
  46. subsys_initcall(cats_pci_init);