synchronousMemoryDatabase.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. * TI DAVINCI dma definitions
  3. *
  4. * Copyright (C) 2006-2009 Texas Instruments.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. *
  11. * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  12. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  14. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  15. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  16. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  18. * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  19. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  20. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  21. *
  22. * You should have received a copy of the GNU General Public License along
  23. * with this program; if not, write to the Free Software Foundation, Inc.,
  24. * 675 Mass Ave, Cambridge, MA 02139, USA.
  25. *
  26. */
  27. /*
  28. * This EDMA3 programming framework exposes two basic kinds of resource:
  29. *
  30. * Channel Triggers transfers, usually from a hardware event but
  31. * also manually or by "chaining" from DMA completions.
  32. * Each channel is coupled to a Parameter RAM (PaRAM) slot.
  33. *
  34. * Slot Each PaRAM slot holds a DMA transfer descriptor (PaRAM
  35. * "set"), source and destination addresses, a link to a
  36. * next PaRAM slot (if any), options for the transfer, and
  37. * instructions for updating those addresses. There are
  38. * more than twice as many slots as event channels.
  39. *
  40. * Each PaRAM set describes a sequence of transfers, either for one large
  41. * buffer or for several discontiguous smaller buffers. An EDMA transfer
  42. * is driven only from a channel, which performs the transfers specified
  43. * in its PaRAM slot until there are no more transfers. When that last
  44. * transfer completes, the "link" field may be used to reload the channel's
  45. * PaRAM slot with a new transfer descriptor.
  46. *
  47. * The EDMA Channel Controller (CC) maps requests from channels into physical
  48. * Transfer Controller (TC) requests when the channel triggers (by hardware
  49. * or software events, or by chaining). The two physical DMA channels provided
  50. * by the TCs are thus shared by many logical channels.
  51. *
  52. * DaVinci hardware also has a "QDMA" mechanism which is not currently
  53. * supported through this interface. (DSP firmware uses it though.)
  54. */
  55. #ifndef EDMA_H_
  56. #define EDMA_H_
  57. /* PaRAM slots are laid out like this */
  58. struct edmacc_param {
  59. unsigned int opt;
  60. unsigned int src;
  61. unsigned int a_b_cnt;
  62. unsigned int dst;
  63. unsigned int src_dst_bidx;
  64. unsigned int link_bcntrld;
  65. unsigned int src_dst_cidx;
  66. unsigned int ccnt;
  67. };
  68. #define CCINT0_INTERRUPT 16
  69. #define CCERRINT_INTERRUPT 17
  70. #define TCERRINT0_INTERRUPT 18
  71. #define TCERRINT1_INTERRUPT 19
  72. /* fields in edmacc_param.opt */
  73. #define SAM BIT(0)
  74. #define DAM BIT(1)
  75. #define SYNCDIM BIT(2)
  76. #define STATIC BIT(3)
  77. #define EDMA_FWID (0x07 << 8)
  78. #define TCCMODE BIT(11)
  79. #define EDMA_TCC(t) ((t) << 12)
  80. #define TCINTEN BIT(20)
  81. #define ITCINTEN BIT(21)
  82. #define TCCHEN BIT(22)
  83. #define ITCCHEN BIT(23)
  84. #define TRWORD (0x7<<2)
  85. #define PAENTRY (0x1ff<<5)
  86. /* Drivers should avoid using these symbolic names for dm644x
  87. * channels, and use platform_device IORESOURCE_DMA resources
  88. * instead. (Other DaVinci chips have different peripherals
  89. * and thus have different DMA channel mappings.)
  90. */
  91. #define DAVINCI_DMA_MCBSP_TX 2
  92. #define DAVINCI_DMA_MCBSP_RX 3
  93. #define DAVINCI_DMA_VPSS_HIST 4
  94. #define DAVINCI_DMA_VPSS_H3A 5
  95. #define DAVINCI_DMA_VPSS_PRVU 6
  96. #define DAVINCI_DMA_VPSS_RSZ 7
  97. #define DAVINCI_DMA_IMCOP_IMXINT 8
  98. #define DAVINCI_DMA_IMCOP_VLCDINT 9
  99. #define DAVINCI_DMA_IMCO_PASQINT 10
  100. #define DAVINCI_DMA_IMCOP_DSQINT 11
  101. #define DAVINCI_DMA_SPI_SPIX 16
  102. #define DAVINCI_DMA_SPI_SPIR 17
  103. #define DAVINCI_DMA_UART0_URXEVT0 18
  104. #define DAVINCI_DMA_UART0_UTXEVT0 19
  105. #define DAVINCI_DMA_UART1_URXEVT1 20
  106. #define DAVINCI_DMA_UART1_UTXEVT1 21
  107. #define DAVINCI_DMA_UART2_URXEVT2 22
  108. #define DAVINCI_DMA_UART2_UTXEVT2 23
  109. #define DAVINCI_DMA_MEMSTK_MSEVT 24
  110. #define DAVINCI_DMA_MMCRXEVT 26
  111. #define DAVINCI_DMA_MMCTXEVT 27
  112. #define DAVINCI_DMA_I2C_ICREVT 28
  113. #define DAVINCI_DMA_I2C_ICXEVT 29
  114. #define DAVINCI_DMA_GPIO_GPINT0 32
  115. #define DAVINCI_DMA_GPIO_GPINT1 33
  116. #define DAVINCI_DMA_GPIO_GPINT2 34
  117. #define DAVINCI_DMA_GPIO_GPINT3 35
  118. #define DAVINCI_DMA_GPIO_GPINT4 36
  119. #define DAVINCI_DMA_GPIO_GPINT5 37
  120. #define DAVINCI_DMA_GPIO_GPINT6 38
  121. #define DAVINCI_DMA_GPIO_GPINT7 39