Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | |
| 3 | Intel(R) Gigabit Ethernet Linux driver |
Alexander Duyck | 86d5d38 | 2009-02-06 23:23:12 +0000 | [diff] [blame] | 4 | Copyright(c) 2007-2009 Intel Corporation. |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 5 | |
| 6 | This program is free software; you can redistribute it and/or modify it |
| 7 | under the terms and conditions of the GNU General Public License, |
| 8 | version 2, as published by the Free Software Foundation. |
| 9 | |
| 10 | This program is distributed in the hope it will be useful, but WITHOUT |
| 11 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 13 | more details. |
| 14 | |
| 15 | You should have received a copy of the GNU General Public License along with |
| 16 | this program; if not, write to the Free Software Foundation, Inc., |
| 17 | 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. |
| 18 | |
| 19 | The full GNU General Public License is included in this distribution in |
| 20 | the file called "COPYING". |
| 21 | |
| 22 | Contact Information: |
| 23 | e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> |
| 24 | Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 |
| 25 | |
| 26 | *******************************************************************************/ |
| 27 | |
| 28 | /* e1000_82575 |
| 29 | * e1000_82576 |
| 30 | */ |
| 31 | |
| 32 | #include <linux/types.h> |
| 33 | #include <linux/slab.h> |
Alexander Duyck | 2d064c0 | 2008-07-08 15:10:12 -0700 | [diff] [blame] | 34 | #include <linux/if_ether.h> |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 35 | |
| 36 | #include "e1000_mac.h" |
| 37 | #include "e1000_82575.h" |
| 38 | |
| 39 | static s32 igb_get_invariants_82575(struct e1000_hw *); |
| 40 | static s32 igb_acquire_phy_82575(struct e1000_hw *); |
| 41 | static void igb_release_phy_82575(struct e1000_hw *); |
| 42 | static s32 igb_acquire_nvm_82575(struct e1000_hw *); |
| 43 | static void igb_release_nvm_82575(struct e1000_hw *); |
| 44 | static s32 igb_check_for_link_82575(struct e1000_hw *); |
| 45 | static s32 igb_get_cfg_done_82575(struct e1000_hw *); |
| 46 | static s32 igb_init_hw_82575(struct e1000_hw *); |
| 47 | static s32 igb_phy_hw_reset_sgmii_82575(struct e1000_hw *); |
| 48 | static s32 igb_read_phy_reg_sgmii_82575(struct e1000_hw *, u32, u16 *); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 49 | static s32 igb_reset_hw_82575(struct e1000_hw *); |
| 50 | static s32 igb_set_d0_lplu_state_82575(struct e1000_hw *, bool); |
| 51 | static s32 igb_setup_copper_link_82575(struct e1000_hw *); |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 52 | static s32 igb_setup_serdes_link_82575(struct e1000_hw *); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 53 | static s32 igb_write_phy_reg_sgmii_82575(struct e1000_hw *, u32, u16); |
| 54 | static void igb_clear_hw_cntrs_82575(struct e1000_hw *); |
| 55 | static s32 igb_acquire_swfw_sync_82575(struct e1000_hw *, u16); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 56 | static s32 igb_get_pcs_speed_and_duplex_82575(struct e1000_hw *, u16 *, |
| 57 | u16 *); |
| 58 | static s32 igb_get_phy_id_82575(struct e1000_hw *); |
| 59 | static void igb_release_swfw_sync_82575(struct e1000_hw *, u16); |
| 60 | static bool igb_sgmii_active_82575(struct e1000_hw *); |
| 61 | static s32 igb_reset_init_script_82575(struct e1000_hw *); |
| 62 | static s32 igb_read_mac_addr_82575(struct e1000_hw *); |
Alexander Duyck | 009bc06 | 2009-07-23 18:08:35 +0000 | [diff] [blame] | 63 | static s32 igb_set_pcie_completion_timeout(struct e1000_hw *hw); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 64 | |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 65 | static s32 igb_get_invariants_82575(struct e1000_hw *hw) |
| 66 | { |
| 67 | struct e1000_phy_info *phy = &hw->phy; |
| 68 | struct e1000_nvm_info *nvm = &hw->nvm; |
| 69 | struct e1000_mac_info *mac = &hw->mac; |
Alexander Duyck | c1889bf | 2009-02-06 23:16:45 +0000 | [diff] [blame] | 70 | struct e1000_dev_spec_82575 * dev_spec = &hw->dev_spec._82575; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 71 | u32 eecd; |
| 72 | s32 ret_val; |
| 73 | u16 size; |
| 74 | u32 ctrl_ext = 0; |
| 75 | |
| 76 | switch (hw->device_id) { |
| 77 | case E1000_DEV_ID_82575EB_COPPER: |
| 78 | case E1000_DEV_ID_82575EB_FIBER_SERDES: |
| 79 | case E1000_DEV_ID_82575GB_QUAD_COPPER: |
| 80 | mac->type = e1000_82575; |
| 81 | break; |
Alexander Duyck | 2d064c0 | 2008-07-08 15:10:12 -0700 | [diff] [blame] | 82 | case E1000_DEV_ID_82576: |
Alexander Duyck | 9eb2341 | 2009-03-13 20:42:15 +0000 | [diff] [blame] | 83 | case E1000_DEV_ID_82576_NS: |
Alexander Duyck | 747d49b | 2009-10-05 06:33:27 +0000 | [diff] [blame] | 84 | case E1000_DEV_ID_82576_NS_SERDES: |
Alexander Duyck | 2d064c0 | 2008-07-08 15:10:12 -0700 | [diff] [blame] | 85 | case E1000_DEV_ID_82576_FIBER: |
| 86 | case E1000_DEV_ID_82576_SERDES: |
Alexander Duyck | c8ea5ea | 2009-03-13 20:42:35 +0000 | [diff] [blame] | 87 | case E1000_DEV_ID_82576_QUAD_COPPER: |
Alexander Duyck | 4703bf7 | 2009-07-23 18:09:48 +0000 | [diff] [blame] | 88 | case E1000_DEV_ID_82576_SERDES_QUAD: |
Alexander Duyck | 2d064c0 | 2008-07-08 15:10:12 -0700 | [diff] [blame] | 89 | mac->type = e1000_82576; |
| 90 | break; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 91 | default: |
| 92 | return -E1000_ERR_MAC_INIT; |
| 93 | break; |
| 94 | } |
| 95 | |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 96 | /* Set media type */ |
| 97 | /* |
| 98 | * The 82575 uses bits 22:23 for link mode. The mode can be changed |
| 99 | * based on the EEPROM. We cannot rely upon device ID. There |
| 100 | * is no distinguishable difference between fiber and internal |
| 101 | * SerDes mode on the 82575. There can be an external PHY attached |
| 102 | * on the SGMII interface. For this, we'll set sgmii_active to true. |
| 103 | */ |
| 104 | phy->media_type = e1000_media_type_copper; |
| 105 | dev_spec->sgmii_active = false; |
| 106 | |
| 107 | ctrl_ext = rd32(E1000_CTRL_EXT); |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 108 | switch (ctrl_ext & E1000_CTRL_EXT_LINK_MODE_MASK) { |
| 109 | case E1000_CTRL_EXT_LINK_MODE_SGMII: |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 110 | dev_spec->sgmii_active = true; |
| 111 | ctrl_ext |= E1000_CTRL_I2C_ENA; |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 112 | break; |
| 113 | case E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES: |
| 114 | hw->phy.media_type = e1000_media_type_internal_serdes; |
| 115 | ctrl_ext |= E1000_CTRL_I2C_ENA; |
| 116 | break; |
| 117 | default: |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 118 | ctrl_ext &= ~E1000_CTRL_I2C_ENA; |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 119 | break; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 120 | } |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 121 | |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 122 | wr32(E1000_CTRL_EXT, ctrl_ext); |
| 123 | |
| 124 | /* Set mta register count */ |
| 125 | mac->mta_reg_count = 128; |
| 126 | /* Set rar entry count */ |
| 127 | mac->rar_entry_count = E1000_RAR_ENTRIES_82575; |
Alexander Duyck | 2d064c0 | 2008-07-08 15:10:12 -0700 | [diff] [blame] | 128 | if (mac->type == e1000_82576) |
| 129 | mac->rar_entry_count = E1000_RAR_ENTRIES_82576; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 130 | /* Set if part includes ASF firmware */ |
| 131 | mac->asf_firmware_present = true; |
| 132 | /* Set if manageability features are enabled. */ |
| 133 | mac->arc_subsystem_valid = |
| 134 | (rd32(E1000_FWSM) & E1000_FWSM_MODE_MASK) |
| 135 | ? true : false; |
| 136 | |
| 137 | /* physical interface link setup */ |
| 138 | mac->ops.setup_physical_interface = |
| 139 | (hw->phy.media_type == e1000_media_type_copper) |
| 140 | ? igb_setup_copper_link_82575 |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 141 | : igb_setup_serdes_link_82575; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 142 | |
| 143 | /* NVM initialization */ |
| 144 | eecd = rd32(E1000_EECD); |
| 145 | |
| 146 | nvm->opcode_bits = 8; |
| 147 | nvm->delay_usec = 1; |
| 148 | switch (nvm->override) { |
| 149 | case e1000_nvm_override_spi_large: |
| 150 | nvm->page_size = 32; |
| 151 | nvm->address_bits = 16; |
| 152 | break; |
| 153 | case e1000_nvm_override_spi_small: |
| 154 | nvm->page_size = 8; |
| 155 | nvm->address_bits = 8; |
| 156 | break; |
| 157 | default: |
| 158 | nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8; |
| 159 | nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? 16 : 8; |
| 160 | break; |
| 161 | } |
| 162 | |
| 163 | nvm->type = e1000_nvm_eeprom_spi; |
| 164 | |
| 165 | size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> |
| 166 | E1000_EECD_SIZE_EX_SHIFT); |
| 167 | |
| 168 | /* |
| 169 | * Added to a constant, "size" becomes the left-shift value |
| 170 | * for setting word_size. |
| 171 | */ |
| 172 | size += NVM_WORD_SIZE_BASE_SHIFT; |
Jeff Kirsher | 5c3cad7 | 2008-06-27 10:59:33 -0700 | [diff] [blame] | 173 | |
| 174 | /* EEPROM access above 16k is unsupported */ |
| 175 | if (size > 14) |
| 176 | size = 14; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 177 | nvm->word_size = 1 << size; |
| 178 | |
Alexander Duyck | a0c9860 | 2009-07-23 18:10:43 +0000 | [diff] [blame] | 179 | /* if 82576 then initialize mailbox parameters */ |
| 180 | if (mac->type == e1000_82576) |
| 181 | igb_init_mbx_params_pf(hw); |
| 182 | |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 183 | /* setup PHY parameters */ |
| 184 | if (phy->media_type != e1000_media_type_copper) { |
| 185 | phy->type = e1000_phy_none; |
| 186 | return 0; |
| 187 | } |
| 188 | |
| 189 | phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; |
| 190 | phy->reset_delay_us = 100; |
| 191 | |
| 192 | /* PHY function pointers */ |
| 193 | if (igb_sgmii_active_82575(hw)) { |
Alexander Duyck | a8d2a0c | 2009-02-06 23:17:26 +0000 | [diff] [blame] | 194 | phy->ops.reset = igb_phy_hw_reset_sgmii_82575; |
| 195 | phy->ops.read_reg = igb_read_phy_reg_sgmii_82575; |
| 196 | phy->ops.write_reg = igb_write_phy_reg_sgmii_82575; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 197 | } else { |
Alexander Duyck | a8d2a0c | 2009-02-06 23:17:26 +0000 | [diff] [blame] | 198 | phy->ops.reset = igb_phy_hw_reset; |
| 199 | phy->ops.read_reg = igb_read_phy_reg_igp; |
| 200 | phy->ops.write_reg = igb_write_phy_reg_igp; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 201 | } |
| 202 | |
Alexander Duyck | 19e588e | 2009-07-07 13:01:55 +0000 | [diff] [blame] | 203 | /* set lan id */ |
| 204 | hw->bus.func = (rd32(E1000_STATUS) & E1000_STATUS_FUNC_MASK) >> |
| 205 | E1000_STATUS_FUNC_SHIFT; |
| 206 | |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 207 | /* Set phy->phy_addr and phy->id. */ |
| 208 | ret_val = igb_get_phy_id_82575(hw); |
| 209 | if (ret_val) |
| 210 | return ret_val; |
| 211 | |
| 212 | /* Verify phy id and set remaining function pointers */ |
| 213 | switch (phy->id) { |
| 214 | case M88E1111_I_PHY_ID: |
| 215 | phy->type = e1000_phy_m88; |
| 216 | phy->ops.get_phy_info = igb_get_phy_info_m88; |
| 217 | phy->ops.get_cable_length = igb_get_cable_length_m88; |
| 218 | phy->ops.force_speed_duplex = igb_phy_force_speed_duplex_m88; |
| 219 | break; |
| 220 | case IGP03E1000_E_PHY_ID: |
| 221 | phy->type = e1000_phy_igp_3; |
| 222 | phy->ops.get_phy_info = igb_get_phy_info_igp; |
| 223 | phy->ops.get_cable_length = igb_get_cable_length_igp_2; |
| 224 | phy->ops.force_speed_duplex = igb_phy_force_speed_duplex_igp; |
| 225 | phy->ops.set_d0_lplu_state = igb_set_d0_lplu_state_82575; |
| 226 | phy->ops.set_d3_lplu_state = igb_set_d3_lplu_state; |
| 227 | break; |
| 228 | default: |
| 229 | return -E1000_ERR_PHY; |
| 230 | } |
| 231 | |
| 232 | return 0; |
| 233 | } |
| 234 | |
| 235 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 236 | * igb_acquire_phy_82575 - Acquire rights to access PHY |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 237 | * @hw: pointer to the HW structure |
| 238 | * |
| 239 | * Acquire access rights to the correct PHY. This is a |
| 240 | * function pointer entry point called by the api module. |
| 241 | **/ |
| 242 | static s32 igb_acquire_phy_82575(struct e1000_hw *hw) |
| 243 | { |
Alexander Duyck | 008c342 | 2009-10-05 06:32:07 +0000 | [diff] [blame] | 244 | u16 mask = E1000_SWFW_PHY0_SM; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 245 | |
Alexander Duyck | 008c342 | 2009-10-05 06:32:07 +0000 | [diff] [blame] | 246 | if (hw->bus.func == E1000_FUNC_1) |
| 247 | mask = E1000_SWFW_PHY1_SM; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 248 | |
| 249 | return igb_acquire_swfw_sync_82575(hw, mask); |
| 250 | } |
| 251 | |
| 252 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 253 | * igb_release_phy_82575 - Release rights to access PHY |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 254 | * @hw: pointer to the HW structure |
| 255 | * |
| 256 | * A wrapper to release access rights to the correct PHY. This is a |
| 257 | * function pointer entry point called by the api module. |
| 258 | **/ |
| 259 | static void igb_release_phy_82575(struct e1000_hw *hw) |
| 260 | { |
Alexander Duyck | 008c342 | 2009-10-05 06:32:07 +0000 | [diff] [blame] | 261 | u16 mask = E1000_SWFW_PHY0_SM; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 262 | |
Alexander Duyck | 008c342 | 2009-10-05 06:32:07 +0000 | [diff] [blame] | 263 | if (hw->bus.func == E1000_FUNC_1) |
| 264 | mask = E1000_SWFW_PHY1_SM; |
| 265 | |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 266 | igb_release_swfw_sync_82575(hw, mask); |
| 267 | } |
| 268 | |
| 269 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 270 | * igb_read_phy_reg_sgmii_82575 - Read PHY register using sgmii |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 271 | * @hw: pointer to the HW structure |
| 272 | * @offset: register offset to be read |
| 273 | * @data: pointer to the read data |
| 274 | * |
| 275 | * Reads the PHY register at offset using the serial gigabit media independent |
| 276 | * interface and stores the retrieved information in data. |
| 277 | **/ |
| 278 | static s32 igb_read_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset, |
| 279 | u16 *data) |
| 280 | { |
Alexander Duyck | bf6f7a9 | 2009-10-05 06:32:27 +0000 | [diff] [blame] | 281 | s32 ret_val = -E1000_ERR_PARAM; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 282 | |
| 283 | if (offset > E1000_MAX_SGMII_PHY_REG_ADDR) { |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 284 | hw_dbg("PHY Address %u is out of range\n", offset); |
Alexander Duyck | bf6f7a9 | 2009-10-05 06:32:27 +0000 | [diff] [blame] | 285 | goto out; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 286 | } |
| 287 | |
Alexander Duyck | bf6f7a9 | 2009-10-05 06:32:27 +0000 | [diff] [blame] | 288 | ret_val = hw->phy.ops.acquire(hw); |
| 289 | if (ret_val) |
| 290 | goto out; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 291 | |
Alexander Duyck | bf6f7a9 | 2009-10-05 06:32:27 +0000 | [diff] [blame] | 292 | ret_val = igb_read_phy_reg_i2c(hw, offset, data); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 293 | |
Alexander Duyck | bf6f7a9 | 2009-10-05 06:32:27 +0000 | [diff] [blame] | 294 | hw->phy.ops.release(hw); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 295 | |
Alexander Duyck | bf6f7a9 | 2009-10-05 06:32:27 +0000 | [diff] [blame] | 296 | out: |
| 297 | return ret_val; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 298 | } |
| 299 | |
| 300 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 301 | * igb_write_phy_reg_sgmii_82575 - Write PHY register using sgmii |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 302 | * @hw: pointer to the HW structure |
| 303 | * @offset: register offset to write to |
| 304 | * @data: data to write at register offset |
| 305 | * |
| 306 | * Writes the data to PHY register at the offset using the serial gigabit |
| 307 | * media independent interface. |
| 308 | **/ |
| 309 | static s32 igb_write_phy_reg_sgmii_82575(struct e1000_hw *hw, u32 offset, |
| 310 | u16 data) |
| 311 | { |
Alexander Duyck | bf6f7a9 | 2009-10-05 06:32:27 +0000 | [diff] [blame] | 312 | s32 ret_val = -E1000_ERR_PARAM; |
| 313 | |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 314 | |
| 315 | if (offset > E1000_MAX_SGMII_PHY_REG_ADDR) { |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 316 | hw_dbg("PHY Address %d is out of range\n", offset); |
Alexander Duyck | bf6f7a9 | 2009-10-05 06:32:27 +0000 | [diff] [blame] | 317 | goto out; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 318 | } |
| 319 | |
Alexander Duyck | bf6f7a9 | 2009-10-05 06:32:27 +0000 | [diff] [blame] | 320 | ret_val = hw->phy.ops.acquire(hw); |
| 321 | if (ret_val) |
| 322 | goto out; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 323 | |
Alexander Duyck | bf6f7a9 | 2009-10-05 06:32:27 +0000 | [diff] [blame] | 324 | ret_val = igb_write_phy_reg_i2c(hw, offset, data); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 325 | |
Alexander Duyck | bf6f7a9 | 2009-10-05 06:32:27 +0000 | [diff] [blame] | 326 | hw->phy.ops.release(hw); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 327 | |
Alexander Duyck | bf6f7a9 | 2009-10-05 06:32:27 +0000 | [diff] [blame] | 328 | out: |
| 329 | return ret_val; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 330 | } |
| 331 | |
| 332 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 333 | * igb_get_phy_id_82575 - Retrieve PHY addr and id |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 334 | * @hw: pointer to the HW structure |
| 335 | * |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 336 | * Retrieves the PHY address and ID for both PHY's which do and do not use |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 337 | * sgmi interface. |
| 338 | **/ |
| 339 | static s32 igb_get_phy_id_82575(struct e1000_hw *hw) |
| 340 | { |
| 341 | struct e1000_phy_info *phy = &hw->phy; |
| 342 | s32 ret_val = 0; |
| 343 | u16 phy_id; |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 344 | u32 ctrl_ext; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 345 | |
| 346 | /* |
| 347 | * For SGMII PHYs, we try the list of possible addresses until |
| 348 | * we find one that works. For non-SGMII PHYs |
| 349 | * (e.g. integrated copper PHYs), an address of 1 should |
| 350 | * work. The result of this function should mean phy->phy_addr |
| 351 | * and phy->id are set correctly. |
| 352 | */ |
| 353 | if (!(igb_sgmii_active_82575(hw))) { |
| 354 | phy->addr = 1; |
| 355 | ret_val = igb_get_phy_id(hw); |
| 356 | goto out; |
| 357 | } |
| 358 | |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 359 | /* Power on sgmii phy if it is disabled */ |
| 360 | ctrl_ext = rd32(E1000_CTRL_EXT); |
| 361 | wr32(E1000_CTRL_EXT, ctrl_ext & ~E1000_CTRL_EXT_SDP3_DATA); |
| 362 | wrfl(); |
| 363 | msleep(300); |
| 364 | |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 365 | /* |
| 366 | * The address field in the I2CCMD register is 3 bits and 0 is invalid. |
| 367 | * Therefore, we need to test 1-7 |
| 368 | */ |
| 369 | for (phy->addr = 1; phy->addr < 8; phy->addr++) { |
| 370 | ret_val = igb_read_phy_reg_sgmii_82575(hw, PHY_ID1, &phy_id); |
| 371 | if (ret_val == 0) { |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 372 | hw_dbg("Vendor ID 0x%08X read at address %u\n", |
| 373 | phy_id, phy->addr); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 374 | /* |
| 375 | * At the time of this writing, The M88 part is |
| 376 | * the only supported SGMII PHY product. |
| 377 | */ |
| 378 | if (phy_id == M88_VENDOR) |
| 379 | break; |
| 380 | } else { |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 381 | hw_dbg("PHY address %u was unreadable\n", phy->addr); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 382 | } |
| 383 | } |
| 384 | |
| 385 | /* A valid PHY type couldn't be found. */ |
| 386 | if (phy->addr == 8) { |
| 387 | phy->addr = 0; |
| 388 | ret_val = -E1000_ERR_PHY; |
| 389 | goto out; |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 390 | } else { |
| 391 | ret_val = igb_get_phy_id(hw); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 392 | } |
| 393 | |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 394 | /* restore previous sfp cage power state */ |
| 395 | wr32(E1000_CTRL_EXT, ctrl_ext); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 396 | |
| 397 | out: |
| 398 | return ret_val; |
| 399 | } |
| 400 | |
| 401 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 402 | * igb_phy_hw_reset_sgmii_82575 - Performs a PHY reset |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 403 | * @hw: pointer to the HW structure |
| 404 | * |
| 405 | * Resets the PHY using the serial gigabit media independent interface. |
| 406 | **/ |
| 407 | static s32 igb_phy_hw_reset_sgmii_82575(struct e1000_hw *hw) |
| 408 | { |
| 409 | s32 ret_val; |
| 410 | |
| 411 | /* |
| 412 | * This isn't a true "hard" reset, but is the only reset |
| 413 | * available to us at this time. |
| 414 | */ |
| 415 | |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 416 | hw_dbg("Soft resetting SGMII attached PHY...\n"); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 417 | |
| 418 | /* |
| 419 | * SFP documentation requires the following to configure the SPF module |
| 420 | * to work on SGMII. No further documentation is given. |
| 421 | */ |
Alexander Duyck | a8d2a0c | 2009-02-06 23:17:26 +0000 | [diff] [blame] | 422 | ret_val = hw->phy.ops.write_reg(hw, 0x1B, 0x8084); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 423 | if (ret_val) |
| 424 | goto out; |
| 425 | |
| 426 | ret_val = igb_phy_sw_reset(hw); |
| 427 | |
| 428 | out: |
| 429 | return ret_val; |
| 430 | } |
| 431 | |
| 432 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 433 | * igb_set_d0_lplu_state_82575 - Set Low Power Linkup D0 state |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 434 | * @hw: pointer to the HW structure |
| 435 | * @active: true to enable LPLU, false to disable |
| 436 | * |
| 437 | * Sets the LPLU D0 state according to the active flag. When |
| 438 | * activating LPLU this function also disables smart speed |
| 439 | * and vice versa. LPLU will not be activated unless the |
| 440 | * device autonegotiation advertisement meets standards of |
| 441 | * either 10 or 10/100 or 10/100/1000 at all duplexes. |
| 442 | * This is a function pointer entry point only called by |
| 443 | * PHY setup routines. |
| 444 | **/ |
| 445 | static s32 igb_set_d0_lplu_state_82575(struct e1000_hw *hw, bool active) |
| 446 | { |
| 447 | struct e1000_phy_info *phy = &hw->phy; |
| 448 | s32 ret_val; |
| 449 | u16 data; |
| 450 | |
Alexander Duyck | a8d2a0c | 2009-02-06 23:17:26 +0000 | [diff] [blame] | 451 | ret_val = phy->ops.read_reg(hw, IGP02E1000_PHY_POWER_MGMT, &data); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 452 | if (ret_val) |
| 453 | goto out; |
| 454 | |
| 455 | if (active) { |
| 456 | data |= IGP02E1000_PM_D0_LPLU; |
Alexander Duyck | a8d2a0c | 2009-02-06 23:17:26 +0000 | [diff] [blame] | 457 | ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 458 | data); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 459 | if (ret_val) |
| 460 | goto out; |
| 461 | |
| 462 | /* When LPLU is enabled, we should disable SmartSpeed */ |
Alexander Duyck | a8d2a0c | 2009-02-06 23:17:26 +0000 | [diff] [blame] | 463 | ret_val = phy->ops.read_reg(hw, IGP01E1000_PHY_PORT_CONFIG, |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 464 | &data); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 465 | data &= ~IGP01E1000_PSCFR_SMART_SPEED; |
Alexander Duyck | a8d2a0c | 2009-02-06 23:17:26 +0000 | [diff] [blame] | 466 | ret_val = phy->ops.write_reg(hw, IGP01E1000_PHY_PORT_CONFIG, |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 467 | data); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 468 | if (ret_val) |
| 469 | goto out; |
| 470 | } else { |
| 471 | data &= ~IGP02E1000_PM_D0_LPLU; |
Alexander Duyck | a8d2a0c | 2009-02-06 23:17:26 +0000 | [diff] [blame] | 472 | ret_val = phy->ops.write_reg(hw, IGP02E1000_PHY_POWER_MGMT, |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 473 | data); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 474 | /* |
| 475 | * LPLU and SmartSpeed are mutually exclusive. LPLU is used |
| 476 | * during Dx states where the power conservation is most |
| 477 | * important. During driver activity we should enable |
| 478 | * SmartSpeed, so performance is maintained. |
| 479 | */ |
| 480 | if (phy->smart_speed == e1000_smart_speed_on) { |
Alexander Duyck | a8d2a0c | 2009-02-06 23:17:26 +0000 | [diff] [blame] | 481 | ret_val = phy->ops.read_reg(hw, |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 482 | IGP01E1000_PHY_PORT_CONFIG, &data); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 483 | if (ret_val) |
| 484 | goto out; |
| 485 | |
| 486 | data |= IGP01E1000_PSCFR_SMART_SPEED; |
Alexander Duyck | a8d2a0c | 2009-02-06 23:17:26 +0000 | [diff] [blame] | 487 | ret_val = phy->ops.write_reg(hw, |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 488 | IGP01E1000_PHY_PORT_CONFIG, data); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 489 | if (ret_val) |
| 490 | goto out; |
| 491 | } else if (phy->smart_speed == e1000_smart_speed_off) { |
Alexander Duyck | a8d2a0c | 2009-02-06 23:17:26 +0000 | [diff] [blame] | 492 | ret_val = phy->ops.read_reg(hw, |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 493 | IGP01E1000_PHY_PORT_CONFIG, &data); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 494 | if (ret_val) |
| 495 | goto out; |
| 496 | |
| 497 | data &= ~IGP01E1000_PSCFR_SMART_SPEED; |
Alexander Duyck | a8d2a0c | 2009-02-06 23:17:26 +0000 | [diff] [blame] | 498 | ret_val = phy->ops.write_reg(hw, |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 499 | IGP01E1000_PHY_PORT_CONFIG, data); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 500 | if (ret_val) |
| 501 | goto out; |
| 502 | } |
| 503 | } |
| 504 | |
| 505 | out: |
| 506 | return ret_val; |
| 507 | } |
| 508 | |
| 509 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 510 | * igb_acquire_nvm_82575 - Request for access to EEPROM |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 511 | * @hw: pointer to the HW structure |
| 512 | * |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 513 | * Acquire the necessary semaphores for exclusive access to the EEPROM. |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 514 | * Set the EEPROM access request bit and wait for EEPROM access grant bit. |
| 515 | * Return successful if access grant bit set, else clear the request for |
| 516 | * EEPROM access and return -E1000_ERR_NVM (-1). |
| 517 | **/ |
| 518 | static s32 igb_acquire_nvm_82575(struct e1000_hw *hw) |
| 519 | { |
| 520 | s32 ret_val; |
| 521 | |
| 522 | ret_val = igb_acquire_swfw_sync_82575(hw, E1000_SWFW_EEP_SM); |
| 523 | if (ret_val) |
| 524 | goto out; |
| 525 | |
| 526 | ret_val = igb_acquire_nvm(hw); |
| 527 | |
| 528 | if (ret_val) |
| 529 | igb_release_swfw_sync_82575(hw, E1000_SWFW_EEP_SM); |
| 530 | |
| 531 | out: |
| 532 | return ret_val; |
| 533 | } |
| 534 | |
| 535 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 536 | * igb_release_nvm_82575 - Release exclusive access to EEPROM |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 537 | * @hw: pointer to the HW structure |
| 538 | * |
| 539 | * Stop any current commands to the EEPROM and clear the EEPROM request bit, |
| 540 | * then release the semaphores acquired. |
| 541 | **/ |
| 542 | static void igb_release_nvm_82575(struct e1000_hw *hw) |
| 543 | { |
| 544 | igb_release_nvm(hw); |
| 545 | igb_release_swfw_sync_82575(hw, E1000_SWFW_EEP_SM); |
| 546 | } |
| 547 | |
| 548 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 549 | * igb_acquire_swfw_sync_82575 - Acquire SW/FW semaphore |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 550 | * @hw: pointer to the HW structure |
| 551 | * @mask: specifies which semaphore to acquire |
| 552 | * |
| 553 | * Acquire the SW/FW semaphore to access the PHY or NVM. The mask |
| 554 | * will also specify which port we're acquiring the lock for. |
| 555 | **/ |
| 556 | static s32 igb_acquire_swfw_sync_82575(struct e1000_hw *hw, u16 mask) |
| 557 | { |
| 558 | u32 swfw_sync; |
| 559 | u32 swmask = mask; |
| 560 | u32 fwmask = mask << 16; |
| 561 | s32 ret_val = 0; |
| 562 | s32 i = 0, timeout = 200; /* FIXME: find real value to use here */ |
| 563 | |
| 564 | while (i < timeout) { |
| 565 | if (igb_get_hw_semaphore(hw)) { |
| 566 | ret_val = -E1000_ERR_SWFW_SYNC; |
| 567 | goto out; |
| 568 | } |
| 569 | |
| 570 | swfw_sync = rd32(E1000_SW_FW_SYNC); |
| 571 | if (!(swfw_sync & (fwmask | swmask))) |
| 572 | break; |
| 573 | |
| 574 | /* |
| 575 | * Firmware currently using resource (fwmask) |
| 576 | * or other software thread using resource (swmask) |
| 577 | */ |
| 578 | igb_put_hw_semaphore(hw); |
| 579 | mdelay(5); |
| 580 | i++; |
| 581 | } |
| 582 | |
| 583 | if (i == timeout) { |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 584 | hw_dbg("Driver can't access resource, SW_FW_SYNC timeout.\n"); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 585 | ret_val = -E1000_ERR_SWFW_SYNC; |
| 586 | goto out; |
| 587 | } |
| 588 | |
| 589 | swfw_sync |= swmask; |
| 590 | wr32(E1000_SW_FW_SYNC, swfw_sync); |
| 591 | |
| 592 | igb_put_hw_semaphore(hw); |
| 593 | |
| 594 | out: |
| 595 | return ret_val; |
| 596 | } |
| 597 | |
| 598 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 599 | * igb_release_swfw_sync_82575 - Release SW/FW semaphore |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 600 | * @hw: pointer to the HW structure |
| 601 | * @mask: specifies which semaphore to acquire |
| 602 | * |
| 603 | * Release the SW/FW semaphore used to access the PHY or NVM. The mask |
| 604 | * will also specify which port we're releasing the lock for. |
| 605 | **/ |
| 606 | static void igb_release_swfw_sync_82575(struct e1000_hw *hw, u16 mask) |
| 607 | { |
| 608 | u32 swfw_sync; |
| 609 | |
| 610 | while (igb_get_hw_semaphore(hw) != 0); |
| 611 | /* Empty */ |
| 612 | |
| 613 | swfw_sync = rd32(E1000_SW_FW_SYNC); |
| 614 | swfw_sync &= ~mask; |
| 615 | wr32(E1000_SW_FW_SYNC, swfw_sync); |
| 616 | |
| 617 | igb_put_hw_semaphore(hw); |
| 618 | } |
| 619 | |
| 620 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 621 | * igb_get_cfg_done_82575 - Read config done bit |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 622 | * @hw: pointer to the HW structure |
| 623 | * |
| 624 | * Read the management control register for the config done bit for |
| 625 | * completion status. NOTE: silicon which is EEPROM-less will fail trying |
| 626 | * to read the config done bit, so an error is *ONLY* logged and returns |
| 627 | * 0. If we were to return with error, EEPROM-less silicon |
| 628 | * would not be able to be reset or change link. |
| 629 | **/ |
| 630 | static s32 igb_get_cfg_done_82575(struct e1000_hw *hw) |
| 631 | { |
| 632 | s32 timeout = PHY_CFG_TIMEOUT; |
| 633 | s32 ret_val = 0; |
| 634 | u32 mask = E1000_NVM_CFG_DONE_PORT_0; |
| 635 | |
| 636 | if (hw->bus.func == 1) |
| 637 | mask = E1000_NVM_CFG_DONE_PORT_1; |
| 638 | |
| 639 | while (timeout) { |
| 640 | if (rd32(E1000_EEMNGCTL) & mask) |
| 641 | break; |
| 642 | msleep(1); |
| 643 | timeout--; |
| 644 | } |
| 645 | if (!timeout) |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 646 | hw_dbg("MNG configuration cycle has not completed.\n"); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 647 | |
| 648 | /* If EEPROM is not marked present, init the PHY manually */ |
| 649 | if (((rd32(E1000_EECD) & E1000_EECD_PRES) == 0) && |
| 650 | (hw->phy.type == e1000_phy_igp_3)) |
| 651 | igb_phy_init_script_igp3(hw); |
| 652 | |
| 653 | return ret_val; |
| 654 | } |
| 655 | |
| 656 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 657 | * igb_check_for_link_82575 - Check for link |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 658 | * @hw: pointer to the HW structure |
| 659 | * |
| 660 | * If sgmii is enabled, then use the pcs register to determine link, otherwise |
| 661 | * use the generic interface for determining link. |
| 662 | **/ |
| 663 | static s32 igb_check_for_link_82575(struct e1000_hw *hw) |
| 664 | { |
| 665 | s32 ret_val; |
| 666 | u16 speed, duplex; |
| 667 | |
Alexander Duyck | 70d92f8 | 2009-10-05 06:31:47 +0000 | [diff] [blame] | 668 | if (hw->phy.media_type != e1000_media_type_copper) { |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 669 | ret_val = igb_get_pcs_speed_and_duplex_82575(hw, &speed, |
Alexander Duyck | 2d064c0 | 2008-07-08 15:10:12 -0700 | [diff] [blame] | 670 | &duplex); |
Alexander Duyck | 5d0932a | 2009-01-31 00:53:18 -0800 | [diff] [blame] | 671 | /* |
| 672 | * Use this flag to determine if link needs to be checked or |
| 673 | * not. If we have link clear the flag so that we do not |
| 674 | * continue to check for link. |
| 675 | */ |
| 676 | hw->mac.get_link_status = !hw->mac.serdes_has_link; |
| 677 | } else { |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 678 | ret_val = igb_check_for_copper_link(hw); |
Alexander Duyck | 5d0932a | 2009-01-31 00:53:18 -0800 | [diff] [blame] | 679 | } |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 680 | |
| 681 | return ret_val; |
| 682 | } |
Alexander Duyck | 70d92f8 | 2009-10-05 06:31:47 +0000 | [diff] [blame] | 683 | |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 684 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 685 | * igb_get_pcs_speed_and_duplex_82575 - Retrieve current speed/duplex |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 686 | * @hw: pointer to the HW structure |
| 687 | * @speed: stores the current speed |
| 688 | * @duplex: stores the current duplex |
| 689 | * |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 690 | * Using the physical coding sub-layer (PCS), retrieve the current speed and |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 691 | * duplex, then store the values in the pointers provided. |
| 692 | **/ |
| 693 | static s32 igb_get_pcs_speed_and_duplex_82575(struct e1000_hw *hw, u16 *speed, |
| 694 | u16 *duplex) |
| 695 | { |
| 696 | struct e1000_mac_info *mac = &hw->mac; |
| 697 | u32 pcs; |
| 698 | |
| 699 | /* Set up defaults for the return values of this function */ |
| 700 | mac->serdes_has_link = false; |
| 701 | *speed = 0; |
| 702 | *duplex = 0; |
| 703 | |
| 704 | /* |
| 705 | * Read the PCS Status register for link state. For non-copper mode, |
| 706 | * the status register is not accurate. The PCS status register is |
| 707 | * used instead. |
| 708 | */ |
| 709 | pcs = rd32(E1000_PCS_LSTAT); |
| 710 | |
| 711 | /* |
| 712 | * The link up bit determines when link is up on autoneg. The sync ok |
| 713 | * gets set once both sides sync up and agree upon link. Stable link |
| 714 | * can be determined by checking for both link up and link sync ok |
| 715 | */ |
| 716 | if ((pcs & E1000_PCS_LSTS_LINK_OK) && (pcs & E1000_PCS_LSTS_SYNK_OK)) { |
| 717 | mac->serdes_has_link = true; |
| 718 | |
| 719 | /* Detect and store PCS speed */ |
| 720 | if (pcs & E1000_PCS_LSTS_SPEED_1000) { |
| 721 | *speed = SPEED_1000; |
| 722 | } else if (pcs & E1000_PCS_LSTS_SPEED_100) { |
| 723 | *speed = SPEED_100; |
| 724 | } else { |
| 725 | *speed = SPEED_10; |
| 726 | } |
| 727 | |
| 728 | /* Detect and store PCS duplex */ |
| 729 | if (pcs & E1000_PCS_LSTS_DUPLEX_FULL) { |
| 730 | *duplex = FULL_DUPLEX; |
| 731 | } else { |
| 732 | *duplex = HALF_DUPLEX; |
| 733 | } |
| 734 | } |
| 735 | |
| 736 | return 0; |
| 737 | } |
| 738 | |
| 739 | /** |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 740 | * igb_shutdown_serdes_link_82575 - Remove link during power down |
Alexander Duyck | 2d064c0 | 2008-07-08 15:10:12 -0700 | [diff] [blame] | 741 | * @hw: pointer to the HW structure |
| 742 | * |
| 743 | * In the case of fiber serdes, shut down optics and PCS on driver unload |
| 744 | * when management pass thru is not enabled. |
| 745 | **/ |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 746 | void igb_shutdown_serdes_link_82575(struct e1000_hw *hw) |
Alexander Duyck | 2d064c0 | 2008-07-08 15:10:12 -0700 | [diff] [blame] | 747 | { |
| 748 | u32 reg; |
Alexander Duyck | 70d92f8 | 2009-10-05 06:31:47 +0000 | [diff] [blame] | 749 | u16 eeprom_data = 0; |
Alexander Duyck | 2d064c0 | 2008-07-08 15:10:12 -0700 | [diff] [blame] | 750 | |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 751 | if (hw->phy.media_type != e1000_media_type_internal_serdes || |
| 752 | igb_sgmii_active_82575(hw)) |
Alexander Duyck | 2d064c0 | 2008-07-08 15:10:12 -0700 | [diff] [blame] | 753 | return; |
| 754 | |
Alexander Duyck | 70d92f8 | 2009-10-05 06:31:47 +0000 | [diff] [blame] | 755 | if (hw->bus.func == E1000_FUNC_0) |
| 756 | hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_A, 1, &eeprom_data); |
| 757 | else if (hw->bus.func == E1000_FUNC_1) |
| 758 | hw->nvm.ops.read(hw, NVM_INIT_CONTROL3_PORT_B, 1, &eeprom_data); |
| 759 | |
| 760 | /* |
| 761 | * If APM is not enabled in the EEPROM and management interface is |
| 762 | * not enabled, then power down. |
| 763 | */ |
| 764 | if (!(eeprom_data & E1000_NVM_APME_82575) && |
| 765 | !igb_enable_mng_pass_thru(hw)) { |
Alexander Duyck | 2d064c0 | 2008-07-08 15:10:12 -0700 | [diff] [blame] | 766 | /* Disable PCS to turn off link */ |
| 767 | reg = rd32(E1000_PCS_CFG0); |
| 768 | reg &= ~E1000_PCS_CFG_PCS_EN; |
| 769 | wr32(E1000_PCS_CFG0, reg); |
| 770 | |
| 771 | /* shutdown the laser */ |
| 772 | reg = rd32(E1000_CTRL_EXT); |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 773 | reg |= E1000_CTRL_EXT_SDP3_DATA; |
Alexander Duyck | 2d064c0 | 2008-07-08 15:10:12 -0700 | [diff] [blame] | 774 | wr32(E1000_CTRL_EXT, reg); |
| 775 | |
| 776 | /* flush the write to verify completion */ |
| 777 | wrfl(); |
| 778 | msleep(1); |
| 779 | } |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 780 | |
| 781 | return; |
| 782 | } |
| 783 | |
| 784 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 785 | * igb_reset_hw_82575 - Reset hardware |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 786 | * @hw: pointer to the HW structure |
| 787 | * |
| 788 | * This resets the hardware into a known state. This is a |
| 789 | * function pointer entry point called by the api module. |
| 790 | **/ |
| 791 | static s32 igb_reset_hw_82575(struct e1000_hw *hw) |
| 792 | { |
| 793 | u32 ctrl, icr; |
| 794 | s32 ret_val; |
| 795 | |
| 796 | /* |
| 797 | * Prevent the PCI-E bus from sticking if there is no TLP connection |
| 798 | * on the last TLP read/write transaction when MAC is reset. |
| 799 | */ |
| 800 | ret_val = igb_disable_pcie_master(hw); |
| 801 | if (ret_val) |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 802 | hw_dbg("PCI-E Master disable polling has failed.\n"); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 803 | |
Alexander Duyck | 009bc06 | 2009-07-23 18:08:35 +0000 | [diff] [blame] | 804 | /* set the completion timeout for interface */ |
| 805 | ret_val = igb_set_pcie_completion_timeout(hw); |
| 806 | if (ret_val) { |
| 807 | hw_dbg("PCI-E Set completion timeout has failed.\n"); |
| 808 | } |
| 809 | |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 810 | hw_dbg("Masking off all interrupts\n"); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 811 | wr32(E1000_IMC, 0xffffffff); |
| 812 | |
| 813 | wr32(E1000_RCTL, 0); |
| 814 | wr32(E1000_TCTL, E1000_TCTL_PSP); |
| 815 | wrfl(); |
| 816 | |
| 817 | msleep(10); |
| 818 | |
| 819 | ctrl = rd32(E1000_CTRL); |
| 820 | |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 821 | hw_dbg("Issuing a global reset to MAC\n"); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 822 | wr32(E1000_CTRL, ctrl | E1000_CTRL_RST); |
| 823 | |
| 824 | ret_val = igb_get_auto_rd_done(hw); |
| 825 | if (ret_val) { |
| 826 | /* |
| 827 | * When auto config read does not complete, do not |
| 828 | * return with an error. This can happen in situations |
| 829 | * where there is no eeprom and prevents getting link. |
| 830 | */ |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 831 | hw_dbg("Auto Read Done did not complete\n"); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 832 | } |
| 833 | |
| 834 | /* If EEPROM is not present, run manual init scripts */ |
| 835 | if ((rd32(E1000_EECD) & E1000_EECD_PRES) == 0) |
| 836 | igb_reset_init_script_82575(hw); |
| 837 | |
| 838 | /* Clear any pending interrupt events. */ |
| 839 | wr32(E1000_IMC, 0xffffffff); |
| 840 | icr = rd32(E1000_ICR); |
| 841 | |
Alexander Duyck | 5ac1665 | 2009-07-23 18:09:12 +0000 | [diff] [blame] | 842 | /* Install any alternate MAC address into RAR0 */ |
| 843 | ret_val = igb_check_alt_mac_addr(hw); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 844 | |
| 845 | return ret_val; |
| 846 | } |
| 847 | |
| 848 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 849 | * igb_init_hw_82575 - Initialize hardware |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 850 | * @hw: pointer to the HW structure |
| 851 | * |
| 852 | * This inits the hardware readying it for operation. |
| 853 | **/ |
| 854 | static s32 igb_init_hw_82575(struct e1000_hw *hw) |
| 855 | { |
| 856 | struct e1000_mac_info *mac = &hw->mac; |
| 857 | s32 ret_val; |
| 858 | u16 i, rar_count = mac->rar_entry_count; |
| 859 | |
| 860 | /* Initialize identification LED */ |
| 861 | ret_val = igb_id_led_init(hw); |
| 862 | if (ret_val) { |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 863 | hw_dbg("Error initializing identification LED\n"); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 864 | /* This is not fatal and we should not stop init due to this */ |
| 865 | } |
| 866 | |
| 867 | /* Disabling VLAN filtering */ |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 868 | hw_dbg("Initializing the IEEE VLAN\n"); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 869 | igb_clear_vfta(hw); |
| 870 | |
| 871 | /* Setup the receive address */ |
Alexander Duyck | 5ac1665 | 2009-07-23 18:09:12 +0000 | [diff] [blame] | 872 | igb_init_rx_addrs(hw, rar_count); |
| 873 | |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 874 | /* Zero out the Multicast HASH table */ |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 875 | hw_dbg("Zeroing the MTA\n"); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 876 | for (i = 0; i < mac->mta_reg_count; i++) |
| 877 | array_wr32(E1000_MTA, i, 0); |
| 878 | |
Alexander Duyck | 68d480c | 2009-10-05 06:33:08 +0000 | [diff] [blame] | 879 | /* Zero out the Unicast HASH table */ |
| 880 | hw_dbg("Zeroing the UTA\n"); |
| 881 | for (i = 0; i < mac->uta_reg_count; i++) |
| 882 | array_wr32(E1000_UTA, i, 0); |
| 883 | |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 884 | /* Setup link and flow control */ |
| 885 | ret_val = igb_setup_link(hw); |
| 886 | |
| 887 | /* |
| 888 | * Clear all of the statistics registers (clear on read). It is |
| 889 | * important that we do this after we have tried to establish link |
| 890 | * because the symbol error count will increment wildly if there |
| 891 | * is no link. |
| 892 | */ |
| 893 | igb_clear_hw_cntrs_82575(hw); |
| 894 | |
| 895 | return ret_val; |
| 896 | } |
| 897 | |
| 898 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 899 | * igb_setup_copper_link_82575 - Configure copper link settings |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 900 | * @hw: pointer to the HW structure |
| 901 | * |
| 902 | * Configures the link for auto-neg or forced speed and duplex. Then we check |
| 903 | * for link, once link is established calls to configure collision distance |
| 904 | * and flow control are called. |
| 905 | **/ |
| 906 | static s32 igb_setup_copper_link_82575(struct e1000_hw *hw) |
| 907 | { |
Alexander Duyck | 12645a1 | 2009-07-23 18:08:16 +0000 | [diff] [blame] | 908 | u32 ctrl; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 909 | s32 ret_val; |
| 910 | bool link; |
| 911 | |
| 912 | ctrl = rd32(E1000_CTRL); |
| 913 | ctrl |= E1000_CTRL_SLU; |
| 914 | ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); |
| 915 | wr32(E1000_CTRL, ctrl); |
| 916 | |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 917 | ret_val = igb_setup_serdes_link_82575(hw); |
| 918 | if (ret_val) |
| 919 | goto out; |
| 920 | |
| 921 | if (igb_sgmii_active_82575(hw) && !hw->phy.reset_disable) { |
| 922 | ret_val = hw->phy.ops.reset(hw); |
| 923 | if (ret_val) { |
| 924 | hw_dbg("Error resetting the PHY.\n"); |
| 925 | goto out; |
| 926 | } |
| 927 | } |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 928 | switch (hw->phy.type) { |
| 929 | case e1000_phy_m88: |
| 930 | ret_val = igb_copper_link_setup_m88(hw); |
| 931 | break; |
| 932 | case e1000_phy_igp_3: |
| 933 | ret_val = igb_copper_link_setup_igp(hw); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 934 | break; |
| 935 | default: |
| 936 | ret_val = -E1000_ERR_PHY; |
| 937 | break; |
| 938 | } |
| 939 | |
| 940 | if (ret_val) |
| 941 | goto out; |
| 942 | |
| 943 | if (hw->mac.autoneg) { |
| 944 | /* |
| 945 | * Setup autoneg and flow control advertisement |
| 946 | * and perform autonegotiation. |
| 947 | */ |
| 948 | ret_val = igb_copper_link_autoneg(hw); |
| 949 | if (ret_val) |
| 950 | goto out; |
| 951 | } else { |
| 952 | /* |
| 953 | * PHY will be set to 10H, 10F, 100H or 100F |
| 954 | * depending on user settings. |
| 955 | */ |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 956 | hw_dbg("Forcing Speed and Duplex\n"); |
Alexander Duyck | a8d2a0c | 2009-02-06 23:17:26 +0000 | [diff] [blame] | 957 | ret_val = hw->phy.ops.force_speed_duplex(hw); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 958 | if (ret_val) { |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 959 | hw_dbg("Error Forcing Speed and Duplex\n"); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 960 | goto out; |
| 961 | } |
| 962 | } |
| 963 | |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 964 | /* |
| 965 | * Check link status. Wait up to 100 microseconds for link to become |
| 966 | * valid. |
| 967 | */ |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 968 | ret_val = igb_phy_has_link(hw, COPPER_LINK_UP_LIMIT, 10, &link); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 969 | if (ret_val) |
| 970 | goto out; |
| 971 | |
| 972 | if (link) { |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 973 | hw_dbg("Valid link established!!!\n"); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 974 | /* Config the MAC and PHY after link is up */ |
| 975 | igb_config_collision_dist(hw); |
| 976 | ret_val = igb_config_fc_after_link_up(hw); |
| 977 | } else { |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 978 | hw_dbg("Unable to establish link!!!\n"); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 979 | } |
| 980 | |
| 981 | out: |
| 982 | return ret_val; |
| 983 | } |
| 984 | |
| 985 | /** |
Alexander Duyck | 70d92f8 | 2009-10-05 06:31:47 +0000 | [diff] [blame] | 986 | * igb_setup_serdes_link_82575 - Setup link for serdes |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 987 | * @hw: pointer to the HW structure |
| 988 | * |
Alexander Duyck | 70d92f8 | 2009-10-05 06:31:47 +0000 | [diff] [blame] | 989 | * Configure the physical coding sub-layer (PCS) link. The PCS link is |
| 990 | * used on copper connections where the serialized gigabit media independent |
| 991 | * interface (sgmii), or serdes fiber is being used. Configures the link |
| 992 | * for auto-negotiation or forces speed/duplex. |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 993 | **/ |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 994 | static s32 igb_setup_serdes_link_82575(struct e1000_hw *hw) |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 995 | { |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 996 | u32 ctrl_reg, reg; |
| 997 | |
| 998 | if ((hw->phy.media_type != e1000_media_type_internal_serdes) && |
| 999 | !igb_sgmii_active_82575(hw)) |
| 1000 | return 0; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1001 | |
| 1002 | /* |
| 1003 | * On the 82575, SerDes loopback mode persists until it is |
| 1004 | * explicitly turned off or a power cycle is performed. A read to |
| 1005 | * the register does not indicate its status. Therefore, we ensure |
| 1006 | * loopback mode is disabled during initialization. |
| 1007 | */ |
| 1008 | wr32(E1000_SCTL, E1000_SCTL_DISABLE_SERDES_LOOPBACK); |
| 1009 | |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 1010 | /* power on the sfp cage if present */ |
| 1011 | reg = rd32(E1000_CTRL_EXT); |
| 1012 | reg &= ~E1000_CTRL_EXT_SDP3_DATA; |
| 1013 | wr32(E1000_CTRL_EXT, reg); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1014 | |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 1015 | ctrl_reg = rd32(E1000_CTRL); |
| 1016 | ctrl_reg |= E1000_CTRL_SLU; |
| 1017 | |
| 1018 | if (hw->mac.type == e1000_82575 || hw->mac.type == e1000_82576) { |
| 1019 | /* set both sw defined pins */ |
| 1020 | ctrl_reg |= E1000_CTRL_SWDPIN0 | E1000_CTRL_SWDPIN1; |
| 1021 | |
| 1022 | /* Set switch control to serdes energy detect */ |
| 1023 | reg = rd32(E1000_CONNSW); |
| 1024 | reg |= E1000_CONNSW_ENRGSRC; |
| 1025 | wr32(E1000_CONNSW, reg); |
Alexander Duyck | 921aa74 | 2009-01-21 14:42:28 -0800 | [diff] [blame] | 1026 | } |
| 1027 | |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 1028 | reg = rd32(E1000_PCS_LCTL); |
| 1029 | |
| 1030 | if (igb_sgmii_active_82575(hw)) { |
| 1031 | /* allow time for SFP cage to power up phy */ |
| 1032 | msleep(300); |
| 1033 | |
| 1034 | /* AN time out should be disabled for SGMII mode */ |
| 1035 | reg &= ~(E1000_PCS_LCTL_AN_TIMEOUT); |
| 1036 | } else { |
| 1037 | ctrl_reg |= E1000_CTRL_SPD_1000 | E1000_CTRL_FRCSPD | |
| 1038 | E1000_CTRL_FD | E1000_CTRL_FRCDPX; |
| 1039 | } |
| 1040 | |
| 1041 | wr32(E1000_CTRL, ctrl_reg); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1042 | |
| 1043 | /* |
| 1044 | * New SerDes mode allows for forcing speed or autonegotiating speed |
| 1045 | * at 1gb. Autoneg should be default set by most drivers. This is the |
| 1046 | * mode that will be compatible with older link partners and switches. |
| 1047 | * However, both are supported by the hardware and some drivers/tools. |
| 1048 | */ |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1049 | |
| 1050 | reg &= ~(E1000_PCS_LCTL_AN_ENABLE | E1000_PCS_LCTL_FLV_LINK_UP | |
| 1051 | E1000_PCS_LCTL_FSD | E1000_PCS_LCTL_FORCE_LINK); |
| 1052 | |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 1053 | /* |
| 1054 | * We force flow control to prevent the CTRL register values from being |
| 1055 | * overwritten by the autonegotiated flow control values |
| 1056 | */ |
| 1057 | reg |= E1000_PCS_LCTL_FORCE_FCTRL; |
| 1058 | |
| 1059 | /* |
| 1060 | * we always set sgmii to autoneg since it is the phy that will be |
| 1061 | * forcing the link and the serdes is just a go-between |
| 1062 | */ |
| 1063 | if (hw->mac.autoneg || igb_sgmii_active_82575(hw)) { |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1064 | /* Set PCS register for autoneg */ |
Alexander Duyck | 70d92f8 | 2009-10-05 06:31:47 +0000 | [diff] [blame] | 1065 | reg |= E1000_PCS_LCTL_FSV_1000 | /* Force 1000 */ |
| 1066 | E1000_PCS_LCTL_FDV_FULL | /* SerDes Full dplx */ |
| 1067 | E1000_PCS_LCTL_AN_ENABLE | /* Enable Autoneg */ |
| 1068 | E1000_PCS_LCTL_AN_RESTART; /* Restart autoneg */ |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 1069 | hw_dbg("Configuring Autoneg; PCS_LCTL = 0x%08X\n", reg); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1070 | } else { |
Alexander Duyck | 70d92f8 | 2009-10-05 06:31:47 +0000 | [diff] [blame] | 1071 | /* Check for duplex first */ |
| 1072 | if (hw->mac.forced_speed_duplex & E1000_ALL_FULL_DUPLEX) |
| 1073 | reg |= E1000_PCS_LCTL_FDV_FULL; |
| 1074 | |
| 1075 | /* No need to check for 1000/full since the spec states that |
| 1076 | * it requires autoneg to be enabled */ |
| 1077 | /* Now set speed */ |
| 1078 | if (hw->mac.forced_speed_duplex & E1000_ALL_100_SPEED) |
| 1079 | reg |= E1000_PCS_LCTL_FSV_100; |
| 1080 | |
| 1081 | /* Force speed and force link */ |
| 1082 | reg |= E1000_PCS_LCTL_FSD | |
| 1083 | E1000_PCS_LCTL_FORCE_LINK | |
| 1084 | E1000_PCS_LCTL_FLV_LINK_UP; |
| 1085 | |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 1086 | hw_dbg("Configuring Forced Link; PCS_LCTL = 0x%08X\n", reg); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1087 | } |
Alexander Duyck | 726c09e | 2008-08-04 14:59:56 -0700 | [diff] [blame] | 1088 | |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1089 | wr32(E1000_PCS_LCTL, reg); |
| 1090 | |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 1091 | if (!igb_sgmii_active_82575(hw)) |
| 1092 | igb_force_mac_fc(hw); |
| 1093 | |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1094 | return 0; |
| 1095 | } |
| 1096 | |
| 1097 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 1098 | * igb_sgmii_active_82575 - Return sgmii state |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1099 | * @hw: pointer to the HW structure |
| 1100 | * |
| 1101 | * 82575 silicon has a serialized gigabit media independent interface (sgmii) |
| 1102 | * which can be enabled for use in the embedded applications. Simply |
| 1103 | * return the current state of the sgmii interface. |
| 1104 | **/ |
| 1105 | static bool igb_sgmii_active_82575(struct e1000_hw *hw) |
| 1106 | { |
Alexander Duyck | c1889bf | 2009-02-06 23:16:45 +0000 | [diff] [blame] | 1107 | struct e1000_dev_spec_82575 *dev_spec = &hw->dev_spec._82575; |
Alexander Duyck | c1889bf | 2009-02-06 23:16:45 +0000 | [diff] [blame] | 1108 | return dev_spec->sgmii_active; |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1109 | } |
| 1110 | |
| 1111 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 1112 | * igb_reset_init_script_82575 - Inits HW defaults after reset |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1113 | * @hw: pointer to the HW structure |
| 1114 | * |
| 1115 | * Inits recommended HW defaults after a reset when there is no EEPROM |
| 1116 | * detected. This is only for the 82575. |
| 1117 | **/ |
| 1118 | static s32 igb_reset_init_script_82575(struct e1000_hw *hw) |
| 1119 | { |
| 1120 | if (hw->mac.type == e1000_82575) { |
Auke Kok | 652fff3 | 2008-06-27 11:00:18 -0700 | [diff] [blame] | 1121 | hw_dbg("Running reset init script for 82575\n"); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1122 | /* SerDes configuration via SERDESCTRL */ |
| 1123 | igb_write_8bit_ctrl_reg(hw, E1000_SCTL, 0x00, 0x0C); |
| 1124 | igb_write_8bit_ctrl_reg(hw, E1000_SCTL, 0x01, 0x78); |
| 1125 | igb_write_8bit_ctrl_reg(hw, E1000_SCTL, 0x1B, 0x23); |
| 1126 | igb_write_8bit_ctrl_reg(hw, E1000_SCTL, 0x23, 0x15); |
| 1127 | |
| 1128 | /* CCM configuration via CCMCTL register */ |
| 1129 | igb_write_8bit_ctrl_reg(hw, E1000_CCMCTL, 0x14, 0x00); |
| 1130 | igb_write_8bit_ctrl_reg(hw, E1000_CCMCTL, 0x10, 0x00); |
| 1131 | |
| 1132 | /* PCIe lanes configuration */ |
| 1133 | igb_write_8bit_ctrl_reg(hw, E1000_GIOCTL, 0x00, 0xEC); |
| 1134 | igb_write_8bit_ctrl_reg(hw, E1000_GIOCTL, 0x61, 0xDF); |
| 1135 | igb_write_8bit_ctrl_reg(hw, E1000_GIOCTL, 0x34, 0x05); |
| 1136 | igb_write_8bit_ctrl_reg(hw, E1000_GIOCTL, 0x2F, 0x81); |
| 1137 | |
| 1138 | /* PCIe PLL Configuration */ |
| 1139 | igb_write_8bit_ctrl_reg(hw, E1000_SCCTL, 0x02, 0x47); |
| 1140 | igb_write_8bit_ctrl_reg(hw, E1000_SCCTL, 0x14, 0x00); |
| 1141 | igb_write_8bit_ctrl_reg(hw, E1000_SCCTL, 0x10, 0x00); |
| 1142 | } |
| 1143 | |
| 1144 | return 0; |
| 1145 | } |
| 1146 | |
| 1147 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 1148 | * igb_read_mac_addr_82575 - Read device MAC address |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1149 | * @hw: pointer to the HW structure |
| 1150 | **/ |
| 1151 | static s32 igb_read_mac_addr_82575(struct e1000_hw *hw) |
| 1152 | { |
| 1153 | s32 ret_val = 0; |
| 1154 | |
| 1155 | if (igb_check_alt_mac_addr(hw)) |
| 1156 | ret_val = igb_read_mac_addr(hw); |
| 1157 | |
| 1158 | return ret_val; |
| 1159 | } |
| 1160 | |
| 1161 | /** |
Jeff Kirsher | 733596b | 2008-06-27 10:59:59 -0700 | [diff] [blame] | 1162 | * igb_clear_hw_cntrs_82575 - Clear device specific hardware counters |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1163 | * @hw: pointer to the HW structure |
| 1164 | * |
| 1165 | * Clears the hardware counters by reading the counter registers. |
| 1166 | **/ |
| 1167 | static void igb_clear_hw_cntrs_82575(struct e1000_hw *hw) |
| 1168 | { |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1169 | igb_clear_hw_cntrs_base(hw); |
| 1170 | |
Alexander Duyck | cc9073b | 2009-10-05 06:31:25 +0000 | [diff] [blame] | 1171 | rd32(E1000_PRC64); |
| 1172 | rd32(E1000_PRC127); |
| 1173 | rd32(E1000_PRC255); |
| 1174 | rd32(E1000_PRC511); |
| 1175 | rd32(E1000_PRC1023); |
| 1176 | rd32(E1000_PRC1522); |
| 1177 | rd32(E1000_PTC64); |
| 1178 | rd32(E1000_PTC127); |
| 1179 | rd32(E1000_PTC255); |
| 1180 | rd32(E1000_PTC511); |
| 1181 | rd32(E1000_PTC1023); |
| 1182 | rd32(E1000_PTC1522); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1183 | |
Alexander Duyck | cc9073b | 2009-10-05 06:31:25 +0000 | [diff] [blame] | 1184 | rd32(E1000_ALGNERRC); |
| 1185 | rd32(E1000_RXERRC); |
| 1186 | rd32(E1000_TNCRS); |
| 1187 | rd32(E1000_CEXTERR); |
| 1188 | rd32(E1000_TSCTC); |
| 1189 | rd32(E1000_TSCTFC); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1190 | |
Alexander Duyck | cc9073b | 2009-10-05 06:31:25 +0000 | [diff] [blame] | 1191 | rd32(E1000_MGTPRC); |
| 1192 | rd32(E1000_MGTPDC); |
| 1193 | rd32(E1000_MGTPTC); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1194 | |
Alexander Duyck | cc9073b | 2009-10-05 06:31:25 +0000 | [diff] [blame] | 1195 | rd32(E1000_IAC); |
| 1196 | rd32(E1000_ICRXOC); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1197 | |
Alexander Duyck | cc9073b | 2009-10-05 06:31:25 +0000 | [diff] [blame] | 1198 | rd32(E1000_ICRXPTC); |
| 1199 | rd32(E1000_ICRXATC); |
| 1200 | rd32(E1000_ICTXPTC); |
| 1201 | rd32(E1000_ICTXATC); |
| 1202 | rd32(E1000_ICTXQEC); |
| 1203 | rd32(E1000_ICTXQMTC); |
| 1204 | rd32(E1000_ICRXDMTC); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1205 | |
Alexander Duyck | cc9073b | 2009-10-05 06:31:25 +0000 | [diff] [blame] | 1206 | rd32(E1000_CBTMPC); |
| 1207 | rd32(E1000_HTDPMC); |
| 1208 | rd32(E1000_CBRMPC); |
| 1209 | rd32(E1000_RPTHC); |
| 1210 | rd32(E1000_HGPTC); |
| 1211 | rd32(E1000_HTCBDPC); |
| 1212 | rd32(E1000_HGORCL); |
| 1213 | rd32(E1000_HGORCH); |
| 1214 | rd32(E1000_HGOTCL); |
| 1215 | rd32(E1000_HGOTCH); |
| 1216 | rd32(E1000_LENERRS); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1217 | |
| 1218 | /* This register should not be read in copper configurations */ |
Alexander Duyck | 2fb02a2 | 2009-09-14 08:22:54 +0000 | [diff] [blame] | 1219 | if (hw->phy.media_type == e1000_media_type_internal_serdes || |
| 1220 | igb_sgmii_active_82575(hw)) |
Alexander Duyck | cc9073b | 2009-10-05 06:31:25 +0000 | [diff] [blame] | 1221 | rd32(E1000_SCVPC); |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1222 | } |
| 1223 | |
Alexander Duyck | 662d720 | 2008-06-27 11:00:29 -0700 | [diff] [blame] | 1224 | /** |
| 1225 | * igb_rx_fifo_flush_82575 - Clean rx fifo after RX enable |
| 1226 | * @hw: pointer to the HW structure |
| 1227 | * |
| 1228 | * After rx enable if managability is enabled then there is likely some |
| 1229 | * bad data at the start of the fifo and possibly in the DMA fifo. This |
| 1230 | * function clears the fifos and flushes any packets that came in as rx was |
| 1231 | * being enabled. |
| 1232 | **/ |
| 1233 | void igb_rx_fifo_flush_82575(struct e1000_hw *hw) |
| 1234 | { |
| 1235 | u32 rctl, rlpml, rxdctl[4], rfctl, temp_rctl, rx_enabled; |
| 1236 | int i, ms_wait; |
| 1237 | |
| 1238 | if (hw->mac.type != e1000_82575 || |
| 1239 | !(rd32(E1000_MANC) & E1000_MANC_RCV_TCO_EN)) |
| 1240 | return; |
| 1241 | |
| 1242 | /* Disable all RX queues */ |
| 1243 | for (i = 0; i < 4; i++) { |
| 1244 | rxdctl[i] = rd32(E1000_RXDCTL(i)); |
| 1245 | wr32(E1000_RXDCTL(i), |
| 1246 | rxdctl[i] & ~E1000_RXDCTL_QUEUE_ENABLE); |
| 1247 | } |
| 1248 | /* Poll all queues to verify they have shut down */ |
| 1249 | for (ms_wait = 0; ms_wait < 10; ms_wait++) { |
| 1250 | msleep(1); |
| 1251 | rx_enabled = 0; |
| 1252 | for (i = 0; i < 4; i++) |
| 1253 | rx_enabled |= rd32(E1000_RXDCTL(i)); |
| 1254 | if (!(rx_enabled & E1000_RXDCTL_QUEUE_ENABLE)) |
| 1255 | break; |
| 1256 | } |
| 1257 | |
| 1258 | if (ms_wait == 10) |
| 1259 | hw_dbg("Queue disable timed out after 10ms\n"); |
| 1260 | |
| 1261 | /* Clear RLPML, RCTL.SBP, RFCTL.LEF, and set RCTL.LPE so that all |
| 1262 | * incoming packets are rejected. Set enable and wait 2ms so that |
| 1263 | * any packet that was coming in as RCTL.EN was set is flushed |
| 1264 | */ |
| 1265 | rfctl = rd32(E1000_RFCTL); |
| 1266 | wr32(E1000_RFCTL, rfctl & ~E1000_RFCTL_LEF); |
| 1267 | |
| 1268 | rlpml = rd32(E1000_RLPML); |
| 1269 | wr32(E1000_RLPML, 0); |
| 1270 | |
| 1271 | rctl = rd32(E1000_RCTL); |
| 1272 | temp_rctl = rctl & ~(E1000_RCTL_EN | E1000_RCTL_SBP); |
| 1273 | temp_rctl |= E1000_RCTL_LPE; |
| 1274 | |
| 1275 | wr32(E1000_RCTL, temp_rctl); |
| 1276 | wr32(E1000_RCTL, temp_rctl | E1000_RCTL_EN); |
| 1277 | wrfl(); |
| 1278 | msleep(2); |
| 1279 | |
| 1280 | /* Enable RX queues that were previously enabled and restore our |
| 1281 | * previous state |
| 1282 | */ |
| 1283 | for (i = 0; i < 4; i++) |
| 1284 | wr32(E1000_RXDCTL(i), rxdctl[i]); |
| 1285 | wr32(E1000_RCTL, rctl); |
| 1286 | wrfl(); |
| 1287 | |
| 1288 | wr32(E1000_RLPML, rlpml); |
| 1289 | wr32(E1000_RFCTL, rfctl); |
| 1290 | |
| 1291 | /* Flush receive errors generated by workaround */ |
| 1292 | rd32(E1000_ROC); |
| 1293 | rd32(E1000_RNBC); |
| 1294 | rd32(E1000_MPC); |
| 1295 | } |
| 1296 | |
Alexander Duyck | 4ae196d | 2009-02-19 20:40:07 -0800 | [diff] [blame] | 1297 | /** |
Alexander Duyck | 009bc06 | 2009-07-23 18:08:35 +0000 | [diff] [blame] | 1298 | * igb_set_pcie_completion_timeout - set pci-e completion timeout |
| 1299 | * @hw: pointer to the HW structure |
| 1300 | * |
| 1301 | * The defaults for 82575 and 82576 should be in the range of 50us to 50ms, |
| 1302 | * however the hardware default for these parts is 500us to 1ms which is less |
| 1303 | * than the 10ms recommended by the pci-e spec. To address this we need to |
| 1304 | * increase the value to either 10ms to 200ms for capability version 1 config, |
| 1305 | * or 16ms to 55ms for version 2. |
| 1306 | **/ |
| 1307 | static s32 igb_set_pcie_completion_timeout(struct e1000_hw *hw) |
| 1308 | { |
| 1309 | u32 gcr = rd32(E1000_GCR); |
| 1310 | s32 ret_val = 0; |
| 1311 | u16 pcie_devctl2; |
| 1312 | |
| 1313 | /* only take action if timeout value is defaulted to 0 */ |
| 1314 | if (gcr & E1000_GCR_CMPL_TMOUT_MASK) |
| 1315 | goto out; |
| 1316 | |
| 1317 | /* |
| 1318 | * if capababilities version is type 1 we can write the |
| 1319 | * timeout of 10ms to 200ms through the GCR register |
| 1320 | */ |
| 1321 | if (!(gcr & E1000_GCR_CAP_VER2)) { |
| 1322 | gcr |= E1000_GCR_CMPL_TMOUT_10ms; |
| 1323 | goto out; |
| 1324 | } |
| 1325 | |
| 1326 | /* |
| 1327 | * for version 2 capabilities we need to write the config space |
| 1328 | * directly in order to set the completion timeout value for |
| 1329 | * 16ms to 55ms |
| 1330 | */ |
| 1331 | ret_val = igb_read_pcie_cap_reg(hw, PCIE_DEVICE_CONTROL2, |
| 1332 | &pcie_devctl2); |
| 1333 | if (ret_val) |
| 1334 | goto out; |
| 1335 | |
| 1336 | pcie_devctl2 |= PCIE_DEVICE_CONTROL2_16ms; |
| 1337 | |
| 1338 | ret_val = igb_write_pcie_cap_reg(hw, PCIE_DEVICE_CONTROL2, |
| 1339 | &pcie_devctl2); |
| 1340 | out: |
| 1341 | /* disable completion timeout resend */ |
| 1342 | gcr &= ~E1000_GCR_CMPL_TMOUT_RESEND; |
| 1343 | |
| 1344 | wr32(E1000_GCR, gcr); |
| 1345 | return ret_val; |
| 1346 | } |
| 1347 | |
| 1348 | /** |
Alexander Duyck | 4ae196d | 2009-02-19 20:40:07 -0800 | [diff] [blame] | 1349 | * igb_vmdq_set_loopback_pf - enable or disable vmdq loopback |
| 1350 | * @hw: pointer to the hardware struct |
| 1351 | * @enable: state to enter, either enabled or disabled |
| 1352 | * |
| 1353 | * enables/disables L2 switch loopback functionality. |
| 1354 | **/ |
| 1355 | void igb_vmdq_set_loopback_pf(struct e1000_hw *hw, bool enable) |
| 1356 | { |
| 1357 | u32 dtxswc = rd32(E1000_DTXSWC); |
| 1358 | |
| 1359 | if (enable) |
| 1360 | dtxswc |= E1000_DTXSWC_VMDQ_LOOPBACK_EN; |
| 1361 | else |
| 1362 | dtxswc &= ~E1000_DTXSWC_VMDQ_LOOPBACK_EN; |
| 1363 | |
| 1364 | wr32(E1000_DTXSWC, dtxswc); |
| 1365 | } |
| 1366 | |
| 1367 | /** |
| 1368 | * igb_vmdq_set_replication_pf - enable or disable vmdq replication |
| 1369 | * @hw: pointer to the hardware struct |
| 1370 | * @enable: state to enter, either enabled or disabled |
| 1371 | * |
| 1372 | * enables/disables replication of packets across multiple pools. |
| 1373 | **/ |
| 1374 | void igb_vmdq_set_replication_pf(struct e1000_hw *hw, bool enable) |
| 1375 | { |
| 1376 | u32 vt_ctl = rd32(E1000_VT_CTL); |
| 1377 | |
| 1378 | if (enable) |
| 1379 | vt_ctl |= E1000_VT_CTL_VM_REPL_EN; |
| 1380 | else |
| 1381 | vt_ctl &= ~E1000_VT_CTL_VM_REPL_EN; |
| 1382 | |
| 1383 | wr32(E1000_VT_CTL, vt_ctl); |
| 1384 | } |
| 1385 | |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1386 | static struct e1000_mac_operations e1000_mac_ops_82575 = { |
| 1387 | .reset_hw = igb_reset_hw_82575, |
| 1388 | .init_hw = igb_init_hw_82575, |
| 1389 | .check_for_link = igb_check_for_link_82575, |
Alexander Duyck | 2d064c0 | 2008-07-08 15:10:12 -0700 | [diff] [blame] | 1390 | .rar_set = igb_rar_set, |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1391 | .read_mac_addr = igb_read_mac_addr_82575, |
| 1392 | .get_speed_and_duplex = igb_get_speed_and_duplex_copper, |
| 1393 | }; |
| 1394 | |
| 1395 | static struct e1000_phy_operations e1000_phy_ops_82575 = { |
Alexander Duyck | a8d2a0c | 2009-02-06 23:17:26 +0000 | [diff] [blame] | 1396 | .acquire = igb_acquire_phy_82575, |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1397 | .get_cfg_done = igb_get_cfg_done_82575, |
Alexander Duyck | a8d2a0c | 2009-02-06 23:17:26 +0000 | [diff] [blame] | 1398 | .release = igb_release_phy_82575, |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1399 | }; |
| 1400 | |
| 1401 | static struct e1000_nvm_operations e1000_nvm_ops_82575 = { |
Alexander Duyck | 312c75a | 2009-02-06 23:17:47 +0000 | [diff] [blame] | 1402 | .acquire = igb_acquire_nvm_82575, |
| 1403 | .read = igb_read_nvm_eerd, |
| 1404 | .release = igb_release_nvm_82575, |
| 1405 | .write = igb_write_nvm_spi, |
Auke Kok | 9d5c824 | 2008-01-24 02:22:38 -0800 | [diff] [blame] | 1406 | }; |
| 1407 | |
| 1408 | const struct e1000_info e1000_82575_info = { |
| 1409 | .get_invariants = igb_get_invariants_82575, |
| 1410 | .mac_ops = &e1000_mac_ops_82575, |
| 1411 | .phy_ops = &e1000_phy_ops_82575, |
| 1412 | .nvm_ops = &e1000_nvm_ops_82575, |
| 1413 | }; |
| 1414 | |