dw-edma-v0-regs.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2018-2019 Synopsys, Inc. and/or its affiliates.
  4. * Synopsys DesignWare eDMA v0 core
  5. *
  6. * Author: Gustavo Pimentel <[email protected]>
  7. */
  8. #ifndef _DW_EDMA_V0_REGS_H
  9. #define _DW_EDMA_V0_REGS_H
  10. #include <linux/dmaengine.h>
  11. #define EDMA_V0_MAX_NR_CH 8
  12. #define EDMA_V0_VIEWPORT_MASK GENMASK(2, 0)
  13. #define EDMA_V0_DONE_INT_MASK GENMASK(7, 0)
  14. #define EDMA_V0_ABORT_INT_MASK GENMASK(23, 16)
  15. #define EDMA_V0_WRITE_CH_COUNT_MASK GENMASK(3, 0)
  16. #define EDMA_V0_READ_CH_COUNT_MASK GENMASK(19, 16)
  17. #define EDMA_V0_CH_STATUS_MASK GENMASK(6, 5)
  18. #define EDMA_V0_DOORBELL_CH_MASK GENMASK(2, 0)
  19. #define EDMA_V0_LINKED_LIST_ERR_MASK GENMASK(7, 0)
  20. #define EDMA_V0_CH_ODD_MSI_DATA_MASK GENMASK(31, 16)
  21. #define EDMA_V0_CH_EVEN_MSI_DATA_MASK GENMASK(15, 0)
  22. struct dw_edma_v0_ch_regs {
  23. u32 ch_control1; /* 0x0000 */
  24. u32 ch_control2; /* 0x0004 */
  25. u32 transfer_size; /* 0x0008 */
  26. union {
  27. u64 reg; /* 0x000c..0x0010 */
  28. struct {
  29. u32 lsb; /* 0x000c */
  30. u32 msb; /* 0x0010 */
  31. };
  32. } sar;
  33. union {
  34. u64 reg; /* 0x0014..0x0018 */
  35. struct {
  36. u32 lsb; /* 0x0014 */
  37. u32 msb; /* 0x0018 */
  38. };
  39. } dar;
  40. union {
  41. u64 reg; /* 0x001c..0x0020 */
  42. struct {
  43. u32 lsb; /* 0x001c */
  44. u32 msb; /* 0x0020 */
  45. };
  46. } llp;
  47. } __packed;
  48. struct dw_edma_v0_ch {
  49. struct dw_edma_v0_ch_regs wr; /* 0x0200 */
  50. u32 padding_1[55]; /* 0x0224..0x02fc */
  51. struct dw_edma_v0_ch_regs rd; /* 0x0300 */
  52. u32 padding_2[55]; /* 0x0324..0x03fc */
  53. } __packed;
  54. struct dw_edma_v0_unroll {
  55. u32 padding_1; /* 0x00f8 */
  56. u32 wr_engine_chgroup; /* 0x0100 */
  57. u32 rd_engine_chgroup; /* 0x0104 */
  58. union {
  59. u64 reg; /* 0x0108..0x010c */
  60. struct {
  61. u32 lsb; /* 0x0108 */
  62. u32 msb; /* 0x010c */
  63. };
  64. } wr_engine_hshake_cnt;
  65. u32 padding_2[2]; /* 0x0110..0x0114 */
  66. union {
  67. u64 reg; /* 0x0120..0x0124 */
  68. struct {
  69. u32 lsb; /* 0x0120 */
  70. u32 msb; /* 0x0124 */
  71. };
  72. } rd_engine_hshake_cnt;
  73. u32 padding_3[2]; /* 0x0120..0x0124 */
  74. u32 wr_ch0_pwr_en; /* 0x0128 */
  75. u32 wr_ch1_pwr_en; /* 0x012c */
  76. u32 wr_ch2_pwr_en; /* 0x0130 */
  77. u32 wr_ch3_pwr_en; /* 0x0134 */
  78. u32 wr_ch4_pwr_en; /* 0x0138 */
  79. u32 wr_ch5_pwr_en; /* 0x013c */
  80. u32 wr_ch6_pwr_en; /* 0x0140 */
  81. u32 wr_ch7_pwr_en; /* 0x0144 */
  82. u32 padding_4[8]; /* 0x0148..0x0164 */
  83. u32 rd_ch0_pwr_en; /* 0x0168 */
  84. u32 rd_ch1_pwr_en; /* 0x016c */
  85. u32 rd_ch2_pwr_en; /* 0x0170 */
  86. u32 rd_ch3_pwr_en; /* 0x0174 */
  87. u32 rd_ch4_pwr_en; /* 0x0178 */
  88. u32 rd_ch5_pwr_en; /* 0x018c */
  89. u32 rd_ch6_pwr_en; /* 0x0180 */
  90. u32 rd_ch7_pwr_en; /* 0x0184 */
  91. u32 padding_5[30]; /* 0x0188..0x01fc */
  92. struct dw_edma_v0_ch ch[EDMA_V0_MAX_NR_CH]; /* 0x0200..0x1120 */
  93. } __packed;
  94. struct dw_edma_v0_legacy {
  95. u32 viewport_sel; /* 0x00f8 */
  96. struct dw_edma_v0_ch_regs ch; /* 0x0100..0x0120 */
  97. } __packed;
  98. struct dw_edma_v0_regs {
  99. /* eDMA global registers */
  100. u32 ctrl_data_arb_prior; /* 0x0000 */
  101. u32 padding_1; /* 0x0004 */
  102. u32 ctrl; /* 0x0008 */
  103. u32 wr_engine_en; /* 0x000c */
  104. u32 wr_doorbell; /* 0x0010 */
  105. u32 padding_2; /* 0x0014 */
  106. union {
  107. u64 reg; /* 0x0018..0x001c */
  108. struct {
  109. u32 lsb; /* 0x0018 */
  110. u32 msb; /* 0x001c */
  111. };
  112. } wr_ch_arb_weight;
  113. u32 padding_3[3]; /* 0x0020..0x0028 */
  114. u32 rd_engine_en; /* 0x002c */
  115. u32 rd_doorbell; /* 0x0030 */
  116. u32 padding_4; /* 0x0034 */
  117. union {
  118. u64 reg; /* 0x0038..0x003c */
  119. struct {
  120. u32 lsb; /* 0x0038 */
  121. u32 msb; /* 0x003c */
  122. };
  123. } rd_ch_arb_weight;
  124. u32 padding_5[3]; /* 0x0040..0x0048 */
  125. /* eDMA interrupts registers */
  126. u32 wr_int_status; /* 0x004c */
  127. u32 padding_6; /* 0x0050 */
  128. u32 wr_int_mask; /* 0x0054 */
  129. u32 wr_int_clear; /* 0x0058 */
  130. u32 wr_err_status; /* 0x005c */
  131. union {
  132. u64 reg; /* 0x0060..0x0064 */
  133. struct {
  134. u32 lsb; /* 0x0060 */
  135. u32 msb; /* 0x0064 */
  136. };
  137. } wr_done_imwr;
  138. union {
  139. u64 reg; /* 0x0068..0x006c */
  140. struct {
  141. u32 lsb; /* 0x0068 */
  142. u32 msb; /* 0x006c */
  143. };
  144. } wr_abort_imwr;
  145. u32 wr_ch01_imwr_data; /* 0x0070 */
  146. u32 wr_ch23_imwr_data; /* 0x0074 */
  147. u32 wr_ch45_imwr_data; /* 0x0078 */
  148. u32 wr_ch67_imwr_data; /* 0x007c */
  149. u32 padding_7[4]; /* 0x0080..0x008c */
  150. u32 wr_linked_list_err_en; /* 0x0090 */
  151. u32 padding_8[3]; /* 0x0094..0x009c */
  152. u32 rd_int_status; /* 0x00a0 */
  153. u32 padding_9; /* 0x00a4 */
  154. u32 rd_int_mask; /* 0x00a8 */
  155. u32 rd_int_clear; /* 0x00ac */
  156. u32 padding_10; /* 0x00b0 */
  157. union {
  158. u64 reg; /* 0x00b4..0x00b8 */
  159. struct {
  160. u32 lsb; /* 0x00b4 */
  161. u32 msb; /* 0x00b8 */
  162. };
  163. } rd_err_status;
  164. u32 padding_11[2]; /* 0x00bc..0x00c0 */
  165. u32 rd_linked_list_err_en; /* 0x00c4 */
  166. u32 padding_12; /* 0x00c8 */
  167. union {
  168. u64 reg; /* 0x00cc..0x00d0 */
  169. struct {
  170. u32 lsb; /* 0x00cc */
  171. u32 msb; /* 0x00d0 */
  172. };
  173. } rd_done_imwr;
  174. union {
  175. u64 reg; /* 0x00d4..0x00d8 */
  176. struct {
  177. u32 lsb; /* 0x00d4 */
  178. u32 msb; /* 0x00d8 */
  179. };
  180. } rd_abort_imwr;
  181. u32 rd_ch01_imwr_data; /* 0x00dc */
  182. u32 rd_ch23_imwr_data; /* 0x00e0 */
  183. u32 rd_ch45_imwr_data; /* 0x00e4 */
  184. u32 rd_ch67_imwr_data; /* 0x00e8 */
  185. u32 padding_13[4]; /* 0x00ec..0x00f8 */
  186. /* eDMA channel context grouping */
  187. union dw_edma_v0_type {
  188. struct dw_edma_v0_legacy legacy; /* 0x00f8..0x0120 */
  189. struct dw_edma_v0_unroll unroll; /* 0x00f8..0x1120 */
  190. } type;
  191. } __packed;
  192. struct dw_edma_v0_lli {
  193. u32 control;
  194. u32 transfer_size;
  195. union {
  196. u64 reg;
  197. struct {
  198. u32 lsb;
  199. u32 msb;
  200. };
  201. } sar;
  202. union {
  203. u64 reg;
  204. struct {
  205. u32 lsb;
  206. u32 msb;
  207. };
  208. } dar;
  209. } __packed;
  210. struct dw_edma_v0_llp {
  211. u32 control;
  212. u32 reserved;
  213. union {
  214. u64 reg;
  215. struct {
  216. u32 lsb;
  217. u32 msb;
  218. };
  219. } llp;
  220. } __packed;
  221. #endif /* _DW_EDMA_V0_REGS_H */