Lines Matching +full:max +full:- +full:fingers

1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 1999 - 2018 Intel Corporation. */
35 * e1000_init_phy_params_80003es2lan - Init ESB2 PHY func ptrs.
40 struct e1000_phy_info *phy = &hw->phy; in e1000_init_phy_params_80003es2lan()
43 if (hw->phy.media_type != e1000_media_type_copper) { in e1000_init_phy_params_80003es2lan()
44 phy->type = e1000_phy_none; in e1000_init_phy_params_80003es2lan()
47 phy->ops.power_up = e1000_power_up_phy_copper; in e1000_init_phy_params_80003es2lan()
48 phy->ops.power_down = e1000_power_down_phy_copper_80003es2lan; in e1000_init_phy_params_80003es2lan()
51 phy->addr = 1; in e1000_init_phy_params_80003es2lan()
52 phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; in e1000_init_phy_params_80003es2lan()
53 phy->reset_delay_us = 100; in e1000_init_phy_params_80003es2lan()
54 phy->type = e1000_phy_gg82563; in e1000_init_phy_params_80003es2lan()
60 if (phy->id != GG82563_E_PHY_ID) in e1000_init_phy_params_80003es2lan()
61 return -E1000_ERR_PHY; in e1000_init_phy_params_80003es2lan()
67 * e1000_init_nvm_params_80003es2lan - Init ESB2 NVM func ptrs.
72 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_init_nvm_params_80003es2lan()
76 nvm->opcode_bits = 8; in e1000_init_nvm_params_80003es2lan()
77 nvm->delay_usec = 1; in e1000_init_nvm_params_80003es2lan()
78 switch (nvm->override) { in e1000_init_nvm_params_80003es2lan()
80 nvm->page_size = 32; in e1000_init_nvm_params_80003es2lan()
81 nvm->address_bits = 16; in e1000_init_nvm_params_80003es2lan()
84 nvm->page_size = 8; in e1000_init_nvm_params_80003es2lan()
85 nvm->address_bits = 8; in e1000_init_nvm_params_80003es2lan()
88 nvm->page_size = eecd & E1000_EECD_ADDR_BITS ? 32 : 8; in e1000_init_nvm_params_80003es2lan()
89 nvm->address_bits = eecd & E1000_EECD_ADDR_BITS ? 16 : 8; in e1000_init_nvm_params_80003es2lan()
93 nvm->type = e1000_nvm_eeprom_spi; in e1000_init_nvm_params_80003es2lan()
97 /* Added to a constant, "size" becomes the left-shift value in e1000_init_nvm_params_80003es2lan()
105 nvm->word_size = BIT(size); in e1000_init_nvm_params_80003es2lan()
111 * e1000_init_mac_params_80003es2lan - Init ESB2 MAC func ptrs.
116 struct e1000_mac_info *mac = &hw->mac; in e1000_init_mac_params_80003es2lan()
118 /* Set media type and media-dependent function pointers */ in e1000_init_mac_params_80003es2lan()
119 switch (hw->adapter->pdev->device) { in e1000_init_mac_params_80003es2lan()
121 hw->phy.media_type = e1000_media_type_internal_serdes; in e1000_init_mac_params_80003es2lan()
122 mac->ops.check_for_link = e1000e_check_for_serdes_link; in e1000_init_mac_params_80003es2lan()
123 mac->ops.setup_physical_interface = in e1000_init_mac_params_80003es2lan()
127 hw->phy.media_type = e1000_media_type_copper; in e1000_init_mac_params_80003es2lan()
128 mac->ops.check_for_link = e1000e_check_for_copper_link; in e1000_init_mac_params_80003es2lan()
129 mac->ops.setup_physical_interface = in e1000_init_mac_params_80003es2lan()
135 mac->mta_reg_count = 128; in e1000_init_mac_params_80003es2lan()
137 mac->rar_entry_count = E1000_RAR_ENTRIES; in e1000_init_mac_params_80003es2lan()
139 mac->has_fwsm = true; in e1000_init_mac_params_80003es2lan()
141 mac->arc_subsystem_valid = !!(er32(FWSM) & E1000_FWSM_MODE_MASK); in e1000_init_mac_params_80003es2lan()
143 mac->adaptive_ifs = false; in e1000_init_mac_params_80003es2lan()
146 hw->mac.ops.set_lan_id(hw); in e1000_init_mac_params_80003es2lan()
153 struct e1000_hw *hw = &adapter->hw; in e1000_get_variants_80003es2lan()
172 * e1000_acquire_phy_80003es2lan - Acquire rights to access PHY
181 mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM; in e1000_acquire_phy_80003es2lan()
186 * e1000_release_phy_80003es2lan - Release rights to access PHY
195 mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM; in e1000_release_phy_80003es2lan()
200 * e1000_acquire_mac_csr_80003es2lan - Acquire right to access Kumeran register
216 * e1000_release_mac_csr_80003es2lan - Release right to access Kumeran Register
231 * e1000_acquire_nvm_80003es2lan - Acquire rights to access NVM
253 * e1000_release_nvm_80003es2lan - Relinquish rights to access NVM
265 * e1000_acquire_swfw_sync_80003es2lan - Acquire SW/FW semaphore
282 return -E1000_ERR_SWFW_SYNC; in e1000_acquire_swfw_sync_80003es2lan()
298 return -E1000_ERR_SWFW_SYNC; in e1000_acquire_swfw_sync_80003es2lan()
310 * e1000_release_swfw_sync_80003es2lan - Release SW/FW semaphore
332 * e1000_read_phy_reg_gg82563_80003es2lan - Read GG82563 PHY register
367 if (hw->dev_spec.e80003es2lan.mdic_wa_enable) { in e1000_read_phy_reg_gg82563_80003es2lan()
379 return -E1000_ERR_PHY; in e1000_read_phy_reg_gg82563_80003es2lan()
401 * e1000_write_phy_reg_gg82563_80003es2lan - Write GG82563 PHY register
436 if (hw->dev_spec.e80003es2lan.mdic_wa_enable) { in e1000_write_phy_reg_gg82563_80003es2lan()
448 return -E1000_ERR_PHY; in e1000_write_phy_reg_gg82563_80003es2lan()
470 * e1000_write_nvm_80003es2lan - Write to ESB2 NVM
485 * e1000_get_cfg_done_80003es2lan - Wait for configuration to complete
496 if (hw->bus.func == 1) in e1000_get_cfg_done_80003es2lan()
503 timeout--; in e1000_get_cfg_done_80003es2lan()
507 return -E1000_ERR_RESET; in e1000_get_cfg_done_80003es2lan()
514 * e1000_phy_force_speed_duplex_80003es2lan - Force PHY speed and duplex
526 /* Clear Auto-Crossover to force MDI manually. M88E1000 requires MDI in e1000_phy_force_speed_duplex_80003es2lan()
555 if (hw->phy.autoneg_wait_to_complete) { in e1000_phy_force_speed_duplex_80003es2lan()
565 * Reset the DSP and cross our fingers. in e1000_phy_force_speed_duplex_80003es2lan()
584 * to the link speed. 10Mbps -> 2.5MHz, else 25MHz. in e1000_phy_force_speed_duplex_80003es2lan()
587 if (hw->mac.forced_speed_duplex & E1000_ALL_10_SPEED) in e1000_phy_force_speed_duplex_80003es2lan()
592 /* In addition, we must re-enable CRS on Tx for both half and full in e1000_phy_force_speed_duplex_80003es2lan()
602 * e1000_get_cable_length_80003es2lan - Set approximate cable length
610 struct e1000_phy_info *phy = &hw->phy; in e1000_get_cable_length_80003es2lan()
620 if (index >= GG82563_CABLE_LENGTH_TABLE_SIZE - 5) in e1000_get_cable_length_80003es2lan()
621 return -E1000_ERR_PHY; in e1000_get_cable_length_80003es2lan()
623 phy->min_cable_length = e1000_gg82563_cable_length_table[index]; in e1000_get_cable_length_80003es2lan()
624 phy->max_cable_length = e1000_gg82563_cable_length_table[index + 5]; in e1000_get_cable_length_80003es2lan()
626 phy->cable_length = (phy->min_cable_length + phy->max_cable_length) / 2; in e1000_get_cable_length_80003es2lan()
632 * e1000_get_link_up_info_80003es2lan - Report speed and duplex
644 if (hw->phy.media_type == e1000_media_type_copper) { in e1000_get_link_up_info_80003es2lan()
646 hw->phy.ops.cfg_on_link_up(hw); in e1000_get_link_up_info_80003es2lan()
657 * e1000_reset_hw_80003es2lan - Reset the ESB2 controller
668 /* Prevent the PCI-E bus from sticking if there is no TLP connection in e1000_reset_hw_80003es2lan()
673 e_dbg("PCI-E Master disable polling has failed.\n"); in e1000_reset_hw_80003es2lan()
694 /* Disable IBIST slave mode (far-end loopback) */ in e1000_reset_hw_80003es2lan()
704 e_dbg("Error disabling far-end loopback\n"); in e1000_reset_hw_80003es2lan()
706 e_dbg("Error disabling far-end loopback\n"); in e1000_reset_hw_80003es2lan()
722 * e1000_init_hw_80003es2lan - Initialize the ESB2 controller
729 struct e1000_mac_info *mac = &hw->mac; in e1000_init_hw_80003es2lan()
738 ret_val = mac->ops.id_led_init(hw); in e1000_init_hw_80003es2lan()
745 mac->ops.clear_vfta(hw); in e1000_init_hw_80003es2lan()
748 e1000e_init_rx_addrs(hw, mac->rar_entry_count); in e1000_init_hw_80003es2lan()
752 for (i = 0; i < mac->mta_reg_count; i++) in e1000_init_hw_80003es2lan()
756 ret_val = mac->ops.setup_link(hw); in e1000_init_hw_80003es2lan()
760 /* Disable IBIST slave mode (far-end loopback) */ in e1000_init_hw_80003es2lan()
770 e_dbg("Error disabling far-end loopback\n"); in e1000_init_hw_80003es2lan()
772 e_dbg("Error disabling far-end loopback\n"); in e1000_init_hw_80003es2lan()
775 /* Set the transmit descriptor write-back policy */ in e1000_init_hw_80003es2lan()
798 /* Configure Transmit Inter-Packet Gap */ in e1000_init_hw_80003es2lan()
809 hw->dev_spec.e80003es2lan.mdic_wa_enable = true; in e1000_init_hw_80003es2lan()
817 hw->dev_spec.e80003es2lan.mdic_wa_enable = false; in e1000_init_hw_80003es2lan()
831 * e1000_initialize_hw_bits_80003es2lan - Init hw bits of ESB2
834 * Initializes required hardware-dependent bits needed for normal operation.
853 if (hw->phy.media_type != e1000_media_type_copper) in e1000_initialize_hw_bits_80003es2lan()
874 * e1000_copper_link_setup_gg82563_80003es2lan - Configure GG82563 Link
881 struct e1000_phy_info *phy = &hw->phy; in e1000_copper_link_setup_gg82563_80003es2lan()
891 /* Use 25MHz for both link down and 1000Base-T for Tx clock. */ in e1000_copper_link_setup_gg82563_80003es2lan()
899 * MDI/MDI-X = 0 (default) in e1000_copper_link_setup_gg82563_80003es2lan()
900 * 0 - Auto for all speeds in e1000_copper_link_setup_gg82563_80003es2lan()
901 * 1 - MDI mode in e1000_copper_link_setup_gg82563_80003es2lan()
902 * 2 - MDI-X mode in e1000_copper_link_setup_gg82563_80003es2lan()
903 * 3 - Auto for 1000Base-T only (MDI-X for 10/100Base-T modes) in e1000_copper_link_setup_gg82563_80003es2lan()
911 switch (phy->mdix) { in e1000_copper_link_setup_gg82563_80003es2lan()
927 * 0 - Disabled in e1000_copper_link_setup_gg82563_80003es2lan()
928 * 1 - Enabled in e1000_copper_link_setup_gg82563_80003es2lan()
931 if (phy->disable_polarity_correction) in e1000_copper_link_setup_gg82563_80003es2lan()
939 ret_val = hw->phy.ops.commit(hw); in e1000_copper_link_setup_gg82563_80003es2lan()
983 if (!hw->mac.ops.check_mng_mode(hw)) { in e1000_copper_link_setup_gg82563_80003es2lan()
1016 * e1000_setup_copper_link_80003es2lan - Setup Copper Link for ESB2
1034 * iteration and increase the max iterations when in e1000_setup_copper_link_80003es2lan()
1073 * e1000_cfg_on_link_up_80003es2lan - es2 link configuration after link-up
1085 if (hw->phy.media_type == e1000_media_type_copper) { in e1000_cfg_on_link_up_80003es2lan()
1101 * e1000_cfg_kmrn_10_100_80003es2lan - Apply "quirks" for 10/100 operation
1123 /* Configure Transmit Inter-Packet Gap */ in e1000_cfg_kmrn_10_100_80003es2lan()
1149 * e1000_cfg_kmrn_1000_80003es2lan - Apply "quirks" for gigabit operation
1170 /* Configure Transmit Inter-Packet Gap */ in e1000_cfg_kmrn_1000_80003es2lan()
1193 * e1000_read_kmrn_reg_80003es2lan - Read kumeran register
1228 * e1000_write_kmrn_reg_80003es2lan - Write kumeran register
1259 * e1000_read_mac_addr_80003es2lan - Read device MAC address
1278 * e1000_power_down_phy_copper_80003es2lan - Remove link during PHY power down
1287 if (!(hw->mac.ops.check_mng_mode(hw) || in e1000_power_down_phy_copper_80003es2lan()
1288 hw->phy.ops.check_reset_block(hw))) in e1000_power_down_phy_copper_80003es2lan()
1293 * e1000_clear_hw_cntrs_80003es2lan - Clear device specific hardware counters