ebsa285-pci.c 1.1 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(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. .swizzle = pci_std_swizzle,
  28. .map_irq = ebsa285_map_irq,
  29. .nr_controllers = 1,
  30. .setup = dc21285_setup,
  31. .scan = dc21285_scan_bus,
  32. .preinit = dc21285_preinit,
  33. .postinit = dc21285_postinit,
  34. };
  35. static int __init ebsa285_init_pci(void)
  36. {
  37. if (machine_is_ebsa285())
  38. pci_common_init(&ebsa285_pci);
  39. return 0;
  40. }
  41. subsys_initcall(ebsa285_init_pci);