ixdpg425-pci.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. * arch/arm/mach-ixp4xx/ixdpg425-pci.c
  3. *
  4. * PCI setup routines for Intel IXDPG425 Platform
  5. *
  6. * Copyright (C) 2004 MontaVista Softwrae, Inc.
  7. *
  8. * Maintainer: Deepak Saxena <dsaxena@plexity.net>
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License version 2 as
  12. * published by the Free Software Foundation.
  13. *
  14. */
  15. #include <linux/kernel.h>
  16. #include <linux/pci.h>
  17. #include <linux/init.h>
  18. #include <linux/irq.h>
  19. #include <asm/mach-types.h>
  20. #include <mach/hardware.h>
  21. #include <asm/mach/pci.h>
  22. void __init ixdpg425_pci_preinit(void)
  23. {
  24. irq_set_irq_type(IRQ_IXP4XX_GPIO6, IRQ_TYPE_LEVEL_LOW);
  25. irq_set_irq_type(IRQ_IXP4XX_GPIO7, IRQ_TYPE_LEVEL_LOW);
  26. ixp4xx_pci_preinit();
  27. }
  28. static int __init ixdpg425_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
  29. {
  30. if (slot == 12 || slot == 13)
  31. return IRQ_IXP4XX_GPIO7;
  32. else if (slot == 14)
  33. return IRQ_IXP4XX_GPIO6;
  34. else return -1;
  35. }
  36. struct hw_pci ixdpg425_pci __initdata = {
  37. .nr_controllers = 1,
  38. .preinit = ixdpg425_pci_preinit,
  39. .swizzle = pci_std_swizzle,
  40. .setup = ixp4xx_setup,
  41. .scan = ixp4xx_scan_bus,
  42. .map_irq = ixdpg425_map_irq,
  43. };
  44. int __init ixdpg425_pci_init(void)
  45. {
  46. if (machine_is_ixdpg425())
  47. pci_common_init(&ixdpg425_pci);
  48. return 0;
  49. }
  50. subsys_initcall(ixdpg425_pci_init);