hw.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  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. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc., 59
  16. * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. *
  18. * The full GNU General Public License is included in this distribution in the
  19. * file called COPYING.
  20. */
  21. #ifndef _IOAT_HW_H_
  22. #define _IOAT_HW_H_
  23. /* PCI Configuration Space Values */
  24. #define IOAT_MMIO_BAR 0
  25. /* CB device ID's */
  26. #define IOAT_PCI_DID_5000 0x1A38
  27. #define IOAT_PCI_DID_CNB 0x360B
  28. #define IOAT_PCI_DID_SCNB 0x65FF
  29. #define IOAT_PCI_DID_SNB 0x402F
  30. #define PCI_DEVICE_ID_INTEL_IOAT_IVB0 0x0e20
  31. #define PCI_DEVICE_ID_INTEL_IOAT_IVB1 0x0e21
  32. #define PCI_DEVICE_ID_INTEL_IOAT_IVB2 0x0e22
  33. #define PCI_DEVICE_ID_INTEL_IOAT_IVB3 0x0e23
  34. #define PCI_DEVICE_ID_INTEL_IOAT_IVB4 0x0e24
  35. #define PCI_DEVICE_ID_INTEL_IOAT_IVB5 0x0e25
  36. #define PCI_DEVICE_ID_INTEL_IOAT_IVB6 0x0e26
  37. #define PCI_DEVICE_ID_INTEL_IOAT_IVB7 0x0e27
  38. #define PCI_DEVICE_ID_INTEL_IOAT_IVB8 0x0e2e
  39. #define PCI_DEVICE_ID_INTEL_IOAT_IVB9 0x0e2f
  40. #define PCI_DEVICE_ID_INTEL_IOAT_HSW0 0x2f20
  41. #define PCI_DEVICE_ID_INTEL_IOAT_HSW1 0x2f21
  42. #define PCI_DEVICE_ID_INTEL_IOAT_HSW2 0x2f22
  43. #define PCI_DEVICE_ID_INTEL_IOAT_HSW3 0x2f23
  44. #define PCI_DEVICE_ID_INTEL_IOAT_HSW4 0x2f24
  45. #define PCI_DEVICE_ID_INTEL_IOAT_HSW5 0x2f25
  46. #define PCI_DEVICE_ID_INTEL_IOAT_HSW6 0x2f26
  47. #define PCI_DEVICE_ID_INTEL_IOAT_HSW7 0x2f27
  48. #define PCI_DEVICE_ID_INTEL_IOAT_HSW8 0x2f2e
  49. #define PCI_DEVICE_ID_INTEL_IOAT_HSW9 0x2f2f
  50. #define PCI_DEVICE_ID_INTEL_IOAT_BWD0 0x0C50
  51. #define PCI_DEVICE_ID_INTEL_IOAT_BWD1 0x0C51
  52. #define PCI_DEVICE_ID_INTEL_IOAT_BWD2 0x0C52
  53. #define PCI_DEVICE_ID_INTEL_IOAT_BWD3 0x0C53
  54. #define IOAT_VER_1_2 0x12 /* Version 1.2 */
  55. #define IOAT_VER_2_0 0x20 /* Version 2.0 */
  56. #define IOAT_VER_3_0 0x30 /* Version 3.0 */
  57. #define IOAT_VER_3_2 0x32 /* Version 3.2 */
  58. #define IOAT_VER_3_3 0x33 /* Version 3.3 */
  59. int system_has_dca_enabled(struct pci_dev *pdev);
  60. struct ioat_dma_descriptor {
  61. uint32_t size;
  62. union {
  63. uint32_t ctl;
  64. struct {
  65. unsigned int int_en:1;
  66. unsigned int src_snoop_dis:1;
  67. unsigned int dest_snoop_dis:1;
  68. unsigned int compl_write:1;
  69. unsigned int fence:1;
  70. unsigned int null:1;
  71. unsigned int src_brk:1;
  72. unsigned int dest_brk:1;
  73. unsigned int bundle:1;
  74. unsigned int dest_dca:1;
  75. unsigned int hint:1;
  76. unsigned int rsvd2:13;
  77. #define IOAT_OP_COPY 0x00
  78. unsigned int op:8;
  79. } ctl_f;
  80. };
  81. uint64_t src_addr;
  82. uint64_t dst_addr;
  83. uint64_t next;
  84. uint64_t rsv1;
  85. uint64_t rsv2;
  86. /* store some driver data in an unused portion of the descriptor */
  87. union {
  88. uint64_t user1;
  89. uint64_t tx_cnt;
  90. };
  91. uint64_t user2;
  92. };
  93. struct ioat_xor_descriptor {
  94. uint32_t size;
  95. union {
  96. uint32_t ctl;
  97. struct {
  98. unsigned int int_en:1;
  99. unsigned int src_snoop_dis:1;
  100. unsigned int dest_snoop_dis:1;
  101. unsigned int compl_write:1;
  102. unsigned int fence:1;
  103. unsigned int src_cnt:3;
  104. unsigned int bundle:1;
  105. unsigned int dest_dca:1;
  106. unsigned int hint:1;
  107. unsigned int rsvd:13;
  108. #define IOAT_OP_XOR 0x87
  109. #define IOAT_OP_XOR_VAL 0x88
  110. unsigned int op:8;
  111. } ctl_f;
  112. };
  113. uint64_t src_addr;
  114. uint64_t dst_addr;
  115. uint64_t next;
  116. uint64_t src_addr2;
  117. uint64_t src_addr3;
  118. uint64_t src_addr4;
  119. uint64_t src_addr5;
  120. };
  121. struct ioat_xor_ext_descriptor {
  122. uint64_t src_addr6;
  123. uint64_t src_addr7;
  124. uint64_t src_addr8;
  125. uint64_t next;
  126. uint64_t rsvd[4];
  127. };
  128. struct ioat_pq_descriptor {
  129. union {
  130. uint32_t size;
  131. uint32_t dwbes;
  132. struct {
  133. unsigned int rsvd:25;
  134. unsigned int p_val_err:1;
  135. unsigned int q_val_err:1;
  136. unsigned int rsvd1:4;
  137. unsigned int wbes:1;
  138. } dwbes_f;
  139. };
  140. union {
  141. uint32_t ctl;
  142. struct {
  143. unsigned int int_en:1;
  144. unsigned int src_snoop_dis:1;
  145. unsigned int dest_snoop_dis:1;
  146. unsigned int compl_write:1;
  147. unsigned int fence:1;
  148. unsigned int src_cnt:3;
  149. unsigned int bundle:1;
  150. unsigned int dest_dca:1;
  151. unsigned int hint:1;
  152. unsigned int p_disable:1;
  153. unsigned int q_disable:1;
  154. unsigned int rsvd2:2;
  155. unsigned int wb_en:1;
  156. unsigned int prl_en:1;
  157. unsigned int rsvd3:7;
  158. #define IOAT_OP_PQ 0x89
  159. #define IOAT_OP_PQ_VAL 0x8a
  160. #define IOAT_OP_PQ_16S 0xa0
  161. #define IOAT_OP_PQ_VAL_16S 0xa1
  162. unsigned int op:8;
  163. } ctl_f;
  164. };
  165. uint64_t src_addr;
  166. uint64_t p_addr;
  167. uint64_t next;
  168. uint64_t src_addr2;
  169. union {
  170. uint64_t src_addr3;
  171. uint64_t sed_addr;
  172. };
  173. uint8_t coef[8];
  174. uint64_t q_addr;
  175. };
  176. struct ioat_pq_ext_descriptor {
  177. uint64_t src_addr4;
  178. uint64_t src_addr5;
  179. uint64_t src_addr6;
  180. uint64_t next;
  181. uint64_t src_addr7;
  182. uint64_t src_addr8;
  183. uint64_t rsvd[2];
  184. };
  185. struct ioat_pq_update_descriptor {
  186. uint32_t size;
  187. union {
  188. uint32_t ctl;
  189. struct {
  190. unsigned int int_en:1;
  191. unsigned int src_snoop_dis:1;
  192. unsigned int dest_snoop_dis:1;
  193. unsigned int compl_write:1;
  194. unsigned int fence:1;
  195. unsigned int src_cnt:3;
  196. unsigned int bundle:1;
  197. unsigned int dest_dca:1;
  198. unsigned int hint:1;
  199. unsigned int p_disable:1;
  200. unsigned int q_disable:1;
  201. unsigned int rsvd:3;
  202. unsigned int coef:8;
  203. #define IOAT_OP_PQ_UP 0x8b
  204. unsigned int op:8;
  205. } ctl_f;
  206. };
  207. uint64_t src_addr;
  208. uint64_t p_addr;
  209. uint64_t next;
  210. uint64_t src_addr2;
  211. uint64_t p_src;
  212. uint64_t q_src;
  213. uint64_t q_addr;
  214. };
  215. struct ioat_raw_descriptor {
  216. uint64_t field[8];
  217. };
  218. struct ioat_pq16a_descriptor {
  219. uint8_t coef[8];
  220. uint64_t src_addr3;
  221. uint64_t src_addr4;
  222. uint64_t src_addr5;
  223. uint64_t src_addr6;
  224. uint64_t src_addr7;
  225. uint64_t src_addr8;
  226. uint64_t src_addr9;
  227. };
  228. struct ioat_pq16b_descriptor {
  229. uint64_t src_addr10;
  230. uint64_t src_addr11;
  231. uint64_t src_addr12;
  232. uint64_t src_addr13;
  233. uint64_t src_addr14;
  234. uint64_t src_addr15;
  235. uint64_t src_addr16;
  236. uint64_t rsvd;
  237. };
  238. union ioat_sed_pq_descriptor {
  239. struct ioat_pq16a_descriptor a;
  240. struct ioat_pq16b_descriptor b;
  241. };
  242. #define SED_SIZE 64
  243. struct ioat_sed_raw_descriptor {
  244. uint64_t a[8];
  245. uint64_t b[8];
  246. uint64_t c[8];
  247. };
  248. #endif