netwinder-pci.c
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * linux/arch/arm/mach-footbridge/netwinder-pci.c
  3.  *
  4.  * PCI bios-type initialisation for PCI machines
  5.  *
  6.  * Bits taken from various places.
  7.  */
  8. #include <linux/kernel.h>
  9. #include <linux/pci.h>
  10. #include <linux/init.h>
  11. #include <asm/irq.h>
  12. #include <asm/mach/pci.h>
  13. #include <asm/hardware/dec21285.h>
  14. /* netwinder host-specific stuff */
  15. static int __init netwinder_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
  16. {
  17. #define DEV(v,d) ((v)<<16|(d))
  18. switch (DEV(dev->vendor, dev->device)) {
  19. case DEV(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21142):
  20. case DEV(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_53C885):
  21. case DEV(PCI_VENDOR_ID_NCR, PCI_DEVICE_ID_NCR_YELLOWFIN):
  22. return IRQ_NETWINDER_ETHER100;
  23. case DEV(PCI_VENDOR_ID_WINBOND2, 0x5a5a):
  24. return IRQ_NETWINDER_ETHER10;
  25. case DEV(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_83C553):
  26. return 0;
  27. case DEV(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105):
  28. return IRQ_ISA_HARDDISK1;
  29. case DEV(PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2000):
  30. case DEV(PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_2010):
  31. case DEV(PCI_VENDOR_ID_INTERG, PCI_DEVICE_ID_INTERG_5000):
  32. return IRQ_NETWINDER_VGA;
  33. case DEV(PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21285):
  34. return 0;
  35. default:
  36. printk(KERN_ERR "PCI: %02X:%02X [%04X:%04X] unknown devicen",
  37. dev->bus->number, dev->devfn,
  38. dev->vendor, dev->device);
  39. return 0;
  40. }
  41. }
  42. struct hw_pci netwinder_pci __initdata = {
  43. setup_resources: dc21285_setup_resources,
  44. init: dc21285_init,
  45. mem_offset: DC21285_PCI_MEM,
  46. swizzle: no_swizzle,
  47. map_irq: netwinder_map_irq,
  48. };