coyote-pci.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * arch/arm/mach-ixp4xx/coyote-pci.c
  3. *
  4. * PCI setup routines for ADI Engineering Coyote platform
  5. *
  6. * Copyright (C) 2002 Jungo Software Technologies.
  7. * Copyright (C) 2003 MontaVista Softwrae, Inc.
  8. *
  9. * Maintainer: Deepak Saxena <dsaxena@mvista.com>
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License version 2 as
  13. * published by the Free Software Foundation.
  14. *
  15. */
  16. #include <linux/kernel.h>
  17. #include <linux/pci.h>
  18. #include <linux/init.h>
  19. #include <linux/irq.h>
  20. #include <asm/mach-types.h>
  21. #include <mach/hardware.h>
  22. #include <asm/irq.h>
  23. #include <asm/mach/pci.h>
  24. void __init coyote_pci_preinit(void)
  25. {
  26. set_irq_type(IRQ_COYOTE_PCI_SLOT0, IRQ_TYPE_LEVEL_LOW);
  27. set_irq_type(IRQ_COYOTE_PCI_SLOT1, IRQ_TYPE_LEVEL_LOW);
  28. ixp4xx_pci_preinit();
  29. }
  30. static int __init coyote_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
  31. {
  32. if (slot == COYOTE_PCI_SLOT0_DEVID)
  33. return IRQ_COYOTE_PCI_SLOT0;
  34. else if (slot == COYOTE_PCI_SLOT1_DEVID)
  35. return IRQ_COYOTE_PCI_SLOT1;
  36. else return -1;
  37. }
  38. struct hw_pci coyote_pci __initdata = {
  39. .nr_controllers = 1,
  40. .preinit = coyote_pci_preinit,
  41. .swizzle = pci_std_swizzle,
  42. .setup = ixp4xx_setup,
  43. .scan = ixp4xx_scan_bus,
  44. .map_irq = coyote_map_irq,
  45. };
  46. int __init coyote_pci_init(void)
  47. {
  48. if (machine_is_adi_coyote())
  49. pci_common_init(&coyote_pci);
  50. return 0;
  51. }
  52. subsys_initcall(coyote_pci_init);