blob: 3f435c16608dd3ddcf05f0b589b4a529a4efe1b4 [file] [log] [blame]
Auke Kokbc7f75f2007-09-17 12:30:59 -07001/*******************************************************************************
2
3 Intel PRO/1000 Linux driver
Bruce Allanc7e54b12009-11-20 23:25:45 +00004 Copyright(c) 1999 - 2009 Intel Corporation.
Auke Kokbc7f75f2007-09-17 12:30:59 -07005
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 Linux NICS <linux.nics@intel.com>
24 e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25 Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27*******************************************************************************/
28
29/*
30 * 80003ES2LAN Gigabit Ethernet Controller (Copper)
31 * 80003ES2LAN Gigabit Ethernet Controller (Serdes)
32 */
33
Auke Kokbc7f75f2007-09-17 12:30:59 -070034#include "e1000.h"
35
36#define E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL 0x00
37#define E1000_KMRNCTRLSTA_OFFSET_INB_CTRL 0x02
38#define E1000_KMRNCTRLSTA_OFFSET_HD_CTRL 0x10
David Graham2d9498f2008-04-23 11:09:14 -070039#define E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE 0x1F
Auke Kokbc7f75f2007-09-17 12:30:59 -070040
41#define E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS 0x0008
42#define E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS 0x0800
43#define E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING 0x0010
44
45#define E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT 0x0004
46#define E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT 0x0000
David Graham2d9498f2008-04-23 11:09:14 -070047#define E1000_KMRNCTRLSTA_OPMODE_E_IDLE 0x2000
Auke Kokbc7f75f2007-09-17 12:30:59 -070048
49#define E1000_TCTL_EXT_GCEX_MASK 0x000FFC00 /* Gigabit Carry Extend Padding */
50#define DEFAULT_TCTL_EXT_GCEX_80003ES2LAN 0x00010000
51
52#define DEFAULT_TIPG_IPGT_1000_80003ES2LAN 0x8
53#define DEFAULT_TIPG_IPGT_10_100_80003ES2LAN 0x9
54
55/* GG82563 PHY Specific Status Register (Page 0, Register 16 */
56#define GG82563_PSCR_POLARITY_REVERSAL_DISABLE 0x0002 /* 1=Reversal Disab. */
57#define GG82563_PSCR_CROSSOVER_MODE_MASK 0x0060
58#define GG82563_PSCR_CROSSOVER_MODE_MDI 0x0000 /* 00=Manual MDI */
59#define GG82563_PSCR_CROSSOVER_MODE_MDIX 0x0020 /* 01=Manual MDIX */
60#define GG82563_PSCR_CROSSOVER_MODE_AUTO 0x0060 /* 11=Auto crossover */
61
62/* PHY Specific Control Register 2 (Page 0, Register 26) */
63#define GG82563_PSCR2_REVERSE_AUTO_NEG 0x2000
64 /* 1=Reverse Auto-Negotiation */
65
66/* MAC Specific Control Register (Page 2, Register 21) */
67/* Tx clock speed for Link Down and 1000BASE-T for the following speeds */
68#define GG82563_MSCR_TX_CLK_MASK 0x0007
69#define GG82563_MSCR_TX_CLK_10MBPS_2_5 0x0004
70#define GG82563_MSCR_TX_CLK_100MBPS_25 0x0005
71#define GG82563_MSCR_TX_CLK_1000MBPS_25 0x0007
72
73#define GG82563_MSCR_ASSERT_CRS_ON_TX 0x0010 /* 1=Assert */
74
75/* DSP Distance Register (Page 5, Register 26) */
76#define GG82563_DSPD_CABLE_LENGTH 0x0007 /* 0 = <50M
77 1 = 50-80M
78 2 = 80-110M
79 3 = 110-140M
80 4 = >140M */
81
82/* Kumeran Mode Control Register (Page 193, Register 16) */
83#define GG82563_KMCR_PASS_FALSE_CARRIER 0x0800
84
David Graham2d9498f2008-04-23 11:09:14 -070085/* Max number of times Kumeran read/write should be validated */
86#define GG82563_MAX_KMRN_RETRY 0x5
87
Auke Kokbc7f75f2007-09-17 12:30:59 -070088/* Power Management Control Register (Page 193, Register 20) */
89#define GG82563_PMCR_ENABLE_ELECTRICAL_IDLE 0x0001
90 /* 1=Enable SERDES Electrical Idle */
91
92/* In-Band Control Register (Page 194, Register 18) */
93#define GG82563_ICR_DIS_PADDING 0x0010 /* Disable Padding */
94
Bruce Allanad680762008-03-28 09:15:03 -070095/*
96 * A table for the GG82563 cable length where the range is defined
Auke Kokbc7f75f2007-09-17 12:30:59 -070097 * with a lower bound at "index" and the upper bound at
98 * "index + 5".
99 */
100static const u16 e1000_gg82563_cable_length_table[] =
101 { 0, 60, 115, 150, 150, 60, 115, 150, 180, 180, 0xFF };
Bruce Allaneb656d42009-12-01 15:47:02 +0000102#define GG82563_CABLE_LENGTH_TABLE_SIZE \
103 ARRAY_SIZE(e1000_gg82563_cable_length_table)
Auke Kokbc7f75f2007-09-17 12:30:59 -0700104
105static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw);
106static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
107static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
108static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw);
109static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw);
110static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw);
111static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex);
Bruce Allan75eb0fa2008-11-21 16:53:51 -0800112static s32 e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw);
113static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
114 u16 *data);
115static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
116 u16 data);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700117
118/**
119 * e1000_init_phy_params_80003es2lan - Init ESB2 PHY func ptrs.
120 * @hw: pointer to the HW structure
Auke Kokbc7f75f2007-09-17 12:30:59 -0700121 **/
122static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw)
123{
124 struct e1000_phy_info *phy = &hw->phy;
125 s32 ret_val;
126
Jeff Kirsher318a94d2008-03-28 09:15:16 -0700127 if (hw->phy.media_type != e1000_media_type_copper) {
Auke Kokbc7f75f2007-09-17 12:30:59 -0700128 phy->type = e1000_phy_none;
129 return 0;
130 }
131
132 phy->addr = 1;
133 phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
134 phy->reset_delay_us = 100;
135 phy->type = e1000_phy_gg82563;
136
137 /* This can only be done after all function pointers are setup. */
138 ret_val = e1000e_get_phy_id(hw);
139
140 /* Verify phy id */
141 if (phy->id != GG82563_E_PHY_ID)
142 return -E1000_ERR_PHY;
143
144 return ret_val;
145}
146
147/**
148 * e1000_init_nvm_params_80003es2lan - Init ESB2 NVM func ptrs.
149 * @hw: pointer to the HW structure
Auke Kokbc7f75f2007-09-17 12:30:59 -0700150 **/
151static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
152{
153 struct e1000_nvm_info *nvm = &hw->nvm;
154 u32 eecd = er32(EECD);
155 u16 size;
156
157 nvm->opcode_bits = 8;
158 nvm->delay_usec = 1;
159 switch (nvm->override) {
160 case e1000_nvm_override_spi_large:
161 nvm->page_size = 32;
162 nvm->address_bits = 16;
163 break;
164 case e1000_nvm_override_spi_small:
165 nvm->page_size = 8;
166 nvm->address_bits = 8;
167 break;
168 default:
169 nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8;
170 nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? 16 : 8;
171 break;
172 }
173
Bruce Allanad680762008-03-28 09:15:03 -0700174 nvm->type = e1000_nvm_eeprom_spi;
Auke Kokbc7f75f2007-09-17 12:30:59 -0700175
176 size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
177 E1000_EECD_SIZE_EX_SHIFT);
178
Bruce Allanad680762008-03-28 09:15:03 -0700179 /*
180 * Added to a constant, "size" becomes the left-shift value
Auke Kokbc7f75f2007-09-17 12:30:59 -0700181 * for setting word_size.
182 */
183 size += NVM_WORD_SIZE_BASE_SHIFT;
Jeff Kirsher8d7c2942008-04-02 13:48:07 -0700184
185 /* EEPROM access above 16k is unsupported */
186 if (size > 14)
187 size = 14;
Auke Kokbc7f75f2007-09-17 12:30:59 -0700188 nvm->word_size = 1 << size;
189
190 return 0;
191}
192
193/**
194 * e1000_init_mac_params_80003es2lan - Init ESB2 MAC func ptrs.
195 * @hw: pointer to the HW structure
Auke Kokbc7f75f2007-09-17 12:30:59 -0700196 **/
197static s32 e1000_init_mac_params_80003es2lan(struct e1000_adapter *adapter)
198{
199 struct e1000_hw *hw = &adapter->hw;
200 struct e1000_mac_info *mac = &hw->mac;
201 struct e1000_mac_operations *func = &mac->ops;
202
203 /* Set media type */
204 switch (adapter->pdev->device) {
205 case E1000_DEV_ID_80003ES2LAN_SERDES_DPT:
Jeff Kirsher318a94d2008-03-28 09:15:16 -0700206 hw->phy.media_type = e1000_media_type_internal_serdes;
Auke Kokbc7f75f2007-09-17 12:30:59 -0700207 break;
208 default:
Jeff Kirsher318a94d2008-03-28 09:15:16 -0700209 hw->phy.media_type = e1000_media_type_copper;
Auke Kokbc7f75f2007-09-17 12:30:59 -0700210 break;
211 }
212
213 /* Set mta register count */
214 mac->mta_reg_count = 128;
215 /* Set rar entry count */
216 mac->rar_entry_count = E1000_RAR_ENTRIES;
217 /* Set if manageability features are enabled. */
Bruce Allan564ea9b2009-11-20 23:26:44 +0000218 mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK)
219 ? true : false;
Auke Kokbc7f75f2007-09-17 12:30:59 -0700220
221 /* check for link */
Jeff Kirsher318a94d2008-03-28 09:15:16 -0700222 switch (hw->phy.media_type) {
Auke Kokbc7f75f2007-09-17 12:30:59 -0700223 case e1000_media_type_copper:
224 func->setup_physical_interface = e1000_setup_copper_link_80003es2lan;
225 func->check_for_link = e1000e_check_for_copper_link;
226 break;
227 case e1000_media_type_fiber:
228 func->setup_physical_interface = e1000e_setup_fiber_serdes_link;
229 func->check_for_link = e1000e_check_for_fiber_link;
230 break;
231 case e1000_media_type_internal_serdes:
232 func->setup_physical_interface = e1000e_setup_fiber_serdes_link;
233 func->check_for_link = e1000e_check_for_serdes_link;
234 break;
235 default:
236 return -E1000_ERR_CONFIG;
237 break;
238 }
239
240 return 0;
241}
242
Jeff Kirsher69e3fd82008-04-02 13:48:18 -0700243static s32 e1000_get_variants_80003es2lan(struct e1000_adapter *adapter)
Auke Kokbc7f75f2007-09-17 12:30:59 -0700244{
245 struct e1000_hw *hw = &adapter->hw;
246 s32 rc;
247
248 rc = e1000_init_mac_params_80003es2lan(adapter);
249 if (rc)
250 return rc;
251
252 rc = e1000_init_nvm_params_80003es2lan(hw);
253 if (rc)
254 return rc;
255
256 rc = e1000_init_phy_params_80003es2lan(hw);
257 if (rc)
258 return rc;
259
260 return 0;
261}
262
263/**
264 * e1000_acquire_phy_80003es2lan - Acquire rights to access PHY
265 * @hw: pointer to the HW structure
266 *
Bruce Allanfe401672009-11-20 23:26:05 +0000267 * A wrapper to acquire access rights to the correct PHY.
Auke Kokbc7f75f2007-09-17 12:30:59 -0700268 **/
269static s32 e1000_acquire_phy_80003es2lan(struct e1000_hw *hw)
270{
271 u16 mask;
272
273 mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
Auke Kokbc7f75f2007-09-17 12:30:59 -0700274 return e1000_acquire_swfw_sync_80003es2lan(hw, mask);
275}
276
277/**
278 * e1000_release_phy_80003es2lan - Release rights to access PHY
279 * @hw: pointer to the HW structure
280 *
Bruce Allanfe401672009-11-20 23:26:05 +0000281 * A wrapper to release access rights to the correct PHY.
Auke Kokbc7f75f2007-09-17 12:30:59 -0700282 **/
283static void e1000_release_phy_80003es2lan(struct e1000_hw *hw)
284{
285 u16 mask;
286
287 mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
Bruce Allan75eb0fa2008-11-21 16:53:51 -0800288 e1000_release_swfw_sync_80003es2lan(hw, mask);
289}
290
291/**
292 * e1000_acquire_mac_csr_80003es2lan - Acquire rights to access Kumeran register
293 * @hw: pointer to the HW structure
294 *
295 * Acquire the semaphore to access the Kumeran interface.
296 *
297 **/
298static s32 e1000_acquire_mac_csr_80003es2lan(struct e1000_hw *hw)
299{
300 u16 mask;
301
302 mask = E1000_SWFW_CSR_SM;
303
304 return e1000_acquire_swfw_sync_80003es2lan(hw, mask);
305}
306
307/**
308 * e1000_release_mac_csr_80003es2lan - Release rights to access Kumeran Register
309 * @hw: pointer to the HW structure
310 *
311 * Release the semaphore used to access the Kumeran interface
312 **/
313static void e1000_release_mac_csr_80003es2lan(struct e1000_hw *hw)
314{
315 u16 mask;
316
317 mask = E1000_SWFW_CSR_SM;
David Graham2d9498f2008-04-23 11:09:14 -0700318
Auke Kokbc7f75f2007-09-17 12:30:59 -0700319 e1000_release_swfw_sync_80003es2lan(hw, mask);
320}
321
322/**
323 * e1000_acquire_nvm_80003es2lan - Acquire rights to access NVM
324 * @hw: pointer to the HW structure
325 *
Bruce Allanfe401672009-11-20 23:26:05 +0000326 * Acquire the semaphore to access the EEPROM.
Auke Kokbc7f75f2007-09-17 12:30:59 -0700327 **/
328static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw)
329{
330 s32 ret_val;
331
332 ret_val = e1000_acquire_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
333 if (ret_val)
334 return ret_val;
335
336 ret_val = e1000e_acquire_nvm(hw);
337
338 if (ret_val)
339 e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
340
341 return ret_val;
342}
343
344/**
345 * e1000_release_nvm_80003es2lan - Relinquish rights to access NVM
346 * @hw: pointer to the HW structure
347 *
Bruce Allanfe401672009-11-20 23:26:05 +0000348 * Release the semaphore used to access the EEPROM.
Auke Kokbc7f75f2007-09-17 12:30:59 -0700349 **/
350static void e1000_release_nvm_80003es2lan(struct e1000_hw *hw)
351{
352 e1000e_release_nvm(hw);
353 e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
354}
355
356/**
357 * e1000_acquire_swfw_sync_80003es2lan - Acquire SW/FW semaphore
358 * @hw: pointer to the HW structure
359 * @mask: specifies which semaphore to acquire
360 *
361 * Acquire the SW/FW semaphore to access the PHY or NVM. The mask
362 * will also specify which port we're acquiring the lock for.
363 **/
364static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
365{
366 u32 swfw_sync;
367 u32 swmask = mask;
368 u32 fwmask = mask << 16;
369 s32 i = 0;
Bruce Allan75eb0fa2008-11-21 16:53:51 -0800370 s32 timeout = 50;
Auke Kokbc7f75f2007-09-17 12:30:59 -0700371
372 while (i < timeout) {
373 if (e1000e_get_hw_semaphore(hw))
374 return -E1000_ERR_SWFW_SYNC;
375
376 swfw_sync = er32(SW_FW_SYNC);
377 if (!(swfw_sync & (fwmask | swmask)))
378 break;
379
Bruce Allanad680762008-03-28 09:15:03 -0700380 /*
381 * Firmware currently using resource (fwmask)
382 * or other software thread using resource (swmask)
383 */
Auke Kokbc7f75f2007-09-17 12:30:59 -0700384 e1000e_put_hw_semaphore(hw);
385 mdelay(5);
386 i++;
387 }
388
389 if (i == timeout) {
Bruce Allan3bb99fe2009-11-20 23:25:07 +0000390 e_dbg("Driver can't access resource, SW_FW_SYNC timeout.\n");
Auke Kokbc7f75f2007-09-17 12:30:59 -0700391 return -E1000_ERR_SWFW_SYNC;
392 }
393
394 swfw_sync |= swmask;
395 ew32(SW_FW_SYNC, swfw_sync);
396
397 e1000e_put_hw_semaphore(hw);
398
399 return 0;
400}
401
402/**
403 * e1000_release_swfw_sync_80003es2lan - Release SW/FW semaphore
404 * @hw: pointer to the HW structure
405 * @mask: specifies which semaphore to acquire
406 *
407 * Release the SW/FW semaphore used to access the PHY or NVM. The mask
408 * will also specify which port we're releasing the lock for.
409 **/
410static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
411{
412 u32 swfw_sync;
413
414 while (e1000e_get_hw_semaphore(hw) != 0);
415 /* Empty */
416
417 swfw_sync = er32(SW_FW_SYNC);
418 swfw_sync &= ~mask;
419 ew32(SW_FW_SYNC, swfw_sync);
420
421 e1000e_put_hw_semaphore(hw);
422}
423
424/**
425 * e1000_read_phy_reg_gg82563_80003es2lan - Read GG82563 PHY register
426 * @hw: pointer to the HW structure
427 * @offset: offset of the register to read
428 * @data: pointer to the data returned from the operation
429 *
Bruce Allanfe401672009-11-20 23:26:05 +0000430 * Read the GG82563 PHY register.
Auke Kokbc7f75f2007-09-17 12:30:59 -0700431 **/
432static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
433 u32 offset, u16 *data)
434{
435 s32 ret_val;
436 u32 page_select;
437 u16 temp;
438
David Graham2d9498f2008-04-23 11:09:14 -0700439 ret_val = e1000_acquire_phy_80003es2lan(hw);
440 if (ret_val)
441 return ret_val;
442
Auke Kokbc7f75f2007-09-17 12:30:59 -0700443 /* Select Configuration Page */
David Graham2d9498f2008-04-23 11:09:14 -0700444 if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) {
Auke Kokbc7f75f2007-09-17 12:30:59 -0700445 page_select = GG82563_PHY_PAGE_SELECT;
David Graham2d9498f2008-04-23 11:09:14 -0700446 } else {
Bruce Allanad680762008-03-28 09:15:03 -0700447 /*
448 * Use Alternative Page Select register to access
Auke Kokbc7f75f2007-09-17 12:30:59 -0700449 * registers 30 and 31
450 */
451 page_select = GG82563_PHY_PAGE_SELECT_ALT;
David Graham2d9498f2008-04-23 11:09:14 -0700452 }
Auke Kokbc7f75f2007-09-17 12:30:59 -0700453
454 temp = (u16)((u16)offset >> GG82563_PAGE_SHIFT);
David Graham2d9498f2008-04-23 11:09:14 -0700455 ret_val = e1000e_write_phy_reg_mdic(hw, page_select, temp);
456 if (ret_val) {
457 e1000_release_phy_80003es2lan(hw);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700458 return ret_val;
David Graham2d9498f2008-04-23 11:09:14 -0700459 }
Auke Kokbc7f75f2007-09-17 12:30:59 -0700460
Bruce Allanad680762008-03-28 09:15:03 -0700461 /*
462 * The "ready" bit in the MDIC register may be incorrectly set
Auke Kokbc7f75f2007-09-17 12:30:59 -0700463 * before the device has completed the "Page Select" MDI
464 * transaction. So we wait 200us after each MDI command...
465 */
466 udelay(200);
467
468 /* ...and verify the command was successful. */
David Graham2d9498f2008-04-23 11:09:14 -0700469 ret_val = e1000e_read_phy_reg_mdic(hw, page_select, &temp);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700470
471 if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
472 ret_val = -E1000_ERR_PHY;
David Graham2d9498f2008-04-23 11:09:14 -0700473 e1000_release_phy_80003es2lan(hw);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700474 return ret_val;
475 }
476
477 udelay(200);
478
David Graham2d9498f2008-04-23 11:09:14 -0700479 ret_val = e1000e_read_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
480 data);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700481
482 udelay(200);
David Graham2d9498f2008-04-23 11:09:14 -0700483 e1000_release_phy_80003es2lan(hw);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700484
485 return ret_val;
486}
487
488/**
489 * e1000_write_phy_reg_gg82563_80003es2lan - Write GG82563 PHY register
490 * @hw: pointer to the HW structure
491 * @offset: offset of the register to read
492 * @data: value to write to the register
493 *
Bruce Allanfe401672009-11-20 23:26:05 +0000494 * Write to the GG82563 PHY register.
Auke Kokbc7f75f2007-09-17 12:30:59 -0700495 **/
496static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
497 u32 offset, u16 data)
498{
499 s32 ret_val;
500 u32 page_select;
501 u16 temp;
502
David Graham2d9498f2008-04-23 11:09:14 -0700503 ret_val = e1000_acquire_phy_80003es2lan(hw);
504 if (ret_val)
505 return ret_val;
506
Auke Kokbc7f75f2007-09-17 12:30:59 -0700507 /* Select Configuration Page */
David Graham2d9498f2008-04-23 11:09:14 -0700508 if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) {
Auke Kokbc7f75f2007-09-17 12:30:59 -0700509 page_select = GG82563_PHY_PAGE_SELECT;
David Graham2d9498f2008-04-23 11:09:14 -0700510 } else {
Bruce Allanad680762008-03-28 09:15:03 -0700511 /*
512 * Use Alternative Page Select register to access
Auke Kokbc7f75f2007-09-17 12:30:59 -0700513 * registers 30 and 31
514 */
515 page_select = GG82563_PHY_PAGE_SELECT_ALT;
David Graham2d9498f2008-04-23 11:09:14 -0700516 }
Auke Kokbc7f75f2007-09-17 12:30:59 -0700517
518 temp = (u16)((u16)offset >> GG82563_PAGE_SHIFT);
David Graham2d9498f2008-04-23 11:09:14 -0700519 ret_val = e1000e_write_phy_reg_mdic(hw, page_select, temp);
520 if (ret_val) {
521 e1000_release_phy_80003es2lan(hw);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700522 return ret_val;
David Graham2d9498f2008-04-23 11:09:14 -0700523 }
Auke Kokbc7f75f2007-09-17 12:30:59 -0700524
525
Bruce Allanad680762008-03-28 09:15:03 -0700526 /*
527 * The "ready" bit in the MDIC register may be incorrectly set
Auke Kokbc7f75f2007-09-17 12:30:59 -0700528 * before the device has completed the "Page Select" MDI
529 * transaction. So we wait 200us after each MDI command...
530 */
531 udelay(200);
532
533 /* ...and verify the command was successful. */
David Graham2d9498f2008-04-23 11:09:14 -0700534 ret_val = e1000e_read_phy_reg_mdic(hw, page_select, &temp);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700535
David Graham2d9498f2008-04-23 11:09:14 -0700536 if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
537 e1000_release_phy_80003es2lan(hw);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700538 return -E1000_ERR_PHY;
David Graham2d9498f2008-04-23 11:09:14 -0700539 }
Auke Kokbc7f75f2007-09-17 12:30:59 -0700540
541 udelay(200);
542
David Graham2d9498f2008-04-23 11:09:14 -0700543 ret_val = e1000e_write_phy_reg_mdic(hw, MAX_PHY_REG_ADDRESS & offset,
544 data);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700545
546 udelay(200);
David Graham2d9498f2008-04-23 11:09:14 -0700547 e1000_release_phy_80003es2lan(hw);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700548
549 return ret_val;
550}
551
552/**
553 * e1000_write_nvm_80003es2lan - Write to ESB2 NVM
554 * @hw: pointer to the HW structure
555 * @offset: offset of the register to read
556 * @words: number of words to write
557 * @data: buffer of data to write to the NVM
558 *
Bruce Allanfe401672009-11-20 23:26:05 +0000559 * Write "words" of data to the ESB2 NVM.
Auke Kokbc7f75f2007-09-17 12:30:59 -0700560 **/
561static s32 e1000_write_nvm_80003es2lan(struct e1000_hw *hw, u16 offset,
562 u16 words, u16 *data)
563{
564 return e1000e_write_nvm_spi(hw, offset, words, data);
565}
566
567/**
568 * e1000_get_cfg_done_80003es2lan - Wait for configuration to complete
569 * @hw: pointer to the HW structure
570 *
571 * Wait a specific amount of time for manageability processes to complete.
572 * This is a function pointer entry point called by the phy module.
573 **/
574static s32 e1000_get_cfg_done_80003es2lan(struct e1000_hw *hw)
575{
576 s32 timeout = PHY_CFG_TIMEOUT;
577 u32 mask = E1000_NVM_CFG_DONE_PORT_0;
578
579 if (hw->bus.func == 1)
580 mask = E1000_NVM_CFG_DONE_PORT_1;
581
582 while (timeout) {
583 if (er32(EEMNGCTL) & mask)
584 break;
585 msleep(1);
586 timeout--;
587 }
588 if (!timeout) {
Bruce Allan3bb99fe2009-11-20 23:25:07 +0000589 e_dbg("MNG configuration cycle has not completed.\n");
Auke Kokbc7f75f2007-09-17 12:30:59 -0700590 return -E1000_ERR_RESET;
591 }
592
593 return 0;
594}
595
596/**
597 * e1000_phy_force_speed_duplex_80003es2lan - Force PHY speed and duplex
598 * @hw: pointer to the HW structure
599 *
600 * Force the speed and duplex settings onto the PHY. This is a
601 * function pointer entry point called by the phy module.
602 **/
603static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
604{
605 s32 ret_val;
606 u16 phy_data;
607 bool link;
608
Bruce Allanad680762008-03-28 09:15:03 -0700609 /*
610 * Clear Auto-Crossover to force MDI manually. M88E1000 requires MDI
Auke Kokbc7f75f2007-09-17 12:30:59 -0700611 * forced whenever speed and duplex are forced.
612 */
613 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
614 if (ret_val)
615 return ret_val;
616
617 phy_data &= ~GG82563_PSCR_CROSSOVER_MODE_AUTO;
618 ret_val = e1e_wphy(hw, GG82563_PHY_SPEC_CTRL, phy_data);
619 if (ret_val)
620 return ret_val;
621
Bruce Allan3bb99fe2009-11-20 23:25:07 +0000622 e_dbg("GG82563 PSCR: %X\n", phy_data);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700623
624 ret_val = e1e_rphy(hw, PHY_CONTROL, &phy_data);
625 if (ret_val)
626 return ret_val;
627
628 e1000e_phy_force_speed_duplex_setup(hw, &phy_data);
629
630 /* Reset the phy to commit changes. */
631 phy_data |= MII_CR_RESET;
632
633 ret_val = e1e_wphy(hw, PHY_CONTROL, phy_data);
634 if (ret_val)
635 return ret_val;
636
637 udelay(1);
638
Jeff Kirsher318a94d2008-03-28 09:15:16 -0700639 if (hw->phy.autoneg_wait_to_complete) {
Bruce Allan3bb99fe2009-11-20 23:25:07 +0000640 e_dbg("Waiting for forced speed/duplex link "
Auke Kokbc7f75f2007-09-17 12:30:59 -0700641 "on GG82563 phy.\n");
642
643 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
644 100000, &link);
645 if (ret_val)
646 return ret_val;
647
648 if (!link) {
Bruce Allanad680762008-03-28 09:15:03 -0700649 /*
650 * We didn't get link.
Auke Kokbc7f75f2007-09-17 12:30:59 -0700651 * Reset the DSP and cross our fingers.
652 */
653 ret_val = e1000e_phy_reset_dsp(hw);
654 if (ret_val)
655 return ret_val;
656 }
657
658 /* Try once more */
659 ret_val = e1000e_phy_has_link_generic(hw, PHY_FORCE_LIMIT,
660 100000, &link);
661 if (ret_val)
662 return ret_val;
663 }
664
665 ret_val = e1e_rphy(hw, GG82563_PHY_MAC_SPEC_CTRL, &phy_data);
666 if (ret_val)
667 return ret_val;
668
Bruce Allanad680762008-03-28 09:15:03 -0700669 /*
670 * Resetting the phy means we need to verify the TX_CLK corresponds
Auke Kokbc7f75f2007-09-17 12:30:59 -0700671 * to the link speed. 10Mbps -> 2.5MHz, else 25MHz.
672 */
673 phy_data &= ~GG82563_MSCR_TX_CLK_MASK;
674 if (hw->mac.forced_speed_duplex & E1000_ALL_10_SPEED)
675 phy_data |= GG82563_MSCR_TX_CLK_10MBPS_2_5;
676 else
677 phy_data |= GG82563_MSCR_TX_CLK_100MBPS_25;
678
Bruce Allanad680762008-03-28 09:15:03 -0700679 /*
680 * In addition, we must re-enable CRS on Tx for both half and full
Auke Kokbc7f75f2007-09-17 12:30:59 -0700681 * duplex.
682 */
683 phy_data |= GG82563_MSCR_ASSERT_CRS_ON_TX;
684 ret_val = e1e_wphy(hw, GG82563_PHY_MAC_SPEC_CTRL, phy_data);
685
686 return ret_val;
687}
688
689/**
690 * e1000_get_cable_length_80003es2lan - Set approximate cable length
691 * @hw: pointer to the HW structure
692 *
693 * Find the approximate cable length as measured by the GG82563 PHY.
694 * This is a function pointer entry point called by the phy module.
695 **/
696static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw)
697{
698 struct e1000_phy_info *phy = &hw->phy;
Bruce Allaneb656d42009-12-01 15:47:02 +0000699 s32 ret_val = 0;
Bruce Allana708dd82009-11-20 23:28:37 +0000700 u16 phy_data, index;
Auke Kokbc7f75f2007-09-17 12:30:59 -0700701
702 ret_val = e1e_rphy(hw, GG82563_PHY_DSP_DISTANCE, &phy_data);
703 if (ret_val)
Bruce Allaneb656d42009-12-01 15:47:02 +0000704 goto out;
Auke Kokbc7f75f2007-09-17 12:30:59 -0700705
706 index = phy_data & GG82563_DSPD_CABLE_LENGTH;
Bruce Allaneb656d42009-12-01 15:47:02 +0000707
708 if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE - 5) {
709 ret_val = -E1000_ERR_PHY;
710 goto out;
711 }
712
Auke Kokbc7f75f2007-09-17 12:30:59 -0700713 phy->min_cable_length = e1000_gg82563_cable_length_table[index];
Bruce Allaneb656d42009-12-01 15:47:02 +0000714 phy->max_cable_length = e1000_gg82563_cable_length_table[index + 5];
Auke Kokbc7f75f2007-09-17 12:30:59 -0700715
716 phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
717
Bruce Allaneb656d42009-12-01 15:47:02 +0000718out:
719 return ret_val;
Auke Kokbc7f75f2007-09-17 12:30:59 -0700720}
721
722/**
723 * e1000_get_link_up_info_80003es2lan - Report speed and duplex
724 * @hw: pointer to the HW structure
725 * @speed: pointer to speed buffer
726 * @duplex: pointer to duplex buffer
727 *
728 * Retrieve the current speed and duplex configuration.
Auke Kokbc7f75f2007-09-17 12:30:59 -0700729 **/
730static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
731 u16 *duplex)
732{
733 s32 ret_val;
734
Jeff Kirsher318a94d2008-03-28 09:15:16 -0700735 if (hw->phy.media_type == e1000_media_type_copper) {
Auke Kokbc7f75f2007-09-17 12:30:59 -0700736 ret_val = e1000e_get_speed_and_duplex_copper(hw,
737 speed,
738 duplex);
Bruce Allan75eb0fa2008-11-21 16:53:51 -0800739 hw->phy.ops.cfg_on_link_up(hw);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700740 } else {
741 ret_val = e1000e_get_speed_and_duplex_fiber_serdes(hw,
742 speed,
743 duplex);
744 }
745
746 return ret_val;
747}
748
749/**
750 * e1000_reset_hw_80003es2lan - Reset the ESB2 controller
751 * @hw: pointer to the HW structure
752 *
753 * Perform a global reset to the ESB2 controller.
Auke Kokbc7f75f2007-09-17 12:30:59 -0700754 **/
755static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
756{
Bruce Allana708dd82009-11-20 23:28:37 +0000757 u32 ctrl, icr;
Auke Kokbc7f75f2007-09-17 12:30:59 -0700758 s32 ret_val;
759
Bruce Allanad680762008-03-28 09:15:03 -0700760 /*
761 * Prevent the PCI-E bus from sticking if there is no TLP connection
Auke Kokbc7f75f2007-09-17 12:30:59 -0700762 * on the last TLP read/write transaction when MAC is reset.
763 */
764 ret_val = e1000e_disable_pcie_master(hw);
765 if (ret_val)
Bruce Allan3bb99fe2009-11-20 23:25:07 +0000766 e_dbg("PCI-E Master disable polling has failed.\n");
Auke Kokbc7f75f2007-09-17 12:30:59 -0700767
Bruce Allan3bb99fe2009-11-20 23:25:07 +0000768 e_dbg("Masking off all interrupts\n");
Auke Kokbc7f75f2007-09-17 12:30:59 -0700769 ew32(IMC, 0xffffffff);
770
771 ew32(RCTL, 0);
772 ew32(TCTL, E1000_TCTL_PSP);
773 e1e_flush();
774
775 msleep(10);
776
777 ctrl = er32(CTRL);
778
Bruce Allan75eb0fa2008-11-21 16:53:51 -0800779 ret_val = e1000_acquire_phy_80003es2lan(hw);
Bruce Allan3bb99fe2009-11-20 23:25:07 +0000780 e_dbg("Issuing a global reset to MAC\n");
Auke Kokbc7f75f2007-09-17 12:30:59 -0700781 ew32(CTRL, ctrl | E1000_CTRL_RST);
Bruce Allan75eb0fa2008-11-21 16:53:51 -0800782 e1000_release_phy_80003es2lan(hw);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700783
784 ret_val = e1000e_get_auto_rd_done(hw);
785 if (ret_val)
786 /* We don't want to continue accessing MAC registers. */
787 return ret_val;
788
789 /* Clear any pending interrupt events. */
790 ew32(IMC, 0xffffffff);
791 icr = er32(ICR);
792
793 return 0;
794}
795
796/**
797 * e1000_init_hw_80003es2lan - Initialize the ESB2 controller
798 * @hw: pointer to the HW structure
799 *
800 * Initialize the hw bits, LED, VFTA, MTA, link and hw counters.
Auke Kokbc7f75f2007-09-17 12:30:59 -0700801 **/
802static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
803{
804 struct e1000_mac_info *mac = &hw->mac;
805 u32 reg_data;
806 s32 ret_val;
807 u16 i;
808
809 e1000_initialize_hw_bits_80003es2lan(hw);
810
811 /* Initialize identification LED */
812 ret_val = e1000e_id_led_init(hw);
Bruce Allande39b752009-11-20 23:27:59 +0000813 if (ret_val)
Bruce Allan3bb99fe2009-11-20 23:25:07 +0000814 e_dbg("Error initializing identification LED\n");
Bruce Allande39b752009-11-20 23:27:59 +0000815 /* This is not fatal and we should not stop init due to this */
Auke Kokbc7f75f2007-09-17 12:30:59 -0700816
817 /* Disabling VLAN filtering */
Bruce Allan3bb99fe2009-11-20 23:25:07 +0000818 e_dbg("Initializing the IEEE VLAN\n");
Bruce Allancaaddaf2009-12-01 15:46:43 +0000819 mac->ops.clear_vfta(hw);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700820
821 /* Setup the receive address. */
822 e1000e_init_rx_addrs(hw, mac->rar_entry_count);
823
824 /* Zero out the Multicast HASH table */
Bruce Allan3bb99fe2009-11-20 23:25:07 +0000825 e_dbg("Zeroing the MTA\n");
Auke Kokbc7f75f2007-09-17 12:30:59 -0700826 for (i = 0; i < mac->mta_reg_count; i++)
827 E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
828
829 /* Setup link and flow control */
830 ret_val = e1000e_setup_link(hw);
831
832 /* Set the transmit descriptor write-back policy */
Jeff Kirshere9ec2c02008-04-02 13:48:13 -0700833 reg_data = er32(TXDCTL(0));
Auke Kokbc7f75f2007-09-17 12:30:59 -0700834 reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
835 E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC;
Jeff Kirshere9ec2c02008-04-02 13:48:13 -0700836 ew32(TXDCTL(0), reg_data);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700837
838 /* ...for both queues. */
Jeff Kirshere9ec2c02008-04-02 13:48:13 -0700839 reg_data = er32(TXDCTL(1));
Auke Kokbc7f75f2007-09-17 12:30:59 -0700840 reg_data = (reg_data & ~E1000_TXDCTL_WTHRESH) |
841 E1000_TXDCTL_FULL_TX_DESC_WB | E1000_TXDCTL_COUNT_DESC;
Jeff Kirshere9ec2c02008-04-02 13:48:13 -0700842 ew32(TXDCTL(1), reg_data);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700843
844 /* Enable retransmit on late collisions */
845 reg_data = er32(TCTL);
846 reg_data |= E1000_TCTL_RTLC;
847 ew32(TCTL, reg_data);
848
849 /* Configure Gigabit Carry Extend Padding */
850 reg_data = er32(TCTL_EXT);
851 reg_data &= ~E1000_TCTL_EXT_GCEX_MASK;
852 reg_data |= DEFAULT_TCTL_EXT_GCEX_80003ES2LAN;
853 ew32(TCTL_EXT, reg_data);
854
855 /* Configure Transmit Inter-Packet Gap */
856 reg_data = er32(TIPG);
857 reg_data &= ~E1000_TIPG_IPGT_MASK;
858 reg_data |= DEFAULT_TIPG_IPGT_1000_80003ES2LAN;
859 ew32(TIPG, reg_data);
860
861 reg_data = E1000_READ_REG_ARRAY(hw, E1000_FFLT, 0x0001);
862 reg_data &= ~0x00100000;
863 E1000_WRITE_REG_ARRAY(hw, E1000_FFLT, 0x0001, reg_data);
864
Bruce Allanad680762008-03-28 09:15:03 -0700865 /*
866 * Clear all of the statistics registers (clear on read). It is
Auke Kokbc7f75f2007-09-17 12:30:59 -0700867 * important that we do this after we have tried to establish link
868 * because the symbol error count will increment wildly if there
869 * is no link.
870 */
871 e1000_clear_hw_cntrs_80003es2lan(hw);
872
873 return ret_val;
874}
875
876/**
877 * e1000_initialize_hw_bits_80003es2lan - Init hw bits of ESB2
878 * @hw: pointer to the HW structure
879 *
880 * Initializes required hardware-dependent bits needed for normal operation.
881 **/
882static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw)
883{
884 u32 reg;
885
886 /* Transmit Descriptor Control 0 */
Jeff Kirshere9ec2c02008-04-02 13:48:13 -0700887 reg = er32(TXDCTL(0));
Auke Kokbc7f75f2007-09-17 12:30:59 -0700888 reg |= (1 << 22);
Jeff Kirshere9ec2c02008-04-02 13:48:13 -0700889 ew32(TXDCTL(0), reg);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700890
891 /* Transmit Descriptor Control 1 */
Jeff Kirshere9ec2c02008-04-02 13:48:13 -0700892 reg = er32(TXDCTL(1));
Auke Kokbc7f75f2007-09-17 12:30:59 -0700893 reg |= (1 << 22);
Jeff Kirshere9ec2c02008-04-02 13:48:13 -0700894 ew32(TXDCTL(1), reg);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700895
896 /* Transmit Arbitration Control 0 */
Jeff Kirshere9ec2c02008-04-02 13:48:13 -0700897 reg = er32(TARC(0));
Auke Kokbc7f75f2007-09-17 12:30:59 -0700898 reg &= ~(0xF << 27); /* 30:27 */
Jeff Kirsher318a94d2008-03-28 09:15:16 -0700899 if (hw->phy.media_type != e1000_media_type_copper)
Auke Kokbc7f75f2007-09-17 12:30:59 -0700900 reg &= ~(1 << 20);
Jeff Kirshere9ec2c02008-04-02 13:48:13 -0700901 ew32(TARC(0), reg);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700902
903 /* Transmit Arbitration Control 1 */
Jeff Kirshere9ec2c02008-04-02 13:48:13 -0700904 reg = er32(TARC(1));
Auke Kokbc7f75f2007-09-17 12:30:59 -0700905 if (er32(TCTL) & E1000_TCTL_MULR)
906 reg &= ~(1 << 28);
907 else
908 reg |= (1 << 28);
Jeff Kirshere9ec2c02008-04-02 13:48:13 -0700909 ew32(TARC(1), reg);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700910}
911
912/**
913 * e1000_copper_link_setup_gg82563_80003es2lan - Configure GG82563 Link
914 * @hw: pointer to the HW structure
915 *
916 * Setup some GG82563 PHY registers for obtaining link
917 **/
918static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
919{
920 struct e1000_phy_info *phy = &hw->phy;
921 s32 ret_val;
922 u32 ctrl_ext;
Bruce Allan75eb0fa2008-11-21 16:53:51 -0800923 u16 data;
Auke Kokbc7f75f2007-09-17 12:30:59 -0700924
David Graham2d9498f2008-04-23 11:09:14 -0700925 ret_val = e1e_rphy(hw, GG82563_PHY_MAC_SPEC_CTRL, &data);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700926 if (ret_val)
927 return ret_val;
928
929 data |= GG82563_MSCR_ASSERT_CRS_ON_TX;
930 /* Use 25MHz for both link down and 1000Base-T for Tx clock. */
931 data |= GG82563_MSCR_TX_CLK_1000MBPS_25;
932
David Graham2d9498f2008-04-23 11:09:14 -0700933 ret_val = e1e_wphy(hw, GG82563_PHY_MAC_SPEC_CTRL, data);
Auke Kokbc7f75f2007-09-17 12:30:59 -0700934 if (ret_val)
935 return ret_val;
936
Bruce Allanad680762008-03-28 09:15:03 -0700937 /*
938 * Options:
Auke Kokbc7f75f2007-09-17 12:30:59 -0700939 * MDI/MDI-X = 0 (default)
940 * 0 - Auto for all speeds
941 * 1 - MDI mode
942 * 2 - MDI-X mode
943 * 3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes)
944 */
945 ret_val = e1e_rphy(hw, GG82563_PHY_SPEC_CTRL, &data);
946 if (ret_val)
947 return ret_val;
948
949 data &= ~GG82563_PSCR_CROSSOVER_MODE_MASK;
950
951 switch (phy->mdix) {
952 case 1:
953 data |= GG82563_PSCR_CROSSOVER_MODE_MDI;
954 break;
955 case 2:
956 data |= GG82563_PSCR_CROSSOVER_MODE_MDIX;
957 break;
958 case 0:
959 default:
960 data |= GG82563_PSCR_CROSSOVER_MODE_AUTO;
961 break;
962 }
963
Bruce Allanad680762008-03-28 09:15:03 -0700964 /*
965 * Options:
Auke Kokbc7f75f2007-09-17 12:30:59 -0700966 * disable_polarity_correction = 0 (default)
967 * Automatic Correction for Reversed Cable Polarity
968 * 0 - Disabled
969 * 1 - Enabled
970 */
971 data &= ~GG82563_PSCR_POLARITY_REVERSAL_DISABLE;
972 if (phy->disable_polarity_correction)
973 data |= GG82563_PSCR_POLARITY_REVERSAL_DISABLE;
974
975 ret_val = e1e_wphy(hw, GG82563_PHY_SPEC_CTRL, data);
976 if (ret_val)
977 return ret_val;
978
979 /* SW Reset the PHY so all changes take effect */
980 ret_val = e1000e_commit_phy(hw);
981 if (ret_val) {
Bruce Allan3bb99fe2009-11-20 23:25:07 +0000982 e_dbg("Error Resetting the PHY\n");
Auke Kokbc7f75f2007-09-17 12:30:59 -0700983 return ret_val;
984 }
985
Bruce Allanad680762008-03-28 09:15:03 -0700986 /* Bypass Rx and Tx FIFO's */
Bruce Allan75eb0fa2008-11-21 16:53:51 -0800987 ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
988 E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL,
Bruce Allanad680762008-03-28 09:15:03 -0700989 E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS |
Auke Kokbc7f75f2007-09-17 12:30:59 -0700990 E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS);
991 if (ret_val)
992 return ret_val;
993
Bruce Allan75eb0fa2008-11-21 16:53:51 -0800994 ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
David Graham2d9498f2008-04-23 11:09:14 -0700995 E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE,
996 &data);
997 if (ret_val)
998 return ret_val;
999 data |= E1000_KMRNCTRLSTA_OPMODE_E_IDLE;
Bruce Allan75eb0fa2008-11-21 16:53:51 -08001000 ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
David Graham2d9498f2008-04-23 11:09:14 -07001001 E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE,
1002 data);
1003 if (ret_val)
1004 return ret_val;
1005
Auke Kokbc7f75f2007-09-17 12:30:59 -07001006 ret_val = e1e_rphy(hw, GG82563_PHY_SPEC_CTRL_2, &data);
1007 if (ret_val)
1008 return ret_val;
1009
1010 data &= ~GG82563_PSCR2_REVERSE_AUTO_NEG;
1011 ret_val = e1e_wphy(hw, GG82563_PHY_SPEC_CTRL_2, data);
1012 if (ret_val)
1013 return ret_val;
1014
1015 ctrl_ext = er32(CTRL_EXT);
1016 ctrl_ext &= ~(E1000_CTRL_EXT_LINK_MODE_MASK);
1017 ew32(CTRL_EXT, ctrl_ext);
1018
1019 ret_val = e1e_rphy(hw, GG82563_PHY_PWR_MGMT_CTRL, &data);
1020 if (ret_val)
1021 return ret_val;
1022
Bruce Allanad680762008-03-28 09:15:03 -07001023 /*
1024 * Do not init these registers when the HW is in IAMT mode, since the
Auke Kokbc7f75f2007-09-17 12:30:59 -07001025 * firmware will have already initialized them. We only initialize
1026 * them if the HW is not in IAMT mode.
1027 */
1028 if (!e1000e_check_mng_mode(hw)) {
1029 /* Enable Electrical Idle on the PHY */
1030 data |= GG82563_PMCR_ENABLE_ELECTRICAL_IDLE;
1031 ret_val = e1e_wphy(hw, GG82563_PHY_PWR_MGMT_CTRL, data);
1032 if (ret_val)
1033 return ret_val;
1034
Bruce Allan75eb0fa2008-11-21 16:53:51 -08001035 ret_val = e1e_rphy(hw, GG82563_PHY_KMRN_MODE_CTRL, &data);
1036 if (ret_val)
1037 return ret_val;
Auke Kokbc7f75f2007-09-17 12:30:59 -07001038
1039 data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
1040 ret_val = e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, data);
1041 if (ret_val)
1042 return ret_val;
1043 }
1044
Bruce Allanad680762008-03-28 09:15:03 -07001045 /*
1046 * Workaround: Disable padding in Kumeran interface in the MAC
Auke Kokbc7f75f2007-09-17 12:30:59 -07001047 * and in the PHY to avoid CRC errors.
1048 */
1049 ret_val = e1e_rphy(hw, GG82563_PHY_INBAND_CTRL, &data);
1050 if (ret_val)
1051 return ret_val;
1052
1053 data |= GG82563_ICR_DIS_PADDING;
1054 ret_val = e1e_wphy(hw, GG82563_PHY_INBAND_CTRL, data);
1055 if (ret_val)
1056 return ret_val;
1057
1058 return 0;
1059}
1060
1061/**
1062 * e1000_setup_copper_link_80003es2lan - Setup Copper Link for ESB2
1063 * @hw: pointer to the HW structure
1064 *
1065 * Essentially a wrapper for setting up all things "copper" related.
1066 * This is a function pointer entry point called by the mac module.
1067 **/
1068static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
1069{
1070 u32 ctrl;
1071 s32 ret_val;
1072 u16 reg_data;
1073
1074 ctrl = er32(CTRL);
1075 ctrl |= E1000_CTRL_SLU;
1076 ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
1077 ew32(CTRL, ctrl);
1078
Bruce Allanad680762008-03-28 09:15:03 -07001079 /*
1080 * Set the mac to wait the maximum time between each
Auke Kokbc7f75f2007-09-17 12:30:59 -07001081 * iteration and increase the max iterations when
Bruce Allanad680762008-03-28 09:15:03 -07001082 * polling the phy; this fixes erroneous timeouts at 10Mbps.
1083 */
Bruce Allan75eb0fa2008-11-21 16:53:51 -08001084 ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 4),
1085 0xFFFF);
Auke Kokbc7f75f2007-09-17 12:30:59 -07001086 if (ret_val)
1087 return ret_val;
Bruce Allan75eb0fa2008-11-21 16:53:51 -08001088 ret_val = e1000_read_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9),
1089 &reg_data);
Auke Kokbc7f75f2007-09-17 12:30:59 -07001090 if (ret_val)
1091 return ret_val;
1092 reg_data |= 0x3F;
Bruce Allan75eb0fa2008-11-21 16:53:51 -08001093 ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9),
1094 reg_data);
Auke Kokbc7f75f2007-09-17 12:30:59 -07001095 if (ret_val)
1096 return ret_val;
Bruce Allan75eb0fa2008-11-21 16:53:51 -08001097 ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
Auke Kokbc7f75f2007-09-17 12:30:59 -07001098 E1000_KMRNCTRLSTA_OFFSET_INB_CTRL,
1099 &reg_data);
1100 if (ret_val)
1101 return ret_val;
1102 reg_data |= E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING;
Bruce Allan75eb0fa2008-11-21 16:53:51 -08001103 ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
1104 E1000_KMRNCTRLSTA_OFFSET_INB_CTRL,
Bruce Allanad680762008-03-28 09:15:03 -07001105 reg_data);
Auke Kokbc7f75f2007-09-17 12:30:59 -07001106 if (ret_val)
1107 return ret_val;
1108
1109 ret_val = e1000_copper_link_setup_gg82563_80003es2lan(hw);
1110 if (ret_val)
1111 return ret_val;
1112
1113 ret_val = e1000e_setup_copper_link(hw);
1114
1115 return 0;
1116}
1117
1118/**
Bruce Allan75eb0fa2008-11-21 16:53:51 -08001119 * e1000_cfg_on_link_up_80003es2lan - es2 link configuration after link-up
1120 * @hw: pointer to the HW structure
1121 * @duplex: current duplex setting
1122 *
1123 * Configure the KMRN interface by applying last minute quirks for
1124 * 10/100 operation.
1125 **/
1126static s32 e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw)
1127{
1128 s32 ret_val = 0;
1129 u16 speed;
1130 u16 duplex;
1131
1132 if (hw->phy.media_type == e1000_media_type_copper) {
1133 ret_val = e1000e_get_speed_and_duplex_copper(hw, &speed,
1134 &duplex);
1135 if (ret_val)
1136 return ret_val;
1137
1138 if (speed == SPEED_1000)
1139 ret_val = e1000_cfg_kmrn_1000_80003es2lan(hw);
1140 else
1141 ret_val = e1000_cfg_kmrn_10_100_80003es2lan(hw, duplex);
1142 }
1143
1144 return ret_val;
1145}
1146
1147/**
Auke Kokbc7f75f2007-09-17 12:30:59 -07001148 * e1000_cfg_kmrn_10_100_80003es2lan - Apply "quirks" for 10/100 operation
1149 * @hw: pointer to the HW structure
1150 * @duplex: current duplex setting
1151 *
1152 * Configure the KMRN interface by applying last minute quirks for
1153 * 10/100 operation.
1154 **/
1155static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
1156{
1157 s32 ret_val;
1158 u32 tipg;
David Graham2d9498f2008-04-23 11:09:14 -07001159 u32 i = 0;
1160 u16 reg_data, reg_data2;
Auke Kokbc7f75f2007-09-17 12:30:59 -07001161
1162 reg_data = E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT;
Bruce Allan75eb0fa2008-11-21 16:53:51 -08001163 ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
1164 E1000_KMRNCTRLSTA_OFFSET_HD_CTRL,
1165 reg_data);
Auke Kokbc7f75f2007-09-17 12:30:59 -07001166 if (ret_val)
1167 return ret_val;
1168
1169 /* Configure Transmit Inter-Packet Gap */
1170 tipg = er32(TIPG);
1171 tipg &= ~E1000_TIPG_IPGT_MASK;
1172 tipg |= DEFAULT_TIPG_IPGT_10_100_80003ES2LAN;
1173 ew32(TIPG, tipg);
1174
David Graham2d9498f2008-04-23 11:09:14 -07001175 do {
1176 ret_val = e1e_rphy(hw, GG82563_PHY_KMRN_MODE_CTRL, &reg_data);
1177 if (ret_val)
1178 return ret_val;
1179
1180 ret_val = e1e_rphy(hw, GG82563_PHY_KMRN_MODE_CTRL, &reg_data2);
1181 if (ret_val)
1182 return ret_val;
1183 i++;
1184 } while ((reg_data != reg_data2) && (i < GG82563_MAX_KMRN_RETRY));
Auke Kokbc7f75f2007-09-17 12:30:59 -07001185
1186 if (duplex == HALF_DUPLEX)
1187 reg_data |= GG82563_KMCR_PASS_FALSE_CARRIER;
1188 else
1189 reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
1190
1191 ret_val = e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);
1192
1193 return 0;
1194}
1195
1196/**
1197 * e1000_cfg_kmrn_1000_80003es2lan - Apply "quirks" for gigabit operation
1198 * @hw: pointer to the HW structure
1199 *
1200 * Configure the KMRN interface by applying last minute quirks for
1201 * gigabit operation.
1202 **/
1203static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw)
1204{
1205 s32 ret_val;
David Graham2d9498f2008-04-23 11:09:14 -07001206 u16 reg_data, reg_data2;
Auke Kokbc7f75f2007-09-17 12:30:59 -07001207 u32 tipg;
David Graham2d9498f2008-04-23 11:09:14 -07001208 u32 i = 0;
Auke Kokbc7f75f2007-09-17 12:30:59 -07001209
1210 reg_data = E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT;
Bruce Allan75eb0fa2008-11-21 16:53:51 -08001211 ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
1212 E1000_KMRNCTRLSTA_OFFSET_HD_CTRL,
1213 reg_data);
Auke Kokbc7f75f2007-09-17 12:30:59 -07001214 if (ret_val)
1215 return ret_val;
1216
1217 /* Configure Transmit Inter-Packet Gap */
1218 tipg = er32(TIPG);
1219 tipg &= ~E1000_TIPG_IPGT_MASK;
1220 tipg |= DEFAULT_TIPG_IPGT_1000_80003ES2LAN;
1221 ew32(TIPG, tipg);
1222
David Graham2d9498f2008-04-23 11:09:14 -07001223 do {
1224 ret_val = e1e_rphy(hw, GG82563_PHY_KMRN_MODE_CTRL, &reg_data);
1225 if (ret_val)
1226 return ret_val;
1227
1228 ret_val = e1e_rphy(hw, GG82563_PHY_KMRN_MODE_CTRL, &reg_data2);
1229 if (ret_val)
1230 return ret_val;
1231 i++;
1232 } while ((reg_data != reg_data2) && (i < GG82563_MAX_KMRN_RETRY));
Auke Kokbc7f75f2007-09-17 12:30:59 -07001233
1234 reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
1235 ret_val = e1e_wphy(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);
1236
1237 return ret_val;
1238}
1239
1240/**
Bruce Allan75eb0fa2008-11-21 16:53:51 -08001241 * e1000_read_kmrn_reg_80003es2lan - Read kumeran register
1242 * @hw: pointer to the HW structure
1243 * @offset: register offset to be read
1244 * @data: pointer to the read data
1245 *
1246 * Acquire semaphore, then read the PHY register at offset
1247 * using the kumeran interface. The information retrieved is stored in data.
1248 * Release the semaphore before exiting.
1249 **/
Hannes Ederfa4c16d2008-12-22 09:16:13 +00001250static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
1251 u16 *data)
Bruce Allan75eb0fa2008-11-21 16:53:51 -08001252{
1253 u32 kmrnctrlsta;
1254 s32 ret_val = 0;
1255
1256 ret_val = e1000_acquire_mac_csr_80003es2lan(hw);
1257 if (ret_val)
1258 return ret_val;
1259
1260 kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
1261 E1000_KMRNCTRLSTA_OFFSET) | E1000_KMRNCTRLSTA_REN;
1262 ew32(KMRNCTRLSTA, kmrnctrlsta);
1263
1264 udelay(2);
1265
1266 kmrnctrlsta = er32(KMRNCTRLSTA);
1267 *data = (u16)kmrnctrlsta;
1268
1269 e1000_release_mac_csr_80003es2lan(hw);
1270
1271 return ret_val;
1272}
1273
1274/**
1275 * e1000_write_kmrn_reg_80003es2lan - Write kumeran register
1276 * @hw: pointer to the HW structure
1277 * @offset: register offset to write to
1278 * @data: data to write at register offset
1279 *
1280 * Acquire semaphore, then write the data to PHY register
1281 * at the offset using the kumeran interface. Release semaphore
1282 * before exiting.
1283 **/
Hannes Ederfa4c16d2008-12-22 09:16:13 +00001284static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
1285 u16 data)
Bruce Allan75eb0fa2008-11-21 16:53:51 -08001286{
1287 u32 kmrnctrlsta;
1288 s32 ret_val = 0;
1289
1290 ret_val = e1000_acquire_mac_csr_80003es2lan(hw);
1291 if (ret_val)
1292 return ret_val;
1293
1294 kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
1295 E1000_KMRNCTRLSTA_OFFSET) | data;
1296 ew32(KMRNCTRLSTA, kmrnctrlsta);
1297
1298 udelay(2);
1299
1300 e1000_release_mac_csr_80003es2lan(hw);
1301
1302 return ret_val;
1303}
1304
1305/**
Auke Kokbc7f75f2007-09-17 12:30:59 -07001306 * e1000_clear_hw_cntrs_80003es2lan - Clear device specific hardware counters
1307 * @hw: pointer to the HW structure
1308 *
1309 * Clears the hardware counters by reading the counter registers.
1310 **/
1311static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw)
1312{
Auke Kokbc7f75f2007-09-17 12:30:59 -07001313 e1000e_clear_hw_cntrs_base(hw);
1314
Bruce Allan99673d92009-11-20 23:27:21 +00001315 er32(PRC64);
1316 er32(PRC127);
1317 er32(PRC255);
1318 er32(PRC511);
1319 er32(PRC1023);
1320 er32(PRC1522);
1321 er32(PTC64);
1322 er32(PTC127);
1323 er32(PTC255);
1324 er32(PTC511);
1325 er32(PTC1023);
1326 er32(PTC1522);
Auke Kokbc7f75f2007-09-17 12:30:59 -07001327
Bruce Allan99673d92009-11-20 23:27:21 +00001328 er32(ALGNERRC);
1329 er32(RXERRC);
1330 er32(TNCRS);
1331 er32(CEXTERR);
1332 er32(TSCTC);
1333 er32(TSCTFC);
Auke Kokbc7f75f2007-09-17 12:30:59 -07001334
Bruce Allan99673d92009-11-20 23:27:21 +00001335 er32(MGTPRC);
1336 er32(MGTPDC);
1337 er32(MGTPTC);
Auke Kokbc7f75f2007-09-17 12:30:59 -07001338
Bruce Allan99673d92009-11-20 23:27:21 +00001339 er32(IAC);
1340 er32(ICRXOC);
Auke Kokbc7f75f2007-09-17 12:30:59 -07001341
Bruce Allan99673d92009-11-20 23:27:21 +00001342 er32(ICRXPTC);
1343 er32(ICRXATC);
1344 er32(ICTXPTC);
1345 er32(ICTXATC);
1346 er32(ICTXQEC);
1347 er32(ICTXQMTC);
1348 er32(ICRXDMTC);
Auke Kokbc7f75f2007-09-17 12:30:59 -07001349}
1350
1351static struct e1000_mac_operations es2_mac_ops = {
Bruce Allana4f58f52009-06-02 11:29:18 +00001352 .id_led_init = e1000e_id_led_init,
Bruce Allan4662e822008-08-26 18:37:06 -07001353 .check_mng_mode = e1000e_check_mng_mode_generic,
Auke Kokbc7f75f2007-09-17 12:30:59 -07001354 /* check_for_link dependent on media type */
1355 .cleanup_led = e1000e_cleanup_led_generic,
1356 .clear_hw_cntrs = e1000_clear_hw_cntrs_80003es2lan,
1357 .get_bus_info = e1000e_get_bus_info_pcie,
1358 .get_link_up_info = e1000_get_link_up_info_80003es2lan,
1359 .led_on = e1000e_led_on_generic,
1360 .led_off = e1000e_led_off_generic,
Jeff Kirshere2de3eb2008-03-28 09:15:11 -07001361 .update_mc_addr_list = e1000e_update_mc_addr_list_generic,
Bruce Allancaaddaf2009-12-01 15:46:43 +00001362 .write_vfta = e1000_write_vfta_generic,
1363 .clear_vfta = e1000_clear_vfta_generic,
Auke Kokbc7f75f2007-09-17 12:30:59 -07001364 .reset_hw = e1000_reset_hw_80003es2lan,
1365 .init_hw = e1000_init_hw_80003es2lan,
1366 .setup_link = e1000e_setup_link,
1367 /* setup_physical_interface dependent on media type */
Bruce Allana4f58f52009-06-02 11:29:18 +00001368 .setup_led = e1000e_setup_led_generic,
Auke Kokbc7f75f2007-09-17 12:30:59 -07001369};
1370
1371static struct e1000_phy_operations es2_phy_ops = {
Bruce Allan94d81862009-11-20 23:25:26 +00001372 .acquire = e1000_acquire_phy_80003es2lan,
Auke Kokbc7f75f2007-09-17 12:30:59 -07001373 .check_reset_block = e1000e_check_reset_block_generic,
Bruce Allan94d81862009-11-20 23:25:26 +00001374 .commit = e1000e_phy_sw_reset,
Auke Kokbc7f75f2007-09-17 12:30:59 -07001375 .force_speed_duplex = e1000_phy_force_speed_duplex_80003es2lan,
1376 .get_cfg_done = e1000_get_cfg_done_80003es2lan,
1377 .get_cable_length = e1000_get_cable_length_80003es2lan,
Bruce Allan94d81862009-11-20 23:25:26 +00001378 .get_info = e1000e_get_phy_info_m88,
1379 .read_reg = e1000_read_phy_reg_gg82563_80003es2lan,
1380 .release = e1000_release_phy_80003es2lan,
1381 .reset = e1000e_phy_hw_reset_generic,
Auke Kokbc7f75f2007-09-17 12:30:59 -07001382 .set_d0_lplu_state = NULL,
1383 .set_d3_lplu_state = e1000e_set_d3_lplu_state,
Bruce Allan94d81862009-11-20 23:25:26 +00001384 .write_reg = e1000_write_phy_reg_gg82563_80003es2lan,
Bruce Allan75eb0fa2008-11-21 16:53:51 -08001385 .cfg_on_link_up = e1000_cfg_on_link_up_80003es2lan,
Auke Kokbc7f75f2007-09-17 12:30:59 -07001386};
1387
1388static struct e1000_nvm_operations es2_nvm_ops = {
Bruce Allan94d81862009-11-20 23:25:26 +00001389 .acquire = e1000_acquire_nvm_80003es2lan,
1390 .read = e1000e_read_nvm_eerd,
1391 .release = e1000_release_nvm_80003es2lan,
1392 .update = e1000e_update_nvm_checksum_generic,
Auke Kokbc7f75f2007-09-17 12:30:59 -07001393 .valid_led_default = e1000e_valid_led_default,
Bruce Allan94d81862009-11-20 23:25:26 +00001394 .validate = e1000e_validate_nvm_checksum_generic,
1395 .write = e1000_write_nvm_80003es2lan,
Auke Kokbc7f75f2007-09-17 12:30:59 -07001396};
1397
1398struct e1000_info e1000_es2_info = {
1399 .mac = e1000_80003es2lan,
1400 .flags = FLAG_HAS_HW_VLAN_FILTER
1401 | FLAG_HAS_JUMBO_FRAMES
Auke Kokbc7f75f2007-09-17 12:30:59 -07001402 | FLAG_HAS_WOL
1403 | FLAG_APME_IN_CTRL3
1404 | FLAG_RX_CSUM_ENABLED
1405 | FLAG_HAS_CTRLEXT_ON_LOAD
Auke Kokbc7f75f2007-09-17 12:30:59 -07001406 | FLAG_RX_NEEDS_RESTART /* errata */
1407 | FLAG_TARC_SET_BIT_ZERO /* errata */
1408 | FLAG_APME_CHECK_PORT_B
1409 | FLAG_DISABLE_FC_PAUSE_TIME /* errata */
1410 | FLAG_TIPG_MEDIUM_FOR_80003ESLAN,
1411 .pba = 38,
Bruce Allan2adc55c2009-06-02 11:28:58 +00001412 .max_hw_frame_size = DEFAULT_JUMBO,
Jeff Kirsher69e3fd82008-04-02 13:48:18 -07001413 .get_variants = e1000_get_variants_80003es2lan,
Auke Kokbc7f75f2007-09-17 12:30:59 -07001414 .mac_ops = &es2_mac_ops,
1415 .phy_ops = &es2_phy_ops,
1416 .nvm_ops = &es2_nvm_ops,
1417};
1418