aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c60
1 files changed, 41 insertions, 19 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 33501bcddc48..c27af12314ed 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -2287,13 +2287,11 @@ static int bnx2x_set_spio(struct bnx2x *bp, int spio, u32 mode)
2287void bnx2x_calc_fc_adv(struct bnx2x *bp) 2287void bnx2x_calc_fc_adv(struct bnx2x *bp)
2288{ 2288{
2289 u8 cfg_idx = bnx2x_get_link_cfg_idx(bp); 2289 u8 cfg_idx = bnx2x_get_link_cfg_idx(bp);
2290
2291 bp->port.advertising[cfg_idx] &= ~(ADVERTISED_Asym_Pause |
2292 ADVERTISED_Pause);
2290 switch (bp->link_vars.ieee_fc & 2293 switch (bp->link_vars.ieee_fc &
2291 MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_MASK) { 2294 MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_MASK) {
2292 case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_NONE:
2293 bp->port.advertising[cfg_idx] &= ~(ADVERTISED_Asym_Pause |
2294 ADVERTISED_Pause);
2295 break;
2296
2297 case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH: 2295 case MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH:
2298 bp->port.advertising[cfg_idx] |= (ADVERTISED_Asym_Pause | 2296 bp->port.advertising[cfg_idx] |= (ADVERTISED_Asym_Pause |
2299 ADVERTISED_Pause); 2297 ADVERTISED_Pause);
@@ -2304,8 +2302,6 @@ void bnx2x_calc_fc_adv(struct bnx2x *bp)
2304 break; 2302 break;
2305 2303
2306 default: 2304 default:
2307 bp->port.advertising[cfg_idx] &= ~(ADVERTISED_Asym_Pause |
2308 ADVERTISED_Pause);
2309 break; 2305 break;
2310 } 2306 }
2311} 2307}
@@ -2351,12 +2347,16 @@ int bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode)
2351 if (load_mode == LOAD_DIAG) { 2347 if (load_mode == LOAD_DIAG) {
2352 struct link_params *lp = &bp->link_params; 2348 struct link_params *lp = &bp->link_params;
2353 lp->loopback_mode = LOOPBACK_XGXS; 2349 lp->loopback_mode = LOOPBACK_XGXS;
2354 /* do PHY loopback at 10G speed, if possible */ 2350 /* Prefer doing PHY loopback at highest speed */
2355 if (lp->req_line_speed[cfx_idx] < SPEED_10000) { 2351 if (lp->req_line_speed[cfx_idx] < SPEED_20000) {
2356 if (lp->speed_cap_mask[cfx_idx] & 2352 if (lp->speed_cap_mask[cfx_idx] &
2357 PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) 2353 PORT_HW_CFG_SPEED_CAPABILITY_D0_20G)
2358 lp->req_line_speed[cfx_idx] = 2354 lp->req_line_speed[cfx_idx] =
2359 SPEED_10000; 2355 SPEED_20000;
2356 else if (lp->speed_cap_mask[cfx_idx] &
2357 PORT_HW_CFG_SPEED_CAPABILITY_D0_10G)
2358 lp->req_line_speed[cfx_idx] =
2359 SPEED_10000;
2360 else 2360 else
2361 lp->req_line_speed[cfx_idx] = 2361 lp->req_line_speed[cfx_idx] =
2362 SPEED_1000; 2362 SPEED_1000;
@@ -4867,9 +4867,7 @@ static bool bnx2x_check_blocks_with_parity3(struct bnx2x *bp, u32 sig,
4867 res = true; 4867 res = true;
4868 break; 4868 break;
4869 case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY: 4869 case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY:
4870 if (print) 4870 (*par_num)++;
4871 _print_next_block((*par_num)++,
4872 "MCP SCPAD");
4873 /* clear latched SCPAD PATIRY from MCP */ 4871 /* clear latched SCPAD PATIRY from MCP */
4874 REG_WR(bp, MISC_REG_AEU_CLR_LATCH_SIGNAL, 4872 REG_WR(bp, MISC_REG_AEU_CLR_LATCH_SIGNAL,
4875 1UL << 10); 4873 1UL << 10);
@@ -4931,6 +4929,7 @@ static bool bnx2x_parity_attn(struct bnx2x *bp, bool *global, bool print,
4931 (sig[3] & HW_PRTY_ASSERT_SET_3) || 4929 (sig[3] & HW_PRTY_ASSERT_SET_3) ||
4932 (sig[4] & HW_PRTY_ASSERT_SET_4)) { 4930 (sig[4] & HW_PRTY_ASSERT_SET_4)) {
4933 int par_num = 0; 4931 int par_num = 0;
4932
4934 DP(NETIF_MSG_HW, "Was parity error: HW block parity attention:\n" 4933 DP(NETIF_MSG_HW, "Was parity error: HW block parity attention:\n"
4935 "[0]:0x%08x [1]:0x%08x [2]:0x%08x [3]:0x%08x [4]:0x%08x\n", 4934 "[0]:0x%08x [1]:0x%08x [2]:0x%08x [3]:0x%08x [4]:0x%08x\n",
4936 sig[0] & HW_PRTY_ASSERT_SET_0, 4935 sig[0] & HW_PRTY_ASSERT_SET_0,
@@ -4938,9 +4937,18 @@ static bool bnx2x_parity_attn(struct bnx2x *bp, bool *global, bool print,
4938 sig[2] & HW_PRTY_ASSERT_SET_2, 4937 sig[2] & HW_PRTY_ASSERT_SET_2,
4939 sig[3] & HW_PRTY_ASSERT_SET_3, 4938 sig[3] & HW_PRTY_ASSERT_SET_3,
4940 sig[4] & HW_PRTY_ASSERT_SET_4); 4939 sig[4] & HW_PRTY_ASSERT_SET_4);
4941 if (print) 4940 if (print) {
4942 netdev_err(bp->dev, 4941 if (((sig[0] & HW_PRTY_ASSERT_SET_0) ||
4943 "Parity errors detected in blocks: "); 4942 (sig[1] & HW_PRTY_ASSERT_SET_1) ||
4943 (sig[2] & HW_PRTY_ASSERT_SET_2) ||
4944 (sig[4] & HW_PRTY_ASSERT_SET_4)) ||
4945 (sig[3] & HW_PRTY_ASSERT_SET_3_WITHOUT_SCPAD)) {
4946 netdev_err(bp->dev,
4947 "Parity errors detected in blocks: ");
4948 } else {
4949 print = false;
4950 }
4951 }
4944 res |= bnx2x_check_blocks_with_parity0(bp, 4952 res |= bnx2x_check_blocks_with_parity0(bp,
4945 sig[0] & HW_PRTY_ASSERT_SET_0, &par_num, print); 4953 sig[0] & HW_PRTY_ASSERT_SET_0, &par_num, print);
4946 res |= bnx2x_check_blocks_with_parity1(bp, 4954 res |= bnx2x_check_blocks_with_parity1(bp,
@@ -8431,7 +8439,7 @@ int bnx2x_set_eth_mac(struct bnx2x *bp, bool set)
8431 BNX2X_ETH_MAC, &ramrod_flags); 8439 BNX2X_ETH_MAC, &ramrod_flags);
8432 } else { /* vf */ 8440 } else { /* vf */
8433 return bnx2x_vfpf_config_mac(bp, bp->dev->dev_addr, 8441 return bnx2x_vfpf_config_mac(bp, bp->dev->dev_addr,
8434 bp->fp->index, true); 8442 bp->fp->index, set);
8435 } 8443 }
8436} 8444}
8437 8445
@@ -9323,7 +9331,8 @@ unload_error:
9323 * function stop ramrod is sent, since as part of this ramrod FW access 9331 * function stop ramrod is sent, since as part of this ramrod FW access
9324 * PTP registers. 9332 * PTP registers.
9325 */ 9333 */
9326 bnx2x_stop_ptp(bp); 9334 if (bp->flags & PTP_SUPPORTED)
9335 bnx2x_stop_ptp(bp);
9327 9336
9328 /* Disable HW interrupts, NAPI */ 9337 /* Disable HW interrupts, NAPI */
9329 bnx2x_netif_stop(bp, 1); 9338 bnx2x_netif_stop(bp, 1);
@@ -11147,6 +11156,12 @@ static void bnx2x_link_settings_requested(struct bnx2x *bp)
11147 bp->port.advertising[idx] |= 11156 bp->port.advertising[idx] |=
11148 (ADVERTISED_1000baseT_Full | 11157 (ADVERTISED_1000baseT_Full |
11149 ADVERTISED_TP); 11158 ADVERTISED_TP);
11159 } else if (bp->port.supported[idx] &
11160 SUPPORTED_1000baseKX_Full) {
11161 bp->link_params.req_line_speed[idx] =
11162 SPEED_1000;
11163 bp->port.advertising[idx] |=
11164 ADVERTISED_1000baseKX_Full;
11150 } else { 11165 } else {
11151 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", 11166 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n",
11152 link_config, 11167 link_config,
@@ -11179,6 +11194,13 @@ static void bnx2x_link_settings_requested(struct bnx2x *bp)
11179 bp->port.advertising[idx] |= 11194 bp->port.advertising[idx] |=
11180 (ADVERTISED_10000baseT_Full | 11195 (ADVERTISED_10000baseT_Full |
11181 ADVERTISED_FIBRE); 11196 ADVERTISED_FIBRE);
11197 } else if (bp->port.supported[idx] &
11198 SUPPORTED_10000baseKR_Full) {
11199 bp->link_params.req_line_speed[idx] =
11200 SPEED_10000;
11201 bp->port.advertising[idx] |=
11202 (ADVERTISED_10000baseKR_Full |
11203 ADVERTISED_FIBRE);
11182 } else { 11204 } else {
11183 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n", 11205 BNX2X_ERR("NVRAM config error. Invalid link_config 0x%x speed_cap_mask 0x%x\n",
11184 link_config, 11206 link_config,