ebsa285-pci.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #include <asm/irq.h>
  12. #include <asm/mach/pci.h>
  13. #include <asm/mach-types.h>
  14. static int irqmap_ebsa285[] __initdata = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI };
  15. static int __init ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  16. {
  17. if (dev->vendor == PCI_VENDOR_ID_CONTAQ &&
  18. dev->device == PCI_DEVICE_ID_CONTAQ_82C693)
  19. switch (PCI_FUNC(dev->devfn)) {
  20. case 1: return 14;
  21. case 2: return 15;
  22. case 3: return 12;
  23. }
  24. return irqmap_ebsa285[(slot + pin) & 3];
  25. }
  26. static struct hw_pci ebsa285_pci __initdata = {
  27. .map_irq = ebsa285_map_irq,
  28. .nr_controllers = 1,
  29. .ops = &dc21285_ops,
  30. .setup = dc21285_setup,
  31. .preinit = dc21285_preinit,
  32. .postinit = dc21285_postinit,
  33. };
  34. static int __init ebsa285_init_pci(void)
  35. {
  36. if (machine_is_ebsa285())
  37. pci_common_init(&ebsa285_pci);
  38. return 0;
  39. }
  40. subsys_initcall(ebsa285_init_pci);