hw.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. /*
  2. * Copyright(c) 2004 - 2009 Intel Corporation. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify it
  5. * under the terms of the GNU General Public License as published by the Free
  6. * Software Foundation; either version 2 of the License, or (at your option)
  7. * any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * The full GNU General Public License is included in this distribution in the
  15. * file called COPYING.
  16. */
  17. #ifndef _IOAT_HW_H_
  18. #define _IOAT_HW_H_
  19. /* PCI Configuration Space Values */
  20. #define IOAT_MMIO_BAR 0
  21. /* CB device ID's */
  22. #define PCI_DEVICE_ID_INTEL_IOAT_IVB0 0x0e20
  23. #define PCI_DEVICE_ID_INTEL_IOAT_IVB1 0x0e21
  24. #define PCI_DEVICE_ID_INTEL_IOAT_IVB2 0x0e22
  25. #define PCI_DEVICE_ID_INTEL_IOAT_IVB3 0x0e23
  26. #define PCI_DEVICE_ID_INTEL_IOAT_IVB4 0x0e24
  27. #define PCI_DEVICE_ID_INTEL_IOAT_IVB5 0x0e25
  28. #define PCI_DEVICE_ID_INTEL_IOAT_IVB6 0x0e26
  29. #define PCI_DEVICE_ID_INTEL_IOAT_IVB7 0x0e27
  30. #define PCI_DEVICE_ID_INTEL_IOAT_IVB8 0x0e2e
  31. #define PCI_DEVICE_ID_INTEL_IOAT_IVB9 0x0e2f
  32. #define PCI_DEVICE_ID_INTEL_IOAT_HSW0 0x2f20
  33. #define PCI_DEVICE_ID_INTEL_IOAT_HSW1 0x2f21
  34. #define PCI_DEVICE_ID_INTEL_IOAT_HSW2 0x2f22
  35. #define PCI_DEVICE_ID_INTEL_IOAT_HSW3 0x2f23
  36. #define PCI_DEVICE_ID_INTEL_IOAT_HSW4 0x2f24
  37. #define PCI_DEVICE_ID_INTEL_IOAT_HSW5 0x2f25
  38. #define PCI_DEVICE_ID_INTEL_IOAT_HSW6 0x2f26
  39. #define PCI_DEVICE_ID_INTEL_IOAT_HSW7 0x2f27
  40. #define PCI_DEVICE_ID_INTEL_IOAT_HSW8 0x2f2e
  41. #define PCI_DEVICE_ID_INTEL_IOAT_HSW9 0x2f2f
  42. #define PCI_DEVICE_ID_INTEL_IOAT_BWD0 0x0C50
  43. #define PCI_DEVICE_ID_INTEL_IOAT_BWD1 0x0C51
  44. #define PCI_DEVICE_ID_INTEL_IOAT_BWD2 0x0C52
  45. #define PCI_DEVICE_ID_INTEL_IOAT_BWD3 0x0C53
  46. #define PCI_DEVICE_ID_INTEL_IOAT_BDXDE0 0x6f50
  47. #define PCI_DEVICE_ID_INTEL_IOAT_BDXDE1 0x6f51
  48. #define PCI_DEVICE_ID_INTEL_IOAT_BDXDE2 0x6f52
  49. #define PCI_DEVICE_ID_INTEL_IOAT_BDXDE3 0x6f53
  50. #define PCI_DEVICE_ID_INTEL_IOAT_BDX0 0x6f20
  51. #define PCI_DEVICE_ID_INTEL_IOAT_BDX1 0x6f21
  52. #define PCI_DEVICE_ID_INTEL_IOAT_BDX2 0x6f22
  53. #define PCI_DEVICE_ID_INTEL_IOAT_BDX3 0x6f23
  54. #define PCI_DEVICE_ID_INTEL_IOAT_BDX4 0x6f24
  55. #define PCI_DEVICE_ID_INTEL_IOAT_BDX5 0x6f25
  56. #define PCI_DEVICE_ID_INTEL_IOAT_BDX6 0x6f26
  57. #define PCI_DEVICE_ID_INTEL_IOAT_BDX7 0x6f27
  58. #define PCI_DEVICE_ID_INTEL_IOAT_BDX8 0x6f2e
  59. #define PCI_DEVICE_ID_INTEL_IOAT_BDX9 0x6f2f
  60. #define PCI_DEVICE_ID_INTEL_IOAT_SKX 0x2021
  61. #define IOAT_VER_1_2 0x12 /* Version 1.2 */
  62. #define IOAT_VER_2_0 0x20 /* Version 2.0 */
  63. #define IOAT_VER_3_0 0x30 /* Version 3.0 */
  64. #define IOAT_VER_3_2 0x32 /* Version 3.2 */
  65. #define IOAT_VER_3_3 0x33 /* Version 3.3 */
  66. int system_has_dca_enabled(struct pci_dev *pdev);
  67. struct ioat_dma_descriptor {
  68. uint32_t size;
  69. union {
  70. uint32_t ctl;
  71. struct {
  72. unsigned int int_en:1;
  73. unsigned int src_snoop_dis:1;
  74. unsigned int dest_snoop_dis:1;
  75. unsigned int compl_write:1;
  76. unsigned int fence:1;
  77. unsigned int null:1;
  78. unsigned int src_brk:1;
  79. unsigned int dest_brk:1;
  80. unsigned int bundle:1;
  81. unsigned int dest_dca:1;
  82. unsigned int hint:1;
  83. unsigned int rsvd2:13;
  84. #define IOAT_OP_COPY 0x00
  85. unsigned int op:8;
  86. } ctl_f;
  87. };
  88. uint64_t src_addr;
  89. uint64_t dst_addr;
  90. uint64_t next;
  91. uint64_t rsv1;
  92. uint64_t rsv2;
  93. /* store some driver data in an unused portion of the descriptor */
  94. union {
  95. uint64_t user1;
  96. uint64_t tx_cnt;
  97. };
  98. uint64_t user2;
  99. };
  100. struct ioat_xor_descriptor {
  101. uint32_t size;
  102. union {
  103. uint32_t ctl;
  104. struct {
  105. unsigned int int_en:1;
  106. unsigned int src_snoop_dis:1;
  107. unsigned int dest_snoop_dis:1;
  108. unsigned int compl_write:1;
  109. unsigned int fence:1;
  110. unsigned int src_cnt:3;
  111. unsigned int bundle:1;
  112. unsigned int dest_dca:1;
  113. unsigned int hint:1;
  114. unsigned int rsvd:13;
  115. #define IOAT_OP_XOR 0x87
  116. #define IOAT_OP_XOR_VAL 0x88
  117. unsigned int op:8;
  118. } ctl_f;
  119. };
  120. uint64_t src_addr;
  121. uint64_t dst_addr;
  122. uint64_t next;
  123. uint64_t src_addr2;
  124. uint64_t src_addr3;
  125. uint64_t src_addr4;
  126. uint64_t src_addr5;
  127. };
  128. struct ioat_xor_ext_descriptor {
  129. uint64_t src_addr6;
  130. uint64_t src_addr7;
  131. uint64_t src_addr8;
  132. uint64_t next;
  133. uint64_t rsvd[4];
  134. };
  135. struct ioat_pq_descriptor {
  136. union {
  137. uint32_t size;
  138. uint32_t dwbes;
  139. struct {
  140. unsigned int rsvd:25;
  141. unsigned int p_val_err:1;
  142. unsigned int q_val_err:1;
  143. unsigned int rsvd1:4;
  144. unsigned int wbes:1;
  145. } dwbes_f;
  146. };
  147. union {
  148. uint32_t ctl;
  149. struct {
  150. unsigned int int_en:1;
  151. unsigned int src_snoop_dis:1;
  152. unsigned int dest_snoop_dis:1;
  153. unsigned int compl_write:1;
  154. unsigned int fence:1;
  155. unsigned int src_cnt:3;
  156. unsigned int bundle:1;
  157. unsigned int dest_dca:1;
  158. unsigned int hint:1;
  159. unsigned int p_disable:1;
  160. unsigned int q_disable:1;
  161. unsigned int rsvd2:2;
  162. unsigned int wb_en:1;
  163. unsigned int prl_en:1;
  164. unsigned int rsvd3:7;
  165. #define IOAT_OP_PQ 0x89
  166. #define IOAT_OP_PQ_VAL 0x8a
  167. #define IOAT_OP_PQ_16S 0xa0
  168. #define IOAT_OP_PQ_VAL_16S 0xa1
  169. unsigned int op:8;
  170. } ctl_f;
  171. };
  172. uint64_t src_addr;
  173. uint64_t p_addr;
  174. uint64_t next;
  175. uint64_t src_addr2;
  176. union {
  177. uint64_t src_addr3;
  178. uint64_t sed_addr;
  179. };
  180. uint8_t coef[8];
  181. uint64_t q_addr;
  182. };
  183. struct ioat_pq_ext_descriptor {
  184. uint64_t src_addr4;
  185. uint64_t src_addr5;
  186. uint64_t src_addr6;
  187. uint64_t next;
  188. uint64_t src_addr7;
  189. uint64_t src_addr8;
  190. uint64_t rsvd[2];
  191. };
  192. struct ioat_pq_update_descriptor {
  193. uint32_t size;
  194. union {
  195. uint32_t ctl;
  196. struct {
  197. unsigned int int_en:1;
  198. unsigned int src_snoop_dis:1;
  199. unsigned int dest_snoop_dis:1;
  200. unsigned int compl_write:1;
  201. unsigned int fence:1;
  202. unsigned int src_cnt:3;
  203. unsigned int bundle:1;
  204. unsigned int dest_dca:1;
  205. unsigned int hint:1;
  206. unsigned int p_disable:1;
  207. unsigned int q_disable:1;
  208. unsigned int rsvd:3;
  209. unsigned int coef:8;
  210. #define IOAT_OP_PQ_UP 0x8b
  211. unsigned int op:8;
  212. } ctl_f;
  213. };
  214. uint64_t src_addr;
  215. uint64_t p_addr;
  216. uint64_t next;
  217. uint64_t src_addr2;
  218. uint64_t p_src;
  219. uint64_t q_src;
  220. uint64_t q_addr;
  221. };
  222. struct ioat_raw_descriptor {
  223. uint64_t field[8];
  224. };
  225. struct ioat_pq16a_descriptor {
  226. uint8_t coef[8];
  227. uint64_t src_addr3;
  228. uint64_t src_addr4;
  229. uint64_t src_addr5;
  230. uint64_t src_addr6;
  231. uint64_t src_addr7;
  232. uint64_t src_addr8;
  233. uint64_t src_addr9;
  234. };
  235. struct ioat_pq16b_descriptor {
  236. uint64_t src_addr10;
  237. uint64_t src_addr11;
  238. uint64_t src_addr12;
  239. uint64_t src_addr13;
  240. uint64_t src_addr14;
  241. uint64_t src_addr15;
  242. uint64_t src_addr16;
  243. uint64_t rsvd;
  244. };
  245. union ioat_sed_pq_descriptor {
  246. struct ioat_pq16a_descriptor a;
  247. struct ioat_pq16b_descriptor b;
  248. };
  249. #define SED_SIZE 64
  250. struct ioat_sed_raw_descriptor {
  251. uint64_t a[8];
  252. uint64_t b[8];
  253. uint64_t c[8];
  254. };
  255. #endif