hw.h 4.9 KB

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