2 * Copyright (c) 2017, Mellanox Technologies, Ltd. All rights reserved.
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:
10 * Redistribution and use in source and binary forms, with or
11 * without modification, are permitted provided that the following
14 * - Redistributions of source code must retain the above
15 * copyright notice, this list of conditions and the following
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.
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
32 #ifndef MLX5_IFC_FPGA_H
33 #define MLX5_IFC_FPGA_H
35 struct mlx5_ifc_ipv4_layout_bits {
36 u8 reserved_at_0[0x60];
41 struct mlx5_ifc_ipv6_layout_bits {
45 union mlx5_ifc_ipv6_layout_ipv4_layout_auto_bits {
46 struct mlx5_ifc_ipv6_layout_bits ipv6_layout;
47 struct mlx5_ifc_ipv4_layout_bits ipv4_layout;
48 u8 reserved_at_0[0x80];
52 MLX5_FPGA_CAP_SANDBOX_VENDOR_ID_MLNX = 0x2c9,
56 MLX5_FPGA_CAP_SANDBOX_PRODUCT_ID_IPSEC = 0x2,
59 struct mlx5_ifc_fpga_shell_caps_bits {
61 u8 reserved_at_10[0x8];
62 u8 total_rcv_credits[0x8];
64 u8 reserved_at_20[0xe];
66 u8 reserved_at_30[0x5];
70 u8 reserved_at_38[0x4];
76 u8 reserved_at_40[0x1a];
79 u8 max_fpga_qp_msg_size[0x20];
81 u8 reserved_at_80[0x180];
84 struct mlx5_ifc_fpga_cap_bits {
88 u8 register_file_ver[0x20];
90 u8 fpga_ctrl_modify[0x1];
91 u8 reserved_at_41[0x5];
92 u8 access_reg_query_mode[0x2];
93 u8 reserved_at_48[0x6];
94 u8 access_reg_modify_mode[0x2];
95 u8 reserved_at_50[0x10];
97 u8 reserved_at_60[0x20];
99 u8 image_version[0x20];
105 u8 shell_version[0x20];
107 u8 reserved_at_100[0x80];
109 struct mlx5_ifc_fpga_shell_caps_bits shell_caps;
111 u8 reserved_at_380[0x8];
112 u8 ieee_vendor_id[0x18];
114 u8 sandbox_product_version[0x10];
115 u8 sandbox_product_id[0x10];
117 u8 sandbox_basic_caps[0x20];
119 u8 reserved_at_3e0[0x10];
120 u8 sandbox_extended_caps_len[0x10];
122 u8 sandbox_extended_caps_addr[0x40];
124 u8 fpga_ddr_start_addr[0x40];
126 u8 fpga_cr_space_start_addr[0x40];
128 u8 fpga_ddr_size[0x20];
130 u8 fpga_cr_space_size[0x20];
132 u8 reserved_at_500[0x300];
136 MLX5_FPGA_CTRL_OPERATION_LOAD = 0x1,
137 MLX5_FPGA_CTRL_OPERATION_RESET = 0x2,
138 MLX5_FPGA_CTRL_OPERATION_FLASH_SELECT = 0x3,
139 MLX5_FPGA_CTRL_OPERATION_SANDBOX_BYPASS_ON = 0x4,
140 MLX5_FPGA_CTRL_OPERATION_SANDBOX_BYPASS_OFF = 0x5,
141 MLX5_FPGA_CTRL_OPERATION_RESET_SANDBOX = 0x6,
144 struct mlx5_ifc_fpga_ctrl_bits {
145 u8 reserved_at_0[0x8];
147 u8 reserved_at_10[0x8];
150 u8 reserved_at_20[0x8];
151 u8 flash_select_admin[0x8];
152 u8 reserved_at_30[0x8];
153 u8 flash_select_oper[0x8];
155 u8 reserved_at_40[0x40];
159 MLX5_FPGA_ERROR_EVENT_SYNDROME_CORRUPTED_DDR = 0x1,
160 MLX5_FPGA_ERROR_EVENT_SYNDROME_FLASH_TIMEOUT = 0x2,
161 MLX5_FPGA_ERROR_EVENT_SYNDROME_INTERNAL_LINK_ERROR = 0x3,
162 MLX5_FPGA_ERROR_EVENT_SYNDROME_WATCHDOG_FAILURE = 0x4,
163 MLX5_FPGA_ERROR_EVENT_SYNDROME_I2C_FAILURE = 0x5,
164 MLX5_FPGA_ERROR_EVENT_SYNDROME_IMAGE_CHANGED = 0x6,
165 MLX5_FPGA_ERROR_EVENT_SYNDROME_TEMPERATURE_CRITICAL = 0x7,
168 struct mlx5_ifc_fpga_error_event_bits {
169 u8 reserved_at_0[0x40];
171 u8 reserved_at_40[0x18];
174 u8 reserved_at_60[0x80];
177 #define MLX5_FPGA_ACCESS_REG_SIZE_MAX 64
179 struct mlx5_ifc_fpga_access_reg_bits {
180 u8 reserved_at_0[0x20];
182 u8 reserved_at_20[0x10];
190 enum mlx5_ifc_fpga_qp_state {
191 MLX5_FPGA_QPC_STATE_INIT = 0x0,
192 MLX5_FPGA_QPC_STATE_ACTIVE = 0x1,
193 MLX5_FPGA_QPC_STATE_ERROR = 0x2,
196 enum mlx5_ifc_fpga_qp_type {
197 MLX5_FPGA_QPC_QP_TYPE_SHELL_QP = 0x0,
198 MLX5_FPGA_QPC_QP_TYPE_SANDBOX_QP = 0x1,
201 enum mlx5_ifc_fpga_qp_service_type {
202 MLX5_FPGA_QPC_ST_RC = 0x0,
205 struct mlx5_ifc_fpga_qpc_bits {
207 u8 reserved_at_4[0x1b];
210 u8 reserved_at_20[0x4];
212 u8 reserved_at_28[0x10];
213 u8 traffic_class[0x8];
220 u8 reserved_at_60[0x20];
222 u8 reserved_at_80[0x8];
223 u8 next_rcv_psn[0x18];
225 u8 reserved_at_a0[0x8];
226 u8 next_send_psn[0x18];
228 u8 reserved_at_c0[0x10];
231 u8 reserved_at_e0[0x8];
234 u8 reserved_at_100[0x15];
236 u8 reserved_at_118[0x5];
239 u8 reserved_at_120[0x20];
241 u8 reserved_at_140[0x10];
242 u8 remote_mac_47_32[0x10];
244 u8 remote_mac_31_0[0x20];
246 u8 remote_ip[16][0x8];
248 u8 reserved_at_200[0x40];
250 u8 reserved_at_240[0x10];
251 u8 fpga_mac_47_32[0x10];
253 u8 fpga_mac_31_0[0x20];
258 struct mlx5_ifc_fpga_create_qp_in_bits {
260 u8 reserved_at_10[0x10];
262 u8 reserved_at_20[0x10];
265 u8 reserved_at_40[0x40];
267 struct mlx5_ifc_fpga_qpc_bits fpga_qpc;
270 struct mlx5_ifc_fpga_create_qp_out_bits {
272 u8 reserved_at_8[0x18];
276 u8 reserved_at_40[0x8];
279 u8 reserved_at_60[0x20];
281 struct mlx5_ifc_fpga_qpc_bits fpga_qpc;
284 struct mlx5_ifc_fpga_modify_qp_in_bits {
286 u8 reserved_at_10[0x10];
288 u8 reserved_at_20[0x10];
291 u8 reserved_at_40[0x8];
294 u8 field_select[0x20];
296 struct mlx5_ifc_fpga_qpc_bits fpga_qpc;
299 struct mlx5_ifc_fpga_modify_qp_out_bits {
301 u8 reserved_at_8[0x18];
305 u8 reserved_at_40[0x40];
308 struct mlx5_ifc_fpga_query_qp_in_bits {
310 u8 reserved_at_10[0x10];
312 u8 reserved_at_20[0x10];
315 u8 reserved_at_40[0x8];
318 u8 reserved_at_60[0x20];
321 struct mlx5_ifc_fpga_query_qp_out_bits {
323 u8 reserved_at_8[0x18];
327 u8 reserved_at_40[0x40];
329 struct mlx5_ifc_fpga_qpc_bits fpga_qpc;
332 struct mlx5_ifc_fpga_query_qp_counters_in_bits {
334 u8 reserved_at_10[0x10];
336 u8 reserved_at_20[0x10];
340 u8 reserved_at_41[0x7];
343 u8 reserved_at_60[0x20];
346 struct mlx5_ifc_fpga_query_qp_counters_out_bits {
348 u8 reserved_at_8[0x18];
352 u8 reserved_at_40[0x40];
354 u8 rx_ack_packets[0x40];
356 u8 rx_send_packets[0x40];
358 u8 tx_ack_packets[0x40];
360 u8 tx_send_packets[0x40];
362 u8 rx_total_drop[0x40];
364 u8 reserved_at_1c0[0x1c0];
367 struct mlx5_ifc_fpga_destroy_qp_in_bits {
369 u8 reserved_at_10[0x10];
371 u8 reserved_at_20[0x10];
374 u8 reserved_at_40[0x8];
377 u8 reserved_at_60[0x20];
380 struct mlx5_ifc_fpga_destroy_qp_out_bits {
382 u8 reserved_at_8[0x18];
386 u8 reserved_at_40[0x40];
390 MLX5_FPGA_QP_ERROR_EVENT_SYNDROME_RETRY_COUNTER_EXPIRED = 0x1,
391 MLX5_FPGA_QP_ERROR_EVENT_SYNDROME_RNR_EXPIRED = 0x2,
394 struct mlx5_ifc_fpga_qp_error_event_bits {
395 u8 reserved_at_0[0x40];
397 u8 reserved_at_40[0x18];
400 u8 reserved_at_60[0x60];
402 u8 reserved_at_c0[0x8];
405 #endif /* MLX5_IFC_FPGA_H */