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_fpga_shell_caps_bits {
37 u8 reserved_at_10[0x8];
38 u8 total_rcv_credits[0x8];
40 u8 reserved_at_20[0xe];
42 u8 reserved_at_30[0x5];
46 u8 reserved_at_38[0x4];
52 u8 reserved_at_40[0x1a];
55 u8 max_fpga_qp_msg_size[0x20];
57 u8 reserved_at_80[0x180];
60 struct mlx5_ifc_fpga_cap_bits {
64 u8 register_file_ver[0x20];
66 u8 fpga_ctrl_modify[0x1];
67 u8 reserved_at_41[0x5];
68 u8 access_reg_query_mode[0x2];
69 u8 reserved_at_48[0x6];
70 u8 access_reg_modify_mode[0x2];
71 u8 reserved_at_50[0x10];
73 u8 reserved_at_60[0x20];
75 u8 image_version[0x20];
81 u8 shell_version[0x20];
83 u8 reserved_at_100[0x80];
85 struct mlx5_ifc_fpga_shell_caps_bits shell_caps;
87 u8 reserved_at_380[0x8];
88 u8 ieee_vendor_id[0x18];
90 u8 sandbox_product_version[0x10];
91 u8 sandbox_product_id[0x10];
93 u8 sandbox_basic_caps[0x20];
95 u8 reserved_at_3e0[0x10];
96 u8 sandbox_extended_caps_len[0x10];
98 u8 sandbox_extended_caps_addr[0x40];
100 u8 fpga_ddr_start_addr[0x40];
102 u8 fpga_cr_space_start_addr[0x40];
104 u8 fpga_ddr_size[0x20];
106 u8 fpga_cr_space_size[0x20];
108 u8 reserved_at_500[0x300];
111 struct mlx5_ifc_fpga_ctrl_bits {
112 u8 reserved_at_0[0x8];
114 u8 reserved_at_10[0x8];
117 u8 reserved_at_20[0x8];
118 u8 flash_select_admin[0x8];
119 u8 reserved_at_30[0x8];
120 u8 flash_select_oper[0x8];
122 u8 reserved_at_40[0x40];
126 MLX5_FPGA_ERROR_EVENT_SYNDROME_CORRUPTED_DDR = 0x1,
127 MLX5_FPGA_ERROR_EVENT_SYNDROME_FLASH_TIMEOUT = 0x2,
128 MLX5_FPGA_ERROR_EVENT_SYNDROME_INTERNAL_LINK_ERROR = 0x3,
129 MLX5_FPGA_ERROR_EVENT_SYNDROME_WATCHDOG_FAILURE = 0x4,
130 MLX5_FPGA_ERROR_EVENT_SYNDROME_I2C_FAILURE = 0x5,
131 MLX5_FPGA_ERROR_EVENT_SYNDROME_IMAGE_CHANGED = 0x6,
132 MLX5_FPGA_ERROR_EVENT_SYNDROME_TEMPERATURE_CRITICAL = 0x7,
135 struct mlx5_ifc_fpga_error_event_bits {
136 u8 reserved_at_0[0x40];
138 u8 reserved_at_40[0x18];
141 u8 reserved_at_60[0x80];
144 enum mlx5_ifc_fpga_qp_state {
145 MLX5_FPGA_QPC_STATE_INIT = 0x0,
146 MLX5_FPGA_QPC_STATE_ACTIVE = 0x1,
147 MLX5_FPGA_QPC_STATE_ERROR = 0x2,
150 enum mlx5_ifc_fpga_qp_type {
151 MLX5_FPGA_QPC_QP_TYPE_SHELL_QP = 0x0,
152 MLX5_FPGA_QPC_QP_TYPE_SANDBOX_QP = 0x1,
155 enum mlx5_ifc_fpga_qp_service_type {
156 MLX5_FPGA_QPC_ST_RC = 0x0,
159 struct mlx5_ifc_fpga_qpc_bits {
161 u8 reserved_at_4[0x1b];
164 u8 reserved_at_20[0x4];
166 u8 reserved_at_28[0x10];
167 u8 traffic_class[0x8];
174 u8 reserved_at_60[0x20];
176 u8 reserved_at_80[0x8];
177 u8 next_rcv_psn[0x18];
179 u8 reserved_at_a0[0x8];
180 u8 next_send_psn[0x18];
182 u8 reserved_at_c0[0x10];
185 u8 reserved_at_e0[0x8];
188 u8 reserved_at_100[0x15];
190 u8 reserved_at_118[0x5];
193 u8 reserved_at_120[0x20];
195 u8 reserved_at_140[0x10];
196 u8 remote_mac_47_32[0x10];
198 u8 remote_mac_31_0[0x20];
200 u8 remote_ip[16][0x8];
202 u8 reserved_at_200[0x40];
204 u8 reserved_at_240[0x10];
205 u8 fpga_mac_47_32[0x10];
207 u8 fpga_mac_31_0[0x20];
212 struct mlx5_ifc_fpga_create_qp_in_bits {
214 u8 reserved_at_10[0x10];
216 u8 reserved_at_20[0x10];
219 u8 reserved_at_40[0x40];
221 struct mlx5_ifc_fpga_qpc_bits fpga_qpc;
224 struct mlx5_ifc_fpga_create_qp_out_bits {
226 u8 reserved_at_8[0x18];
230 u8 reserved_at_40[0x8];
233 u8 reserved_at_60[0x20];
235 struct mlx5_ifc_fpga_qpc_bits fpga_qpc;
238 struct mlx5_ifc_fpga_modify_qp_in_bits {
240 u8 reserved_at_10[0x10];
242 u8 reserved_at_20[0x10];
245 u8 reserved_at_40[0x8];
248 u8 field_select[0x20];
250 struct mlx5_ifc_fpga_qpc_bits fpga_qpc;
253 struct mlx5_ifc_fpga_modify_qp_out_bits {
255 u8 reserved_at_8[0x18];
259 u8 reserved_at_40[0x40];
262 struct mlx5_ifc_fpga_query_qp_in_bits {
264 u8 reserved_at_10[0x10];
266 u8 reserved_at_20[0x10];
269 u8 reserved_at_40[0x8];
272 u8 reserved_at_60[0x20];
275 struct mlx5_ifc_fpga_query_qp_out_bits {
277 u8 reserved_at_8[0x18];
281 u8 reserved_at_40[0x40];
283 struct mlx5_ifc_fpga_qpc_bits fpga_qpc;
286 struct mlx5_ifc_fpga_query_qp_counters_in_bits {
288 u8 reserved_at_10[0x10];
290 u8 reserved_at_20[0x10];
294 u8 reserved_at_41[0x7];
297 u8 reserved_at_60[0x20];
300 struct mlx5_ifc_fpga_query_qp_counters_out_bits {
302 u8 reserved_at_8[0x18];
306 u8 reserved_at_40[0x40];
308 u8 rx_ack_packets[0x40];
310 u8 rx_send_packets[0x40];
312 u8 tx_ack_packets[0x40];
314 u8 tx_send_packets[0x40];
316 u8 rx_total_drop[0x40];
318 u8 reserved_at_1c0[0x1c0];
321 struct mlx5_ifc_fpga_destroy_qp_in_bits {
323 u8 reserved_at_10[0x10];
325 u8 reserved_at_20[0x10];
328 u8 reserved_at_40[0x8];
331 u8 reserved_at_60[0x20];
334 struct mlx5_ifc_fpga_destroy_qp_out_bits {
336 u8 reserved_at_8[0x18];
340 u8 reserved_at_40[0x40];
343 #endif /* MLX5_IFC_FPGA_H */