You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

151 lines
3.4 KiB

8 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __EDMA_SUBSYSTEM_HEADER__
  2. #define __EDMA_SUBSYSTEM_HEADER__
  3. #include <stdint.h>
  4. /* 1D Transfer Parameters */
  5. typedef struct{
  6. uint32_t src;
  7. uint32_t dst;
  8. uint32_t chan;
  9. } hostBuffer;
  10. /* EDMA PARAM registers */
  11. typedef struct{
  12. uint32_t sam : 1;
  13. uint32_t dam : 1;
  14. uint32_t syncdim : 1;
  15. uint32_t static_set : 1;
  16. uint32_t : 4;
  17. uint32_t fwid : 3;
  18. uint32_t tccmode : 1;
  19. uint32_t tcc : 6;
  20. uint32_t : 2;
  21. uint32_t tcinten : 1;
  22. uint32_t itcinten : 1;
  23. uint32_t tcchen : 1;
  24. uint32_t itcchen : 1;
  25. uint32_t privid : 4;
  26. uint32_t : 3;
  27. uint32_t priv : 1;
  28. } edmaParamOpt;
  29. /*typedef struct{
  30. uint32_t src;
  31. } edmaParamSrc;*/
  32. typedef struct{
  33. uint32_t acnt : 16;
  34. uint32_t bcnt : 16;
  35. } edmaParamABcnt;
  36. /*typedef struct{
  37. uint32_t dst;
  38. } edmaParamDst;*/
  39. typedef struct{
  40. uint32_t srcbidx : 16;
  41. uint32_t dstbidx : 16;
  42. } edmaParamBidx;
  43. typedef struct{
  44. uint32_t link : 16;
  45. uint32_t bcntrld : 16;
  46. } edmaParamLnkRld;
  47. typedef struct{
  48. uint32_t srccidx : 16;
  49. uint32_t dstcidx : 16;
  50. } edmaParamCidx;
  51. typedef struct{
  52. uint32_t ccnt : 16;
  53. uint32_t : 16;
  54. } edmaParamCcnt;
  55. typedef struct{
  56. edmaParamOpt opt;
  57. /*edmaParamSrc*/ uint32_t src;
  58. edmaParamABcnt abcnt;
  59. /*edmaParamDst*/ uint32_t dst;
  60. edmaParamBidx bidx;
  61. edmaParamLnkRld lnkrld;
  62. edmaParamCidx cidx;
  63. edmaParamCcnt ccnt;
  64. } edmaParam;
  65. /* Addresses for Constant Table pointer registers
  66. * CTBIR_0 -> C24 (PRU0 DRAM)
  67. * CTBIR_1 -> C25 (PRU1 DRAM)
  68. */
  69. #define CTBIR_0 (*(volatile uint32_t *)(0x22020))
  70. #define CTBIR_1 (*(volatile uint32_t *)(0x22024))
  71. /* EDMA Channel Registers */
  72. #define CM_PER_BASE ((volatile uint32_t *)(0x44E00000))
  73. #define TPTC0_CLKCTRL (0x24 / 4)
  74. #define TPCC_CLKCTRL (0xBC / 4)
  75. #define ON (0x2)
  76. /* EDMA Channel Registers */
  77. #define EDMA0_CC_BASE ((volatile uint32_t *)(0x49000000))
  78. #define DMAQNUM0 (0x0240 / 4)
  79. #define DMAQNUM1 (0x0244 / 4)
  80. #define DCHMAP_10 (0x0128 / 4)
  81. #define QUEPRI (0x0284 / 4)
  82. #define EMR (0x0300 / 4)
  83. #define EMCR (0x0307 / 4)
  84. #define EMCRH (0x030C / 4)
  85. #define QEMCR (0x0314 / 4)
  86. #define CCERRCLR (0x031C / 4)
  87. #define DRAE0 (0x0340 / 4)
  88. #define DRAE1 (0x0348 / 4)
  89. #define DRAE2 (0x0350 / 4)
  90. #define DRAE3 (0x0358 / 4)
  91. #define QWMTHRA (0x0620 / 4)
  92. #define GLOBAL_ESR (0x1010 / 4)
  93. #define GLOBAL_ESRH (0x1014 / 4)
  94. #define GLOBAL_EECR (0x1028 / 4)
  95. #define GLOBAL_EECRH (0x102C / 4)
  96. #define GLOBAL_SECR (0x1040 / 4)
  97. #define GLOBAL_SECRH (0x1044 / 4)
  98. #define GLOBAL_IESR (0x1060 / 4)
  99. #define GLOBAL_IESRH (0x1064 / 4)
  100. #define GLOBAL_ICR (0x1070 / 4)
  101. #define GLOBAL_ICRH (0x1074 / 4)
  102. /* EDMA Shadow Region 1 */
  103. #define ESR (0x2210 / 4)
  104. #define ESRH (0x2214 / 4)
  105. #define EESR (0x1030 / 4)
  106. #define EECR (0x2228 / 4)
  107. #define EECRH (0x222C / 4)
  108. #define SECR (0x2240 / 4)
  109. #define SECRH (0x2244 / 4)
  110. #define IPR (0x2268 / 4)
  111. #define IPRH (0x226C / 4)
  112. #define ICR (0x2270 / 4)
  113. #define ICRH (0x2274 / 4)
  114. #define IESR (0x2260 / 4)
  115. #define IESRH (0x2264 / 4)
  116. #define IEVAL (0x2278 / 4)
  117. #define IECR (0x2258 / 4)
  118. #define IECRH (0x225C / 4)
  119. /* EDMA PARAM registers */
  120. #define PARAM_OFFSET (0x4000 / 4)
  121. #define OPT 0x00
  122. #define SRC 0x04
  123. #define ACNT 0x100
  124. #define BCNT 0x1
  125. #define DST 0x0C
  126. #define SRC_DST_BIDX 0x10
  127. #define LINK_BCNTRLD 0x14
  128. #define SRC_DST_CIDX 0x18
  129. #define CCNT 0x1
  130. #define COPY_LENGTH 32
  131. #endif