FreeBSD kernel E1000 device code
e1000_80003es2lan.c
Go to the documentation of this file.
1/******************************************************************************
2 SPDX-License-Identifier: BSD-3-Clause
3
4 Copyright (c) 2001-2020, Intel Corporation
5 All rights reserved.
6
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions are met:
9
10 1. Redistributions of source code must retain the above copyright notice,
11 this list of conditions and the following disclaimer.
12
13 2. Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in the
15 documentation and/or other materials provided with the distribution.
16
17 3. Neither the name of the Intel Corporation nor the names of its
18 contributors may be used to endorse or promote products derived from
19 this software without specific prior written permission.
20
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 POSSIBILITY OF SUCH DAMAGE.
32
33******************************************************************************/
34/*$FreeBSD$*/
35
36/* 80003ES2LAN Gigabit Ethernet Controller (Copper)
37 * 80003ES2LAN Gigabit Ethernet Controller (Serdes)
38 */
39
40#include "e1000_api.h"
41
43static void e1000_release_phy_80003es2lan(struct e1000_hw *hw);
45static void e1000_release_nvm_80003es2lan(struct e1000_hw *hw);
47 u32 offset,
48 u16 *data);
50 u32 offset,
51 u16 data);
52static s32 e1000_write_nvm_80003es2lan(struct e1000_hw *hw, u16 offset,
53 u16 words, u16 *data);
57static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed,
58 u16 *duplex);
59static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw);
60static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw);
62static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw);
63static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex);
66static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
67 u16 *data);
68static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
69 u16 data);
73
74/* A table for the GG82563 cable length where the range is defined
75 * with a lower bound at "index" and the upper bound at
76 * "index + 5".
77 */
79 0, 60, 115, 150, 150, 60, 115, 150, 180, 180, 0xFF };
80#define GG82563_CABLE_LENGTH_TABLE_SIZE \
81 (sizeof(e1000_gg82563_cable_length_table) / \
82 sizeof(e1000_gg82563_cable_length_table[0]))
83
89{
90 struct e1000_phy_info *phy = &hw->phy;
91 s32 ret_val;
92
93 DEBUGFUNC("e1000_init_phy_params_80003es2lan");
94
96 phy->type = e1000_phy_none;
97 return E1000_SUCCESS;
98 } else {
101 }
102
103 phy->addr = 1;
105 phy->reset_delay_us = 100;
106 phy->type = e1000_phy_gg82563;
107
117
122
124
125 /* This can only be done after all function pointers are setup. */
126 ret_val = e1000_get_phy_id(hw);
127
128 /* Verify phy id */
129 if (phy->id != GG82563_E_PHY_ID)
130 return -E1000_ERR_PHY;
131
132 return ret_val;
133}
134
140{
141 struct e1000_nvm_info *nvm = &hw->nvm;
142 u32 eecd = E1000_READ_REG(hw, E1000_EECD);
143 u16 size;
144
145 DEBUGFUNC("e1000_init_nvm_params_80003es2lan");
146
147 nvm->opcode_bits = 8;
148 nvm->delay_usec = 1;
149 switch (nvm->override) {
151 nvm->page_size = 32;
152 nvm->address_bits = 16;
153 break;
155 nvm->page_size = 8;
156 nvm->address_bits = 8;
157 break;
158 default:
159 nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8;
160 nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? 16 : 8;
161 break;
162 }
163
165
166 size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
168
169 /* Added to a constant, "size" becomes the left-shift value
170 * for setting word_size.
171 */
173
174 /* EEPROM access above 16k is unsupported */
175 if (size > 14)
176 size = 14;
177 nvm->word_size = 1 << size;
178
179 /* Function Pointers */
187
188 return E1000_SUCCESS;
189}
190
196{
197 struct e1000_mac_info *mac = &hw->mac;
198
199 DEBUGFUNC("e1000_init_mac_params_80003es2lan");
200
201 /* Set media type and media-dependent function pointers */
202 switch (hw->device_id) {
208 break;
209 default:
214 break;
215 }
216
217 /* Set mta register count */
218 mac->mta_reg_count = 128;
219 /* Set rar entry count */
221 /* Set if part includes ASF firmware */
222 mac->asf_firmware_present = true;
223 /* FWSM register */
224 mac->has_fwsm = true;
225 /* ARC supported; valid only if manageability features are enabled. */
228 /* Adaptive IFS not supported */
229 mac->adaptive_ifs = false;
230
231 /* Function pointers */
232
233 /* bus type/speed/width */
235 /* reset */
237 /* hw initialization */
239 /* link setup */
241 /* check management mode */
243 /* multicast address update */
245 /* writing VFTA */
247 /* clearing VFTA */
249 /* read mac address */
251 /* ID LED init */
253 /* blink LED */
255 /* setup LED */
257 /* cleanup LED */
259 /* turn on/off LED */
262 /* clear hardware counters */
264 /* link info */
266
267 /* set lan id for port to determine which phy lock to use */
268 hw->mac.ops.set_lan_id(hw);
269
270 return E1000_SUCCESS;
271}
272
280{
281 DEBUGFUNC("e1000_init_function_pointers_80003es2lan");
282
286}
287
295{
296 u16 mask;
297
298 DEBUGFUNC("e1000_acquire_phy_80003es2lan");
299
301 return e1000_acquire_swfw_sync(hw, mask);
302}
303
311{
312 u16 mask;
313
314 DEBUGFUNC("e1000_release_phy_80003es2lan");
315
317 e1000_release_swfw_sync(hw, mask);
318}
319
328{
329 u16 mask;
330
331 DEBUGFUNC("e1000_acquire_mac_csr_80003es2lan");
332
333 mask = E1000_SWFW_CSR_SM;
334
335 return e1000_acquire_swfw_sync(hw, mask);
336}
337
345{
346 u16 mask;
347
348 DEBUGFUNC("e1000_release_mac_csr_80003es2lan");
349
350 mask = E1000_SWFW_CSR_SM;
351
352 e1000_release_swfw_sync(hw, mask);
353}
354
362{
363 s32 ret_val;
364
365 DEBUGFUNC("e1000_acquire_nvm_80003es2lan");
366
368 if (ret_val)
369 return ret_val;
370
371 ret_val = e1000_acquire_nvm_generic(hw);
372
373 if (ret_val)
375
376 return ret_val;
377}
378
386{
387 DEBUGFUNC("e1000_release_nvm_80003es2lan");
388
391}
392
402 u32 offset, u16 *data)
403{
404 s32 ret_val;
405 u32 page_select;
406 u16 temp;
407
408 DEBUGFUNC("e1000_read_phy_reg_gg82563_80003es2lan");
409
410 ret_val = e1000_acquire_phy_80003es2lan(hw);
411 if (ret_val)
412 return ret_val;
413
414 /* Select Configuration Page */
415 if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) {
416 page_select = GG82563_PHY_PAGE_SELECT;
417 } else {
418 /* Use Alternative Page Select register to access
419 * registers 30 and 31
420 */
421 page_select = GG82563_PHY_PAGE_SELECT_ALT;
422 }
423
424 temp = (u16)((u16)offset >> GG82563_PAGE_SHIFT);
425 ret_val = e1000_write_phy_reg_mdic(hw, page_select, temp);
426 if (ret_val) {
428 return ret_val;
429 }
430
432 /* The "ready" bit in the MDIC register may be incorrectly set
433 * before the device has completed the "Page Select" MDI
434 * transaction. So we wait 200us after each MDI command...
435 */
436 usec_delay(200);
437
438 /* ...and verify the command was successful. */
439 ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp);
440
441 if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
443 return -E1000_ERR_PHY;
444 }
445
446 usec_delay(200);
447
448 ret_val = e1000_read_phy_reg_mdic(hw,
449 MAX_PHY_REG_ADDRESS & offset,
450 data);
451
452 usec_delay(200);
453 } else {
454 ret_val = e1000_read_phy_reg_mdic(hw,
455 MAX_PHY_REG_ADDRESS & offset,
456 data);
457 }
458
460
461 return ret_val;
462}
463
473 u32 offset, u16 data)
474{
475 s32 ret_val;
476 u32 page_select;
477 u16 temp;
478
479 DEBUGFUNC("e1000_write_phy_reg_gg82563_80003es2lan");
480
481 ret_val = e1000_acquire_phy_80003es2lan(hw);
482 if (ret_val)
483 return ret_val;
484
485 /* Select Configuration Page */
486 if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) {
487 page_select = GG82563_PHY_PAGE_SELECT;
488 } else {
489 /* Use Alternative Page Select register to access
490 * registers 30 and 31
491 */
492 page_select = GG82563_PHY_PAGE_SELECT_ALT;
493 }
494
495 temp = (u16)((u16)offset >> GG82563_PAGE_SHIFT);
496 ret_val = e1000_write_phy_reg_mdic(hw, page_select, temp);
497 if (ret_val) {
499 return ret_val;
500 }
501
503 /* The "ready" bit in the MDIC register may be incorrectly set
504 * before the device has completed the "Page Select" MDI
505 * transaction. So we wait 200us after each MDI command...
506 */
507 usec_delay(200);
508
509 /* ...and verify the command was successful. */
510 ret_val = e1000_read_phy_reg_mdic(hw, page_select, &temp);
511
512 if (((u16)offset >> GG82563_PAGE_SHIFT) != temp) {
514 return -E1000_ERR_PHY;
515 }
516
517 usec_delay(200);
518
519 ret_val = e1000_write_phy_reg_mdic(hw,
520 MAX_PHY_REG_ADDRESS & offset,
521 data);
522
523 usec_delay(200);
524 } else {
525 ret_val = e1000_write_phy_reg_mdic(hw,
526 MAX_PHY_REG_ADDRESS & offset,
527 data);
528 }
529
531
532 return ret_val;
533}
534
544static s32 e1000_write_nvm_80003es2lan(struct e1000_hw *hw, u16 offset,
545 u16 words, u16 *data)
546{
547 DEBUGFUNC("e1000_write_nvm_80003es2lan");
548
549 return e1000_write_nvm_spi(hw, offset, words, data);
550}
551
560{
561 s32 timeout = PHY_CFG_TIMEOUT;
563
564 DEBUGFUNC("e1000_get_cfg_done_80003es2lan");
565
566 if (hw->bus.func == 1)
568
569 while (timeout) {
570 if (E1000_READ_REG(hw, E1000_EEMNGCTL) & mask)
571 break;
572 msec_delay(1);
573 timeout--;
574 }
575 if (!timeout) {
576 DEBUGOUT("MNG configuration cycle has not completed.\n");
577 return -E1000_ERR_RESET;
578 }
579
580 return E1000_SUCCESS;
581}
582
591{
592 s32 ret_val;
593 u16 phy_data;
594 bool link;
595
596 DEBUGFUNC("e1000_phy_force_speed_duplex_80003es2lan");
597
598 if (!(hw->phy.ops.read_reg))
599 return E1000_SUCCESS;
600
601 /* Clear Auto-Crossover to force MDI manually. M88E1000 requires MDI
602 * forced whenever speed and duplex are forced.
603 */
604 ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
605 if (ret_val)
606 return ret_val;
607
608 phy_data &= ~GG82563_PSCR_CROSSOVER_MODE_AUTO;
609 ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_SPEC_CTRL, phy_data);
610 if (ret_val)
611 return ret_val;
612
613 DEBUGOUT1("GG82563 PSCR: %X\n", phy_data);
614
615 ret_val = hw->phy.ops.read_reg(hw, PHY_CONTROL, &phy_data);
616 if (ret_val)
617 return ret_val;
618
620
621 /* Reset the phy to commit changes. */
622 phy_data |= MII_CR_RESET;
623
624 ret_val = hw->phy.ops.write_reg(hw, PHY_CONTROL, phy_data);
625 if (ret_val)
626 return ret_val;
627
628 usec_delay(1);
629
631 DEBUGOUT("Waiting for forced speed/duplex link on GG82563 phy.\n");
632
634 100000, &link);
635 if (ret_val)
636 return ret_val;
637
638 if (!link) {
639 /* We didn't get link.
640 * Reset the DSP and cross our fingers.
641 */
642 ret_val = e1000_phy_reset_dsp_generic(hw);
643 if (ret_val)
644 return ret_val;
645 }
646
647 /* Try once more */
649 100000, &link);
650 if (ret_val)
651 return ret_val;
652 }
653
654 ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL,
655 &phy_data);
656 if (ret_val)
657 return ret_val;
658
659 /* Resetting the phy means we need to verify the TX_CLK corresponds
660 * to the link speed. 10Mbps -> 2.5MHz, else 25MHz.
661 */
662 phy_data &= ~GG82563_MSCR_TX_CLK_MASK;
665 else
667
668 /* In addition, we must re-enable CRS on Tx for both half and full
669 * duplex.
670 */
672 ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL,
673 phy_data);
674
675 return ret_val;
676}
677
686{
687 struct e1000_phy_info *phy = &hw->phy;
688 s32 ret_val;
689 u16 phy_data, index;
690
691 DEBUGFUNC("e1000_get_cable_length_80003es2lan");
692
693 if (!(hw->phy.ops.read_reg))
694 return E1000_SUCCESS;
695
696 ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_DSP_DISTANCE, &phy_data);
697 if (ret_val)
698 return ret_val;
699
700 index = phy_data & GG82563_DSPD_CABLE_LENGTH;
701
702 if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE - 5)
703 return -E1000_ERR_PHY;
704
707
708 phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2;
709
710 return E1000_SUCCESS;
711}
712
722 u16 *duplex)
723{
724 s32 ret_val;
725
726 DEBUGFUNC("e1000_get_link_up_info_80003es2lan");
727
730 duplex);
731 hw->phy.ops.cfg_on_link_up(hw);
732 } else {
734 speed,
735 duplex);
736 }
737
738 return ret_val;
739}
740
748{
749 u32 ctrl;
750 s32 ret_val;
751 u16 kum_reg_data;
752
753 DEBUGFUNC("e1000_reset_hw_80003es2lan");
754
755 /* Prevent the PCI-E bus from sticking if there is no TLP connection
756 * on the last TLP read/write transaction when MAC is reset.
757 */
759 if (ret_val)
760 DEBUGOUT("PCI-E Master disable polling has failed.\n");
761
762 DEBUGOUT("Masking off all interrupts\n");
763 E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
764
768
769 msec_delay(10);
770
771 ctrl = E1000_READ_REG(hw, E1000_CTRL);
772
773 ret_val = e1000_acquire_phy_80003es2lan(hw);
774 if (ret_val)
775 return ret_val;
776
777 DEBUGOUT("Issuing a global reset to MAC\n");
780
781 /* Disable IBIST slave mode (far-end loopback) */
783 E1000_KMRNCTRLSTA_INBAND_PARAM, &kum_reg_data);
784 if (!ret_val) {
785 kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
788 kum_reg_data);
789 if (ret_val)
790 DEBUGOUT("Error disabling far-end loopback\n");
791 } else
792 DEBUGOUT("Error disabling far-end loopback\n");
793
794 ret_val = e1000_get_auto_rd_done_generic(hw);
795 if (ret_val)
796 /* We don't want to continue accessing MAC registers. */
797 return ret_val;
798
799 /* Clear any pending interrupt events. */
800 E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
802
804}
805
813{
814 struct e1000_mac_info *mac = &hw->mac;
815 u32 reg_data;
816 s32 ret_val;
817 u16 kum_reg_data;
818 u16 i;
819
820 DEBUGFUNC("e1000_init_hw_80003es2lan");
821
823
824 /* Initialize identification LED */
825 ret_val = mac->ops.id_led_init(hw);
826 /* An error is not fatal and we should not stop init due to this */
827 if (ret_val)
828 DEBUGOUT("Error initializing identification LED\n");
829
830 /* Disabling VLAN filtering */
831 DEBUGOUT("Initializing the IEEE VLAN\n");
832 mac->ops.clear_vfta(hw);
833
834 /* Setup the receive address. */
836
837 /* Zero out the Multicast HASH table */
838 DEBUGOUT("Zeroing the MTA\n");
839 for (i = 0; i < mac->mta_reg_count; i++)
841
842 /* Setup link and flow control */
843 ret_val = mac->ops.setup_link(hw);
844 if (ret_val)
845 return ret_val;
846
847 /* Disable IBIST slave mode (far-end loopback) */
848 ret_val =
850 &kum_reg_data);
851 if (!ret_val) {
852 kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
855 kum_reg_data);
856 if (ret_val)
857 DEBUGOUT("Error disabling far-end loopback\n");
858 } else
859 DEBUGOUT("Error disabling far-end loopback\n");
860
861 /* Set the transmit descriptor write-back policy */
862 reg_data = E1000_READ_REG(hw, E1000_TXDCTL(0));
863 reg_data = ((reg_data & ~E1000_TXDCTL_WTHRESH) |
865 E1000_WRITE_REG(hw, E1000_TXDCTL(0), reg_data);
866
867 /* ...for both queues. */
868 reg_data = E1000_READ_REG(hw, E1000_TXDCTL(1));
869 reg_data = ((reg_data & ~E1000_TXDCTL_WTHRESH) |
871 E1000_WRITE_REG(hw, E1000_TXDCTL(1), reg_data);
872
873 /* Enable retransmit on late collisions */
874 reg_data = E1000_READ_REG(hw, E1000_TCTL);
875 reg_data |= E1000_TCTL_RTLC;
876 E1000_WRITE_REG(hw, E1000_TCTL, reg_data);
877
878 /* Configure Gigabit Carry Extend Padding */
879 reg_data = E1000_READ_REG(hw, E1000_TCTL_EXT);
880 reg_data &= ~E1000_TCTL_EXT_GCEX_MASK;
882 E1000_WRITE_REG(hw, E1000_TCTL_EXT, reg_data);
883
884 /* Configure Transmit Inter-Packet Gap */
885 reg_data = E1000_READ_REG(hw, E1000_TIPG);
886 reg_data &= ~E1000_TIPG_IPGT_MASK;
888 E1000_WRITE_REG(hw, E1000_TIPG, reg_data);
889
890 reg_data = E1000_READ_REG_ARRAY(hw, E1000_FFLT, 0x0001);
891 reg_data &= ~0x00100000;
892 E1000_WRITE_REG_ARRAY(hw, E1000_FFLT, 0x0001, reg_data);
893
894 /* default to true to enable the MDIC W/A */
896
897 ret_val =
900 if (!ret_val) {
904 }
905
906 /* Clear all of the statistics registers (clear on read). It is
907 * important that we do this after we have tried to establish link
908 * because the symbol error count will increment wildly if there
909 * is no link.
910 */
912
913 return ret_val;
914}
915
923{
924 u32 reg;
925
926 DEBUGFUNC("e1000_initialize_hw_bits_80003es2lan");
927
928 /* Transmit Descriptor Control 0 */
929 reg = E1000_READ_REG(hw, E1000_TXDCTL(0));
930 reg |= (1 << 22);
931 E1000_WRITE_REG(hw, E1000_TXDCTL(0), reg);
932
933 /* Transmit Descriptor Control 1 */
934 reg = E1000_READ_REG(hw, E1000_TXDCTL(1));
935 reg |= (1 << 22);
936 E1000_WRITE_REG(hw, E1000_TXDCTL(1), reg);
937
938 /* Transmit Arbitration Control 0 */
939 reg = E1000_READ_REG(hw, E1000_TARC(0));
940 reg &= ~(0xF << 27); /* 30:27 */
942 reg &= ~(1 << 20);
943 E1000_WRITE_REG(hw, E1000_TARC(0), reg);
944
945 /* Transmit Arbitration Control 1 */
946 reg = E1000_READ_REG(hw, E1000_TARC(1));
948 reg &= ~(1 << 28);
949 else
950 reg |= (1 << 28);
951 E1000_WRITE_REG(hw, E1000_TARC(1), reg);
952
953 /* Disable IPv6 extension header parsing because some malformed
954 * IPv6 headers can hang the Rx.
955 */
956 reg = E1000_READ_REG(hw, E1000_RFCTL);
959
960 return;
961}
962
970{
971 struct e1000_phy_info *phy = &hw->phy;
972 s32 ret_val;
973 u32 reg;
974 u16 data;
975
976 DEBUGFUNC("e1000_copper_link_setup_gg82563_80003es2lan");
977
978 ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, &data);
979 if (ret_val)
980 return ret_val;
981
983 /* Use 25MHz for both link down and 1000Base-T for Tx clock. */
985
986 ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_MAC_SPEC_CTRL, data);
987 if (ret_val)
988 return ret_val;
989
990 /* Options:
991 * MDI/MDI-X = 0 (default)
992 * 0 - Auto for all speeds
993 * 1 - MDI mode
994 * 2 - MDI-X mode
995 * 3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes)
996 */
997 ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_SPEC_CTRL, &data);
998 if (ret_val)
999 return ret_val;
1000
1001 data &= ~GG82563_PSCR_CROSSOVER_MODE_MASK;
1002
1003 switch (phy->mdix) {
1004 case 1:
1006 break;
1007 case 2:
1009 break;
1010 case 0:
1011 default:
1013 break;
1014 }
1015
1016 /* Options:
1017 * disable_polarity_correction = 0 (default)
1018 * Automatic Correction for Reversed Cable Polarity
1019 * 0 - Disabled
1020 * 1 - Enabled
1021 */
1022 data &= ~GG82563_PSCR_POLARITY_REVERSAL_DISABLE;
1025
1026 ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_SPEC_CTRL, data);
1027 if (ret_val)
1028 return ret_val;
1029
1030 /* SW Reset the PHY so all changes take effect */
1031 ret_val = hw->phy.ops.commit(hw);
1032 if (ret_val) {
1033 DEBUGOUT("Error Resetting the PHY\n");
1034 return ret_val;
1035 }
1036
1037 /* Bypass Rx and Tx FIFO's */
1041 ret_val = e1000_write_kmrn_reg_80003es2lan(hw, reg, data);
1042 if (ret_val)
1043 return ret_val;
1044
1046 ret_val = e1000_read_kmrn_reg_80003es2lan(hw, reg, &data);
1047 if (ret_val)
1048 return ret_val;
1050 ret_val = e1000_write_kmrn_reg_80003es2lan(hw, reg, data);
1051 if (ret_val)
1052 return ret_val;
1053
1054 ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_SPEC_CTRL_2, &data);
1055 if (ret_val)
1056 return ret_val;
1057
1058 data &= ~GG82563_PSCR2_REVERSE_AUTO_NEG;
1059 ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_SPEC_CTRL_2, data);
1060 if (ret_val)
1061 return ret_val;
1062
1063 reg = E1000_READ_REG(hw, E1000_CTRL_EXT);
1064 reg &= ~E1000_CTRL_EXT_LINK_MODE_MASK;
1066
1067 ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_PWR_MGMT_CTRL, &data);
1068 if (ret_val)
1069 return ret_val;
1070
1071 /* Do not init these registers when the HW is in IAMT mode, since the
1072 * firmware will have already initialized them. We only initialize
1073 * them if the HW is not in IAMT mode.
1074 */
1075 if (!hw->mac.ops.check_mng_mode(hw)) {
1076 /* Enable Electrical Idle on the PHY */
1078 ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_PWR_MGMT_CTRL,
1079 data);
1080 if (ret_val)
1081 return ret_val;
1082
1083 ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
1084 &data);
1085 if (ret_val)
1086 return ret_val;
1087
1088 data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
1089 ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
1090 data);
1091 if (ret_val)
1092 return ret_val;
1093 }
1094
1095 /* Workaround: Disable padding in Kumeran interface in the MAC
1096 * and in the PHY to avoid CRC errors.
1097 */
1098 ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_INBAND_CTRL, &data);
1099 if (ret_val)
1100 return ret_val;
1101
1103 ret_val = hw->phy.ops.write_reg(hw, GG82563_PHY_INBAND_CTRL, data);
1104 if (ret_val)
1105 return ret_val;
1106
1107 return E1000_SUCCESS;
1108}
1109
1118{
1119 u32 ctrl;
1120 s32 ret_val;
1121 u16 reg_data;
1122
1123 DEBUGFUNC("e1000_setup_copper_link_80003es2lan");
1124
1125 ctrl = E1000_READ_REG(hw, E1000_CTRL);
1126 ctrl |= E1000_CTRL_SLU;
1128 E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
1129
1130 /* Set the mac to wait the maximum time between each
1131 * iteration and increase the max iterations when
1132 * polling the phy; this fixes erroneous timeouts at 10Mbps.
1133 */
1134 ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 4),
1135 0xFFFF);
1136 if (ret_val)
1137 return ret_val;
1138 ret_val = e1000_read_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9),
1139 &reg_data);
1140 if (ret_val)
1141 return ret_val;
1142 reg_data |= 0x3F;
1143 ret_val = e1000_write_kmrn_reg_80003es2lan(hw, GG82563_REG(0x34, 9),
1144 reg_data);
1145 if (ret_val)
1146 return ret_val;
1147 ret_val =
1150 &reg_data);
1151 if (ret_val)
1152 return ret_val;
1154 ret_val =
1157 reg_data);
1158 if (ret_val)
1159 return ret_val;
1160
1162 if (ret_val)
1163 return ret_val;
1164
1166}
1167
1176{
1177 s32 ret_val = E1000_SUCCESS;
1178 u16 speed;
1179 u16 duplex;
1180
1181 DEBUGFUNC("e1000_configure_on_link_up");
1182
1184 ret_val = e1000_get_speed_and_duplex_copper_generic(hw, &speed,
1185 &duplex);
1186 if (ret_val)
1187 return ret_val;
1188
1189 if (speed == SPEED_1000)
1190 ret_val = e1000_cfg_kmrn_1000_80003es2lan(hw);
1191 else
1192 ret_val = e1000_cfg_kmrn_10_100_80003es2lan(hw, duplex);
1193 }
1194
1195 return ret_val;
1196}
1197
1207{
1208 s32 ret_val;
1209 u32 tipg;
1210 u32 i = 0;
1211 u16 reg_data, reg_data2;
1212
1213 DEBUGFUNC("e1000_configure_kmrn_for_10_100");
1214
1216 ret_val =
1219 reg_data);
1220 if (ret_val)
1221 return ret_val;
1222
1223 /* Configure Transmit Inter-Packet Gap */
1224 tipg = E1000_READ_REG(hw, E1000_TIPG);
1225 tipg &= ~E1000_TIPG_IPGT_MASK;
1227 E1000_WRITE_REG(hw, E1000_TIPG, tipg);
1228
1229 do {
1230 ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
1231 &reg_data);
1232 if (ret_val)
1233 return ret_val;
1234
1235 ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
1236 &reg_data2);
1237 if (ret_val)
1238 return ret_val;
1239 i++;
1240 } while ((reg_data != reg_data2) && (i < GG82563_MAX_KMRN_RETRY));
1241
1242 if (duplex == HALF_DUPLEX)
1244 else
1245 reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
1246
1247 return hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);
1248}
1249
1258{
1259 s32 ret_val;
1260 u16 reg_data, reg_data2;
1261 u32 tipg;
1262 u32 i = 0;
1263
1264 DEBUGFUNC("e1000_configure_kmrn_for_1000");
1265
1267 ret_val =
1270 reg_data);
1271 if (ret_val)
1272 return ret_val;
1273
1274 /* Configure Transmit Inter-Packet Gap */
1275 tipg = E1000_READ_REG(hw, E1000_TIPG);
1276 tipg &= ~E1000_TIPG_IPGT_MASK;
1278 E1000_WRITE_REG(hw, E1000_TIPG, tipg);
1279
1280 do {
1281 ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
1282 &reg_data);
1283 if (ret_val)
1284 return ret_val;
1285
1286 ret_val = hw->phy.ops.read_reg(hw, GG82563_PHY_KMRN_MODE_CTRL,
1287 &reg_data2);
1288 if (ret_val)
1289 return ret_val;
1290 i++;
1291 } while ((reg_data != reg_data2) && (i < GG82563_MAX_KMRN_RETRY));
1292
1293 reg_data &= ~GG82563_KMCR_PASS_FALSE_CARRIER;
1294
1295 return hw->phy.ops.write_reg(hw, GG82563_PHY_KMRN_MODE_CTRL, reg_data);
1296}
1297
1309 u16 *data)
1310{
1311 u32 kmrnctrlsta;
1312 s32 ret_val;
1313
1314 DEBUGFUNC("e1000_read_kmrn_reg_80003es2lan");
1315
1317 if (ret_val)
1318 return ret_val;
1319
1320 kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
1322 E1000_WRITE_REG(hw, E1000_KMRNCTRLSTA, kmrnctrlsta);
1324
1325 usec_delay(2);
1326
1327 kmrnctrlsta = E1000_READ_REG(hw, E1000_KMRNCTRLSTA);
1328 *data = (u16)kmrnctrlsta;
1329
1331
1332 return ret_val;
1333}
1334
1346 u16 data)
1347{
1348 u32 kmrnctrlsta;
1349 s32 ret_val;
1350
1351 DEBUGFUNC("e1000_write_kmrn_reg_80003es2lan");
1352
1354 if (ret_val)
1355 return ret_val;
1356
1357 kmrnctrlsta = ((offset << E1000_KMRNCTRLSTA_OFFSET_SHIFT) &
1359 E1000_WRITE_REG(hw, E1000_KMRNCTRLSTA, kmrnctrlsta);
1361
1362 usec_delay(2);
1363
1365
1366 return ret_val;
1367}
1368
1374{
1375 s32 ret_val;
1376
1377 DEBUGFUNC("e1000_read_mac_addr_80003es2lan");
1378
1379 /* If there's an alternate MAC address place it in RAR0
1380 * so that it will override the Si installed default perm
1381 * address.
1382 */
1384 if (ret_val)
1385 return ret_val;
1386
1387 return e1000_read_mac_addr_generic(hw);
1388}
1389
1398{
1399 /* If the management interface is not enabled, then power down */
1400 if (!(hw->mac.ops.check_mng_mode(hw) ||
1401 hw->phy.ops.check_reset_block(hw)))
1403
1404 return;
1405}
1406
1414{
1415 DEBUGFUNC("e1000_clear_hw_cntrs_80003es2lan");
1416
1418
1431
1438
1442
1445
1453}
static const u16 e1000_gg82563_cable_length_table[]
static s32 e1000_get_cable_length_80003es2lan(struct e1000_hw *hw)
static s32 e1000_read_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, u16 *data)
static void e1000_power_down_phy_copper_80003es2lan(struct e1000_hw *hw)
static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw)
static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw, u32 offset, u16 *data)
static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw, u32 offset, u16 data)
static s32 e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw)
static s32 e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex)
static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw)
static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
static s32 e1000_acquire_nvm_80003es2lan(struct e1000_hw *hw)
static s32 e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw)
#define GG82563_CABLE_LENGTH_TABLE_SIZE
static s32 e1000_init_phy_params_80003es2lan(struct e1000_hw *hw)
static void e1000_release_phy_80003es2lan(struct e1000_hw *hw)
static s32 e1000_get_cfg_done_80003es2lan(struct e1000_hw *hw)
static s32 e1000_acquire_phy_80003es2lan(struct e1000_hw *hw)
static s32 e1000_write_nvm_80003es2lan(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
static s32 e1000_acquire_mac_csr_80003es2lan(struct e1000_hw *hw)
static s32 e1000_init_mac_params_80003es2lan(struct e1000_hw *hw)
static s32 e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw)
static void e1000_release_mac_csr_80003es2lan(struct e1000_hw *hw)
static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
static void e1000_release_nvm_80003es2lan(struct e1000_hw *hw)
static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
void e1000_init_function_pointers_80003es2lan(struct e1000_hw *hw)
static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
static s32 e1000_get_link_up_info_80003es2lan(struct e1000_hw *hw, u16 *speed, u16 *duplex)
static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
static s32 e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset, u16 data)
#define DEFAULT_TCTL_EXT_GCEX_80003ES2LAN
#define GG82563_KMCR_PASS_FALSE_CARRIER
#define GG82563_DSPD_CABLE_LENGTH
#define DEFAULT_TIPG_IPGT_1000_80003ES2LAN
#define E1000_KMRNCTRLSTA_HD_CTRL_1000_DEFAULT
#define GG82563_PSCR_CROSSOVER_MODE_MDI
#define GG82563_PSCR_CROSSOVER_MODE_AUTO
#define E1000_KMRNCTRLSTA_INB_CTRL_DIS_PADDING
#define GG82563_MSCR_TX_CLK_10MBPS_2_5
#define GG82563_MAX_KMRN_RETRY
#define GG82563_PMCR_ENABLE_ELECTRICAL_IDLE
#define GG82563_MSCR_TX_CLK_1000MBPS_25
#define E1000_KMRNCTRLSTA_HD_CTRL_10_100_DEFAULT
#define E1000_KMRNCTRLSTA_OPMODE_E_IDLE
#define E1000_KMRNCTRLSTA_FIFO_CTRL_TX_BYPASS
#define E1000_KMRNCTRLSTA_OPMODE_MASK
#define E1000_KMRNCTRLSTA_OPMODE_INBAND_MDIO
#define E1000_KMRNCTRLSTA_FIFO_CTRL_RX_BYPASS
#define E1000_KMRNCTRLSTA_OFFSET_MAC2PHY_OPMODE
#define GG82563_PSCR_CROSSOVER_MODE_MDIX
#define E1000_KMRNCTRLSTA_OFFSET_HD_CTRL
#define E1000_KMRNCTRLSTA_OFFSET_FIFO_CTRL
#define GG82563_ICR_DIS_PADDING
#define GG82563_MSCR_TX_CLK_100MBPS_25
#define GG82563_MSCR_ASSERT_CRS_ON_TX
#define DEFAULT_TIPG_IPGT_10_100_80003ES2LAN
#define GG82563_PSCR_POLARITY_REVERSAL_DISABLE
#define E1000_KMRNCTRLSTA_OFFSET_INB_CTRL
#define E1000_ERR_PHY
#define GG82563_PHY_SPEC_CTRL_2
#define E1000_TCTL_RTLC
#define GG82563_PHY_DSP_DISTANCE
#define PHY_FORCE_LIMIT
#define GG82563_PHY_KMRN_MODE_CTRL
#define GG82563_PHY_INBAND_CTRL
#define E1000_TCTL_MULR
#define M88E1000_PHY_SPEC_CTRL
#define E1000_CTRL_FRCSPD
#define PHY_CONTROL
#define NVM_WORD_SIZE_BASE_SHIFT
#define E1000_SWFW_PHY1_SM
#define MAX_PHY_REG_ADDRESS
#define SPEED_1000
#define GG82563_PHY_PAGE_SELECT_ALT
#define E1000_TCTL_PSP
#define E1000_ERR_RESET
#define GG82563_E_PHY_ID
#define GG82563_PHY_MAC_SPEC_CTRL
#define HALF_DUPLEX
#define E1000_CTRL_SLU
#define E1000_ALL_10_SPEED
#define MII_CR_RESET
#define E1000_EECD_SIZE_EX_SHIFT
#define E1000_EECD_SIZE_EX_MASK
#define E1000_SWFW_PHY0_SM
#define E1000_TXDCTL_COUNT_DESC
#define GG82563_PAGE_SHIFT
#define PHY_CFG_TIMEOUT
#define E1000_CTRL_RST
#define AUTONEG_ADVERTISE_SPEED_DEFAULT
#define E1000_SWFW_CSR_SM
#define GG82563_MIN_ALT_REG
#define E1000_NVM_CFG_DONE_PORT_0
#define E1000_SWFW_EEP_SM
#define E1000_EECD_ADDR_BITS
#define E1000_NVM_CFG_DONE_PORT_1
#define GG82563_PHY_PWR_MGMT_CTRL
#define E1000_RAR_ENTRIES
#define GG82563_REG(page, reg)
#define E1000_CTRL_FRCDPX
#define GG82563_PHY_PAGE_SELECT
#define E1000_SUCCESS
#define E1000_RFCTL_NEW_IPV6_EXT_DIS
#define E1000_TXDCTL_FULL_TX_DESC_WB
#define E1000_RFCTL_IPV6_EX_DIS
#define GG82563_PHY_SPEC_CTRL
@ e1000_phy_none
Definition: e1000_hw.h:309
@ e1000_phy_gg82563
Definition: e1000_hw.h:313
@ e1000_nvm_override_spi_large
Definition: e1000_hw.h:302
@ e1000_nvm_override_spi_small
Definition: e1000_hw.h:301
#define E1000_DEV_ID_80003ES2LAN_SERDES_DPT
Definition: e1000_hw.h:101
@ e1000_media_type_internal_serdes
Definition: e1000_hw.h:285
@ e1000_media_type_copper
Definition: e1000_hw.h:283
@ e1000_nvm_eeprom_spi
Definition: e1000_hw.h:292
s32 e1000_get_bus_info_pcie_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:240
s32 e1000_valid_led_default_generic(struct e1000_hw *hw, u16 *data)
Definition: e1000_mac.c:1752
s32 e1000_check_for_copper_link_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:717
s32 e1000_id_led_init_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:1775
s32 e1000_acquire_swfw_sync(struct e1000_hw *hw, u16 mask)
Definition: e1000_mac.c:2301
s32 e1000_led_on_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:1936
s32 e1000_disable_pcie_master_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:2023
s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:408
s32 e1000_setup_link_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:1010
void e1000_clear_hw_cntrs_base_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:666
void e1000_release_swfw_sync(struct e1000_hw *hw, u16 mask)
Definition: e1000_mac.c:2354
s32 e1000_cleanup_led_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:1875
s32 e1000_led_off_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:1965
void e1000_update_mc_addr_list_generic(struct e1000_hw *hw, u8 *mc_addr_list, u32 mc_addr_count)
Definition: e1000_mac.c:595
s32 e1000_blink_led_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:1889
s32 e1000_setup_fiber_serdes_link_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:1184
void e1000_clear_vfta_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:340
s32 e1000_get_speed_and_duplex_copper_generic(struct e1000_hw *hw, u16 *speed, u16 *duplex)
Definition: e1000_mac.c:1667
void e1000_init_rx_addrs_generic(struct e1000_hw *hw, u16 rar_count)
Definition: e1000_mac.c:378
void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value)
Definition: e1000_mac.c:361
s32 e1000_get_speed_and_duplex_fiber_serdes_generic(struct e1000_hw E1000_UNUSEDARG *hw, u16 *speed, u16 *duplex)
Definition: e1000_mac.c:1706
s32 e1000_check_for_serdes_link_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:849
s32 e1000_setup_led_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:1843
s32 e1000_get_auto_rd_done_generic(struct e1000_hw *hw)
Definition: e1000_mac.c:1723
bool e1000_check_mng_mode_generic(struct e1000_hw *hw)
Definition: e1000_manage.c:114
#define E1000_FWSM_MODE_MASK
Definition: e1000_manage.h:63
s32 e1000_update_nvm_checksum_generic(struct e1000_hw *hw)
Definition: e1000_nvm.c:1235
s32 e1000_read_mac_addr_generic(struct e1000_hw *hw)
Definition: e1000_nvm.c:1174
s32 e1000_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
Definition: e1000_nvm.c:611
s32 e1000_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
Definition: e1000_nvm.c:563
void e1000_release_nvm_generic(struct e1000_hw *hw)
Definition: e1000_nvm.c:370
s32 e1000_acquire_nvm_generic(struct e1000_hw *hw)
Definition: e1000_nvm.c:269
s32 e1000_validate_nvm_checksum_generic(struct e1000_hw *hw)
Definition: e1000_nvm.c:1202
#define DEBUGOUT1(...)
Definition: e1000_osdep.h:111
#define msec_delay(x)
Definition: e1000_osdep.h:103
#define usec_delay(x)
Definition: e1000_osdep.h:101
#define E1000_WRITE_REG_ARRAY(hw, reg, index, value)
Definition: e1000_osdep.h:206
#define E1000_READ_REG_ARRAY(hw, reg, index)
Definition: e1000_osdep.h:201
#define DEBUGFUNC(F)
Definition: e1000_osdep.h:115
#define E1000_WRITE_FLUSH(a)
Definition: e1000_osdep.h:177
#define E1000_WRITE_REG(hw, reg, value)
Definition: e1000_osdep.h:196
uint16_t u16
Definition: e1000_osdep.h:123
#define DEBUGOUT(...)
Definition: e1000_osdep.h:109
#define E1000_READ_REG(hw, reg)
Definition: e1000_osdep.h:191
int32_t s32
Definition: e1000_osdep.h:126
uint32_t u32
Definition: e1000_osdep.h:122
s32 e1000_check_reset_block_generic(struct e1000_hw *hw)
Definition: e1000_phy.c:206
void e1000_phy_force_speed_duplex_setup(struct e1000_hw *hw, u16 *phy_ctrl)
Definition: e1000_phy.c:2025
s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations, u32 usec_interval, bool *success)
Definition: e1000_phy.c:2360
s32 e1000_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data)
Definition: e1000_phy.c:291
s32 e1000_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data)
Definition: e1000_phy.c:356
s32 e1000_get_phy_id(struct e1000_hw *hw)
Definition: e1000_phy.c:225
void e1000_power_down_phy_copper(struct e1000_hw *hw)
Definition: e1000_phy.c:3522
s32 e1000_get_phy_info_m88(struct e1000_hw *hw)
Definition: e1000_phy.c:2637
void e1000_power_up_phy_copper(struct e1000_hw *hw)
Definition: e1000_phy.c:3504
s32 e1000_phy_sw_reset_generic(struct e1000_hw *hw)
Definition: e1000_phy.c:2829
s32 e1000_phy_reset_dsp_generic(struct e1000_hw *hw)
Definition: e1000_phy.c:266
s32 e1000_check_polarity_m88(struct e1000_hw *hw)
Definition: e1000_phy.c:2217
s32 e1000_phy_hw_reset_generic(struct e1000_hw *hw)
Definition: e1000_phy.c:2862
s32 e1000_set_d3_lplu_state_generic(struct e1000_hw *hw, bool active)
Definition: e1000_phy.c:2088
s32 e1000_setup_copper_link_generic(struct e1000_hw *hw)
Definition: e1000_phy.c:1699
#define E1000_KMRNCTRLSTA_REN
Definition: e1000_phy.h:274
#define E1000_KMRNCTRLSTA_INBAND_PARAM
Definition: e1000_phy.h:278
#define E1000_KMRNCTRLSTA_OFFSET_SHIFT
Definition: e1000_phy.h:273
#define E1000_KMRNCTRLSTA_IBIST_DISABLE
Definition: e1000_phy.h:279
#define E1000_KMRNCTRLSTA_OFFSET
Definition: e1000_phy.h:272
#define E1000_TCTL_EXT
Definition: e1000_regs.h:105
#define E1000_RXERRC
Definition: e1000_regs.h:329
#define E1000_PTC1522
Definition: e1000_regs.h:379
#define E1000_PTC255
Definition: e1000_regs.h:376
#define E1000_ICTXQMTC
Definition: e1000_regs.h:391
#define E1000_PTC127
Definition: e1000_regs.h:375
#define E1000_PTC511
Definition: e1000_regs.h:377
#define E1000_PRC255
Definition: e1000_regs.h:348
#define E1000_ICRXDMTC
Definition: e1000_regs.h:392
#define E1000_PRC127
Definition: e1000_regs.h:347
#define E1000_PRC64
Definition: e1000_regs.h:346
#define E1000_ICRXPTC
Definition: e1000_regs.h:386
#define E1000_EEMNGCTL
Definition: e1000_regs.h:119
#define E1000_ICTXATC
Definition: e1000_regs.h:389
#define E1000_FFLT
Definition: e1000_regs.h:517
#define E1000_TNCRS
Definition: e1000_regs.h:337
#define E1000_RCTL
Definition: e1000_regs.h:89
#define E1000_ICTXQEC
Definition: e1000_regs.h:390
#define E1000_TCTL
Definition: e1000_regs.h:104
#define E1000_ICRXOC
Definition: e1000_regs.h:393
#define E1000_FWSM
Definition: e1000_regs.h:545
#define E1000_ALGNERRC
Definition: e1000_regs.h:327
#define E1000_TXDCTL(_n)
Definition: e1000_regs.h:278
#define E1000_MGTPRC
Definition: e1000_regs.h:365
#define E1000_ICRXATC
Definition: e1000_regs.h:387
#define E1000_PTC1023
Definition: e1000_regs.h:378
#define E1000_MGTPTC
Definition: e1000_regs.h:367
#define E1000_CTRL
Definition: e1000_regs.h:39
#define E1000_TIPG
Definition: e1000_regs.h:106
#define E1000_PRC1522
Definition: e1000_regs.h:351
#define E1000_IMC
Definition: e1000_regs.h:83
#define E1000_KMRNCTRLSTA
Definition: e1000_regs.h:526
#define E1000_ICTXPTC
Definition: e1000_regs.h:388
#define E1000_TARC(_n)
Definition: e1000_regs.h:284
#define E1000_PRC1023
Definition: e1000_regs.h:350
#define E1000_PRC511
Definition: e1000_regs.h:349
#define E1000_TSCTFC
Definition: e1000_regs.h:383
#define E1000_CEXTERR
Definition: e1000_regs.h:339
#define E1000_MTA
Definition: e1000_regs.h:496
#define E1000_ICR
Definition: e1000_regs.h:79
#define E1000_PTC64
Definition: e1000_regs.h:374
#define E1000_EECD
Definition: e1000_regs.h:42
#define E1000_IAC
Definition: e1000_regs.h:384
#define E1000_MGTPDC
Definition: e1000_regs.h:366
#define E1000_TSCTC
Definition: e1000_regs.h:382
#define E1000_CTRL_EXT
Definition: e1000_regs.h:44
#define E1000_RFCTL
Definition: e1000_regs.h:495
union e1000_hw::@46 dev_spec
struct e1000_dev_spec_80003es2lan _80003es2lan
Definition: e1000_hw.h:1041
struct e1000_bus_info bus
Definition: e1000_hw.h:1032
struct e1000_mac_info mac
Definition: e1000_hw.h:1028
struct e1000_nvm_info nvm
Definition: e1000_hw.h:1031
u16 device_id
Definition: e1000_hw.h:1047
struct e1000_phy_info phy
Definition: e1000_hw.h:1030
u8 forced_speed_duplex
Definition: e1000_hw.h:838
bool adaptive_ifs
Definition: e1000_hw.h:840
bool arc_subsystem_valid
Definition: e1000_hw.h:842
bool asf_firmware_present
Definition: e1000_hw.h:843
u16 mta_reg_count
Definition: e1000_hw.h:830
u16 rar_entry_count
Definition: e1000_hw.h:836
struct e1000_mac_operations ops
Definition: e1000_hw.h:811
s32(* setup_led)(struct e1000_hw *)
Definition: e1000_hw.h:744
s32(* id_led_init)(struct e1000_hw *)
Definition: e1000_hw.h:725
s32(* get_link_up_info)(struct e1000_hw *, u16 *, u16 *)
Definition: e1000_hw.h:734
s32(* setup_physical_interface)(struct e1000_hw *)
Definition: e1000_hw.h:743
s32(* check_for_link)(struct e1000_hw *)
Definition: e1000_hw.h:728
void(* clear_vfta)(struct e1000_hw *)
Definition: e1000_hw.h:731
s32(* blink_led)(struct e1000_hw *)
Definition: e1000_hw.h:726
s32(* reset_hw)(struct e1000_hw *)
Definition: e1000_hw.h:738
s32(* led_on)(struct e1000_hw *)
Definition: e1000_hw.h:735
s32(* read_mac_addr)(struct e1000_hw *)
Definition: e1000_hw.h:748
void(* write_vfta)(struct e1000_hw *, u32, u32)
Definition: e1000_hw.h:745
s32(* init_hw)(struct e1000_hw *)
Definition: e1000_hw.h:739
s32(* setup_link)(struct e1000_hw *)
Definition: e1000_hw.h:742
s32(* cleanup_led)(struct e1000_hw *)
Definition: e1000_hw.h:729
void(* clear_hw_cntrs)(struct e1000_hw *)
Definition: e1000_hw.h:730
void(* set_lan_id)(struct e1000_hw *)
Definition: e1000_hw.h:733
void(* update_mc_addr_list)(struct e1000_hw *, u8 *, u32)
Definition: e1000_hw.h:737
s32(* led_off)(struct e1000_hw *)
Definition: e1000_hw.h:736
bool(* check_mng_mode)(struct e1000_hw *)
Definition: e1000_hw.h:727
s32(* get_bus_info)(struct e1000_hw *)
Definition: e1000_hw.h:732
s32(* init_params)(struct e1000_hw *)
Definition: e1000_hw.h:724
struct e1000_nvm_operations ops
Definition: e1000_hw.h:889
enum e1000_nvm_type type
Definition: e1000_hw.h:890
enum e1000_nvm_override override
Definition: e1000_hw.h:891
u16 address_bits
Definition: e1000_hw.h:898
void(* release)(struct e1000_hw *)
Definition: e1000_hw.h:802
s32(* init_params)(struct e1000_hw *)
Definition: e1000_hw.h:799
s32(* write)(struct e1000_hw *, u16, u16, u16 *)
Definition: e1000_hw.h:807
s32(* validate)(struct e1000_hw *)
Definition: e1000_hw.h:806
s32(* update)(struct e1000_hw *)
Definition: e1000_hw.h:804
s32(* read)(struct e1000_hw *, u16, u16, u16 *)
Definition: e1000_hw.h:801
s32(* acquire)(struct e1000_hw *)
Definition: e1000_hw.h:800
s32(* valid_led_default)(struct e1000_hw *, u16 *)
Definition: e1000_hw.h:805
u32 reset_delay_us
Definition: e1000_hw.h:868
bool autoneg_wait_to_complete
Definition: e1000_hw.h:885
u16 max_cable_length
Definition: e1000_hw.h:876
u16 min_cable_length
Definition: e1000_hw.h:877
enum e1000_media_type media_type
Definition: e1000_hw.h:871
u16 cable_length
Definition: e1000_hw.h:875
bool disable_polarity_correction
Definition: e1000_hw.h:881
struct e1000_phy_operations ops
Definition: e1000_hw.h:856
enum e1000_phy_type type
Definition: e1000_hw.h:857
u16 autoneg_mask
Definition: e1000_hw.h:874
s32(* get_cfg_done)(struct e1000_hw *hw)
Definition: e1000_hw.h:777
void(* power_up)(struct e1000_hw *)
Definition: e1000_hw.h:791
s32(* reset)(struct e1000_hw *)
Definition: e1000_hw.h:785
s32(* init_params)(struct e1000_hw *)
Definition: e1000_hw.h:770
s32(* read_reg)(struct e1000_hw *, u32, u16 *)
Definition: e1000_hw.h:781
s32(* get_info)(struct e1000_hw *)
Definition: e1000_hw.h:779
void(* release)(struct e1000_hw *)
Definition: e1000_hw.h:784
s32(* set_d3_lplu_state)(struct e1000_hw *, bool)
Definition: e1000_hw.h:787
s32(* force_speed_duplex)(struct e1000_hw *)
Definition: e1000_hw.h:776
s32(* get_cable_length)(struct e1000_hw *)
Definition: e1000_hw.h:778
s32(* check_reset_block)(struct e1000_hw *)
Definition: e1000_hw.h:774
s32(* acquire)(struct e1000_hw *)
Definition: e1000_hw.h:771
s32(* cfg_on_link_up)(struct e1000_hw *)
Definition: e1000_hw.h:772
s32(* write_reg)(struct e1000_hw *, u32, u16)
Definition: e1000_hw.h:788
s32(* commit)(struct e1000_hw *)
Definition: e1000_hw.h:775
void(* power_down)(struct e1000_hw *)
Definition: e1000_hw.h:792
s32(* check_polarity)(struct e1000_hw *)
Definition: e1000_hw.h:773