Skip to content

Commit b7a49f7

Browse files
manishc88davem330
authored andcommitted
bnx2x: Utilize firmware 7.13.21.0
This new firmware addresses few important issues and enhancements as mentioned below - - Support direct invalidation of FP HSI Ver per function ID, required for invalidating FP HSI Ver prior to each VF start, as there is no VF start - BRB hardware block parity error detection support for the driver - Fix the FCOE underrun flow - Fix PSOD during FCoE BFS over the NIC ports after preboot driver - Maintains backward compatibility This patch incorporates this new firmware 7.13.21.0 in bnx2x driver. Signed-off-by: Manish Chopra <[email protected]> Signed-off-by: Prabhakar Kushwaha <[email protected]> Signed-off-by: Alok Prasad <[email protected]> Signed-off-by: Ariel Elior <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 434ed21 commit b7a49f7

File tree

5 files changed

+69
-28
lines changed

5 files changed

+69
-28
lines changed

drivers/net/ethernet/broadcom/bnx2x/bnx2x.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1850,6 +1850,14 @@ struct bnx2x {
18501850

18511851
/* Vxlan/Geneve related information */
18521852
u16 udp_tunnel_ports[BNX2X_UDP_PORT_MAX];
1853+
1854+
#define FW_CAP_INVALIDATE_VF_FP_HSI BIT(0)
1855+
u32 fw_cap;
1856+
1857+
u32 fw_major;
1858+
u32 fw_minor;
1859+
u32 fw_rev;
1860+
u32 fw_eng;
18531861
};
18541862

18551863
/* Tx queues may be less or equal to Rx queues */
@@ -2525,5 +2533,6 @@ void bnx2x_register_phc(struct bnx2x *bp);
25252533
* Meant for implicit re-load flows.
25262534
*/
25272535
int bnx2x_vlan_reconfigure_vid(struct bnx2x *bp);
2528-
2536+
int bnx2x_init_firmware(struct bnx2x *bp);
2537+
void bnx2x_release_firmware(struct bnx2x *bp);
25292538
#endif /* bnx2x.h */

drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,10 +2365,8 @@ int bnx2x_compare_fw_ver(struct bnx2x *bp, u32 load_code, bool print_err)
23652365
if (load_code != FW_MSG_CODE_DRV_LOAD_COMMON_CHIP &&
23662366
load_code != FW_MSG_CODE_DRV_LOAD_COMMON) {
23672367
/* build my FW version dword */
2368-
u32 my_fw = (BCM_5710_FW_MAJOR_VERSION) +
2369-
(BCM_5710_FW_MINOR_VERSION << 8) +
2370-
(BCM_5710_FW_REVISION_VERSION << 16) +
2371-
(BCM_5710_FW_ENGINEERING_VERSION << 24);
2368+
u32 my_fw = (bp->fw_major) + (bp->fw_minor << 8) +
2369+
(bp->fw_rev << 16) + (bp->fw_eng << 24);
23722370

23732371
/* read loaded FW from chip */
23742372
u32 loaded_fw = REG_RD(bp, XSEM_REG_PRAM);

drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@
241241
IRO[221].m2))
242242
#define XSTORM_VF_TO_PF_OFFSET(funcId) \
243243
(IRO[48].base + ((funcId) * IRO[48].m1))
244+
#define XSTORM_ETH_FUNCTION_INFO_FP_HSI_VALID_E2_OFFSET(fid) \
245+
(IRO[386].base + ((fid) * IRO[386].m1))
244246
#define COMMON_ASM_INVALID_ASSERT_OPCODE 0x0
245247

246248
/* eth hsi version */

drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3024,7 +3024,8 @@ struct afex_stats {
30243024

30253025
#define BCM_5710_FW_MAJOR_VERSION 7
30263026
#define BCM_5710_FW_MINOR_VERSION 13
3027-
#define BCM_5710_FW_REVISION_VERSION 15
3027+
#define BCM_5710_FW_REVISION_VERSION 21
3028+
#define BCM_5710_FW_REVISION_VERSION_V15 15
30283029
#define BCM_5710_FW_ENGINEERING_VERSION 0
30293030
#define BCM_5710_FW_COMPILE_FLAGS 1
30303031

drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

Lines changed: 53 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,19 @@
7474
__stringify(BCM_5710_FW_MINOR_VERSION) "." \
7575
__stringify(BCM_5710_FW_REVISION_VERSION) "." \
7676
__stringify(BCM_5710_FW_ENGINEERING_VERSION)
77+
78+
#define FW_FILE_VERSION_V15 \
79+
__stringify(BCM_5710_FW_MAJOR_VERSION) "." \
80+
__stringify(BCM_5710_FW_MINOR_VERSION) "." \
81+
__stringify(BCM_5710_FW_REVISION_VERSION_V15) "." \
82+
__stringify(BCM_5710_FW_ENGINEERING_VERSION)
83+
7784
#define FW_FILE_NAME_E1 "bnx2x/bnx2x-e1-" FW_FILE_VERSION ".fw"
7885
#define FW_FILE_NAME_E1H "bnx2x/bnx2x-e1h-" FW_FILE_VERSION ".fw"
7986
#define FW_FILE_NAME_E2 "bnx2x/bnx2x-e2-" FW_FILE_VERSION ".fw"
87+
#define FW_FILE_NAME_E1_V15 "bnx2x/bnx2x-e1-" FW_FILE_VERSION_V15 ".fw"
88+
#define FW_FILE_NAME_E1H_V15 "bnx2x/bnx2x-e1h-" FW_FILE_VERSION_V15 ".fw"
89+
#define FW_FILE_NAME_E2_V15 "bnx2x/bnx2x-e2-" FW_FILE_VERSION_V15 ".fw"
8090

8191
/* Time in jiffies before concluding the transmitter is hung */
8292
#define TX_TIMEOUT (5*HZ)
@@ -747,9 +757,7 @@ static int bnx2x_mc_assert(struct bnx2x *bp)
747757
CHIP_IS_E1(bp) ? "everest1" :
748758
CHIP_IS_E1H(bp) ? "everest1h" :
749759
CHIP_IS_E2(bp) ? "everest2" : "everest3",
750-
BCM_5710_FW_MAJOR_VERSION,
751-
BCM_5710_FW_MINOR_VERSION,
752-
BCM_5710_FW_REVISION_VERSION);
760+
bp->fw_major, bp->fw_minor, bp->fw_rev);
753761

754762
return rc;
755763
}
@@ -12308,6 +12316,15 @@ static int bnx2x_init_bp(struct bnx2x *bp)
1230812316

1230912317
bnx2x_read_fwinfo(bp);
1231012318

12319+
if (IS_PF(bp)) {
12320+
rc = bnx2x_init_firmware(bp);
12321+
12322+
if (rc) {
12323+
bnx2x_free_mem_bp(bp);
12324+
return rc;
12325+
}
12326+
}
12327+
1231112328
func = BP_FUNC(bp);
1231212329

1231312330
/* need to reset chip if undi was active */
@@ -12320,6 +12337,7 @@ static int bnx2x_init_bp(struct bnx2x *bp)
1232012337

1232112338
rc = bnx2x_prev_unload(bp);
1232212339
if (rc) {
12340+
bnx2x_release_firmware(bp);
1232312341
bnx2x_free_mem_bp(bp);
1232412342
return rc;
1232512343
}
@@ -13317,16 +13335,11 @@ static int bnx2x_check_firmware(struct bnx2x *bp)
1331713335
/* Check FW version */
1331813336
offset = be32_to_cpu(fw_hdr->fw_version.offset);
1331913337
fw_ver = firmware->data + offset;
13320-
if ((fw_ver[0] != BCM_5710_FW_MAJOR_VERSION) ||
13321-
(fw_ver[1] != BCM_5710_FW_MINOR_VERSION) ||
13322-
(fw_ver[2] != BCM_5710_FW_REVISION_VERSION) ||
13323-
(fw_ver[3] != BCM_5710_FW_ENGINEERING_VERSION)) {
13338+
if (fw_ver[0] != bp->fw_major || fw_ver[1] != bp->fw_minor ||
13339+
fw_ver[2] != bp->fw_rev || fw_ver[3] != bp->fw_eng) {
1332413340
BNX2X_ERR("Bad FW version:%d.%d.%d.%d. Should be %d.%d.%d.%d\n",
13325-
fw_ver[0], fw_ver[1], fw_ver[2], fw_ver[3],
13326-
BCM_5710_FW_MAJOR_VERSION,
13327-
BCM_5710_FW_MINOR_VERSION,
13328-
BCM_5710_FW_REVISION_VERSION,
13329-
BCM_5710_FW_ENGINEERING_VERSION);
13341+
fw_ver[0], fw_ver[1], fw_ver[2], fw_ver[3],
13342+
bp->fw_major, bp->fw_minor, bp->fw_rev, bp->fw_eng);
1333013343
return -EINVAL;
1333113344
}
1333213345

@@ -13404,34 +13417,51 @@ do { \
1340413417
(u8 *)bp->arr, len); \
1340513418
} while (0)
1340613419

13407-
static int bnx2x_init_firmware(struct bnx2x *bp)
13420+
int bnx2x_init_firmware(struct bnx2x *bp)
1340813421
{
13409-
const char *fw_file_name;
13422+
const char *fw_file_name, *fw_file_name_v15;
1341013423
struct bnx2x_fw_file_hdr *fw_hdr;
1341113424
int rc;
1341213425

1341313426
if (bp->firmware)
1341413427
return 0;
1341513428

13416-
if (CHIP_IS_E1(bp))
13429+
if (CHIP_IS_E1(bp)) {
1341713430
fw_file_name = FW_FILE_NAME_E1;
13418-
else if (CHIP_IS_E1H(bp))
13431+
fw_file_name_v15 = FW_FILE_NAME_E1_V15;
13432+
} else if (CHIP_IS_E1H(bp)) {
1341913433
fw_file_name = FW_FILE_NAME_E1H;
13420-
else if (!CHIP_IS_E1x(bp))
13434+
fw_file_name_v15 = FW_FILE_NAME_E1H_V15;
13435+
} else if (!CHIP_IS_E1x(bp)) {
1342113436
fw_file_name = FW_FILE_NAME_E2;
13422-
else {
13437+
fw_file_name_v15 = FW_FILE_NAME_E2_V15;
13438+
} else {
1342313439
BNX2X_ERR("Unsupported chip revision\n");
1342413440
return -EINVAL;
1342513441
}
13442+
1342613443
BNX2X_DEV_INFO("Loading %s\n", fw_file_name);
1342713444

1342813445
rc = request_firmware(&bp->firmware, fw_file_name, &bp->pdev->dev);
1342913446
if (rc) {
13430-
BNX2X_ERR("Can't load firmware file %s\n",
13431-
fw_file_name);
13432-
goto request_firmware_exit;
13447+
BNX2X_DEV_INFO("Trying to load older fw %s\n", fw_file_name_v15);
13448+
13449+
/* try to load prev version */
13450+
rc = request_firmware(&bp->firmware, fw_file_name_v15, &bp->pdev->dev);
13451+
13452+
if (rc)
13453+
goto request_firmware_exit;
13454+
13455+
bp->fw_rev = BCM_5710_FW_REVISION_VERSION_V15;
13456+
} else {
13457+
bp->fw_cap |= FW_CAP_INVALIDATE_VF_FP_HSI;
13458+
bp->fw_rev = BCM_5710_FW_REVISION_VERSION;
1343313459
}
1343413460

13461+
bp->fw_major = BCM_5710_FW_MAJOR_VERSION;
13462+
bp->fw_minor = BCM_5710_FW_MINOR_VERSION;
13463+
bp->fw_eng = BCM_5710_FW_ENGINEERING_VERSION;
13464+
1343513465
rc = bnx2x_check_firmware(bp);
1343613466
if (rc) {
1343713467
BNX2X_ERR("Corrupt firmware file %s\n", fw_file_name);
@@ -13487,7 +13517,7 @@ static int bnx2x_init_firmware(struct bnx2x *bp)
1348713517
return rc;
1348813518
}
1348913519

13490-
static void bnx2x_release_firmware(struct bnx2x *bp)
13520+
void bnx2x_release_firmware(struct bnx2x *bp)
1349113521
{
1349213522
kfree(bp->init_ops_offsets);
1349313523
kfree(bp->init_ops);
@@ -14004,6 +14034,7 @@ static int bnx2x_init_one(struct pci_dev *pdev,
1400414034
return 0;
1400514035

1400614036
init_one_freemem:
14037+
bnx2x_release_firmware(bp);
1400714038
bnx2x_free_mem_bp(bp);
1400814039

1400914040
init_one_exit:

0 commit comments

Comments
 (0)