diff options
| author | Vasundhara Volam <vasundhara.volam@emulex.com> | 2015-02-06 08:18:38 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-02-08 01:50:58 -0500 |
| commit | 81a9e226ff2c5cf963a79c1cbecd6e68c0e35a21 (patch) | |
| tree | c4efe34ad05b82a019276ada37d7725a7fc7e1b4 | |
| parent | 5d3acd0d161012caee0a8be2d03ac04ba901df09 (diff) | |
be2net: avoid flashing SH-B0 UFI image on SH-P2 chip
Skyhawk-B0 FW UFI is not compatible to flash on Skyhawk-P2 ASIC.
But, Skyhawk-P2 FW UFI is compatible with both B0 and P2 chips.
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>
| -rw-r--r-- | drivers/net/ethernet/emulex/benet/be_cmds.h | 1 | ||||
| -rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.h b/drivers/net/ethernet/emulex/benet/be_cmds.h index bed4a32c41f3..774c5d1719e1 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.h +++ b/drivers/net/ethernet/emulex/benet/be_cmds.h | |||
| @@ -1093,6 +1093,7 @@ struct be_cmd_req_query_fw_cfg { | |||
| 1093 | 1093 | ||
| 1094 | /* ASIC revisions */ | 1094 | /* ASIC revisions */ |
| 1095 | #define ASIC_REV_B0 0x10 | 1095 | #define ASIC_REV_B0 0x10 |
| 1096 | #define ASIC_REV_P2 0x11 | ||
| 1096 | 1097 | ||
| 1097 | struct be_cmd_resp_query_fw_cfg { | 1098 | struct be_cmd_resp_query_fw_cfg { |
| 1098 | struct be_cmd_resp_hdr hdr; | 1099 | struct be_cmd_resp_hdr hdr; |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 2b9e1be1568d..36f140a9c31e 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
| @@ -4336,6 +4336,7 @@ static int lancer_fw_download(struct be_adapter *adapter, | |||
| 4336 | #define BE3_UFI 3 | 4336 | #define BE3_UFI 3 |
| 4337 | #define BE3R_UFI 10 | 4337 | #define BE3R_UFI 10 |
| 4338 | #define SH_UFI 4 | 4338 | #define SH_UFI 4 |
| 4339 | #define SH_P2_UFI 11 | ||
| 4339 | 4340 | ||
| 4340 | static int be_get_ufi_type(struct be_adapter *adapter, | 4341 | static int be_get_ufi_type(struct be_adapter *adapter, |
| 4341 | struct flash_file_hdr_g3 *fhdr) | 4342 | struct flash_file_hdr_g3 *fhdr) |
| @@ -4350,7 +4351,8 @@ static int be_get_ufi_type(struct be_adapter *adapter, | |||
| 4350 | */ | 4351 | */ |
| 4351 | switch (fhdr->build[0]) { | 4352 | switch (fhdr->build[0]) { |
| 4352 | case BLD_STR_UFI_TYPE_SH: | 4353 | case BLD_STR_UFI_TYPE_SH: |
| 4353 | return SH_UFI; | 4354 | return (fhdr->asic_type_rev == ASIC_REV_P2) ? SH_P2_UFI : |
| 4355 | SH_UFI; | ||
| 4354 | case BLD_STR_UFI_TYPE_BE3: | 4356 | case BLD_STR_UFI_TYPE_BE3: |
| 4355 | return (fhdr->asic_type_rev == ASIC_REV_B0) ? BE3R_UFI : | 4357 | return (fhdr->asic_type_rev == ASIC_REV_B0) ? BE3R_UFI : |
| 4356 | BE3_UFI; | 4358 | BE3_UFI; |
| @@ -4364,6 +4366,7 @@ static int be_get_ufi_type(struct be_adapter *adapter, | |||
| 4364 | /* Check if the flash image file is compatible with the adapter that | 4366 | /* Check if the flash image file is compatible with the adapter that |
| 4365 | * is being flashed. | 4367 | * is being flashed. |
| 4366 | * BE3 chips with asic-rev B0 must be flashed only with BE3R_UFI type. | 4368 | * BE3 chips with asic-rev B0 must be flashed only with BE3R_UFI type. |
| 4369 | * Skyhawk chips with asic-rev P2 must be flashed only with SH_P2_UFI type. | ||
| 4367 | */ | 4370 | */ |
| 4368 | static bool be_check_ufi_compatibility(struct be_adapter *adapter, | 4371 | static bool be_check_ufi_compatibility(struct be_adapter *adapter, |
| 4369 | struct flash_file_hdr_g3 *fhdr) | 4372 | struct flash_file_hdr_g3 *fhdr) |
| @@ -4371,8 +4374,11 @@ static bool be_check_ufi_compatibility(struct be_adapter *adapter, | |||
| 4371 | int ufi_type = be_get_ufi_type(adapter, fhdr); | 4374 | int ufi_type = be_get_ufi_type(adapter, fhdr); |
| 4372 | 4375 | ||
| 4373 | switch (ufi_type) { | 4376 | switch (ufi_type) { |
| 4374 | case SH_UFI: | 4377 | case SH_P2_UFI: |
| 4375 | return skyhawk_chip(adapter); | 4378 | return skyhawk_chip(adapter); |
| 4379 | case SH_UFI: | ||
| 4380 | return (skyhawk_chip(adapter) && | ||
| 4381 | adapter->asic_rev < ASIC_REV_P2); | ||
| 4376 | case BE3R_UFI: | 4382 | case BE3R_UFI: |
| 4377 | return BE3_chip(adapter); | 4383 | return BE3_chip(adapter); |
| 4378 | case BE3_UFI: | 4384 | case BE3_UFI: |
