mlx5_ifc_fpga.h 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  1. /*
  2. * Copyright (c) 2017, Mellanox Technologies, Ltd. All rights reserved.
  3. *
  4. * This software is available to you under a choice of one of two
  5. * licenses. You may choose to be licensed under the terms of the GNU
  6. * General Public License (GPL) Version 2, available from the file
  7. * COPYING in the main directory of this source tree, or the
  8. * OpenIB.org BSD license below:
  9. *
  10. * Redistribution and use in source and binary forms, with or
  11. * without modification, are permitted provided that the following
  12. * conditions are met:
  13. *
  14. * - Redistributions of source code must retain the above
  15. * copyright notice, this list of conditions and the following
  16. * disclaimer.
  17. *
  18. * - Redistributions in binary form must reproduce the above
  19. * copyright notice, this list of conditions and the following
  20. * disclaimer in the documentation and/or other materials
  21. * provided with the distribution.
  22. *
  23. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  24. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  25. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  26. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  27. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  28. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  29. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  30. * SOFTWARE.
  31. */
  32. #ifndef MLX5_IFC_FPGA_H
  33. #define MLX5_IFC_FPGA_H
  34. struct mlx5_ifc_fpga_shell_caps_bits {
  35. u8 max_num_qps[0x10];
  36. u8 reserved_at_10[0x8];
  37. u8 total_rcv_credits[0x8];
  38. u8 reserved_at_20[0xe];
  39. u8 qp_type[0x2];
  40. u8 reserved_at_30[0x5];
  41. u8 rae[0x1];
  42. u8 rwe[0x1];
  43. u8 rre[0x1];
  44. u8 reserved_at_38[0x4];
  45. u8 dc[0x1];
  46. u8 ud[0x1];
  47. u8 uc[0x1];
  48. u8 rc[0x1];
  49. u8 reserved_at_40[0x1a];
  50. u8 log_ddr_size[0x6];
  51. u8 max_fpga_qp_msg_size[0x20];
  52. u8 reserved_at_80[0x180];
  53. };
  54. struct mlx5_ifc_fpga_cap_bits {
  55. u8 fpga_id[0x8];
  56. u8 fpga_device[0x18];
  57. u8 register_file_ver[0x20];
  58. u8 fpga_ctrl_modify[0x1];
  59. u8 reserved_at_41[0x5];
  60. u8 access_reg_query_mode[0x2];
  61. u8 reserved_at_48[0x6];
  62. u8 access_reg_modify_mode[0x2];
  63. u8 reserved_at_50[0x10];
  64. u8 reserved_at_60[0x20];
  65. u8 image_version[0x20];
  66. u8 image_date[0x20];
  67. u8 image_time[0x20];
  68. u8 shell_version[0x20];
  69. u8 reserved_at_100[0x80];
  70. struct mlx5_ifc_fpga_shell_caps_bits shell_caps;
  71. u8 reserved_at_380[0x8];
  72. u8 ieee_vendor_id[0x18];
  73. u8 sandbox_product_version[0x10];
  74. u8 sandbox_product_id[0x10];
  75. u8 sandbox_basic_caps[0x20];
  76. u8 reserved_at_3e0[0x10];
  77. u8 sandbox_extended_caps_len[0x10];
  78. u8 sandbox_extended_caps_addr[0x40];
  79. u8 fpga_ddr_start_addr[0x40];
  80. u8 fpga_cr_space_start_addr[0x40];
  81. u8 fpga_ddr_size[0x20];
  82. u8 fpga_cr_space_size[0x20];
  83. u8 reserved_at_500[0x300];
  84. };
  85. enum {
  86. MLX5_FPGA_CTRL_OPERATION_LOAD = 0x1,
  87. MLX5_FPGA_CTRL_OPERATION_RESET = 0x2,
  88. MLX5_FPGA_CTRL_OPERATION_FLASH_SELECT = 0x3,
  89. MLX5_FPGA_CTRL_OPERATION_SANDBOX_BYPASS_ON = 0x4,
  90. MLX5_FPGA_CTRL_OPERATION_SANDBOX_BYPASS_OFF = 0x5,
  91. MLX5_FPGA_CTRL_OPERATION_RESET_SANDBOX = 0x6,
  92. };
  93. struct mlx5_ifc_fpga_ctrl_bits {
  94. u8 reserved_at_0[0x8];
  95. u8 operation[0x8];
  96. u8 reserved_at_10[0x8];
  97. u8 status[0x8];
  98. u8 reserved_at_20[0x8];
  99. u8 flash_select_admin[0x8];
  100. u8 reserved_at_30[0x8];
  101. u8 flash_select_oper[0x8];
  102. u8 reserved_at_40[0x40];
  103. };
  104. enum {
  105. MLX5_FPGA_ERROR_EVENT_SYNDROME_CORRUPTED_DDR = 0x1,
  106. MLX5_FPGA_ERROR_EVENT_SYNDROME_FLASH_TIMEOUT = 0x2,
  107. MLX5_FPGA_ERROR_EVENT_SYNDROME_INTERNAL_LINK_ERROR = 0x3,
  108. MLX5_FPGA_ERROR_EVENT_SYNDROME_WATCHDOG_FAILURE = 0x4,
  109. MLX5_FPGA_ERROR_EVENT_SYNDROME_I2C_FAILURE = 0x5,
  110. MLX5_FPGA_ERROR_EVENT_SYNDROME_IMAGE_CHANGED = 0x6,
  111. MLX5_FPGA_ERROR_EVENT_SYNDROME_TEMPERATURE_CRITICAL = 0x7,
  112. };
  113. struct mlx5_ifc_fpga_error_event_bits {
  114. u8 reserved_at_0[0x40];
  115. u8 reserved_at_40[0x18];
  116. u8 syndrome[0x8];
  117. u8 reserved_at_60[0x80];
  118. };
  119. #define MLX5_FPGA_ACCESS_REG_SIZE_MAX 64
  120. struct mlx5_ifc_fpga_access_reg_bits {
  121. u8 reserved_at_0[0x20];
  122. u8 reserved_at_20[0x10];
  123. u8 size[0x10];
  124. u8 address[0x40];
  125. u8 data[0][0x8];
  126. };
  127. enum mlx5_ifc_fpga_qp_state {
  128. MLX5_FPGA_QPC_STATE_INIT = 0x0,
  129. MLX5_FPGA_QPC_STATE_ACTIVE = 0x1,
  130. MLX5_FPGA_QPC_STATE_ERROR = 0x2,
  131. };
  132. enum mlx5_ifc_fpga_qp_type {
  133. MLX5_FPGA_QPC_QP_TYPE_SHELL_QP = 0x0,
  134. MLX5_FPGA_QPC_QP_TYPE_SANDBOX_QP = 0x1,
  135. };
  136. enum mlx5_ifc_fpga_qp_service_type {
  137. MLX5_FPGA_QPC_ST_RC = 0x0,
  138. };
  139. struct mlx5_ifc_fpga_qpc_bits {
  140. u8 state[0x4];
  141. u8 reserved_at_4[0x1b];
  142. u8 qp_type[0x1];
  143. u8 reserved_at_20[0x4];
  144. u8 st[0x4];
  145. u8 reserved_at_28[0x10];
  146. u8 traffic_class[0x8];
  147. u8 ether_type[0x10];
  148. u8 prio[0x3];
  149. u8 dei[0x1];
  150. u8 vid[0xc];
  151. u8 reserved_at_60[0x20];
  152. u8 reserved_at_80[0x8];
  153. u8 next_rcv_psn[0x18];
  154. u8 reserved_at_a0[0x8];
  155. u8 next_send_psn[0x18];
  156. u8 reserved_at_c0[0x10];
  157. u8 pkey[0x10];
  158. u8 reserved_at_e0[0x8];
  159. u8 remote_qpn[0x18];
  160. u8 reserved_at_100[0x15];
  161. u8 rnr_retry[0x3];
  162. u8 reserved_at_118[0x5];
  163. u8 retry_count[0x3];
  164. u8 reserved_at_120[0x20];
  165. u8 reserved_at_140[0x10];
  166. u8 remote_mac_47_32[0x10];
  167. u8 remote_mac_31_0[0x20];
  168. u8 remote_ip[16][0x8];
  169. u8 reserved_at_200[0x40];
  170. u8 reserved_at_240[0x10];
  171. u8 fpga_mac_47_32[0x10];
  172. u8 fpga_mac_31_0[0x20];
  173. u8 fpga_ip[16][0x8];
  174. };
  175. struct mlx5_ifc_fpga_create_qp_in_bits {
  176. u8 opcode[0x10];
  177. u8 reserved_at_10[0x10];
  178. u8 reserved_at_20[0x10];
  179. u8 op_mod[0x10];
  180. u8 reserved_at_40[0x40];
  181. struct mlx5_ifc_fpga_qpc_bits fpga_qpc;
  182. };
  183. struct mlx5_ifc_fpga_create_qp_out_bits {
  184. u8 status[0x8];
  185. u8 reserved_at_8[0x18];
  186. u8 syndrome[0x20];
  187. u8 reserved_at_40[0x8];
  188. u8 fpga_qpn[0x18];
  189. u8 reserved_at_60[0x20];
  190. struct mlx5_ifc_fpga_qpc_bits fpga_qpc;
  191. };
  192. struct mlx5_ifc_fpga_modify_qp_in_bits {
  193. u8 opcode[0x10];
  194. u8 reserved_at_10[0x10];
  195. u8 reserved_at_20[0x10];
  196. u8 op_mod[0x10];
  197. u8 reserved_at_40[0x8];
  198. u8 fpga_qpn[0x18];
  199. u8 field_select[0x20];
  200. struct mlx5_ifc_fpga_qpc_bits fpga_qpc;
  201. };
  202. struct mlx5_ifc_fpga_modify_qp_out_bits {
  203. u8 status[0x8];
  204. u8 reserved_at_8[0x18];
  205. u8 syndrome[0x20];
  206. u8 reserved_at_40[0x40];
  207. };
  208. struct mlx5_ifc_fpga_query_qp_in_bits {
  209. u8 opcode[0x10];
  210. u8 reserved_at_10[0x10];
  211. u8 reserved_at_20[0x10];
  212. u8 op_mod[0x10];
  213. u8 reserved_at_40[0x8];
  214. u8 fpga_qpn[0x18];
  215. u8 reserved_at_60[0x20];
  216. };
  217. struct mlx5_ifc_fpga_query_qp_out_bits {
  218. u8 status[0x8];
  219. u8 reserved_at_8[0x18];
  220. u8 syndrome[0x20];
  221. u8 reserved_at_40[0x40];
  222. struct mlx5_ifc_fpga_qpc_bits fpga_qpc;
  223. };
  224. struct mlx5_ifc_fpga_query_qp_counters_in_bits {
  225. u8 opcode[0x10];
  226. u8 reserved_at_10[0x10];
  227. u8 reserved_at_20[0x10];
  228. u8 op_mod[0x10];
  229. u8 clear[0x1];
  230. u8 reserved_at_41[0x7];
  231. u8 fpga_qpn[0x18];
  232. u8 reserved_at_60[0x20];
  233. };
  234. struct mlx5_ifc_fpga_query_qp_counters_out_bits {
  235. u8 status[0x8];
  236. u8 reserved_at_8[0x18];
  237. u8 syndrome[0x20];
  238. u8 reserved_at_40[0x40];
  239. u8 rx_ack_packets[0x40];
  240. u8 rx_send_packets[0x40];
  241. u8 tx_ack_packets[0x40];
  242. u8 tx_send_packets[0x40];
  243. u8 rx_total_drop[0x40];
  244. u8 reserved_at_1c0[0x1c0];
  245. };
  246. struct mlx5_ifc_fpga_destroy_qp_in_bits {
  247. u8 opcode[0x10];
  248. u8 reserved_at_10[0x10];
  249. u8 reserved_at_20[0x10];
  250. u8 op_mod[0x10];
  251. u8 reserved_at_40[0x8];
  252. u8 fpga_qpn[0x18];
  253. u8 reserved_at_60[0x20];
  254. };
  255. struct mlx5_ifc_fpga_destroy_qp_out_bits {
  256. u8 status[0x8];
  257. u8 reserved_at_8[0x18];
  258. u8 syndrome[0x20];
  259. u8 reserved_at_40[0x40];
  260. };
  261. enum {
  262. MLX5_FPGA_QP_ERROR_EVENT_SYNDROME_RETRY_COUNTER_EXPIRED = 0x1,
  263. MLX5_FPGA_QP_ERROR_EVENT_SYNDROME_RNR_EXPIRED = 0x2,
  264. };
  265. struct mlx5_ifc_fpga_qp_error_event_bits {
  266. u8 reserved_at_0[0x40];
  267. u8 reserved_at_40[0x18];
  268. u8 syndrome[0x8];
  269. u8 reserved_at_60[0x60];
  270. u8 reserved_at_c0[0x8];
  271. u8 fpga_qpn[0x18];
  272. };
  273. #endif /* MLX5_IFC_FPGA_H */