mcfpci.h 3.1 KB

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