gateway7001-pci.c 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * arch/arch/mach-ixp4xx/gateway7001-pci.c
  3. *
  4. * PCI setup routines for Gateway 7001
  5. *
  6. * Copyright (C) 2007 Imre Kaloz <kaloz@openwrt.org>
  7. *
  8. * based on coyote-pci.c:
  9. * Copyright (C) 2002 Jungo Software Technologies.
  10. * Copyright (C) 2003 MontaVista Softwrae, Inc.
  11. *
  12. * Maintainer: Imre Kaloz <kaloz@openwrt.org>
  13. *
  14. * This program is free software; you can redistribute it and/or modify
  15. * it under the terms of the GNU General Public License version 2 as
  16. * published by the Free Software Foundation.
  17. *
  18. */
  19. #include <linux/kernel.h>
  20. #include <linux/pci.h>
  21. #include <linux/init.h>
  22. #include <linux/irq.h>
  23. #include <asm/mach-types.h>
  24. #include <mach/hardware.h>
  25. #include <asm/mach/pci.h>
  26. void __init gateway7001_pci_preinit(void)
  27. {
  28. irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW);
  29. irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW);
  30. ixp4xx_pci_preinit();
  31. }
  32. static int __init gateway7001_map_irq(const struct pci_dev *dev, u8 slot,
  33. u8 pin)
  34. {
  35. if (slot == 1)
  36. return IRQ_IXP4XX_GPIO11;
  37. else if (slot == 2)
  38. return IRQ_IXP4XX_GPIO10;
  39. else return -1;
  40. }
  41. struct hw_pci gateway7001_pci __initdata = {
  42. .nr_controllers = 1,
  43. .ops = &ixp4xx_ops,
  44. .preinit = gateway7001_pci_preinit,
  45. .setup = ixp4xx_setup,
  46. .map_irq = gateway7001_map_irq,
  47. };
  48. int __init gateway7001_pci_init(void)
  49. {
  50. if (machine_is_gateway7001())
  51. pci_common_init(&gateway7001_pci);
  52. return 0;
  53. }
  54. subsys_initcall(gateway7001_pci_init);