diff options
author | Don Skidmore <donald.c.skidmore@intel.com> | 2010-06-29 14:30:59 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-30 17:27:40 -0400 |
commit | cb836a977f71f76ccbb1ff35b9c113ace96377e9 (patch) | |
tree | b91e2fc048d7f5fb193390f13fd89ef0e7a0b550 /drivers/net | |
parent | 765c9f46867c3253c02275cbb7a453f2eb56eda1 (diff) |
ixgbe: add 1g PHY support for 82599
Add support for 1G SFP+ PHY's to 82599.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_82599.c | 13 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 7 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_phy.c | 33 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_phy.h | 1 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_type.h | 2 |
5 files changed, 52 insertions, 4 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c index 976fd9e146c6..0ee175a289ee 100644 --- a/drivers/net/ixgbe/ixgbe_82599.c +++ b/drivers/net/ixgbe/ixgbe_82599.c | |||
@@ -206,6 +206,14 @@ static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, | |||
206 | s32 status = 0; | 206 | s32 status = 0; |
207 | u32 autoc = 0; | 207 | u32 autoc = 0; |
208 | 208 | ||
209 | /* Determine 1G link capabilities off of SFP+ type */ | ||
210 | if (hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 || | ||
211 | hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1) { | ||
212 | *speed = IXGBE_LINK_SPEED_1GB_FULL; | ||
213 | *negotiation = true; | ||
214 | goto out; | ||
215 | } | ||
216 | |||
209 | /* | 217 | /* |
210 | * Determine link capabilities based on the stored value of AUTOC, | 218 | * Determine link capabilities based on the stored value of AUTOC, |
211 | * which represents EEPROM defaults. If AUTOC value has not been | 219 | * which represents EEPROM defaults. If AUTOC value has not been |
@@ -2087,6 +2095,7 @@ static u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw) | |||
2087 | u32 pma_pmd_1g = autoc & IXGBE_AUTOC_1G_PMA_PMD_MASK; | 2095 | u32 pma_pmd_1g = autoc & IXGBE_AUTOC_1G_PMA_PMD_MASK; |
2088 | u16 ext_ability = 0; | 2096 | u16 ext_ability = 0; |
2089 | u8 comp_codes_10g = 0; | 2097 | u8 comp_codes_10g = 0; |
2098 | u8 comp_codes_1g = 0; | ||
2090 | 2099 | ||
2091 | hw->phy.ops.identify(hw); | 2100 | hw->phy.ops.identify(hw); |
2092 | 2101 | ||
@@ -2167,11 +2176,15 @@ sfp_check: | |||
2167 | case ixgbe_phy_sfp_intel: | 2176 | case ixgbe_phy_sfp_intel: |
2168 | case ixgbe_phy_sfp_unknown: | 2177 | case ixgbe_phy_sfp_unknown: |
2169 | hw->phy.ops.read_i2c_eeprom(hw, | 2178 | hw->phy.ops.read_i2c_eeprom(hw, |
2179 | IXGBE_SFF_1GBE_COMP_CODES, &comp_codes_1g); | ||
2180 | hw->phy.ops.read_i2c_eeprom(hw, | ||
2170 | IXGBE_SFF_10GBE_COMP_CODES, &comp_codes_10g); | 2181 | IXGBE_SFF_10GBE_COMP_CODES, &comp_codes_10g); |
2171 | if (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE) | 2182 | if (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE) |
2172 | physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_SR; | 2183 | physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_SR; |
2173 | else if (comp_codes_10g & IXGBE_SFF_10GBASELR_CAPABLE) | 2184 | else if (comp_codes_10g & IXGBE_SFF_10GBASELR_CAPABLE) |
2174 | physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR; | 2185 | physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR; |
2186 | else if (comp_codes_1g & IXGBE_SFF_1GBASET_CAPABLE) | ||
2187 | physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_T; | ||
2175 | break; | 2188 | break; |
2176 | default: | 2189 | default: |
2177 | break; | 2190 | break; |
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 7d2e5ea2deba..b50b5ea4cf83 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -234,6 +234,13 @@ static int ixgbe_get_settings(struct net_device *netdev, | |||
234 | case ixgbe_sfp_type_not_present: | 234 | case ixgbe_sfp_type_not_present: |
235 | ecmd->port = PORT_NONE; | 235 | ecmd->port = PORT_NONE; |
236 | break; | 236 | break; |
237 | case ixgbe_sfp_type_1g_cu_core0: | ||
238 | case ixgbe_sfp_type_1g_cu_core1: | ||
239 | ecmd->port = PORT_TP; | ||
240 | ecmd->supported = SUPPORTED_TP; | ||
241 | ecmd->advertising = (ADVERTISED_1000baseT_Full | | ||
242 | ADVERTISED_TP); | ||
243 | break; | ||
237 | case ixgbe_sfp_type_unknown: | 244 | case ixgbe_sfp_type_unknown: |
238 | default: | 245 | default: |
239 | ecmd->port = PORT_OTHER; | 246 | ecmd->port = PORT_OTHER; |
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c index 48325a5beff2..6c0d42e33f21 100644 --- a/drivers/net/ixgbe/ixgbe_phy.c +++ b/drivers/net/ixgbe/ixgbe_phy.c | |||
@@ -577,6 +577,8 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) | |||
577 | * 6 SFP_SR/LR_CORE1 - 82599-specific | 577 | * 6 SFP_SR/LR_CORE1 - 82599-specific |
578 | * 7 SFP_act_lmt_DA_CORE0 - 82599-specific | 578 | * 7 SFP_act_lmt_DA_CORE0 - 82599-specific |
579 | * 8 SFP_act_lmt_DA_CORE1 - 82599-specific | 579 | * 8 SFP_act_lmt_DA_CORE1 - 82599-specific |
580 | * 9 SFP_1g_cu_CORE0 - 82599-specific | ||
581 | * 10 SFP_1g_cu_CORE1 - 82599-specific | ||
580 | */ | 582 | */ |
581 | if (hw->mac.type == ixgbe_mac_82598EB) { | 583 | if (hw->mac.type == ixgbe_mac_82598EB) { |
582 | if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE) | 584 | if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE) |
@@ -625,6 +627,13 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) | |||
625 | else | 627 | else |
626 | hw->phy.sfp_type = | 628 | hw->phy.sfp_type = |
627 | ixgbe_sfp_type_srlr_core1; | 629 | ixgbe_sfp_type_srlr_core1; |
630 | else if (comp_codes_1g & IXGBE_SFF_1GBASET_CAPABLE) | ||
631 | if (hw->bus.lan_id == 0) | ||
632 | hw->phy.sfp_type = | ||
633 | ixgbe_sfp_type_1g_cu_core0; | ||
634 | else | ||
635 | hw->phy.sfp_type = | ||
636 | ixgbe_sfp_type_1g_cu_core1; | ||
628 | else | 637 | else |
629 | hw->phy.sfp_type = ixgbe_sfp_type_unknown; | 638 | hw->phy.sfp_type = ixgbe_sfp_type_unknown; |
630 | } | 639 | } |
@@ -696,8 +705,10 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) | |||
696 | goto out; | 705 | goto out; |
697 | } | 706 | } |
698 | 707 | ||
699 | /* 1G SFP modules are not supported */ | 708 | /* Verify supported 1G SFP modules */ |
700 | if (comp_codes_10g == 0) { | 709 | if (comp_codes_10g == 0 && |
710 | !(hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 || | ||
711 | hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0)) { | ||
701 | hw->phy.type = ixgbe_phy_sfp_unsupported; | 712 | hw->phy.type = ixgbe_phy_sfp_unsupported; |
702 | status = IXGBE_ERR_SFP_NOT_SUPPORTED; | 713 | status = IXGBE_ERR_SFP_NOT_SUPPORTED; |
703 | goto out; | 714 | goto out; |
@@ -711,7 +722,9 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) | |||
711 | 722 | ||
712 | /* This is guaranteed to be 82599, no need to check for NULL */ | 723 | /* This is guaranteed to be 82599, no need to check for NULL */ |
713 | hw->mac.ops.get_device_caps(hw, &enforce_sfp); | 724 | hw->mac.ops.get_device_caps(hw, &enforce_sfp); |
714 | if (!(enforce_sfp & IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP)) { | 725 | if (!(enforce_sfp & IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP) && |
726 | !((hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0) || | ||
727 | (hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1))) { | ||
715 | /* Make sure we're a supported PHY type */ | 728 | /* Make sure we're a supported PHY type */ |
716 | if (hw->phy.type == ixgbe_phy_sfp_intel) { | 729 | if (hw->phy.type == ixgbe_phy_sfp_intel) { |
717 | status = 0; | 730 | status = 0; |
@@ -742,6 +755,7 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw, | |||
742 | u16 *data_offset) | 755 | u16 *data_offset) |
743 | { | 756 | { |
744 | u16 sfp_id; | 757 | u16 sfp_id; |
758 | u16 sfp_type = hw->phy.sfp_type; | ||
745 | 759 | ||
746 | if (hw->phy.sfp_type == ixgbe_sfp_type_unknown) | 760 | if (hw->phy.sfp_type == ixgbe_sfp_type_unknown) |
747 | return IXGBE_ERR_SFP_NOT_SUPPORTED; | 761 | return IXGBE_ERR_SFP_NOT_SUPPORTED; |
@@ -753,6 +767,17 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw, | |||
753 | (hw->phy.sfp_type == ixgbe_sfp_type_da_cu)) | 767 | (hw->phy.sfp_type == ixgbe_sfp_type_da_cu)) |
754 | return IXGBE_ERR_SFP_NOT_SUPPORTED; | 768 | return IXGBE_ERR_SFP_NOT_SUPPORTED; |
755 | 769 | ||
770 | /* | ||
771 | * Limiting active cables and 1G Phys must be initialized as | ||
772 | * SR modules | ||
773 | */ | ||
774 | if (sfp_type == ixgbe_sfp_type_da_act_lmt_core0 || | ||
775 | sfp_type == ixgbe_sfp_type_1g_cu_core0) | ||
776 | sfp_type = ixgbe_sfp_type_srlr_core0; | ||
777 | else if (sfp_type == ixgbe_sfp_type_da_act_lmt_core1 || | ||
778 | sfp_type == ixgbe_sfp_type_1g_cu_core1) | ||
779 | sfp_type = ixgbe_sfp_type_srlr_core1; | ||
780 | |||
756 | /* Read offset to PHY init contents */ | 781 | /* Read offset to PHY init contents */ |
757 | hw->eeprom.ops.read(hw, IXGBE_PHY_INIT_OFFSET_NL, list_offset); | 782 | hw->eeprom.ops.read(hw, IXGBE_PHY_INIT_OFFSET_NL, list_offset); |
758 | 783 | ||
@@ -769,7 +794,7 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw, | |||
769 | hw->eeprom.ops.read(hw, *list_offset, &sfp_id); | 794 | hw->eeprom.ops.read(hw, *list_offset, &sfp_id); |
770 | 795 | ||
771 | while (sfp_id != IXGBE_PHY_INIT_END_NL) { | 796 | while (sfp_id != IXGBE_PHY_INIT_END_NL) { |
772 | if (sfp_id == hw->phy.sfp_type) { | 797 | if (sfp_id == sfp_type) { |
773 | (*list_offset)++; | 798 | (*list_offset)++; |
774 | hw->eeprom.ops.read(hw, *list_offset, data_offset); | 799 | hw->eeprom.ops.read(hw, *list_offset, data_offset); |
775 | if ((!*data_offset) || (*data_offset == 0xFFFF)) { | 800 | if ((!*data_offset) || (*data_offset == 0xFFFF)) { |
diff --git a/drivers/net/ixgbe/ixgbe_phy.h b/drivers/net/ixgbe/ixgbe_phy.h index ef4ba834c593..fb3898f12fc5 100644 --- a/drivers/net/ixgbe/ixgbe_phy.h +++ b/drivers/net/ixgbe/ixgbe_phy.h | |||
@@ -48,6 +48,7 @@ | |||
48 | #define IXGBE_SFF_DA_SPEC_ACTIVE_LIMITING 0x4 | 48 | #define IXGBE_SFF_DA_SPEC_ACTIVE_LIMITING 0x4 |
49 | #define IXGBE_SFF_1GBASESX_CAPABLE 0x1 | 49 | #define IXGBE_SFF_1GBASESX_CAPABLE 0x1 |
50 | #define IXGBE_SFF_1GBASELX_CAPABLE 0x2 | 50 | #define IXGBE_SFF_1GBASELX_CAPABLE 0x2 |
51 | #define IXGBE_SFF_1GBASET_CAPABLE 0x8 | ||
51 | #define IXGBE_SFF_10GBASESR_CAPABLE 0x10 | 52 | #define IXGBE_SFF_10GBASESR_CAPABLE 0x10 |
52 | #define IXGBE_SFF_10GBASELR_CAPABLE 0x20 | 53 | #define IXGBE_SFF_10GBASELR_CAPABLE 0x20 |
53 | #define IXGBE_I2C_EEPROM_READ_MASK 0x100 | 54 | #define IXGBE_I2C_EEPROM_READ_MASK 0x100 |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index cdd1998f18c7..9587d975d66c 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -2214,6 +2214,8 @@ enum ixgbe_sfp_type { | |||
2214 | ixgbe_sfp_type_srlr_core1 = 6, | 2214 | ixgbe_sfp_type_srlr_core1 = 6, |
2215 | ixgbe_sfp_type_da_act_lmt_core0 = 7, | 2215 | ixgbe_sfp_type_da_act_lmt_core0 = 7, |
2216 | ixgbe_sfp_type_da_act_lmt_core1 = 8, | 2216 | ixgbe_sfp_type_da_act_lmt_core1 = 8, |
2217 | ixgbe_sfp_type_1g_cu_core0 = 9, | ||
2218 | ixgbe_sfp_type_1g_cu_core1 = 10, | ||
2217 | ixgbe_sfp_type_not_present = 0xFFFE, | 2219 | ixgbe_sfp_type_not_present = 0xFFFE, |
2218 | ixgbe_sfp_type_unknown = 0xFFFF | 2220 | ixgbe_sfp_type_unknown = 0xFFFF |
2219 | }; | 2221 | }; |