diff options
author | Yuval Mintz <yuvalmin@broadcom.com> | 2012-06-20 15:05:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-22 20:20:32 -0400 |
commit | dbef807ee890b45f9c9125b665c0dddc993c3d15 (patch) | |
tree | 32ae1e68e7c21e7f780ae6fc981d979d866af7fd /drivers | |
parent | a351d497f3367461fc96bf4cb9749bdb163c897e (diff) |
bnx2x: 1G sfp+ module handling
Automatically lower requested link speed to 1G in case 1G SFP+
module is detected.
Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: Yaniv Rosner <yaniv.rosner@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 16 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 202 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h | 17 |
3 files changed, 151 insertions, 84 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index 70c0881ce5a0..819170ee152a 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | |||
@@ -187,7 +187,8 @@ static int bnx2x_get_port_type(struct bnx2x *bp) | |||
187 | int port_type; | 187 | int port_type; |
188 | u32 phy_idx = bnx2x_get_cur_phy_idx(bp); | 188 | u32 phy_idx = bnx2x_get_cur_phy_idx(bp); |
189 | switch (bp->link_params.phy[phy_idx].media_type) { | 189 | switch (bp->link_params.phy[phy_idx].media_type) { |
190 | case ETH_PHY_SFP_FIBER: | 190 | case ETH_PHY_SFPP_10G_FIBER: |
191 | case ETH_PHY_SFP_1G_FIBER: | ||
191 | case ETH_PHY_XFP_FIBER: | 192 | case ETH_PHY_XFP_FIBER: |
192 | case ETH_PHY_KR: | 193 | case ETH_PHY_KR: |
193 | case ETH_PHY_CX4: | 194 | case ETH_PHY_CX4: |
@@ -220,6 +221,11 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
220 | (bp->port.supported[cfg_idx ^ 1] & | 221 | (bp->port.supported[cfg_idx ^ 1] & |
221 | (SUPPORTED_TP | SUPPORTED_FIBRE)); | 222 | (SUPPORTED_TP | SUPPORTED_FIBRE)); |
222 | cmd->advertising = bp->port.advertising[cfg_idx]; | 223 | cmd->advertising = bp->port.advertising[cfg_idx]; |
224 | if (bp->link_params.phy[bnx2x_get_cur_phy_idx(bp)].media_type == | ||
225 | ETH_PHY_SFP_1G_FIBER) { | ||
226 | cmd->supported &= ~(SUPPORTED_10000baseT_Full); | ||
227 | cmd->advertising &= ~(ADVERTISED_10000baseT_Full); | ||
228 | } | ||
223 | 229 | ||
224 | if ((bp->state == BNX2X_STATE_OPEN) && (bp->link_vars.link_up)) { | 230 | if ((bp->state == BNX2X_STATE_OPEN) && (bp->link_vars.link_up)) { |
225 | if (!(bp->flags & MF_FUNC_DIS)) { | 231 | if (!(bp->flags & MF_FUNC_DIS)) { |
@@ -295,7 +301,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
295 | { | 301 | { |
296 | struct bnx2x *bp = netdev_priv(dev); | 302 | struct bnx2x *bp = netdev_priv(dev); |
297 | u32 advertising, cfg_idx, old_multi_phy_config, new_multi_phy_config; | 303 | u32 advertising, cfg_idx, old_multi_phy_config, new_multi_phy_config; |
298 | u32 speed; | 304 | u32 speed, phy_idx; |
299 | 305 | ||
300 | if (IS_MF_SD(bp)) | 306 | if (IS_MF_SD(bp)) |
301 | return 0; | 307 | return 0; |
@@ -550,9 +556,11 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
550 | "10G half not supported\n"); | 556 | "10G half not supported\n"); |
551 | return -EINVAL; | 557 | return -EINVAL; |
552 | } | 558 | } |
553 | 559 | phy_idx = bnx2x_get_cur_phy_idx(bp); | |
554 | if (!(bp->port.supported[cfg_idx] | 560 | if (!(bp->port.supported[cfg_idx] |
555 | & SUPPORTED_10000baseT_Full)) { | 561 | & SUPPORTED_10000baseT_Full) || |
562 | (bp->link_params.phy[phy_idx].media_type == | ||
563 | ETH_PHY_SFP_1G_FIBER)) { | ||
556 | DP(BNX2X_MSG_ETHTOOL, | 564 | DP(BNX2X_MSG_ETHTOOL, |
557 | "10G full not supported\n"); | 565 | "10G full not supported\n"); |
558 | return -EINVAL; | 566 | return -EINVAL; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c index 23ca0b642a8e..b21a6be81032 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | |||
@@ -4373,6 +4373,23 @@ static void bnx2x_warpcore_config_runtime(struct bnx2x_phy *phy, | |||
4373 | } /*params->rx_tx_asic_rst*/ | 4373 | } /*params->rx_tx_asic_rst*/ |
4374 | 4374 | ||
4375 | } | 4375 | } |
4376 | static void bnx2x_warpcore_config_sfi(struct bnx2x_phy *phy, | ||
4377 | struct link_params *params) | ||
4378 | { | ||
4379 | u16 lane = bnx2x_get_warpcore_lane(phy, params); | ||
4380 | struct bnx2x *bp = params->bp; | ||
4381 | bnx2x_warpcore_clear_regs(phy, params, lane); | ||
4382 | if ((params->req_line_speed[LINK_CONFIG_IDX(INT_PHY)] == | ||
4383 | SPEED_10000) && | ||
4384 | (phy->media_type != ETH_PHY_SFP_1G_FIBER)) { | ||
4385 | DP(NETIF_MSG_LINK, "Setting 10G SFI\n"); | ||
4386 | bnx2x_warpcore_set_10G_XFI(phy, params, 0); | ||
4387 | } else { | ||
4388 | DP(NETIF_MSG_LINK, "Setting 1G Fiber\n"); | ||
4389 | bnx2x_warpcore_set_sgmii_speed(phy, params, 1, 0); | ||
4390 | } | ||
4391 | } | ||
4392 | |||
4376 | static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy, | 4393 | static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy, |
4377 | struct link_params *params, | 4394 | struct link_params *params, |
4378 | struct link_vars *vars) | 4395 | struct link_vars *vars) |
@@ -4433,19 +4450,11 @@ static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy, | |||
4433 | break; | 4450 | break; |
4434 | 4451 | ||
4435 | case PORT_HW_CFG_NET_SERDES_IF_SFI: | 4452 | case PORT_HW_CFG_NET_SERDES_IF_SFI: |
4436 | |||
4437 | bnx2x_warpcore_clear_regs(phy, params, lane); | ||
4438 | if (vars->line_speed == SPEED_10000) { | ||
4439 | DP(NETIF_MSG_LINK, "Setting 10G SFI\n"); | ||
4440 | bnx2x_warpcore_set_10G_XFI(phy, params, 0); | ||
4441 | } else if (vars->line_speed == SPEED_1000) { | ||
4442 | DP(NETIF_MSG_LINK, "Setting 1G Fiber\n"); | ||
4443 | bnx2x_warpcore_set_sgmii_speed( | ||
4444 | phy, params, 1, 0); | ||
4445 | } | ||
4446 | /* Issue Module detection */ | 4453 | /* Issue Module detection */ |
4447 | if (bnx2x_is_sfp_module_plugged(phy, params)) | 4454 | if (bnx2x_is_sfp_module_plugged(phy, params)) |
4448 | bnx2x_sfp_module_detection(phy, params); | 4455 | bnx2x_sfp_module_detection(phy, params); |
4456 | |||
4457 | bnx2x_warpcore_config_sfi(phy, params); | ||
4449 | break; | 4458 | break; |
4450 | 4459 | ||
4451 | case PORT_HW_CFG_NET_SERDES_IF_DXGXS: | 4460 | case PORT_HW_CFG_NET_SERDES_IF_DXGXS: |
@@ -6354,7 +6363,9 @@ int bnx2x_test_link(struct link_params *params, struct link_vars *vars, | |||
6354 | for (phy_index = EXT_PHY1; phy_index < params->num_phys; | 6363 | for (phy_index = EXT_PHY1; phy_index < params->num_phys; |
6355 | phy_index++) { | 6364 | phy_index++) { |
6356 | serdes_phy_type = ((params->phy[phy_index].media_type == | 6365 | serdes_phy_type = ((params->phy[phy_index].media_type == |
6357 | ETH_PHY_SFP_FIBER) || | 6366 | ETH_PHY_SFPP_10G_FIBER) || |
6367 | (params->phy[phy_index].media_type == | ||
6368 | ETH_PHY_SFP_1G_FIBER) || | ||
6358 | (params->phy[phy_index].media_type == | 6369 | (params->phy[phy_index].media_type == |
6359 | ETH_PHY_XFP_FIBER) || | 6370 | ETH_PHY_XFP_FIBER) || |
6360 | (params->phy[phy_index].media_type == | 6371 | (params->phy[phy_index].media_type == |
@@ -7891,7 +7902,7 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, | |||
7891 | { | 7902 | { |
7892 | struct bnx2x *bp = params->bp; | 7903 | struct bnx2x *bp = params->bp; |
7893 | u32 sync_offset = 0, phy_idx, media_types; | 7904 | u32 sync_offset = 0, phy_idx, media_types; |
7894 | u8 val, check_limiting_mode = 0; | 7905 | u8 val[2], check_limiting_mode = 0; |
7895 | *edc_mode = EDC_MODE_LIMITING; | 7906 | *edc_mode = EDC_MODE_LIMITING; |
7896 | 7907 | ||
7897 | phy->media_type = ETH_PHY_UNSPECIFIED; | 7908 | phy->media_type = ETH_PHY_UNSPECIFIED; |
@@ -7899,13 +7910,13 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, | |||
7899 | if (bnx2x_read_sfp_module_eeprom(phy, | 7910 | if (bnx2x_read_sfp_module_eeprom(phy, |
7900 | params, | 7911 | params, |
7901 | SFP_EEPROM_CON_TYPE_ADDR, | 7912 | SFP_EEPROM_CON_TYPE_ADDR, |
7902 | 1, | 7913 | 2, |
7903 | &val) != 0) { | 7914 | (u8 *)val) != 0) { |
7904 | DP(NETIF_MSG_LINK, "Failed to read from SFP+ module EEPROM\n"); | 7915 | DP(NETIF_MSG_LINK, "Failed to read from SFP+ module EEPROM\n"); |
7905 | return -EINVAL; | 7916 | return -EINVAL; |
7906 | } | 7917 | } |
7907 | 7918 | ||
7908 | switch (val) { | 7919 | switch (val[0]) { |
7909 | case SFP_EEPROM_CON_TYPE_VAL_COPPER: | 7920 | case SFP_EEPROM_CON_TYPE_VAL_COPPER: |
7910 | { | 7921 | { |
7911 | u8 copper_module_type; | 7922 | u8 copper_module_type; |
@@ -7943,13 +7954,29 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, | |||
7943 | break; | 7954 | break; |
7944 | } | 7955 | } |
7945 | case SFP_EEPROM_CON_TYPE_VAL_LC: | 7956 | case SFP_EEPROM_CON_TYPE_VAL_LC: |
7946 | phy->media_type = ETH_PHY_SFP_FIBER; | ||
7947 | DP(NETIF_MSG_LINK, "Optic module detected\n"); | ||
7948 | check_limiting_mode = 1; | 7957 | check_limiting_mode = 1; |
7958 | if ((val[1] & (SFP_EEPROM_COMP_CODE_SR_MASK | | ||
7959 | SFP_EEPROM_COMP_CODE_LR_MASK | | ||
7960 | SFP_EEPROM_COMP_CODE_LRM_MASK)) == 0) { | ||
7961 | DP(NETIF_MSG_LINK, "1G Optic module detected\n"); | ||
7962 | phy->media_type = ETH_PHY_SFP_1G_FIBER; | ||
7963 | phy->req_line_speed = SPEED_1000; | ||
7964 | } else { | ||
7965 | int idx, cfg_idx = 0; | ||
7966 | DP(NETIF_MSG_LINK, "10G Optic module detected\n"); | ||
7967 | for (idx = INT_PHY; idx < MAX_PHYS; idx++) { | ||
7968 | if (params->phy[idx].type == phy->type) { | ||
7969 | cfg_idx = LINK_CONFIG_IDX(idx); | ||
7970 | break; | ||
7971 | } | ||
7972 | } | ||
7973 | phy->media_type = ETH_PHY_SFPP_10G_FIBER; | ||
7974 | phy->req_line_speed = params->req_line_speed[cfg_idx]; | ||
7975 | } | ||
7949 | break; | 7976 | break; |
7950 | default: | 7977 | default: |
7951 | DP(NETIF_MSG_LINK, "Unable to determine module type 0x%x !!!\n", | 7978 | DP(NETIF_MSG_LINK, "Unable to determine module type 0x%x !!!\n", |
7952 | val); | 7979 | val[0]); |
7953 | return -EINVAL; | 7980 | return -EINVAL; |
7954 | } | 7981 | } |
7955 | sync_offset = params->shmem_base + | 7982 | sync_offset = params->shmem_base + |
@@ -8479,14 +8506,34 @@ void bnx2x_handle_module_detect_int(struct link_params *params) | |||
8479 | 8506 | ||
8480 | /* Call the handling function in case module is detected */ | 8507 | /* Call the handling function in case module is detected */ |
8481 | if (gpio_val == 0) { | 8508 | if (gpio_val == 0) { |
8509 | bnx2x_set_mdio_clk(bp, params->chip_id, params->port); | ||
8510 | bnx2x_set_aer_mmd(params, phy); | ||
8511 | |||
8482 | bnx2x_power_sfp_module(params, phy, 1); | 8512 | bnx2x_power_sfp_module(params, phy, 1); |
8483 | bnx2x_set_gpio_int(bp, gpio_num, | 8513 | bnx2x_set_gpio_int(bp, gpio_num, |
8484 | MISC_REGISTERS_GPIO_INT_OUTPUT_CLR, | 8514 | MISC_REGISTERS_GPIO_INT_OUTPUT_CLR, |
8485 | gpio_port); | 8515 | gpio_port); |
8486 | if (bnx2x_wait_for_sfp_module_initialized(phy, params) == 0) | 8516 | if (bnx2x_wait_for_sfp_module_initialized(phy, params) == 0) { |
8487 | bnx2x_sfp_module_detection(phy, params); | 8517 | bnx2x_sfp_module_detection(phy, params); |
8488 | else | 8518 | if (CHIP_IS_E3(bp)) { |
8519 | u16 rx_tx_in_reset; | ||
8520 | /* In case WC is out of reset, reconfigure the | ||
8521 | * link speed while taking into account 1G | ||
8522 | * module limitation. | ||
8523 | */ | ||
8524 | bnx2x_cl45_read(bp, phy, | ||
8525 | MDIO_WC_DEVAD, | ||
8526 | MDIO_WC_REG_DIGITAL5_MISC6, | ||
8527 | &rx_tx_in_reset); | ||
8528 | if (!rx_tx_in_reset) { | ||
8529 | bnx2x_warpcore_reset_lane(bp, phy, 1); | ||
8530 | bnx2x_warpcore_config_sfi(phy, params); | ||
8531 | bnx2x_warpcore_reset_lane(bp, phy, 0); | ||
8532 | } | ||
8533 | } | ||
8534 | } else { | ||
8489 | DP(NETIF_MSG_LINK, "SFP+ module is not initialized\n"); | 8535 | DP(NETIF_MSG_LINK, "SFP+ module is not initialized\n"); |
8536 | } | ||
8490 | } else { | 8537 | } else { |
8491 | u32 val = REG_RD(bp, params->shmem_base + | 8538 | u32 val = REG_RD(bp, params->shmem_base + |
8492 | offsetof(struct shmem_region, dev_info. | 8539 | offsetof(struct shmem_region, dev_info. |
@@ -8938,6 +8985,63 @@ static void bnx2x_8727_hw_reset(struct bnx2x_phy *phy, | |||
8938 | MISC_REGISTERS_GPIO_OUTPUT_LOW, port); | 8985 | MISC_REGISTERS_GPIO_OUTPUT_LOW, port); |
8939 | } | 8986 | } |
8940 | 8987 | ||
8988 | static void bnx2x_8727_config_speed(struct bnx2x_phy *phy, | ||
8989 | struct link_params *params) | ||
8990 | { | ||
8991 | struct bnx2x *bp = params->bp; | ||
8992 | u16 tmp1, val; | ||
8993 | /* Set option 1G speed */ | ||
8994 | if ((phy->req_line_speed == SPEED_1000) || | ||
8995 | (phy->media_type == ETH_PHY_SFP_1G_FIBER)) { | ||
8996 | DP(NETIF_MSG_LINK, "Setting 1G force\n"); | ||
8997 | bnx2x_cl45_write(bp, phy, | ||
8998 | MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 0x40); | ||
8999 | bnx2x_cl45_write(bp, phy, | ||
9000 | MDIO_PMA_DEVAD, MDIO_PMA_REG_10G_CTRL2, 0xD); | ||
9001 | bnx2x_cl45_read(bp, phy, | ||
9002 | MDIO_PMA_DEVAD, MDIO_PMA_REG_10G_CTRL2, &tmp1); | ||
9003 | DP(NETIF_MSG_LINK, "1.7 = 0x%x\n", tmp1); | ||
9004 | /* Power down the XAUI until link is up in case of dual-media | ||
9005 | * and 1G | ||
9006 | */ | ||
9007 | if (DUAL_MEDIA(params)) { | ||
9008 | bnx2x_cl45_read(bp, phy, | ||
9009 | MDIO_PMA_DEVAD, | ||
9010 | MDIO_PMA_REG_8727_PCS_GP, &val); | ||
9011 | val |= (3<<10); | ||
9012 | bnx2x_cl45_write(bp, phy, | ||
9013 | MDIO_PMA_DEVAD, | ||
9014 | MDIO_PMA_REG_8727_PCS_GP, val); | ||
9015 | } | ||
9016 | } else if ((phy->req_line_speed == SPEED_AUTO_NEG) && | ||
9017 | ((phy->speed_cap_mask & | ||
9018 | PORT_HW_CFG_SPEED_CAPABILITY_D0_1G)) && | ||
9019 | ((phy->speed_cap_mask & | ||
9020 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) != | ||
9021 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10G)) { | ||
9022 | |||
9023 | DP(NETIF_MSG_LINK, "Setting 1G clause37\n"); | ||
9024 | bnx2x_cl45_write(bp, phy, | ||
9025 | MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL, 0); | ||
9026 | bnx2x_cl45_write(bp, phy, | ||
9027 | MDIO_AN_DEVAD, MDIO_AN_REG_CL37_AN, 0x1300); | ||
9028 | } else { | ||
9029 | /* Since the 8727 has only single reset pin, need to set the 10G | ||
9030 | * registers although it is default | ||
9031 | */ | ||
9032 | bnx2x_cl45_write(bp, phy, | ||
9033 | MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL, | ||
9034 | 0x0020); | ||
9035 | bnx2x_cl45_write(bp, phy, | ||
9036 | MDIO_AN_DEVAD, MDIO_AN_REG_CL37_AN, 0x0100); | ||
9037 | bnx2x_cl45_write(bp, phy, | ||
9038 | MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 0x2040); | ||
9039 | bnx2x_cl45_write(bp, phy, | ||
9040 | MDIO_PMA_DEVAD, MDIO_PMA_REG_10G_CTRL2, | ||
9041 | 0x0008); | ||
9042 | } | ||
9043 | } | ||
9044 | |||
8941 | static int bnx2x_8727_config_init(struct bnx2x_phy *phy, | 9045 | static int bnx2x_8727_config_init(struct bnx2x_phy *phy, |
8942 | struct link_params *params, | 9046 | struct link_params *params, |
8943 | struct link_vars *vars) | 9047 | struct link_vars *vars) |
@@ -9007,56 +9111,7 @@ static int bnx2x_8727_config_init(struct bnx2x_phy *phy, | |||
9007 | bnx2x_cl45_read(bp, phy, | 9111 | bnx2x_cl45_read(bp, phy, |
9008 | MDIO_PMA_DEVAD, MDIO_PMA_LASI_RXSTAT, &tmp1); | 9112 | MDIO_PMA_DEVAD, MDIO_PMA_LASI_RXSTAT, &tmp1); |
9009 | 9113 | ||
9010 | /* Set option 1G speed */ | 9114 | bnx2x_8727_config_speed(phy, params); |
9011 | if (phy->req_line_speed == SPEED_1000) { | ||
9012 | DP(NETIF_MSG_LINK, "Setting 1G force\n"); | ||
9013 | bnx2x_cl45_write(bp, phy, | ||
9014 | MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 0x40); | ||
9015 | bnx2x_cl45_write(bp, phy, | ||
9016 | MDIO_PMA_DEVAD, MDIO_PMA_REG_10G_CTRL2, 0xD); | ||
9017 | bnx2x_cl45_read(bp, phy, | ||
9018 | MDIO_PMA_DEVAD, MDIO_PMA_REG_10G_CTRL2, &tmp1); | ||
9019 | DP(NETIF_MSG_LINK, "1.7 = 0x%x\n", tmp1); | ||
9020 | /* Power down the XAUI until link is up in case of dual-media | ||
9021 | * and 1G | ||
9022 | */ | ||
9023 | if (DUAL_MEDIA(params)) { | ||
9024 | bnx2x_cl45_read(bp, phy, | ||
9025 | MDIO_PMA_DEVAD, | ||
9026 | MDIO_PMA_REG_8727_PCS_GP, &val); | ||
9027 | val |= (3<<10); | ||
9028 | bnx2x_cl45_write(bp, phy, | ||
9029 | MDIO_PMA_DEVAD, | ||
9030 | MDIO_PMA_REG_8727_PCS_GP, val); | ||
9031 | } | ||
9032 | } else if ((phy->req_line_speed == SPEED_AUTO_NEG) && | ||
9033 | ((phy->speed_cap_mask & | ||
9034 | PORT_HW_CFG_SPEED_CAPABILITY_D0_1G)) && | ||
9035 | ((phy->speed_cap_mask & | ||
9036 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) != | ||
9037 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10G)) { | ||
9038 | |||
9039 | DP(NETIF_MSG_LINK, "Setting 1G clause37\n"); | ||
9040 | bnx2x_cl45_write(bp, phy, | ||
9041 | MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL, 0); | ||
9042 | bnx2x_cl45_write(bp, phy, | ||
9043 | MDIO_AN_DEVAD, MDIO_AN_REG_CL37_AN, 0x1300); | ||
9044 | } else { | ||
9045 | /* Since the 8727 has only single reset pin, need to set the 10G | ||
9046 | * registers although it is default | ||
9047 | */ | ||
9048 | bnx2x_cl45_write(bp, phy, | ||
9049 | MDIO_AN_DEVAD, MDIO_AN_REG_8727_MISC_CTRL, | ||
9050 | 0x0020); | ||
9051 | bnx2x_cl45_write(bp, phy, | ||
9052 | MDIO_AN_DEVAD, MDIO_AN_REG_CL37_AN, 0x0100); | ||
9053 | bnx2x_cl45_write(bp, phy, | ||
9054 | MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 0x2040); | ||
9055 | bnx2x_cl45_write(bp, phy, | ||
9056 | MDIO_PMA_DEVAD, MDIO_PMA_REG_10G_CTRL2, | ||
9057 | 0x0008); | ||
9058 | } | ||
9059 | |||
9060 | /* Set 2-wire transfer rate of SFP+ module EEPROM | 9115 | /* Set 2-wire transfer rate of SFP+ module EEPROM |
9061 | * to 100Khz since some DACs(direct attached cables) do | 9116 | * to 100Khz since some DACs(direct attached cables) do |
9062 | * not work at 400Khz. | 9117 | * not work at 400Khz. |
@@ -9183,6 +9238,9 @@ static void bnx2x_8727_handle_mod_abs(struct bnx2x_phy *phy, | |||
9183 | bnx2x_sfp_module_detection(phy, params); | 9238 | bnx2x_sfp_module_detection(phy, params); |
9184 | else | 9239 | else |
9185 | DP(NETIF_MSG_LINK, "SFP+ module is not initialized\n"); | 9240 | DP(NETIF_MSG_LINK, "SFP+ module is not initialized\n"); |
9241 | |||
9242 | /* Reconfigure link speed based on module type limitations */ | ||
9243 | bnx2x_8727_config_speed(phy, params); | ||
9186 | } | 9244 | } |
9187 | 9245 | ||
9188 | DP(NETIF_MSG_LINK, "8727 RX_ALARM_STATUS 0x%x\n", | 9246 | DP(NETIF_MSG_LINK, "8727 RX_ALARM_STATUS 0x%x\n", |
@@ -11327,7 +11385,7 @@ static struct bnx2x_phy phy_8706 = { | |||
11327 | SUPPORTED_FIBRE | | 11385 | SUPPORTED_FIBRE | |
11328 | SUPPORTED_Pause | | 11386 | SUPPORTED_Pause | |
11329 | SUPPORTED_Asym_Pause), | 11387 | SUPPORTED_Asym_Pause), |
11330 | .media_type = ETH_PHY_SFP_FIBER, | 11388 | .media_type = ETH_PHY_SFPP_10G_FIBER, |
11331 | .ver_addr = 0, | 11389 | .ver_addr = 0, |
11332 | .req_flow_ctrl = 0, | 11390 | .req_flow_ctrl = 0, |
11333 | .req_line_speed = 0, | 11391 | .req_line_speed = 0, |
@@ -11666,7 +11724,7 @@ static int bnx2x_populate_int_phy(struct bnx2x *bp, u32 shmem_base, u8 port, | |||
11666 | SUPPORTED_FIBRE | | 11724 | SUPPORTED_FIBRE | |
11667 | SUPPORTED_Pause | | 11725 | SUPPORTED_Pause | |
11668 | SUPPORTED_Asym_Pause); | 11726 | SUPPORTED_Asym_Pause); |
11669 | phy->media_type = ETH_PHY_SFP_FIBER; | 11727 | phy->media_type = ETH_PHY_SFPP_10G_FIBER; |
11670 | break; | 11728 | break; |
11671 | case PORT_HW_CFG_NET_SERDES_IF_KR: | 11729 | case PORT_HW_CFG_NET_SERDES_IF_KR: |
11672 | phy->media_type = ETH_PHY_KR; | 11730 | phy->media_type = ETH_PHY_KR; |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h index 7b6051bc4551..017236bee323 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h | |||
@@ -168,14 +168,15 @@ struct bnx2x_phy { | |||
168 | u32 supported; | 168 | u32 supported; |
169 | 169 | ||
170 | u32 media_type; | 170 | u32 media_type; |
171 | #define ETH_PHY_UNSPECIFIED 0x0 | 171 | #define ETH_PHY_UNSPECIFIED 0x0 |
172 | #define ETH_PHY_SFP_FIBER 0x1 | 172 | #define ETH_PHY_SFPP_10G_FIBER 0x1 |
173 | #define ETH_PHY_XFP_FIBER 0x2 | 173 | #define ETH_PHY_XFP_FIBER 0x2 |
174 | #define ETH_PHY_DA_TWINAX 0x3 | 174 | #define ETH_PHY_DA_TWINAX 0x3 |
175 | #define ETH_PHY_BASE_T 0x4 | 175 | #define ETH_PHY_BASE_T 0x4 |
176 | #define ETH_PHY_KR 0xf0 | 176 | #define ETH_PHY_SFP_1G_FIBER 0x5 |
177 | #define ETH_PHY_CX4 0xf1 | 177 | #define ETH_PHY_KR 0xf0 |
178 | #define ETH_PHY_NOT_PRESENT 0xff | 178 | #define ETH_PHY_CX4 0xf1 |
179 | #define ETH_PHY_NOT_PRESENT 0xff | ||
179 | 180 | ||
180 | /* The address in which version is located*/ | 181 | /* The address in which version is located*/ |
181 | u32 ver_addr; | 182 | u32 ver_addr; |