diff options
Diffstat (limited to 'drivers/net/ethernet/broadcom')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 298 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/tg3.c | 27 |
4 files changed, 190 insertions, 143 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index a688b9d975a2..f99c6e312a5d 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | |||
@@ -365,13 +365,18 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
365 | DP(NETIF_MSG_LINK, "cfg_idx = %x\n", cfg_idx); | 365 | DP(NETIF_MSG_LINK, "cfg_idx = %x\n", cfg_idx); |
366 | 366 | ||
367 | if (cmd->autoneg == AUTONEG_ENABLE) { | 367 | if (cmd->autoneg == AUTONEG_ENABLE) { |
368 | u32 an_supported_speed = bp->port.supported[cfg_idx]; | ||
369 | if (bp->link_params.phy[EXT_PHY1].type == | ||
370 | PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) | ||
371 | an_supported_speed |= (SUPPORTED_100baseT_Half | | ||
372 | SUPPORTED_100baseT_Full); | ||
368 | if (!(bp->port.supported[cfg_idx] & SUPPORTED_Autoneg)) { | 373 | if (!(bp->port.supported[cfg_idx] & SUPPORTED_Autoneg)) { |
369 | DP(NETIF_MSG_LINK, "Autoneg not supported\n"); | 374 | DP(NETIF_MSG_LINK, "Autoneg not supported\n"); |
370 | return -EINVAL; | 375 | return -EINVAL; |
371 | } | 376 | } |
372 | 377 | ||
373 | /* advertise the requested speed and duplex if supported */ | 378 | /* advertise the requested speed and duplex if supported */ |
374 | if (cmd->advertising & ~(bp->port.supported[cfg_idx])) { | 379 | if (cmd->advertising & ~an_supported_speed) { |
375 | DP(NETIF_MSG_LINK, "Advertisement parameters " | 380 | DP(NETIF_MSG_LINK, "Advertisement parameters " |
376 | "are not supported\n"); | 381 | "are not supported\n"); |
377 | return -EINVAL; | 382 | return -EINVAL; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c index 4df9505b67b6..2091e5dbbcdd 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | |||
@@ -2502,7 +2502,7 @@ static void bnx2x_update_pfc_nig(struct link_params *params, | |||
2502 | struct bnx2x_nig_brb_pfc_port_params *nig_params) | 2502 | struct bnx2x_nig_brb_pfc_port_params *nig_params) |
2503 | { | 2503 | { |
2504 | u32 xcm_mask = 0, ppp_enable = 0, pause_enable = 0, llfc_out_en = 0; | 2504 | u32 xcm_mask = 0, ppp_enable = 0, pause_enable = 0, llfc_out_en = 0; |
2505 | u32 llfc_enable = 0, xcm0_out_en = 0, p0_hwpfc_enable = 0; | 2505 | u32 llfc_enable = 0, xcm_out_en = 0, hwpfc_enable = 0; |
2506 | u32 pkt_priority_to_cos = 0; | 2506 | u32 pkt_priority_to_cos = 0; |
2507 | struct bnx2x *bp = params->bp; | 2507 | struct bnx2x *bp = params->bp; |
2508 | u8 port = params->port; | 2508 | u8 port = params->port; |
@@ -2516,9 +2516,8 @@ static void bnx2x_update_pfc_nig(struct link_params *params, | |||
2516 | * MAC control frames (that are not pause packets) | 2516 | * MAC control frames (that are not pause packets) |
2517 | * will be forwarded to the XCM. | 2517 | * will be forwarded to the XCM. |
2518 | */ | 2518 | */ |
2519 | xcm_mask = REG_RD(bp, | 2519 | xcm_mask = REG_RD(bp, port ? NIG_REG_LLH1_XCM_MASK : |
2520 | port ? NIG_REG_LLH1_XCM_MASK : | 2520 | NIG_REG_LLH0_XCM_MASK); |
2521 | NIG_REG_LLH0_XCM_MASK); | ||
2522 | /* | 2521 | /* |
2523 | * nig params will override non PFC params, since it's possible to | 2522 | * nig params will override non PFC params, since it's possible to |
2524 | * do transition from PFC to SAFC | 2523 | * do transition from PFC to SAFC |
@@ -2533,8 +2532,8 @@ static void bnx2x_update_pfc_nig(struct link_params *params, | |||
2533 | ppp_enable = 1; | 2532 | ppp_enable = 1; |
2534 | xcm_mask &= ~(port ? NIG_LLH1_XCM_MASK_REG_LLH1_XCM_MASK_BCN : | 2533 | xcm_mask &= ~(port ? NIG_LLH1_XCM_MASK_REG_LLH1_XCM_MASK_BCN : |
2535 | NIG_LLH0_XCM_MASK_REG_LLH0_XCM_MASK_BCN); | 2534 | NIG_LLH0_XCM_MASK_REG_LLH0_XCM_MASK_BCN); |
2536 | xcm0_out_en = 0; | 2535 | xcm_out_en = 0; |
2537 | p0_hwpfc_enable = 1; | 2536 | hwpfc_enable = 1; |
2538 | } else { | 2537 | } else { |
2539 | if (nig_params) { | 2538 | if (nig_params) { |
2540 | llfc_out_en = nig_params->llfc_out_en; | 2539 | llfc_out_en = nig_params->llfc_out_en; |
@@ -2545,7 +2544,7 @@ static void bnx2x_update_pfc_nig(struct link_params *params, | |||
2545 | 2544 | ||
2546 | xcm_mask |= (port ? NIG_LLH1_XCM_MASK_REG_LLH1_XCM_MASK_BCN : | 2545 | xcm_mask |= (port ? NIG_LLH1_XCM_MASK_REG_LLH1_XCM_MASK_BCN : |
2547 | NIG_LLH0_XCM_MASK_REG_LLH0_XCM_MASK_BCN); | 2546 | NIG_LLH0_XCM_MASK_REG_LLH0_XCM_MASK_BCN); |
2548 | xcm0_out_en = 1; | 2547 | xcm_out_en = 1; |
2549 | } | 2548 | } |
2550 | 2549 | ||
2551 | if (CHIP_IS_E3(bp)) | 2550 | if (CHIP_IS_E3(bp)) |
@@ -2564,13 +2563,16 @@ static void bnx2x_update_pfc_nig(struct link_params *params, | |||
2564 | REG_WR(bp, port ? NIG_REG_LLH1_XCM_MASK : | 2563 | REG_WR(bp, port ? NIG_REG_LLH1_XCM_MASK : |
2565 | NIG_REG_LLH0_XCM_MASK, xcm_mask); | 2564 | NIG_REG_LLH0_XCM_MASK, xcm_mask); |
2566 | 2565 | ||
2567 | REG_WR(bp, NIG_REG_LLFC_EGRESS_SRC_ENABLE_0, 0x7); | 2566 | REG_WR(bp, port ? NIG_REG_LLFC_EGRESS_SRC_ENABLE_1 : |
2567 | NIG_REG_LLFC_EGRESS_SRC_ENABLE_0, 0x7); | ||
2568 | 2568 | ||
2569 | /* output enable for RX_XCM # IF */ | 2569 | /* output enable for RX_XCM # IF */ |
2570 | REG_WR(bp, NIG_REG_XCM0_OUT_EN, xcm0_out_en); | 2570 | REG_WR(bp, port ? NIG_REG_XCM1_OUT_EN : |
2571 | NIG_REG_XCM0_OUT_EN, xcm_out_en); | ||
2571 | 2572 | ||
2572 | /* HW PFC TX enable */ | 2573 | /* HW PFC TX enable */ |
2573 | REG_WR(bp, NIG_REG_P0_HWPFC_ENABLE, p0_hwpfc_enable); | 2574 | REG_WR(bp, port ? NIG_REG_P1_HWPFC_ENABLE : |
2575 | NIG_REG_P0_HWPFC_ENABLE, hwpfc_enable); | ||
2574 | 2576 | ||
2575 | if (nig_params) { | 2577 | if (nig_params) { |
2576 | u8 i = 0; | 2578 | u8 i = 0; |
@@ -3761,7 +3763,15 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, | |||
3761 | /* Advertise pause */ | 3763 | /* Advertise pause */ |
3762 | bnx2x_ext_phy_set_pause(params, phy, vars); | 3764 | bnx2x_ext_phy_set_pause(params, phy, vars); |
3763 | 3765 | ||
3764 | vars->rx_tx_asic_rst = MAX_KR_LINK_RETRY; | 3766 | /* |
3767 | * Set KR Autoneg Work-Around flag for Warpcore version older than D108 | ||
3768 | */ | ||
3769 | bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD, | ||
3770 | MDIO_WC_REG_UC_INFO_B1_VERSION, &val16); | ||
3771 | if (val16 < 0xd108) { | ||
3772 | DP(NETIF_MSG_LINK, "Enable AN KR work-around\n"); | ||
3773 | vars->rx_tx_asic_rst = MAX_KR_LINK_RETRY; | ||
3774 | } | ||
3765 | 3775 | ||
3766 | bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD, | 3776 | bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD, |
3767 | MDIO_WC_REG_DIGITAL5_MISC7, &val16); | 3777 | MDIO_WC_REG_DIGITAL5_MISC7, &val16); |
@@ -9266,62 +9276,68 @@ static void bnx2x_8727_link_reset(struct bnx2x_phy *phy, | |||
9266 | /* BCM8481/BCM84823/BCM84833 PHY SECTION */ | 9276 | /* BCM8481/BCM84823/BCM84833 PHY SECTION */ |
9267 | /******************************************************************/ | 9277 | /******************************************************************/ |
9268 | static void bnx2x_save_848xx_spirom_version(struct bnx2x_phy *phy, | 9278 | static void bnx2x_save_848xx_spirom_version(struct bnx2x_phy *phy, |
9269 | struct link_params *params) | 9279 | struct bnx2x *bp, |
9280 | u8 port) | ||
9270 | { | 9281 | { |
9271 | u16 val, fw_ver1, fw_ver2, cnt; | 9282 | u16 val, fw_ver1, fw_ver2, cnt; |
9272 | u8 port; | ||
9273 | struct bnx2x *bp = params->bp; | ||
9274 | 9283 | ||
9275 | port = params->port; | 9284 | if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) { |
9285 | bnx2x_cl45_read(bp, phy, MDIO_CTL_DEVAD, 0x400f, &fw_ver1); | ||
9286 | bnx2x_save_spirom_version(bp, port, | ||
9287 | ((fw_ver1 & 0xf000)>>5) | (fw_ver1 & 0x7f), | ||
9288 | phy->ver_addr); | ||
9289 | } else { | ||
9290 | /* For 32-bit registers in 848xx, access via MDIO2ARM i/f. */ | ||
9291 | /* (1) set reg 0xc200_0014(SPI_BRIDGE_CTRL_2) to 0x03000000 */ | ||
9292 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA819, 0x0014); | ||
9293 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81A, 0xc200); | ||
9294 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81B, 0x0000); | ||
9295 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81C, 0x0300); | ||
9296 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA817, 0x0009); | ||
9297 | |||
9298 | for (cnt = 0; cnt < 100; cnt++) { | ||
9299 | bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA818, &val); | ||
9300 | if (val & 1) | ||
9301 | break; | ||
9302 | udelay(5); | ||
9303 | } | ||
9304 | if (cnt == 100) { | ||
9305 | DP(NETIF_MSG_LINK, "Unable to read 848xx " | ||
9306 | "phy fw version(1)\n"); | ||
9307 | bnx2x_save_spirom_version(bp, port, 0, | ||
9308 | phy->ver_addr); | ||
9309 | return; | ||
9310 | } | ||
9276 | 9311 | ||
9277 | /* For the 32 bits registers in 848xx, access via MDIO2ARM interface.*/ | ||
9278 | /* (1) set register 0xc200_0014(SPI_BRIDGE_CTRL_2) to 0x03000000 */ | ||
9279 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA819, 0x0014); | ||
9280 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81A, 0xc200); | ||
9281 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81B, 0x0000); | ||
9282 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81C, 0x0300); | ||
9283 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA817, 0x0009); | ||
9284 | 9312 | ||
9285 | for (cnt = 0; cnt < 100; cnt++) { | 9313 | /* 2) read register 0xc200_0000 (SPI_FW_STATUS) */ |
9286 | bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA818, &val); | 9314 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA819, 0x0000); |
9287 | if (val & 1) | 9315 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81A, 0xc200); |
9288 | break; | 9316 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA817, 0x000A); |
9289 | udelay(5); | 9317 | for (cnt = 0; cnt < 100; cnt++) { |
9290 | } | 9318 | bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA818, &val); |
9291 | if (cnt == 100) { | 9319 | if (val & 1) |
9292 | DP(NETIF_MSG_LINK, "Unable to read 848xx phy fw version(1)\n"); | 9320 | break; |
9293 | bnx2x_save_spirom_version(bp, port, 0, | 9321 | udelay(5); |
9294 | phy->ver_addr); | 9322 | } |
9295 | return; | 9323 | if (cnt == 100) { |
9296 | } | 9324 | DP(NETIF_MSG_LINK, "Unable to read 848xx phy fw " |
9325 | "version(2)\n"); | ||
9326 | bnx2x_save_spirom_version(bp, port, 0, | ||
9327 | phy->ver_addr); | ||
9328 | return; | ||
9329 | } | ||
9297 | 9330 | ||
9331 | /* lower 16 bits of the register SPI_FW_STATUS */ | ||
9332 | bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA81B, &fw_ver1); | ||
9333 | /* upper 16 bits of register SPI_FW_STATUS */ | ||
9334 | bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA81C, &fw_ver2); | ||
9298 | 9335 | ||
9299 | /* 2) read register 0xc200_0000 (SPI_FW_STATUS) */ | 9336 | bnx2x_save_spirom_version(bp, port, (fw_ver2<<16) | fw_ver1, |
9300 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA819, 0x0000); | ||
9301 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81A, 0xc200); | ||
9302 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA817, 0x000A); | ||
9303 | for (cnt = 0; cnt < 100; cnt++) { | ||
9304 | bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA818, &val); | ||
9305 | if (val & 1) | ||
9306 | break; | ||
9307 | udelay(5); | ||
9308 | } | ||
9309 | if (cnt == 100) { | ||
9310 | DP(NETIF_MSG_LINK, "Unable to read 848xx phy fw version(2)\n"); | ||
9311 | bnx2x_save_spirom_version(bp, port, 0, | ||
9312 | phy->ver_addr); | 9337 | phy->ver_addr); |
9313 | return; | ||
9314 | } | 9338 | } |
9315 | 9339 | ||
9316 | /* lower 16 bits of the register SPI_FW_STATUS */ | ||
9317 | bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA81B, &fw_ver1); | ||
9318 | /* upper 16 bits of register SPI_FW_STATUS */ | ||
9319 | bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA81C, &fw_ver2); | ||
9320 | |||
9321 | bnx2x_save_spirom_version(bp, port, (fw_ver2<<16) | fw_ver1, | ||
9322 | phy->ver_addr); | ||
9323 | } | 9340 | } |
9324 | |||
9325 | static void bnx2x_848xx_set_led(struct bnx2x *bp, | 9341 | static void bnx2x_848xx_set_led(struct bnx2x *bp, |
9326 | struct bnx2x_phy *phy) | 9342 | struct bnx2x_phy *phy) |
9327 | { | 9343 | { |
@@ -9392,10 +9408,13 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy, | |||
9392 | u16 tmp_req_line_speed; | 9408 | u16 tmp_req_line_speed; |
9393 | 9409 | ||
9394 | tmp_req_line_speed = phy->req_line_speed; | 9410 | tmp_req_line_speed = phy->req_line_speed; |
9395 | if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) | 9411 | if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) { |
9396 | if (phy->req_line_speed == SPEED_10000) | 9412 | if (phy->req_line_speed == SPEED_10000) |
9397 | phy->req_line_speed = SPEED_AUTO_NEG; | 9413 | phy->req_line_speed = SPEED_AUTO_NEG; |
9398 | 9414 | } else { | |
9415 | /* Save spirom version */ | ||
9416 | bnx2x_save_848xx_spirom_version(phy, bp, params->port); | ||
9417 | } | ||
9399 | /* | 9418 | /* |
9400 | * This phy uses the NIG latch mechanism since link indication | 9419 | * This phy uses the NIG latch mechanism since link indication |
9401 | * arrives through its LED4 and not via its LASI signal, so we | 9420 | * arrives through its LED4 and not via its LASI signal, so we |
@@ -9443,13 +9462,10 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy, | |||
9443 | an_1000_val); | 9462 | an_1000_val); |
9444 | 9463 | ||
9445 | /* set 100 speed advertisement */ | 9464 | /* set 100 speed advertisement */ |
9446 | if (((phy->req_line_speed == SPEED_AUTO_NEG) && | 9465 | if ((phy->req_line_speed == SPEED_AUTO_NEG) && |
9447 | (phy->speed_cap_mask & | 9466 | (phy->speed_cap_mask & |
9448 | (PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL | | 9467 | (PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL | |
9449 | PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF)) && | 9468 | PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF))) { |
9450 | (phy->supported & | ||
9451 | (SUPPORTED_100baseT_Half | | ||
9452 | SUPPORTED_100baseT_Full)))) { | ||
9453 | an_10_100_val |= (1<<7); | 9469 | an_10_100_val |= (1<<7); |
9454 | /* Enable autoneg and restart autoneg for legacy speeds */ | 9470 | /* Enable autoneg and restart autoneg for legacy speeds */ |
9455 | autoneg_val |= (1<<9 | 1<<12); | 9471 | autoneg_val |= (1<<9 | 1<<12); |
@@ -9539,9 +9555,6 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy, | |||
9539 | MDIO_AN_REG_8481_10GBASE_T_AN_CTRL, | 9555 | MDIO_AN_REG_8481_10GBASE_T_AN_CTRL, |
9540 | 1); | 9556 | 1); |
9541 | 9557 | ||
9542 | /* Save spirom version */ | ||
9543 | bnx2x_save_848xx_spirom_version(phy, params); | ||
9544 | |||
9545 | phy->req_line_speed = tmp_req_line_speed; | 9558 | phy->req_line_speed = tmp_req_line_speed; |
9546 | 9559 | ||
9547 | return 0; | 9560 | return 0; |
@@ -9749,17 +9762,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, | |||
9749 | 9762 | ||
9750 | /* Wait for GPHY to come out of reset */ | 9763 | /* Wait for GPHY to come out of reset */ |
9751 | msleep(50); | 9764 | msleep(50); |
9752 | if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) { | 9765 | if (phy->type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) { |
9753 | /* Bring PHY out of super isolate mode */ | ||
9754 | bnx2x_cl45_read(bp, phy, | ||
9755 | MDIO_CTL_DEVAD, | ||
9756 | MDIO_84833_TOP_CFG_XGPHY_STRAP1, &val); | ||
9757 | val &= ~MDIO_84833_SUPER_ISOLATE; | ||
9758 | bnx2x_cl45_write(bp, phy, | ||
9759 | MDIO_CTL_DEVAD, | ||
9760 | MDIO_84833_TOP_CFG_XGPHY_STRAP1, val); | ||
9761 | bnx2x_84833_pair_swap_cfg(phy, params, vars); | ||
9762 | } else { | ||
9763 | /* | 9766 | /* |
9764 | * BCM84823 requires that XGXS links up first @ 10G for normal | 9767 | * BCM84823 requires that XGXS links up first @ 10G for normal |
9765 | * behavior. | 9768 | * behavior. |
@@ -9816,24 +9819,23 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, | |||
9816 | DP(NETIF_MSG_LINK, "Multi_phy config = 0x%x, Media control = 0x%x\n", | 9819 | DP(NETIF_MSG_LINK, "Multi_phy config = 0x%x, Media control = 0x%x\n", |
9817 | params->multi_phy_config, val); | 9820 | params->multi_phy_config, val); |
9818 | 9821 | ||
9819 | /* AutogrEEEn */ | 9822 | if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) { |
9820 | if (params->feature_config_flags & | 9823 | bnx2x_84833_pair_swap_cfg(phy, params, vars); |
9821 | FEATURE_CONFIG_AUTOGREEEN_ENABLED) | ||
9822 | cmd_args[0] = 0x2; | ||
9823 | else | ||
9824 | cmd_args[0] = 0x0; | ||
9825 | 9824 | ||
9826 | cmd_args[1] = 0x0; | 9825 | /* Keep AutogrEEEn disabled. */ |
9827 | cmd_args[2] = PHY84833_CONSTANT_LATENCY + 1; | 9826 | cmd_args[0] = 0x0; |
9828 | cmd_args[3] = PHY84833_CONSTANT_LATENCY; | 9827 | cmd_args[1] = 0x0; |
9829 | rc = bnx2x_84833_cmd_hdlr(phy, params, | 9828 | cmd_args[2] = PHY84833_CONSTANT_LATENCY + 1; |
9830 | PHY84833_CMD_SET_EEE_MODE, cmd_args); | 9829 | cmd_args[3] = PHY84833_CONSTANT_LATENCY; |
9831 | if (rc != 0) | 9830 | rc = bnx2x_84833_cmd_hdlr(phy, params, |
9832 | DP(NETIF_MSG_LINK, "Cfg AutogrEEEn failed.\n"); | 9831 | PHY84833_CMD_SET_EEE_MODE, cmd_args); |
9832 | if (rc != 0) | ||
9833 | DP(NETIF_MSG_LINK, "Cfg AutogrEEEn failed.\n"); | ||
9834 | } | ||
9833 | if (initialize) | 9835 | if (initialize) |
9834 | rc = bnx2x_848xx_cmn_config_init(phy, params, vars); | 9836 | rc = bnx2x_848xx_cmn_config_init(phy, params, vars); |
9835 | else | 9837 | else |
9836 | bnx2x_save_848xx_spirom_version(phy, params); | 9838 | bnx2x_save_848xx_spirom_version(phy, bp, params->port); |
9837 | /* 84833 PHY has a better feature and doesn't need to support this. */ | 9839 | /* 84833 PHY has a better feature and doesn't need to support this. */ |
9838 | if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84823) { | 9840 | if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84823) { |
9839 | cms_enable = REG_RD(bp, params->shmem_base + | 9841 | cms_enable = REG_RD(bp, params->shmem_base + |
@@ -9851,6 +9853,16 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, | |||
9851 | MDIO_CTL_REG_84823_USER_CTRL_REG, val); | 9853 | MDIO_CTL_REG_84823_USER_CTRL_REG, val); |
9852 | } | 9854 | } |
9853 | 9855 | ||
9856 | if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) { | ||
9857 | /* Bring PHY out of super isolate mode as the final step. */ | ||
9858 | bnx2x_cl45_read(bp, phy, | ||
9859 | MDIO_CTL_DEVAD, | ||
9860 | MDIO_84833_TOP_CFG_XGPHY_STRAP1, &val); | ||
9861 | val &= ~MDIO_84833_SUPER_ISOLATE; | ||
9862 | bnx2x_cl45_write(bp, phy, | ||
9863 | MDIO_CTL_DEVAD, | ||
9864 | MDIO_84833_TOP_CFG_XGPHY_STRAP1, val); | ||
9865 | } | ||
9854 | return rc; | 9866 | return rc; |
9855 | } | 9867 | } |
9856 | 9868 | ||
@@ -9988,10 +10000,11 @@ static void bnx2x_848x3_link_reset(struct bnx2x_phy *phy, | |||
9988 | } else { | 10000 | } else { |
9989 | bnx2x_cl45_read(bp, phy, | 10001 | bnx2x_cl45_read(bp, phy, |
9990 | MDIO_CTL_DEVAD, | 10002 | MDIO_CTL_DEVAD, |
9991 | 0x400f, &val16); | 10003 | MDIO_84833_TOP_CFG_XGPHY_STRAP1, &val16); |
10004 | val16 |= MDIO_84833_SUPER_ISOLATE; | ||
9992 | bnx2x_cl45_write(bp, phy, | 10005 | bnx2x_cl45_write(bp, phy, |
9993 | MDIO_PMA_DEVAD, | 10006 | MDIO_CTL_DEVAD, |
9994 | MDIO_PMA_REG_CTRL, 0x800); | 10007 | MDIO_84833_TOP_CFG_XGPHY_STRAP1, val16); |
9995 | } | 10008 | } |
9996 | } | 10009 | } |
9997 | 10010 | ||
@@ -11516,6 +11529,19 @@ static int bnx2x_populate_ext_phy(struct bnx2x *bp, | |||
11516 | } | 11529 | } |
11517 | phy->mdio_ctrl = bnx2x_get_emac_base(bp, mdc_mdio_access, port); | 11530 | phy->mdio_ctrl = bnx2x_get_emac_base(bp, mdc_mdio_access, port); |
11518 | 11531 | ||
11532 | if ((phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) && | ||
11533 | (phy->ver_addr)) { | ||
11534 | /* | ||
11535 | * Remove 100Mb link supported for BCM84833 when phy fw | ||
11536 | * version lower than or equal to 1.39 | ||
11537 | */ | ||
11538 | u32 raw_ver = REG_RD(bp, phy->ver_addr); | ||
11539 | if (((raw_ver & 0x7F) <= 39) && | ||
11540 | (((raw_ver & 0xF80) >> 7) <= 1)) | ||
11541 | phy->supported &= ~(SUPPORTED_100baseT_Half | | ||
11542 | SUPPORTED_100baseT_Full); | ||
11543 | } | ||
11544 | |||
11519 | /* | 11545 | /* |
11520 | * In case mdc/mdio_access of the external phy is different than the | 11546 | * In case mdc/mdio_access of the external phy is different than the |
11521 | * mdc/mdio access of the XGXS, a HW lock must be taken in each access | 11547 | * mdc/mdio access of the XGXS, a HW lock must be taken in each access |
@@ -12333,55 +12359,69 @@ static int bnx2x_84833_common_init_phy(struct bnx2x *bp, | |||
12333 | u32 chip_id) | 12359 | u32 chip_id) |
12334 | { | 12360 | { |
12335 | u8 reset_gpios; | 12361 | u8 reset_gpios; |
12336 | struct bnx2x_phy phy; | ||
12337 | u32 shmem_base, shmem2_base, cnt; | ||
12338 | s8 port = 0; | ||
12339 | u16 val; | ||
12340 | |||
12341 | reset_gpios = bnx2x_84833_get_reset_gpios(bp, shmem_base_path, chip_id); | 12362 | reset_gpios = bnx2x_84833_get_reset_gpios(bp, shmem_base_path, chip_id); |
12342 | bnx2x_set_mult_gpio(bp, reset_gpios, MISC_REGISTERS_GPIO_OUTPUT_LOW); | 12363 | bnx2x_set_mult_gpio(bp, reset_gpios, MISC_REGISTERS_GPIO_OUTPUT_LOW); |
12343 | udelay(10); | 12364 | udelay(10); |
12344 | bnx2x_set_mult_gpio(bp, reset_gpios, MISC_REGISTERS_GPIO_OUTPUT_HIGH); | 12365 | bnx2x_set_mult_gpio(bp, reset_gpios, MISC_REGISTERS_GPIO_OUTPUT_HIGH); |
12345 | DP(NETIF_MSG_LINK, "84833 reset pulse on pin values 0x%x\n", | 12366 | DP(NETIF_MSG_LINK, "84833 reset pulse on pin values 0x%x\n", |
12346 | reset_gpios); | 12367 | reset_gpios); |
12347 | for (port = PORT_MAX - 1; port >= PORT_0; port--) { | 12368 | return 0; |
12348 | /* This PHY is for E2 and E3. */ | 12369 | } |
12349 | shmem_base = shmem_base_path[port]; | ||
12350 | shmem2_base = shmem2_base_path[port]; | ||
12351 | /* Extract the ext phy address for the port */ | ||
12352 | if (bnx2x_populate_phy(bp, phy_index, shmem_base, shmem2_base, | ||
12353 | 0, &phy) != | ||
12354 | 0) { | ||
12355 | DP(NETIF_MSG_LINK, "populate_phy failed\n"); | ||
12356 | return -EINVAL; | ||
12357 | } | ||
12358 | 12370 | ||
12359 | /* Wait for FW completing its initialization. */ | 12371 | static int bnx2x_84833_pre_init_phy(struct bnx2x *bp, |
12360 | for (cnt = 0; cnt < 1000; cnt++) { | 12372 | struct bnx2x_phy *phy) |
12361 | bnx2x_cl45_read(bp, &phy, | 12373 | { |
12374 | u16 val, cnt; | ||
12375 | /* Wait for FW completing its initialization. */ | ||
12376 | for (cnt = 0; cnt < 1500; cnt++) { | ||
12377 | bnx2x_cl45_read(bp, phy, | ||
12362 | MDIO_PMA_DEVAD, | 12378 | MDIO_PMA_DEVAD, |
12363 | MDIO_PMA_REG_CTRL, &val); | 12379 | MDIO_PMA_REG_CTRL, &val); |
12364 | if (!(val & (1<<15))) | 12380 | if (!(val & (1<<15))) |
12365 | break; | 12381 | break; |
12366 | msleep(1); | 12382 | msleep(1); |
12367 | } | 12383 | } |
12368 | if (cnt >= 1000) | 12384 | if (cnt >= 1500) { |
12369 | DP(NETIF_MSG_LINK, | 12385 | DP(NETIF_MSG_LINK, "84833 reset timeout\n"); |
12370 | "84833 Cmn reset timeout (%d)\n", port); | 12386 | return -EINVAL; |
12371 | |||
12372 | /* Put the port in super isolate mode. */ | ||
12373 | bnx2x_cl45_read(bp, &phy, | ||
12374 | MDIO_CTL_DEVAD, | ||
12375 | MDIO_84833_TOP_CFG_XGPHY_STRAP1, &val); | ||
12376 | val |= MDIO_84833_SUPER_ISOLATE; | ||
12377 | bnx2x_cl45_write(bp, &phy, | ||
12378 | MDIO_CTL_DEVAD, | ||
12379 | MDIO_84833_TOP_CFG_XGPHY_STRAP1, val); | ||
12380 | } | 12387 | } |
12381 | 12388 | ||
12389 | /* Put the port in super isolate mode. */ | ||
12390 | bnx2x_cl45_read(bp, phy, | ||
12391 | MDIO_CTL_DEVAD, | ||
12392 | MDIO_84833_TOP_CFG_XGPHY_STRAP1, &val); | ||
12393 | val |= MDIO_84833_SUPER_ISOLATE; | ||
12394 | bnx2x_cl45_write(bp, phy, | ||
12395 | MDIO_CTL_DEVAD, | ||
12396 | MDIO_84833_TOP_CFG_XGPHY_STRAP1, val); | ||
12397 | |||
12398 | /* Save spirom version */ | ||
12399 | bnx2x_save_848xx_spirom_version(phy, bp, PORT_0); | ||
12382 | return 0; | 12400 | return 0; |
12383 | } | 12401 | } |
12384 | 12402 | ||
12403 | int bnx2x_pre_init_phy(struct bnx2x *bp, | ||
12404 | u32 shmem_base, | ||
12405 | u32 shmem2_base, | ||
12406 | u32 chip_id) | ||
12407 | { | ||
12408 | int rc = 0; | ||
12409 | struct bnx2x_phy phy; | ||
12410 | bnx2x_set_mdio_clk(bp, chip_id, PORT_0); | ||
12411 | if (bnx2x_populate_phy(bp, EXT_PHY1, shmem_base, shmem2_base, | ||
12412 | PORT_0, &phy)) { | ||
12413 | DP(NETIF_MSG_LINK, "populate_phy failed\n"); | ||
12414 | return -EINVAL; | ||
12415 | } | ||
12416 | switch (phy.type) { | ||
12417 | case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833: | ||
12418 | rc = bnx2x_84833_pre_init_phy(bp, &phy); | ||
12419 | break; | ||
12420 | default: | ||
12421 | break; | ||
12422 | } | ||
12423 | return rc; | ||
12424 | } | ||
12385 | 12425 | ||
12386 | static int bnx2x_ext_phy_common_init(struct bnx2x *bp, u32 shmem_base_path[], | 12426 | static int bnx2x_ext_phy_common_init(struct bnx2x *bp, u32 shmem_base_path[], |
12387 | u32 shmem2_base_path[], u8 phy_index, | 12427 | u32 shmem2_base_path[], u8 phy_index, |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h index 44609de4e5dc..dddbcf6e154e 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h | |||
@@ -2176,6 +2176,7 @@ | |||
2176 | * set to 0x345678021. This is a new register (with 2_) added in E3 B0 to | 2176 | * set to 0x345678021. This is a new register (with 2_) added in E3 B0 to |
2177 | * accommodate the 9 input clients to ETS arbiter. */ | 2177 | * accommodate the 9 input clients to ETS arbiter. */ |
2178 | #define NIG_REG_P0_TX_ARB_PRIORITY_CLIENT2_MSB 0x18684 | 2178 | #define NIG_REG_P0_TX_ARB_PRIORITY_CLIENT2_MSB 0x18684 |
2179 | #define NIG_REG_P1_HWPFC_ENABLE 0x181d0 | ||
2179 | #define NIG_REG_P1_MAC_IN_EN 0x185c0 | 2180 | #define NIG_REG_P1_MAC_IN_EN 0x185c0 |
2180 | /* [RW 1] Output enable for TX MAC interface */ | 2181 | /* [RW 1] Output enable for TX MAC interface */ |
2181 | #define NIG_REG_P1_MAC_OUT_EN 0x185c4 | 2182 | #define NIG_REG_P1_MAC_OUT_EN 0x185c4 |
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 076e02a415a0..d529af99157d 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c | |||
@@ -8846,9 +8846,11 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) | |||
8846 | tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl); | 8846 | tw32_f(GRC_LOCAL_CTRL, tp->grc_local_ctrl); |
8847 | udelay(100); | 8847 | udelay(100); |
8848 | 8848 | ||
8849 | if (tg3_flag(tp, USING_MSIX) && tp->irq_cnt > 1) { | 8849 | if (tg3_flag(tp, USING_MSIX)) { |
8850 | val = tr32(MSGINT_MODE); | 8850 | val = tr32(MSGINT_MODE); |
8851 | val |= MSGINT_MODE_MULTIVEC_EN | MSGINT_MODE_ENABLE; | 8851 | val |= MSGINT_MODE_ENABLE; |
8852 | if (tp->irq_cnt > 1) | ||
8853 | val |= MSGINT_MODE_MULTIVEC_EN; | ||
8852 | if (!tg3_flag(tp, 1SHOT_MSI)) | 8854 | if (!tg3_flag(tp, 1SHOT_MSI)) |
8853 | val |= MSGINT_MODE_ONE_SHOT_DISABLE; | 8855 | val |= MSGINT_MODE_ONE_SHOT_DISABLE; |
8854 | tw32(MSGINT_MODE, val); | 8856 | tw32(MSGINT_MODE, val); |
@@ -9548,19 +9550,18 @@ static int tg3_request_firmware(struct tg3 *tp) | |||
9548 | 9550 | ||
9549 | static bool tg3_enable_msix(struct tg3 *tp) | 9551 | static bool tg3_enable_msix(struct tg3 *tp) |
9550 | { | 9552 | { |
9551 | int i, rc, cpus = num_online_cpus(); | 9553 | int i, rc; |
9552 | struct msix_entry msix_ent[tp->irq_max]; | 9554 | struct msix_entry msix_ent[tp->irq_max]; |
9553 | 9555 | ||
9554 | if (cpus == 1) | 9556 | tp->irq_cnt = num_online_cpus(); |
9555 | /* Just fallback to the simpler MSI mode. */ | 9557 | if (tp->irq_cnt > 1) { |
9556 | return false; | 9558 | /* We want as many rx rings enabled as there are cpus. |
9557 | 9559 | * In multiqueue MSI-X mode, the first MSI-X vector | |
9558 | /* | 9560 | * only deals with link interrupts, etc, so we add |
9559 | * We want as many rx rings enabled as there are cpus. | 9561 | * one to the number of vectors we are requesting. |
9560 | * The first MSIX vector only deals with link interrupts, etc, | 9562 | */ |
9561 | * so we add one to the number of vectors we are requesting. | 9563 | tp->irq_cnt = min_t(unsigned, tp->irq_cnt + 1, tp->irq_max); |
9562 | */ | 9564 | } |
9563 | tp->irq_cnt = min_t(unsigned, cpus + 1, tp->irq_max); | ||
9564 | 9565 | ||
9565 | for (i = 0; i < tp->irq_max; i++) { | 9566 | for (i = 0; i < tp->irq_max; i++) { |
9566 | msix_ent[i].entry = i; | 9567 | msix_ent[i].entry = i; |