diff options
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 94 |
1 files changed, 58 insertions, 36 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c index 20dcc02431ca..11fc79585491 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | |||
@@ -3865,6 +3865,19 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, | |||
3865 | 3865 | ||
3866 | bnx2x_warpcore_enable_AN_KR2(phy, params, vars); | 3866 | bnx2x_warpcore_enable_AN_KR2(phy, params, vars); |
3867 | } else { | 3867 | } else { |
3868 | /* Enable Auto-Detect to support 1G over CL37 as well */ | ||
3869 | bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, | ||
3870 | MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X1, 0x10); | ||
3871 | |||
3872 | /* Force cl48 sync_status LOW to avoid getting stuck in CL73 | ||
3873 | * parallel-detect loop when CL73 and CL37 are enabled. | ||
3874 | */ | ||
3875 | CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK, | ||
3876 | MDIO_AER_BLOCK_AER_REG, 0); | ||
3877 | bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, | ||
3878 | MDIO_WC_REG_RXB_ANA_RX_CONTROL_PCI, 0x0800); | ||
3879 | bnx2x_set_aer_mmd(params, phy); | ||
3880 | |||
3868 | bnx2x_disable_kr2(params, vars, phy); | 3881 | bnx2x_disable_kr2(params, vars, phy); |
3869 | } | 3882 | } |
3870 | 3883 | ||
@@ -8120,17 +8133,20 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, | |||
8120 | *edc_mode = EDC_MODE_ACTIVE_DAC; | 8133 | *edc_mode = EDC_MODE_ACTIVE_DAC; |
8121 | else | 8134 | else |
8122 | check_limiting_mode = 1; | 8135 | check_limiting_mode = 1; |
8123 | } else if (copper_module_type & | 8136 | } else { |
8124 | SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_PASSIVE) { | 8137 | *edc_mode = EDC_MODE_PASSIVE_DAC; |
8138 | /* Even in case PASSIVE_DAC indication is not set, | ||
8139 | * treat it as a passive DAC cable, since some cables | ||
8140 | * don't have this indication. | ||
8141 | */ | ||
8142 | if (copper_module_type & | ||
8143 | SFP_EEPROM_FC_TX_TECH_BITMASK_COPPER_PASSIVE) { | ||
8125 | DP(NETIF_MSG_LINK, | 8144 | DP(NETIF_MSG_LINK, |
8126 | "Passive Copper cable detected\n"); | 8145 | "Passive Copper cable detected\n"); |
8127 | *edc_mode = | 8146 | } else { |
8128 | EDC_MODE_PASSIVE_DAC; | 8147 | DP(NETIF_MSG_LINK, |
8129 | } else { | 8148 | "Unknown copper-cable-type\n"); |
8130 | DP(NETIF_MSG_LINK, | 8149 | } |
8131 | "Unknown copper-cable-type 0x%x !!!\n", | ||
8132 | copper_module_type); | ||
8133 | return -EINVAL; | ||
8134 | } | 8150 | } |
8135 | break; | 8151 | break; |
8136 | } | 8152 | } |
@@ -10825,9 +10841,9 @@ static int bnx2x_54618se_config_init(struct bnx2x_phy *phy, | |||
10825 | (1<<11)); | 10841 | (1<<11)); |
10826 | 10842 | ||
10827 | if (((phy->req_line_speed == SPEED_AUTO_NEG) && | 10843 | if (((phy->req_line_speed == SPEED_AUTO_NEG) && |
10828 | (phy->speed_cap_mask & | 10844 | (phy->speed_cap_mask & |
10829 | PORT_HW_CFG_SPEED_CAPABILITY_D0_1G)) || | 10845 | PORT_HW_CFG_SPEED_CAPABILITY_D0_1G)) || |
10830 | (phy->req_line_speed == SPEED_1000)) { | 10846 | (phy->req_line_speed == SPEED_1000)) { |
10831 | an_1000_val |= (1<<8); | 10847 | an_1000_val |= (1<<8); |
10832 | autoneg_val |= (1<<9 | 1<<12); | 10848 | autoneg_val |= (1<<9 | 1<<12); |
10833 | if (phy->req_duplex == DUPLEX_FULL) | 10849 | if (phy->req_duplex == DUPLEX_FULL) |
@@ -10843,30 +10859,32 @@ static int bnx2x_54618se_config_init(struct bnx2x_phy *phy, | |||
10843 | 0x09, | 10859 | 0x09, |
10844 | &an_1000_val); | 10860 | &an_1000_val); |
10845 | 10861 | ||
10846 | /* Set 100 speed advertisement */ | 10862 | /* Advertise 10/100 link speed */ |
10847 | if (((phy->req_line_speed == SPEED_AUTO_NEG) && | 10863 | if (phy->req_line_speed == SPEED_AUTO_NEG) { |
10848 | (phy->speed_cap_mask & | 10864 | if (phy->speed_cap_mask & |
10849 | (PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL | | 10865 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF) { |
10850 | PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF)))) { | 10866 | an_10_100_val |= (1<<5); |
10851 | an_10_100_val |= (1<<7); | 10867 | autoneg_val |= (1<<9 | 1<<12); |
10852 | /* Enable autoneg and restart autoneg for legacy speeds */ | 10868 | DP(NETIF_MSG_LINK, "Advertising 10M-HD\n"); |
10853 | autoneg_val |= (1<<9 | 1<<12); | 10869 | } |
10854 | 10870 | if (phy->speed_cap_mask & | |
10855 | if (phy->req_duplex == DUPLEX_FULL) | 10871 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL) { |
10856 | an_10_100_val |= (1<<8); | ||
10857 | DP(NETIF_MSG_LINK, "Advertising 100M\n"); | ||
10858 | } | ||
10859 | |||
10860 | /* Set 10 speed advertisement */ | ||
10861 | if (((phy->req_line_speed == SPEED_AUTO_NEG) && | ||
10862 | (phy->speed_cap_mask & | ||
10863 | (PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_FULL | | ||
10864 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10M_HALF)))) { | ||
10865 | an_10_100_val |= (1<<5); | ||
10866 | autoneg_val |= (1<<9 | 1<<12); | ||
10867 | if (phy->req_duplex == DUPLEX_FULL) | ||
10868 | an_10_100_val |= (1<<6); | 10872 | an_10_100_val |= (1<<6); |
10869 | DP(NETIF_MSG_LINK, "Advertising 10M\n"); | 10873 | autoneg_val |= (1<<9 | 1<<12); |
10874 | DP(NETIF_MSG_LINK, "Advertising 10M-FD\n"); | ||
10875 | } | ||
10876 | if (phy->speed_cap_mask & | ||
10877 | PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_HALF) { | ||
10878 | an_10_100_val |= (1<<7); | ||
10879 | autoneg_val |= (1<<9 | 1<<12); | ||
10880 | DP(NETIF_MSG_LINK, "Advertising 100M-HD\n"); | ||
10881 | } | ||
10882 | if (phy->speed_cap_mask & | ||
10883 | PORT_HW_CFG_SPEED_CAPABILITY_D0_100M_FULL) { | ||
10884 | an_10_100_val |= (1<<8); | ||
10885 | autoneg_val |= (1<<9 | 1<<12); | ||
10886 | DP(NETIF_MSG_LINK, "Advertising 100M-FD\n"); | ||
10887 | } | ||
10870 | } | 10888 | } |
10871 | 10889 | ||
10872 | /* Only 10/100 are allowed to work in FORCE mode */ | 10890 | /* Only 10/100 are allowed to work in FORCE mode */ |
@@ -13342,6 +13360,10 @@ static u8 bnx2x_analyze_link_error(struct link_params *params, | |||
13342 | DP(NETIF_MSG_LINK, "Link changed:[%x %x]->%x\n", vars->link_up, | 13360 | DP(NETIF_MSG_LINK, "Link changed:[%x %x]->%x\n", vars->link_up, |
13343 | old_status, status); | 13361 | old_status, status); |
13344 | 13362 | ||
13363 | /* Do not touch the link in case physical link down */ | ||
13364 | if ((vars->phy_flags & PHY_PHYSICAL_LINK_FLAG) == 0) | ||
13365 | return 1; | ||
13366 | |||
13345 | /* a. Update shmem->link_status accordingly | 13367 | /* a. Update shmem->link_status accordingly |
13346 | * b. Update link_vars->link_up | 13368 | * b. Update link_vars->link_up |
13347 | */ | 13369 | */ |
@@ -13550,7 +13572,7 @@ static void bnx2x_check_kr2_wa(struct link_params *params, | |||
13550 | */ | 13572 | */ |
13551 | not_kr2_device = (((base_page & 0x8000) == 0) || | 13573 | not_kr2_device = (((base_page & 0x8000) == 0) || |
13552 | (((base_page & 0x8000) && | 13574 | (((base_page & 0x8000) && |
13553 | ((next_page & 0xe0) == 0x2)))); | 13575 | ((next_page & 0xe0) == 0x20)))); |
13554 | 13576 | ||
13555 | /* In case KR2 is already disabled, check if we need to re-enable it */ | 13577 | /* In case KR2 is already disabled, check if we need to re-enable it */ |
13556 | if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE)) { | 13578 | if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE)) { |