@@ -10052,15 +10052,15 @@ static void bnx2x_prev_unload_close_mac(struct bnx2x *bp,
10052
10052
}
10053
10053
10054
10054
#define BNX2X_PREV_UNDI_PROD_ADDR (p ) (BAR_TSTRORM_INTMEM + 0x1508 + ((p) << 4))
10055
+ #define BNX2X_PREV_UNDI_PROD_ADDR_H (f ) (BAR_TSTRORM_INTMEM + \
10056
+ 0x1848 + ((f) << 4))
10055
10057
#define BNX2X_PREV_UNDI_RCQ (val ) ((val) & 0xffff)
10056
10058
#define BNX2X_PREV_UNDI_BD (val ) ((val) >> 16 & 0xffff)
10057
10059
#define BNX2X_PREV_UNDI_PROD (rcq , bd ) ((bd) << 16 | (rcq))
10058
10060
10059
10061
#define BCM_5710_UNDI_FW_MF_MAJOR (0x07)
10060
10062
#define BCM_5710_UNDI_FW_MF_MINOR (0x08)
10061
10063
#define BCM_5710_UNDI_FW_MF_VERS (0x05)
10062
- #define BNX2X_PREV_UNDI_MF_PORT (p ) (BAR_TSTRORM_INTMEM + 0x150c + ((p) << 4))
10063
- #define BNX2X_PREV_UNDI_MF_FUNC (f ) (BAR_TSTRORM_INTMEM + 0x184c + ((f) << 4))
10064
10064
10065
10065
static bool bnx2x_prev_is_after_undi (struct bnx2x * bp )
10066
10066
{
@@ -10079,72 +10079,25 @@ static bool bnx2x_prev_is_after_undi(struct bnx2x *bp)
10079
10079
return false;
10080
10080
}
10081
10081
10082
- static bool bnx2x_prev_unload_undi_fw_supports_mf (struct bnx2x * bp )
10083
- {
10084
- u8 major , minor , version ;
10085
- u32 fw ;
10086
-
10087
- /* Must check that FW is loaded */
10088
- if (!(REG_RD (bp , MISC_REG_RESET_REG_1 ) &
10089
- MISC_REGISTERS_RESET_REG_1_RST_XSEM )) {
10090
- BNX2X_DEV_INFO ("XSEM is reset - UNDI MF FW is not loaded\n" );
10091
- return false;
10092
- }
10093
-
10094
- /* Read Currently loaded FW version */
10095
- fw = REG_RD (bp , XSEM_REG_PRAM );
10096
- major = fw & 0xff ;
10097
- minor = (fw >> 0x8 ) & 0xff ;
10098
- version = (fw >> 0x10 ) & 0xff ;
10099
- BNX2X_DEV_INFO ("Loaded FW: 0x%08x: Major 0x%02x Minor 0x%02x Version 0x%02x\n" ,
10100
- fw , major , minor , version );
10101
-
10102
- if (major > BCM_5710_UNDI_FW_MF_MAJOR )
10103
- return true;
10104
-
10105
- if ((major == BCM_5710_UNDI_FW_MF_MAJOR ) &&
10106
- (minor > BCM_5710_UNDI_FW_MF_MINOR ))
10107
- return true;
10108
-
10109
- if ((major == BCM_5710_UNDI_FW_MF_MAJOR ) &&
10110
- (minor == BCM_5710_UNDI_FW_MF_MINOR ) &&
10111
- (version >= BCM_5710_UNDI_FW_MF_VERS ))
10112
- return true;
10113
-
10114
- return false;
10115
- }
10116
-
10117
- static void bnx2x_prev_unload_undi_mf (struct bnx2x * bp )
10118
- {
10119
- int i ;
10120
-
10121
- /* Due to legacy (FW) code, the first function on each engine has a
10122
- * different offset macro from the rest of the functions.
10123
- * Setting this for all 8 functions is harmless regardless of whether
10124
- * this is actually a multi-function device.
10125
- */
10126
- for (i = 0 ; i < 2 ; i ++ )
10127
- REG_WR (bp , BNX2X_PREV_UNDI_MF_PORT (i ), 1 );
10128
-
10129
- for (i = 2 ; i < 8 ; i ++ )
10130
- REG_WR (bp , BNX2X_PREV_UNDI_MF_FUNC (i - 2 ), 1 );
10131
-
10132
- BNX2X_DEV_INFO ("UNDI FW (MF) set to discard\n" );
10133
- }
10134
-
10135
- static void bnx2x_prev_unload_undi_inc (struct bnx2x * bp , u8 port , u8 inc )
10082
+ static void bnx2x_prev_unload_undi_inc (struct bnx2x * bp , u8 inc )
10136
10083
{
10137
10084
u16 rcq , bd ;
10138
- u32 tmp_reg = REG_RD ( bp , BNX2X_PREV_UNDI_PROD_ADDR ( port )) ;
10085
+ u32 addr , tmp_reg ;
10139
10086
10087
+ if (BP_FUNC (bp ) < 2 )
10088
+ addr = BNX2X_PREV_UNDI_PROD_ADDR (BP_PORT (bp ));
10089
+ else
10090
+ addr = BNX2X_PREV_UNDI_PROD_ADDR_H (BP_FUNC (bp ) - 2 );
10091
+
10092
+ tmp_reg = REG_RD (bp , addr );
10140
10093
rcq = BNX2X_PREV_UNDI_RCQ (tmp_reg ) + inc ;
10141
10094
bd = BNX2X_PREV_UNDI_BD (tmp_reg ) + inc ;
10142
10095
10143
10096
tmp_reg = BNX2X_PREV_UNDI_PROD (rcq , bd );
10144
- REG_WR (bp , BNX2X_PREV_UNDI_PROD_ADDR ( port ) , tmp_reg );
10097
+ REG_WR (bp , addr , tmp_reg );
10145
10098
10146
- BNX2X_DEV_INFO ("UNDI producer [%d] rings bd -> 0x%04x, rcq -> 0x%04x\n" ,
10147
- port , bd , rcq );
10099
+ BNX2X_DEV_INFO ("UNDI producer [%d/%d][%08x ] rings bd -> 0x%04x, rcq -> 0x%04x\n" ,
10100
+ BP_PORT ( bp ), BP_FUNC ( bp ), addr , bd , rcq );
10148
10101
}
10149
10102
10150
10103
static int bnx2x_prev_mcp_done (struct bnx2x * bp )
@@ -10383,7 +10336,6 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp)
10383
10336
/* Reset should be performed after BRB is emptied */
10384
10337
if (reset_reg & MISC_REGISTERS_RESET_REG_1_RST_BRB1 ) {
10385
10338
u32 timer_count = 1000 ;
10386
- bool need_write = true;
10387
10339
10388
10340
/* Close the MAC Rx to prevent BRB from filling up */
10389
10341
bnx2x_prev_unload_close_mac (bp , & mac_vals );
@@ -10420,20 +10372,10 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp)
10420
10372
else
10421
10373
timer_count -- ;
10422
10374
10423
- /* New UNDI FW supports MF and contains better
10424
- * cleaning methods - might be redundant but harmless.
10425
- */
10426
- if (bnx2x_prev_unload_undi_fw_supports_mf (bp )) {
10427
- if (need_write ) {
10428
- bnx2x_prev_unload_undi_mf (bp );
10429
- need_write = false;
10430
- }
10431
- } else if (prev_undi ) {
10432
- /* If UNDI resides in memory,
10433
- * manually increment it
10434
- */
10435
- bnx2x_prev_unload_undi_inc (bp , BP_PORT (bp ), 1 );
10436
- }
10375
+ /* If UNDI resides in memory, manually increment it */
10376
+ if (prev_undi )
10377
+ bnx2x_prev_unload_undi_inc (bp , 1 );
10378
+
10437
10379
udelay (10 );
10438
10380
}
10439
10381
0 commit comments