mcfpci.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /****************************************************************************/
  2. /*
  3. * mcfpci.h -- PCI bridge on ColdFire eval boards.
  4. *
  5. * (C) Copyright 2000, Greg Ungerer (gerg@snapgear.com)
  6. * (C) Copyright 2000, Lineo Inc. (www.lineo.com)
  7. */
  8. /****************************************************************************/
  9. #ifndef mcfpci_h
  10. #define mcfpci_h
  11. /****************************************************************************/
  12. #include <linux/config.h>
  13. #ifdef CONFIG_PCI
  14. /*
  15. * Address regions in the PCI address space are not mapped into the
  16. * normal memory space of the ColdFire. They must be accessed via
  17. * handler routines. This is easy for I/O space (inb/outb/etc) but
  18. * needs some code changes to support ordinary memory. Interrupts
  19. * also need to be vectored through the PCI handler first, then it
  20. * will call the actual driver sub-handlers.
  21. */
  22. /*
  23. * Un-define all the standard I/O access routines.
  24. */
  25. #undef inb
  26. #undef inw
  27. #undef inl
  28. #undef inb_p
  29. #undef inw_p
  30. #undef insb
  31. #undef insw
  32. #undef insl
  33. #undef outb
  34. #undef outw
  35. #undef outl
  36. #undef outb_p
  37. #undef outw_p
  38. #undef outsb
  39. #undef outsw
  40. #undef outsl
  41. #undef request_irq
  42. #undef free_irq
  43. #undef bus_to_virt
  44. #undef virt_to_bus
  45. /*
  46. * Re-direct all I/O memory accesses functions to PCI specific ones.
  47. */
  48. #define inb pci_inb
  49. #define inw pci_inw
  50. #define inl pci_inl
  51. #define inb_p pci_inb
  52. #define inw_p pci_inw
  53. #define insb pci_insb
  54. #define insw pci_insw
  55. #define insl pci_insl
  56. #define outb pci_outb
  57. #define outw pci_outw
  58. #define outl pci_outl
  59. #define outb_p pci_outb
  60. #define outw_p pci_outw
  61. #define outsb pci_outsb
  62. #define outsw pci_outsw
  63. #define outsl pci_outsl
  64. #define request_irq pci_request_irq
  65. #define free_irq pci_free_irq
  66. #define virt_to_bus pci_virt_to_bus
  67. #define bus_to_virt pci_bus_to_virt
  68. #define CONFIG_COMEMPCI 1
  69. /*
  70. * Prototypes of the real PCI functions (defined in bios32.c).
  71. */
  72. unsigned char pci_inb(unsigned int addr);
  73. unsigned short pci_inw(unsigned int addr);
  74. unsigned int pci_inl(unsigned int addr);
  75. void pci_insb(void *addr, void *buf, int len);
  76. void pci_insw(void *addr, void *buf, int len);
  77. void pci_insl(void *addr, void *buf, int len);
  78. void pci_outb(unsigned char val, unsigned int addr);
  79. void pci_outw(unsigned short val, unsigned int addr);
  80. void pci_outl(unsigned int val, unsigned int addr);
  81. void pci_outsb(void *addr, void *buf, int len);
  82. void pci_outsw(void *addr, void *buf, int len);
  83. void pci_outsl(void *addr, void *buf, int len);
  84. int pci_request_irq(unsigned int irq,
  85. void (*handler)(int, void *, struct pt_regs *),
  86. unsigned long flags,
  87. const char *device,
  88. void *dev_id);
  89. void pci_free_irq(unsigned int irq, void *dev_id);
  90. void *pci_bmalloc(int size);
  91. void pci_bmfree(void *bmp, int len);
  92. void pci_copytoshmem(unsigned long bmp, void *src, int size);
  93. void pci_copyfromshmem(void *dst, unsigned long bmp, int size);
  94. unsigned long pci_virt_to_bus(volatile void *address);
  95. void *pci_bus_to_virt(unsigned long address);
  96. void pci_bmcpyto(void *dst, void *src, int len);
  97. void pci_bmcpyfrom(void *dst, void *src, int len);
  98. #endif /* CONFIG_PCI */
  99. /****************************************************************************/
  100. #endif /* mcfpci_h */