ixdpg425-pci.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. * arch/arch/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 <asm/mach-types.h>
  19. #include <asm/hardware.h>
  20. #include <asm/irq.h>
  21. #include <asm/mach/pci.h>
  22. extern void ixp4xx_pci_preinit(void);
  23. extern int ixp4xx_setup(int nr, struct pci_sys_data *sys);
  24. extern struct pci_bus *ixp4xx_scan_bus(int nr, struct pci_sys_data *sys);
  25. void __init ixdpg425_pci_preinit(void)
  26. {
  27. set_irq_type(IRQ_IXP4XX_GPIO6, IRQT_LOW);
  28. set_irq_type(IRQ_IXP4XX_GPIO7, IRQT_LOW);
  29. gpio_line_isr_clear(6);
  30. gpio_line_isr_clear(7);
  31. ixp4xx_pci_preinit();
  32. }
  33. static int __init ixdpg425_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
  34. {
  35. if (slot == 12 || slot == 13)
  36. return IRQ_IXP4XX_GPIO7;
  37. else if (slot == 14)
  38. return IRQ_IXP4XX_GPIO6;
  39. else return -1;
  40. }
  41. struct hw_pci ixdpg425_pci __initdata = {
  42. .nr_controllers = 1,
  43. .preinit = ixdpg425_pci_preinit,
  44. .swizzle = pci_std_swizzle,
  45. .setup = ixp4xx_setup,
  46. .scan = ixp4xx_scan_bus,
  47. .map_irq = ixdpg425_map_irq,
  48. };
  49. int __init ixdpg425_pci_init(void)
  50. {
  51. if (machine_is_ixdpg425())
  52. pci_common_init(&ixdpg425_pci);
  53. return 0;
  54. }
  55. subsys_initcall(ixdpg425_pci_init);