aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/emulex
diff options
context:
space:
mode:
authorVasundhara Volam <vasundhara.volam@emulex.com>2015-01-20 03:51:48 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-24 20:22:42 -0500
commite02cfd96a2726a06d29c5b44e0f0375048ae9da1 (patch)
treeb1d53416dd161e86351b17a6ac565bac0beff985 /drivers/net/ethernet/emulex
parent9a6d73d9f297fd1bf7514bf2b1dc2f4b48c638b9 (diff)
be2net: move definitions related to FW cmdsfrom be_hw.h to be_cmds.h
Some FW cmd related definitions were included in be_hw.h Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex')
-rw-r--r--drivers/net/ethernet/emulex/benet/be_cmds.h175
-rw-r--r--drivers/net/ethernet/emulex/benet/be_hw.h223
-rw-r--r--drivers/net/ethernet/emulex/benet/be_main.c2
3 files changed, 176 insertions, 224 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h
index eb5085d6794f..c2701ccd0a1d 100644
--- a/drivers/net/ethernet/emulex/benet/be_cmds.h
+++ b/drivers/net/ethernet/emulex/benet/be_cmds.h
@@ -1161,7 +1161,167 @@ struct be_cmd_resp_get_beacon_state {
1161 u8 rsvd0[3]; 1161 u8 rsvd0[3];
1162} __packed; 1162} __packed;
1163 1163
1164/* Flashrom related descriptors */
1165#define MAX_FLASH_COMP 32
1166
1167#define OPTYPE_ISCSI_ACTIVE 0
1168#define OPTYPE_REDBOOT 1
1169#define OPTYPE_BIOS 2
1170#define OPTYPE_PXE_BIOS 3
1171#define OPTYPE_FCOE_BIOS 8
1172#define OPTYPE_ISCSI_BACKUP 9
1173#define OPTYPE_FCOE_FW_ACTIVE 10
1174#define OPTYPE_FCOE_FW_BACKUP 11
1175#define OPTYPE_NCSI_FW 13
1176#define OPTYPE_REDBOOT_DIR 18
1177#define OPTYPE_REDBOOT_CONFIG 19
1178#define OPTYPE_SH_PHY_FW 21
1179#define OPTYPE_FLASHISM_JUMPVECTOR 22
1180#define OPTYPE_UFI_DIR 23
1181#define OPTYPE_PHY_FW 99
1182
1183#define FLASH_BIOS_IMAGE_MAX_SIZE_g2 262144 /* Max OPTION ROM image sz */
1184#define FLASH_REDBOOT_IMAGE_MAX_SIZE_g2 262144 /* Max Redboot image sz */
1185#define FLASH_IMAGE_MAX_SIZE_g2 1310720 /* Max firmware image size */
1186
1187#define FLASH_NCSI_IMAGE_MAX_SIZE_g3 262144
1188#define FLASH_PHY_FW_IMAGE_MAX_SIZE_g3 262144
1189#define FLASH_BIOS_IMAGE_MAX_SIZE_g3 524288 /* Max OPTION ROM image sz */
1190#define FLASH_REDBOOT_IMAGE_MAX_SIZE_g3 1048576 /* Max Redboot image sz */
1191#define FLASH_IMAGE_MAX_SIZE_g3 2097152 /* Max firmware image size */
1192
1193/* Offsets for components on Flash. */
1194#define FLASH_REDBOOT_START_g2 0
1195#define FLASH_FCoE_BIOS_START_g2 524288
1196#define FLASH_iSCSI_PRIMARY_IMAGE_START_g2 1048576
1197#define FLASH_iSCSI_BACKUP_IMAGE_START_g2 2359296
1198#define FLASH_FCoE_PRIMARY_IMAGE_START_g2 3670016
1199#define FLASH_FCoE_BACKUP_IMAGE_START_g2 4980736
1200#define FLASH_iSCSI_BIOS_START_g2 7340032
1201#define FLASH_PXE_BIOS_START_g2 7864320
1202
1203#define FLASH_REDBOOT_START_g3 262144
1204#define FLASH_PHY_FW_START_g3 1310720
1205#define FLASH_iSCSI_PRIMARY_IMAGE_START_g3 2097152
1206#define FLASH_iSCSI_BACKUP_IMAGE_START_g3 4194304
1207#define FLASH_FCoE_PRIMARY_IMAGE_START_g3 6291456
1208#define FLASH_FCoE_BACKUP_IMAGE_START_g3 8388608
1209#define FLASH_iSCSI_BIOS_START_g3 12582912
1210#define FLASH_PXE_BIOS_START_g3 13107200
1211#define FLASH_FCoE_BIOS_START_g3 13631488
1212#define FLASH_NCSI_START_g3 15990784
1213
1214#define IMAGE_NCSI 16
1215#define IMAGE_OPTION_ROM_PXE 32
1216#define IMAGE_OPTION_ROM_FCoE 33
1217#define IMAGE_OPTION_ROM_ISCSI 34
1218#define IMAGE_FLASHISM_JUMPVECTOR 48
1219#define IMAGE_FIRMWARE_iSCSI 160
1220#define IMAGE_FIRMWARE_FCoE 162
1221#define IMAGE_FIRMWARE_BACKUP_iSCSI 176
1222#define IMAGE_FIRMWARE_BACKUP_FCoE 178
1223#define IMAGE_FIRMWARE_PHY 192
1224#define IMAGE_REDBOOT_DIR 208
1225#define IMAGE_REDBOOT_CONFIG 209
1226#define IMAGE_UFI_DIR 210
1227#define IMAGE_BOOT_CODE 224
1228
1229struct controller_id {
1230 u32 vendor;
1231 u32 device;
1232 u32 subvendor;
1233 u32 subdevice;
1234};
1235
1236struct flash_comp {
1237 unsigned long offset;
1238 int optype;
1239 int size;
1240 int img_type;
1241};
1242
1243struct image_hdr {
1244 u32 imageid;
1245 u32 imageoffset;
1246 u32 imagelength;
1247 u32 image_checksum;
1248 u8 image_version[32];
1249};
1250
1251struct flash_file_hdr_g2 {
1252 u8 sign[32];
1253 u32 cksum;
1254 u32 antidote;
1255 struct controller_id cont_id;
1256 u32 file_len;
1257 u32 chunk_num;
1258 u32 total_chunks;
1259 u32 num_imgs;
1260 u8 build[24];
1261};
1262
1263struct flash_file_hdr_g3 {
1264 u8 sign[52];
1265 u8 ufi_version[4];
1266 u32 file_len;
1267 u32 cksum;
1268 u32 antidote;
1269 u32 num_imgs;
1270 u8 build[24];
1271 u8 asic_type_rev;
1272 u8 rsvd[31];
1273};
1274
1275struct flash_section_hdr {
1276 u32 format_rev;
1277 u32 cksum;
1278 u32 antidote;
1279 u32 num_images;
1280 u8 id_string[128];
1281 u32 rsvd[4];
1282} __packed;
1283
1284struct flash_section_hdr_g2 {
1285 u32 format_rev;
1286 u32 cksum;
1287 u32 antidote;
1288 u32 build_num;
1289 u8 id_string[128];
1290 u32 rsvd[8];
1291} __packed;
1292
1293struct flash_section_entry {
1294 u32 type;
1295 u32 offset;
1296 u32 pad_size;
1297 u32 image_size;
1298 u32 cksum;
1299 u32 entry_point;
1300 u16 optype;
1301 u16 rsvd0;
1302 u32 rsvd1;
1303 u8 ver_data[32];
1304} __packed;
1305
1306struct flash_section_info {
1307 u8 cookie[32];
1308 struct flash_section_hdr fsec_hdr;
1309 struct flash_section_entry fsec_entry[32];
1310} __packed;
1311
1312struct flash_section_info_g2 {
1313 u8 cookie[32];
1314 struct flash_section_hdr_g2 fsec_hdr;
1315 struct flash_section_entry fsec_entry[32];
1316} __packed;
1317
1164/****************** Firmware Flash ******************/ 1318/****************** Firmware Flash ******************/
1319#define FLASHROM_OPER_FLASH 1
1320#define FLASHROM_OPER_SAVE 2
1321#define FLASHROM_OPER_REPORT 4
1322#define FLASHROM_OPER_PHY_FLASH 9
1323#define FLASHROM_OPER_PHY_SAVE 10
1324
1165struct flashrom_params { 1325struct flashrom_params {
1166 u32 op_code; 1326 u32 op_code;
1167 u32 op_type; 1327 u32 op_type;
@@ -1366,6 +1526,7 @@ enum {
1366 PHY_TYPE_QSFP, 1526 PHY_TYPE_QSFP,
1367 PHY_TYPE_KR4_40GB, 1527 PHY_TYPE_KR4_40GB,
1368 PHY_TYPE_KR2_20GB, 1528 PHY_TYPE_KR2_20GB,
1529 PHY_TYPE_TN_8022,
1369 PHY_TYPE_DISABLED = 255 1530 PHY_TYPE_DISABLED = 255
1370}; 1531};
1371 1532
@@ -1429,6 +1590,20 @@ struct be_cmd_req_set_qos {
1429}; 1590};
1430 1591
1431/*********************** Controller Attributes ***********************/ 1592/*********************** Controller Attributes ***********************/
1593struct mgmt_hba_attribs {
1594 u32 rsvd0[24];
1595 u8 controller_model_number[32];
1596 u32 rsvd1[79];
1597 u8 rsvd2[3];
1598 u8 phy_port;
1599 u32 rsvd3[13];
1600} __packed;
1601
1602struct mgmt_controller_attrib {
1603 struct mgmt_hba_attribs hba_attribs;
1604 u32 rsvd0[10];
1605} __packed;
1606
1432struct be_cmd_req_cntl_attribs { 1607struct be_cmd_req_cntl_attribs {
1433 struct be_cmd_req_hdr hdr; 1608 struct be_cmd_req_hdr hdr;
1434}; 1609};
diff --git a/drivers/net/ethernet/emulex/benet/be_hw.h b/drivers/net/ethernet/emulex/benet/be_hw.h
index 6d7b3a4d3cff..8e91ae851a7c 100644
--- a/drivers/net/ethernet/emulex/benet/be_hw.h
+++ b/drivers/net/ethernet/emulex/benet/be_hw.h
@@ -171,94 +171,6 @@
171#define RETRIEVE_FAT 0 171#define RETRIEVE_FAT 0
172#define QUERY_FAT 1 172#define QUERY_FAT 1
173 173
174/* Flashrom related descriptors */
175#define MAX_FLASH_COMP 32
176#define IMAGE_TYPE_FIRMWARE 160
177#define IMAGE_TYPE_BOOTCODE 224
178#define IMAGE_TYPE_OPTIONROM 32
179
180#define NUM_FLASHDIR_ENTRIES 32
181
182#define OPTYPE_ISCSI_ACTIVE 0
183#define OPTYPE_REDBOOT 1
184#define OPTYPE_BIOS 2
185#define OPTYPE_PXE_BIOS 3
186#define OPTYPE_FCOE_BIOS 8
187#define OPTYPE_ISCSI_BACKUP 9
188#define OPTYPE_FCOE_FW_ACTIVE 10
189#define OPTYPE_FCOE_FW_BACKUP 11
190#define OPTYPE_NCSI_FW 13
191#define OPTYPE_REDBOOT_DIR 18
192#define OPTYPE_REDBOOT_CONFIG 19
193#define OPTYPE_SH_PHY_FW 21
194#define OPTYPE_FLASHISM_JUMPVECTOR 22
195#define OPTYPE_UFI_DIR 23
196#define OPTYPE_PHY_FW 99
197#define TN_8022 13
198
199#define FLASHROM_OPER_PHY_FLASH 9
200#define FLASHROM_OPER_PHY_SAVE 10
201#define FLASHROM_OPER_FLASH 1
202#define FLASHROM_OPER_SAVE 2
203#define FLASHROM_OPER_REPORT 4
204
205#define FLASH_IMAGE_MAX_SIZE_g2 (1310720) /* Max firmware image size */
206#define FLASH_BIOS_IMAGE_MAX_SIZE_g2 (262144) /* Max OPTION ROM image sz */
207#define FLASH_REDBOOT_IMAGE_MAX_SIZE_g2 (262144) /* Max Redboot image sz */
208#define FLASH_IMAGE_MAX_SIZE_g3 (2097152) /* Max firmware image size */
209#define FLASH_BIOS_IMAGE_MAX_SIZE_g3 (524288) /* Max OPTION ROM image sz */
210#define FLASH_REDBOOT_IMAGE_MAX_SIZE_g3 (1048576) /* Max Redboot image sz */
211#define FLASH_NCSI_IMAGE_MAX_SIZE_g3 (262144)
212#define FLASH_PHY_FW_IMAGE_MAX_SIZE_g3 262144
213
214#define FLASH_NCSI_MAGIC (0x16032009)
215#define FLASH_NCSI_DISABLED (0)
216#define FLASH_NCSI_ENABLED (1)
217
218#define FLASH_NCSI_BITFILE_HDR_OFFSET (0x600000)
219
220/* Offsets for components on Flash. */
221#define FLASH_iSCSI_PRIMARY_IMAGE_START_g2 (1048576)
222#define FLASH_iSCSI_BACKUP_IMAGE_START_g2 (2359296)
223#define FLASH_FCoE_PRIMARY_IMAGE_START_g2 (3670016)
224#define FLASH_FCoE_BACKUP_IMAGE_START_g2 (4980736)
225#define FLASH_iSCSI_BIOS_START_g2 (7340032)
226#define FLASH_PXE_BIOS_START_g2 (7864320)
227#define FLASH_FCoE_BIOS_START_g2 (524288)
228#define FLASH_REDBOOT_START_g2 (0)
229
230#define FLASH_NCSI_START_g3 (15990784)
231#define FLASH_iSCSI_PRIMARY_IMAGE_START_g3 (2097152)
232#define FLASH_iSCSI_BACKUP_IMAGE_START_g3 (4194304)
233#define FLASH_FCoE_PRIMARY_IMAGE_START_g3 (6291456)
234#define FLASH_FCoE_BACKUP_IMAGE_START_g3 (8388608)
235#define FLASH_iSCSI_BIOS_START_g3 (12582912)
236#define FLASH_PXE_BIOS_START_g3 (13107200)
237#define FLASH_FCoE_BIOS_START_g3 (13631488)
238#define FLASH_REDBOOT_START_g3 (262144)
239#define FLASH_PHY_FW_START_g3 1310720
240
241#define IMAGE_NCSI 16
242#define IMAGE_OPTION_ROM_PXE 32
243#define IMAGE_OPTION_ROM_FCoE 33
244#define IMAGE_OPTION_ROM_ISCSI 34
245#define IMAGE_FLASHISM_JUMPVECTOR 48
246#define IMAGE_FLASH_ISM 49
247#define IMAGE_JUMP_VECTOR 50
248#define IMAGE_FIRMWARE_iSCSI 160
249#define IMAGE_FIRMWARE_COMP_iSCSI 161
250#define IMAGE_FIRMWARE_FCoE 162
251#define IMAGE_FIRMWARE_COMP_FCoE 163
252#define IMAGE_FIRMWARE_BACKUP_iSCSI 176
253#define IMAGE_FIRMWARE_BACKUP_COMP_iSCSI 177
254#define IMAGE_FIRMWARE_BACKUP_FCoE 178
255#define IMAGE_FIRMWARE_BACKUP_COMP_FCoE 179
256#define IMAGE_FIRMWARE_PHY 192
257#define IMAGE_REDBOOT_DIR 208
258#define IMAGE_REDBOOT_CONFIG 209
259#define IMAGE_UFI_DIR 210
260#define IMAGE_BOOT_CODE 224
261
262/************* Rx Packet Type Encoding **************/ 174/************* Rx Packet Type Encoding **************/
263#define BE_UNICAST_PACKET 0 175#define BE_UNICAST_PACKET 0
264#define BE_MULTICAST_PACKET 1 176#define BE_MULTICAST_PACKET 1
@@ -440,138 +352,3 @@ struct amap_eth_rx_compl_v1 {
440struct be_eth_rx_compl { 352struct be_eth_rx_compl {
441 u32 dw[4]; 353 u32 dw[4];
442}; 354};
443
444struct mgmt_hba_attribs {
445 u8 flashrom_version_string[32];
446 u8 manufacturer_name[32];
447 u32 supported_modes;
448 u32 rsvd0[3];
449 u8 ncsi_ver_string[12];
450 u32 default_extended_timeout;
451 u8 controller_model_number[32];
452 u8 controller_description[64];
453 u8 controller_serial_number[32];
454 u8 ip_version_string[32];
455 u8 firmware_version_string[32];
456 u8 bios_version_string[32];
457 u8 redboot_version_string[32];
458 u8 driver_version_string[32];
459 u8 fw_on_flash_version_string[32];
460 u32 functionalities_supported;
461 u16 max_cdblength;
462 u8 asic_revision;
463 u8 generational_guid[16];
464 u8 hba_port_count;
465 u16 default_link_down_timeout;
466 u8 iscsi_ver_min_max;
467 u8 multifunction_device;
468 u8 cache_valid;
469 u8 hba_status;
470 u8 max_domains_supported;
471 u8 phy_port;
472 u32 firmware_post_status;
473 u32 hba_mtu[8];
474 u32 rsvd1[4];
475};
476
477struct mgmt_controller_attrib {
478 struct mgmt_hba_attribs hba_attribs;
479 u16 pci_vendor_id;
480 u16 pci_device_id;
481 u16 pci_sub_vendor_id;
482 u16 pci_sub_system_id;
483 u8 pci_bus_number;
484 u8 pci_device_number;
485 u8 pci_function_number;
486 u8 interface_type;
487 u64 unique_identifier;
488 u32 rsvd0[5];
489};
490
491struct controller_id {
492 u32 vendor;
493 u32 device;
494 u32 subvendor;
495 u32 subdevice;
496};
497
498struct flash_comp {
499 unsigned long offset;
500 int optype;
501 int size;
502 int img_type;
503};
504
505struct image_hdr {
506 u32 imageid;
507 u32 imageoffset;
508 u32 imagelength;
509 u32 image_checksum;
510 u8 image_version[32];
511};
512struct flash_file_hdr_g2 {
513 u8 sign[32];
514 u32 cksum;
515 u32 antidote;
516 struct controller_id cont_id;
517 u32 file_len;
518 u32 chunk_num;
519 u32 total_chunks;
520 u32 num_imgs;
521 u8 build[24];
522};
523
524struct flash_file_hdr_g3 {
525 u8 sign[52];
526 u8 ufi_version[4];
527 u32 file_len;
528 u32 cksum;
529 u32 antidote;
530 u32 num_imgs;
531 u8 build[24];
532 u8 asic_type_rev;
533 u8 rsvd[31];
534};
535
536struct flash_section_hdr {
537 u32 format_rev;
538 u32 cksum;
539 u32 antidote;
540 u32 num_images;
541 u8 id_string[128];
542 u32 rsvd[4];
543} __packed;
544
545struct flash_section_hdr_g2 {
546 u32 format_rev;
547 u32 cksum;
548 u32 antidote;
549 u32 build_num;
550 u8 id_string[128];
551 u32 rsvd[8];
552} __packed;
553
554struct flash_section_entry {
555 u32 type;
556 u32 offset;
557 u32 pad_size;
558 u32 image_size;
559 u32 cksum;
560 u32 entry_point;
561 u16 optype;
562 u16 rsvd0;
563 u32 rsvd1;
564 u8 ver_data[32];
565} __packed;
566
567struct flash_section_info {
568 u8 cookie[32];
569 struct flash_section_hdr fsec_hdr;
570 struct flash_section_entry fsec_entry[32];
571} __packed;
572
573struct flash_section_info_g2 {
574 u8 cookie[32];
575 struct flash_section_hdr_g2 fsec_hdr;
576 struct flash_section_entry fsec_entry[32];
577} __packed;
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index 0b0482b4606d..6c10fece1245 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -3762,7 +3762,7 @@ static char flash_cookie[2][16] = {"*** SE FLAS", "H DIRECTORY *** "};
3762 3762
3763static bool phy_flashing_required(struct be_adapter *adapter) 3763static bool phy_flashing_required(struct be_adapter *adapter)
3764{ 3764{
3765 return (adapter->phy.phy_type == TN_8022 && 3765 return (adapter->phy.phy_type == PHY_TYPE_TN_8022 &&
3766 adapter->phy.interface_type == PHY_TYPE_BASET_10GB); 3766 adapter->phy.interface_type == PHY_TYPE_BASET_10GB);
3767} 3767}
3768 3768