[golan] Add Connect-IB, ConnectX-4 and ConnectX-4 Lx (Infiniband) support
[ipxe.git] / src / drivers / infiniband / mlx_utils / mlx_lib / mlx_nvconfig / mlx_nvconfig_prm.h
1 #ifndef MLX_NVCONFIG_PRM_H_
2 #define MLX_NVCONFIG_PRM_H_
3
4 /*
5 * Copyright (C) 2015 Mellanox Technologies Ltd.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of the
10 * License, or any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA.
21 */
22
23 FILE_LICENCE ( GPL2_OR_LATER );
24
25 #include "../../include/public/mlx_types.h"
26
27 enum {
28 WAKE_ON_LAN_TYPE = 0x10,
29 VIRTUALIZATION_TYPE = 0x11,
30 VPI_LINK_TYPE = 0x12,
31 BOOT_SETTINGS_EXT_TYPE = 0x2001,
32 BANNER_TO_TYPE = 0x2010,
33 OCSD_OCBB_TYPE = 0x2011,
34 FLOW_CONTROL_TYPE = 0x2020,
35 BOOT_SETTINGS_TYPE = 0x2021,
36 ISCSI_GENERAL_SETTINGS_TYPE = 0x2100,
37 IB_BOOT_SETTING_TYPE = 0x2022,
38 IB_DHCP_SETTINGS_TYPE = 0x2023,
39 GLOPAL_PCI_SETTINGS_TYPE = 0x80,
40 GLOPAL_PCI_CAPS_TYPE = 0x81,
41 GLOBAL_ROM_INI_TYPE = 0x100,
42
43 // Types for iSCSI strings
44 DHCP_VEND_ID = 0x2101,
45 ISCSI_INITIATOR_IPV4_ADDR = 0x2102,
46 ISCSI_INITIATOR_SUBNET = 0x2103,
47 ISCSI_INITIATOR_IPV4_GATEWAY = 0x2104,
48 ISCSI_INITIATOR_IPV4_PRIM_DNS = 0x2105,
49 ISCSI_INITIATOR_IPV4_SECDNS = 0x2106,
50 ISCSI_INITIATOR_NAME = 0x2107,
51 ISCSI_INITIATOR_CHAP_ID = 0x2108,
52 ISCSI_INITIATOR_CHAP_PWD = 0x2109,
53 ISCSI_INITIATOR_DHCP_CONF_TYPE = 0x210a,
54
55 CONNECT_FIRST_TGT = 0x2200,
56 FIRST_TGT_IP_ADDRESS = 0x2201,
57 FIRST_TGT_TCP_PORT = 0x2202,
58 FIRST_TGT_BOOT_LUN = 0x2203,
59 FIRST_TGT_ISCSI_NAME = 0x2204,
60 FIRST_TGT_CHAP_ID = 0x2205,
61 FIRST_TGT_CHAP_PWD = 0x2207,
62 };
63
64 union mlx_nvconfig_nic_boot_conf {
65 struct {
66 mlx_uint32 vlan_id : 12;
67 mlx_uint32 link_speed : 4;
68 mlx_uint32 legacy_boot_prot : 8;
69 mlx_uint32 boot_retry_count : 3;
70 mlx_uint32 boot_strap_type : 3;
71 mlx_uint32 en_vlan : 1;
72 mlx_uint32 en_option_rom : 1;
73 };
74 mlx_uint32 dword;
75 };
76
77 union mlx_nvconfig_nic_boot_ext_conf {
78 struct {
79 mlx_uint32 linkup_timeout : 8;
80 mlx_uint32 ip_ver : 2;
81 mlx_uint32 reserved0 : 22;
82 };
83 mlx_uint32 dword;
84 };
85
86 union mlx_nvconfig_rom_banner_timeout_conf {
87 struct {
88 mlx_uint32 rom_banner_to : 4;
89 mlx_uint32 reserved : 28;
90 };
91 mlx_uint32 dword;
92 };
93
94 union mlx_nvconfig_virt_conf {
95 struct {
96 mlx_uint32 reserved0 :24;
97 mlx_uint32 pf_bar_size_valid :1;
98 mlx_uint32 vf_bar_size_valid :1;
99 mlx_uint32 num_pf_msix_valid :1;
100 mlx_uint32 num_vf_msix_valid :1;
101 mlx_uint32 num_pfs_valid :1;
102 mlx_uint32 fpp_valid :1;
103 mlx_uint32 full_vf_qos_valid :1;
104 mlx_uint32 sriov_valid :1;
105 /*-------------------*/
106 mlx_uint32 num_of_vfs :16;
107 mlx_uint32 num_of_pfs :4;
108 mlx_uint32 reserved1 :9;
109 mlx_uint32 fpp_en :1;
110 mlx_uint32 full_vf_qos :1;
111 mlx_uint32 virt_mode :1; //sriov_en
112 /*-------------------*/
113 mlx_uint32 log_pf_uar_bar_size :6;
114 mlx_uint32 log_vf_uar_bar_size :6;
115 mlx_uint32 num_pf_msix :10;
116 mlx_uint32 num_vf_msix :10;
117 };
118 mlx_uint32 dword[3];
119 };
120
121 union mlx_nvconfig_virt_caps {
122 struct {
123 mlx_uint32 reserved0 :24;
124 mlx_uint32 max_vfs_per_pf_valid :1;
125 mlx_uint32 max_total_msix_valid :1;
126 mlx_uint32 max_total_bar_valid :1;
127 mlx_uint32 num_pfs_supported :1;
128 mlx_uint32 num_vf_msix_supported :1;
129 mlx_uint32 num_pf_msix_supported :1;
130 mlx_uint32 vf_bar_size_supported :1;
131 mlx_uint32 pf_bar_size_supported :1;
132 /*-------------------*/
133 mlx_uint32 max_vfs_per_pf :16;
134 mlx_uint32 max_num_pfs :4;
135 mlx_uint32 reserved1 :9;
136 mlx_uint32 fpp_support :1;
137 mlx_uint32 vf_qos_control_support :1;
138 mlx_uint32 sriov_support :1;
139 /*-------------------*/
140 mlx_uint32 max_log_pf_uar_bar_size :6;
141 mlx_uint32 max_log_vf_uar_bar_size :6;
142 mlx_uint32 max_num_pf_msix :10;
143 mlx_uint32 max_num_vf_msix :10;
144 /*-------------------*/
145 mlx_uint32 max_total_msix;
146 /*-------------------*/
147 mlx_uint32 max_total_bar;
148 };
149 mlx_uint32 dword[5];
150 };
151
152 union mlx_nvconfig_iscsi_init_dhcp_conf {
153 struct {
154 mlx_uint32 reserved0 :30;
155 mlx_uint32 dhcp_iscsi_en :1;
156 mlx_uint32 ipv4_dhcp_en :1;
157
158 };
159 mlx_uint32 dword;
160 };
161
162 union mlx_nvconfig_nic_ib_boot_conf {
163 struct {
164 mlx_uint32 boot_pkey : 16;
165 mlx_uint32 reserved0 : 16;
166 };
167 mlx_uint32 dword;
168 };
169
170 union mlx_nvconfig_wol_conf {
171 struct {
172 mlx_uint32 reserved0 :9;
173 mlx_uint32 en_wol_passwd :1;
174 mlx_uint32 en_wol_magic :1;
175 mlx_uint32 reserved1 :21;
176 mlx_uint32 reserved2 :32;
177 };
178 mlx_uint32 dword[2];
179 };
180
181 union mlx_nvconfig_iscsi_general {
182 struct {
183 mlx_uint32 reserved0 :22;
184 mlx_uint32 boot_to_target :2;
185 mlx_uint32 reserved1 :2;
186 mlx_uint32 vlan_en :1;
187 mlx_uint32 tcp_timestamps_en :1;
188 mlx_uint32 chap_mutual_auth_en :1;
189 mlx_uint32 chap_auth_en :1;
190 mlx_uint32 reserved2 :2;
191 /*-------------------*/
192 mlx_uint32 vlan :12;
193 mlx_uint32 reserved3 :20;
194 /*-------------------*/
195 mlx_uint32 lun_busy_retry_count:8;
196 mlx_uint32 link_up_delay_time :8;
197 mlx_uint32 reserved4 :16;
198 };
199 mlx_uint32 dword[3];
200 };
201
202 union mlx_nvconfig_ib_dhcp_conf {
203 struct {
204 mlx_uint32 reserved :24;
205 mlx_uint32 client_identifier :4;
206 mlx_uint32 mac_admin_bit :4;
207 };
208 mlx_uint32 dword;
209 };
210
211 union mlx_nvconfig_ocsd_ocbb_conf {
212 struct {
213 mlx_uint32 reserved :31;
214 mlx_uint32 ocsd_ocbb_en :1;
215 };
216 mlx_uint32 dword;
217 };
218
219 union mlx_nvconfig_vpi_link_conf {
220 struct {
221 mlx_uint32 network_link_type :2;
222 mlx_uint32 default_link_type :2;
223 mlx_uint32 reserved :28;
224 };
225 mlx_uint32 dword;
226 };
227
228 struct mlx_nvcofnig_romini {
229 mlx_uint32 reserved0 :1;
230 mlx_uint32 shared_memory_en :1;
231 mlx_uint32 hii_vpi_en :1;
232 mlx_uint32 tech_enum :1;
233 mlx_uint32 reserved1 :4;
234 mlx_uint32 static_component_name_string :1;
235 mlx_uint32 hii_iscsi_configuration :1;
236 mlx_uint32 hii_ibm_aim :1;
237 mlx_uint32 hii_platform_setup :1;
238 mlx_uint32 hii_bdf_decimal :1;
239 mlx_uint32 hii_read_only :1;
240 mlx_uint32 reserved2 :10;
241 mlx_uint32 mac_enum :1;
242 mlx_uint32 port_enum :1;
243 mlx_uint32 flash_en :1;
244 mlx_uint32 fmp_en :1;
245 mlx_uint32 bofm_en :1;
246 mlx_uint32 platform_to_driver_en :1;
247 mlx_uint32 hii_en :1;
248 mlx_uint32 undi_en :1;
249 /* -------------- */
250 mlx_uint64 dhcp_user_class;
251 /* -------------- */
252 mlx_uint32 reserved3 :22;
253 mlx_uint32 uri_boot_retry_delay :4;
254 mlx_uint32 uri_boot_retry :4;
255 mlx_uint32 option_rom_debug :1;
256 mlx_uint32 promiscuous_vlan :1;
257 };
258
259 #endif /* MLX_NVCONFIG_PRM_H_ */