hw.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  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_PCI_VID 0x8086
  25. #define IOAT_MMIO_BAR 0
  26. /* CB device ID's */
  27. #define IOAT_PCI_DID_5000 0x1A38
  28. #define IOAT_PCI_DID_CNB 0x360B
  29. #define IOAT_PCI_DID_SCNB 0x65FF
  30. #define IOAT_PCI_DID_SNB 0x402F
  31. #define IOAT_PCI_RID 0x00
  32. #define IOAT_PCI_SVID 0x8086
  33. #define IOAT_PCI_SID 0x8086
  34. #define IOAT_VER_1_2 0x12 /* Version 1.2 */
  35. #define IOAT_VER_2_0 0x20 /* Version 2.0 */
  36. #define IOAT_VER_3_0 0x30 /* Version 3.0 */
  37. #define IOAT_VER_3_2 0x32 /* Version 3.2 */
  38. int system_has_dca_enabled(struct pci_dev *pdev);
  39. struct ioat_dma_descriptor {
  40. uint32_t size;
  41. union {
  42. uint32_t ctl;
  43. struct {
  44. unsigned int int_en:1;
  45. unsigned int src_snoop_dis:1;
  46. unsigned int dest_snoop_dis:1;
  47. unsigned int compl_write:1;
  48. unsigned int fence:1;
  49. unsigned int null:1;
  50. unsigned int src_brk:1;
  51. unsigned int dest_brk:1;
  52. unsigned int bundle:1;
  53. unsigned int dest_dca:1;
  54. unsigned int hint:1;
  55. unsigned int rsvd2:13;
  56. #define IOAT_OP_COPY 0x00
  57. unsigned int op:8;
  58. } ctl_f;
  59. };
  60. uint64_t src_addr;
  61. uint64_t dst_addr;
  62. uint64_t next;
  63. uint64_t rsv1;
  64. uint64_t rsv2;
  65. /* store some driver data in an unused portion of the descriptor */
  66. union {
  67. uint64_t user1;
  68. uint64_t tx_cnt;
  69. };
  70. uint64_t user2;
  71. };
  72. struct ioat_fill_descriptor {
  73. uint32_t size;
  74. union {
  75. uint32_t ctl;
  76. struct {
  77. unsigned int int_en:1;
  78. unsigned int rsvd:1;
  79. unsigned int dest_snoop_dis:1;
  80. unsigned int compl_write:1;
  81. unsigned int fence:1;
  82. unsigned int rsvd2:2;
  83. unsigned int dest_brk:1;
  84. unsigned int bundle:1;
  85. unsigned int rsvd4:15;
  86. #define IOAT_OP_FILL 0x01
  87. unsigned int op:8;
  88. } ctl_f;
  89. };
  90. uint64_t src_data;
  91. uint64_t dst_addr;
  92. uint64_t next;
  93. uint64_t rsv1;
  94. uint64_t next_dst_addr;
  95. uint64_t user1;
  96. uint64_t user2;
  97. };
  98. struct ioat_xor_descriptor {
  99. uint32_t size;
  100. union {
  101. uint32_t ctl;
  102. struct {
  103. unsigned int int_en:1;
  104. unsigned int src_snoop_dis:1;
  105. unsigned int dest_snoop_dis:1;
  106. unsigned int compl_write:1;
  107. unsigned int fence:1;
  108. unsigned int src_cnt:3;
  109. unsigned int bundle:1;
  110. unsigned int dest_dca:1;
  111. unsigned int hint:1;
  112. unsigned int rsvd:13;
  113. #define IOAT_OP_XOR 0x87
  114. #define IOAT_OP_XOR_VAL 0x88
  115. unsigned int op:8;
  116. } ctl_f;
  117. };
  118. uint64_t src_addr;
  119. uint64_t dst_addr;
  120. uint64_t next;
  121. uint64_t src_addr2;
  122. uint64_t src_addr3;
  123. uint64_t src_addr4;
  124. uint64_t src_addr5;
  125. };
  126. struct ioat_xor_ext_descriptor {
  127. uint64_t src_addr6;
  128. uint64_t src_addr7;
  129. uint64_t src_addr8;
  130. uint64_t next;
  131. uint64_t rsvd[4];
  132. };
  133. struct ioat_pq_descriptor {
  134. uint32_t size;
  135. union {
  136. uint32_t ctl;
  137. struct {
  138. unsigned int int_en:1;
  139. unsigned int src_snoop_dis:1;
  140. unsigned int dest_snoop_dis:1;
  141. unsigned int compl_write:1;
  142. unsigned int fence:1;
  143. unsigned int src_cnt:3;
  144. unsigned int bundle:1;
  145. unsigned int dest_dca:1;
  146. unsigned int hint:1;
  147. unsigned int p_disable:1;
  148. unsigned int q_disable:1;
  149. unsigned int rsvd:11;
  150. #define IOAT_OP_PQ 0x89
  151. #define IOAT_OP_PQ_VAL 0x8a
  152. unsigned int op:8;
  153. } ctl_f;
  154. };
  155. uint64_t src_addr;
  156. uint64_t p_addr;
  157. uint64_t next;
  158. uint64_t src_addr2;
  159. uint64_t src_addr3;
  160. uint8_t coef[8];
  161. uint64_t q_addr;
  162. };
  163. struct ioat_pq_ext_descriptor {
  164. uint64_t src_addr4;
  165. uint64_t src_addr5;
  166. uint64_t src_addr6;
  167. uint64_t next;
  168. uint64_t src_addr7;
  169. uint64_t src_addr8;
  170. uint64_t rsvd[2];
  171. };
  172. struct ioat_pq_update_descriptor {
  173. uint32_t size;
  174. union {
  175. uint32_t ctl;
  176. struct {
  177. unsigned int int_en:1;
  178. unsigned int src_snoop_dis:1;
  179. unsigned int dest_snoop_dis:1;
  180. unsigned int compl_write:1;
  181. unsigned int fence:1;
  182. unsigned int src_cnt:3;
  183. unsigned int bundle:1;
  184. unsigned int dest_dca:1;
  185. unsigned int hint:1;
  186. unsigned int p_disable:1;
  187. unsigned int q_disable:1;
  188. unsigned int rsvd:3;
  189. unsigned int coef:8;
  190. #define IOAT_OP_PQ_UP 0x8b
  191. unsigned int op:8;
  192. } ctl_f;
  193. };
  194. uint64_t src_addr;
  195. uint64_t p_addr;
  196. uint64_t next;
  197. uint64_t src_addr2;
  198. uint64_t p_src;
  199. uint64_t q_src;
  200. uint64_t q_addr;
  201. };
  202. struct ioat_raw_descriptor {
  203. uint64_t field[8];
  204. };
  205. #endif