ebsa285-pci.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. * linux/arch/arm/mach-footbridge/ebsa285-pci.c
  4. *
  5. * PCI bios-type initialisation for PCI machines
  6. *
  7. * Bits taken from various places.
  8. */
  9. #include <linux/kernel.h>
  10. #include <linux/pci.h>
  11. #include <linux/init.h>
  12. #include <asm/irq.h>
  13. #include <asm/mach/pci.h>
  14. #include <asm/mach-types.h>
  15. static int irqmap_ebsa285[] __initdata = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI };
  16. static int __init ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  17. {
  18. if (dev->vendor == PCI_VENDOR_ID_CONTAQ &&
  19. dev->device == PCI_DEVICE_ID_CONTAQ_82C693)
  20. switch (PCI_FUNC(dev->devfn)) {
  21. case 1: return 14;
  22. case 2: return 15;
  23. case 3: return 12;
  24. }
  25. return irqmap_ebsa285[(slot + pin) & 3];
  26. }
  27. static struct hw_pci ebsa285_pci __initdata = {
  28. .map_irq = ebsa285_map_irq,
  29. .nr_controllers = 1,
  30. .ops = &dc21285_ops,
  31. .setup = dc21285_setup,
  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);