be2net: avoid flashing SH-B0 UFI image on SH-P2 chip
authorVasundhara Volam <vasundhara.volam@emulex.com>
Fri, 6 Feb 2015 13:18:38 +0000 (08:18 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sun, 8 Feb 2015 06:50:58 +0000 (22:50 -0800)
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>
drivers/net/ethernet/emulex/benet/be_cmds.h
drivers/net/ethernet/emulex/benet/be_main.c

index bed4a32c41f33a93f0e3816c298cf4b5141ef019..774c5d1719e153e25ef76afb742646c8a7945daa 100644 (file)
@@ -1093,6 +1093,7 @@ struct be_cmd_req_query_fw_cfg {
 
 /* ASIC revisions */
 #define ASIC_REV_B0            0x10
+#define ASIC_REV_P2            0x11
 
 struct be_cmd_resp_query_fw_cfg {
        struct be_cmd_resp_hdr hdr;
index 2b9e1be1568d8665ba64e173c602cc7c7b78a504..36f140a9c31e719fb15e1173150132e79ef7b186 100644 (file)
@@ -4336,6 +4336,7 @@ static int lancer_fw_download(struct be_adapter *adapter,
 #define BE3_UFI                3
 #define BE3R_UFI       10
 #define SH_UFI         4
+#define SH_P2_UFI      11
 
 static int be_get_ufi_type(struct be_adapter *adapter,
                           struct flash_file_hdr_g3 *fhdr)
@@ -4350,7 +4351,8 @@ static int be_get_ufi_type(struct be_adapter *adapter,
         */
        switch (fhdr->build[0]) {
        case BLD_STR_UFI_TYPE_SH:
-               return SH_UFI;
+               return (fhdr->asic_type_rev == ASIC_REV_P2) ? SH_P2_UFI :
+                                                               SH_UFI;
        case BLD_STR_UFI_TYPE_BE3:
                return (fhdr->asic_type_rev == ASIC_REV_B0) ? BE3R_UFI :
                                                                BE3_UFI;
@@ -4364,6 +4366,7 @@ static int be_get_ufi_type(struct be_adapter *adapter,
 /* Check if the flash image file is compatible with the adapter that
  * is being flashed.
  * BE3 chips with asic-rev B0 must be flashed only with BE3R_UFI type.
+ * Skyhawk chips with asic-rev P2 must be flashed only with SH_P2_UFI type.
  */
 static bool be_check_ufi_compatibility(struct be_adapter *adapter,
                                       struct flash_file_hdr_g3 *fhdr)
@@ -4371,8 +4374,11 @@ static bool be_check_ufi_compatibility(struct be_adapter *adapter,
        int ufi_type = be_get_ufi_type(adapter, fhdr);
 
        switch (ufi_type) {
-       case SH_UFI:
+       case SH_P2_UFI:
                return skyhawk_chip(adapter);
+       case SH_UFI:
+               return (skyhawk_chip(adapter) &&
+                       adapter->asic_rev < ASIC_REV_P2);
        case BE3R_UFI:
                return BE3_chip(adapter);
        case BE3_UFI: