ixdpg425-pci.c 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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(const 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. .ops = &ixp4xx_ops,
  39. .preinit = ixdpg425_pci_preinit,
  40. .setup = ixp4xx_setup,
  41. .map_irq = ixdpg425_map_irq,
  42. };
  43. int __init ixdpg425_pci_init(void)
  44. {
  45. if (machine_is_ixdpg425())
  46. pci_common_init(&ixdpg425_pci);
  47. return 0;
  48. }
  49. subsys_initcall(ixdpg425_pci_init);