Lines Matching +full:save +full:- +full:mac +full:- +full:address
2 SPDX-License-Identifier: BSD-3-Clause
4 Copyright (c) 2001-2020, Intel Corporation
63 * e1000_init_phy_params_82540 - Init PHY func ptrs.
68 struct e1000_phy_info *phy = &hw->phy; in e1000_init_phy_params_82540()
71 phy->addr = 1; in e1000_init_phy_params_82540()
72 phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; in e1000_init_phy_params_82540()
73 phy->reset_delay_us = 10000; in e1000_init_phy_params_82540()
74 phy->type = e1000_phy_m88; in e1000_init_phy_params_82540()
77 phy->ops.check_polarity = e1000_check_polarity_m88; in e1000_init_phy_params_82540()
78 phy->ops.commit = e1000_phy_sw_reset_generic; in e1000_init_phy_params_82540()
79 phy->ops.force_speed_duplex = e1000_phy_force_speed_duplex_m88; in e1000_init_phy_params_82540()
80 phy->ops.get_cable_length = e1000_get_cable_length_m88; in e1000_init_phy_params_82540()
81 phy->ops.get_cfg_done = e1000_get_cfg_done_generic; in e1000_init_phy_params_82540()
82 phy->ops.read_reg = e1000_read_phy_reg_m88; in e1000_init_phy_params_82540()
83 phy->ops.reset = e1000_phy_hw_reset_generic; in e1000_init_phy_params_82540()
84 phy->ops.write_reg = e1000_write_phy_reg_m88; in e1000_init_phy_params_82540()
85 phy->ops.get_info = e1000_get_phy_info_m88; in e1000_init_phy_params_82540()
86 phy->ops.power_up = e1000_power_up_phy_copper; in e1000_init_phy_params_82540()
87 phy->ops.power_down = e1000_power_down_phy_copper_82540; in e1000_init_phy_params_82540()
94 switch (hw->mac.type) { in e1000_init_phy_params_82540()
100 if (phy->id == M88E1011_I_PHY_ID) in e1000_init_phy_params_82540()
104 ret_val = -E1000_ERR_PHY; in e1000_init_phy_params_82540()
114 * e1000_init_nvm_params_82540 - Init NVM func ptrs.
119 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_init_nvm_params_82540()
124 nvm->type = e1000_nvm_eeprom_microwire; in e1000_init_nvm_params_82540()
125 nvm->delay_usec = 50; in e1000_init_nvm_params_82540()
126 nvm->opcode_bits = 3; in e1000_init_nvm_params_82540()
127 switch (nvm->override) { in e1000_init_nvm_params_82540()
129 nvm->address_bits = 8; in e1000_init_nvm_params_82540()
130 nvm->word_size = 256; in e1000_init_nvm_params_82540()
133 nvm->address_bits = 6; in e1000_init_nvm_params_82540()
134 nvm->word_size = 64; in e1000_init_nvm_params_82540()
137 nvm->address_bits = eecd & E1000_EECD_SIZE ? 8 : 6; in e1000_init_nvm_params_82540()
138 nvm->word_size = eecd & E1000_EECD_SIZE ? 256 : 64; in e1000_init_nvm_params_82540()
143 nvm->ops.acquire = e1000_acquire_nvm_generic; in e1000_init_nvm_params_82540()
144 nvm->ops.read = e1000_read_nvm_microwire; in e1000_init_nvm_params_82540()
145 nvm->ops.release = e1000_release_nvm_generic; in e1000_init_nvm_params_82540()
146 nvm->ops.update = e1000_update_nvm_checksum_generic; in e1000_init_nvm_params_82540()
147 nvm->ops.valid_led_default = e1000_valid_led_default_generic; in e1000_init_nvm_params_82540()
148 nvm->ops.validate = e1000_validate_nvm_checksum_generic; in e1000_init_nvm_params_82540()
149 nvm->ops.write = e1000_write_nvm_microwire; in e1000_init_nvm_params_82540()
155 * e1000_init_mac_params_82540 - Init MAC func ptrs.
160 struct e1000_mac_info *mac = &hw->mac; in e1000_init_mac_params_82540() local
166 switch (hw->device_id) { in e1000_init_mac_params_82540()
171 hw->phy.media_type = e1000_media_type_fiber; in e1000_init_mac_params_82540()
175 hw->phy.media_type = e1000_media_type_internal_serdes; in e1000_init_mac_params_82540()
178 hw->phy.media_type = e1000_media_type_copper; in e1000_init_mac_params_82540()
183 mac->mta_reg_count = 128; in e1000_init_mac_params_82540()
185 mac->rar_entry_count = E1000_RAR_ENTRIES; in e1000_init_mac_params_82540()
190 mac->ops.get_bus_info = e1000_get_bus_info_pci_generic; in e1000_init_mac_params_82540()
192 mac->ops.set_lan_id = e1000_set_lan_id_multi_port_pci; in e1000_init_mac_params_82540()
194 mac->ops.reset_hw = e1000_reset_hw_82540; in e1000_init_mac_params_82540()
196 mac->ops.init_hw = e1000_init_hw_82540; in e1000_init_mac_params_82540()
198 mac->ops.setup_link = e1000_setup_link_generic; in e1000_init_mac_params_82540()
200 mac->ops.setup_physical_interface = in e1000_init_mac_params_82540()
201 (hw->phy.media_type == e1000_media_type_copper) in e1000_init_mac_params_82540()
205 switch (hw->phy.media_type) { in e1000_init_mac_params_82540()
207 mac->ops.check_for_link = e1000_check_for_copper_link_generic; in e1000_init_mac_params_82540()
210 mac->ops.check_for_link = e1000_check_for_fiber_link_generic; in e1000_init_mac_params_82540()
213 mac->ops.check_for_link = e1000_check_for_serdes_link_generic; in e1000_init_mac_params_82540()
216 ret_val = -E1000_ERR_CONFIG; in e1000_init_mac_params_82540()
221 mac->ops.get_link_up_info = in e1000_init_mac_params_82540()
222 (hw->phy.media_type == e1000_media_type_copper) in e1000_init_mac_params_82540()
225 /* multicast address update */ in e1000_init_mac_params_82540()
226 mac->ops.update_mc_addr_list = e1000_update_mc_addr_list_generic; in e1000_init_mac_params_82540()
228 mac->ops.write_vfta = e1000_write_vfta_generic; in e1000_init_mac_params_82540()
230 mac->ops.clear_vfta = e1000_clear_vfta_generic; in e1000_init_mac_params_82540()
231 /* read mac address */ in e1000_init_mac_params_82540()
232 mac->ops.read_mac_addr = e1000_read_mac_addr_82540; in e1000_init_mac_params_82540()
234 mac->ops.id_led_init = e1000_id_led_init_generic; in e1000_init_mac_params_82540()
236 mac->ops.setup_led = e1000_setup_led_generic; in e1000_init_mac_params_82540()
238 mac->ops.cleanup_led = e1000_cleanup_led_generic; in e1000_init_mac_params_82540()
240 mac->ops.led_on = e1000_led_on_generic; in e1000_init_mac_params_82540()
241 mac->ops.led_off = e1000_led_off_generic; in e1000_init_mac_params_82540()
243 mac->ops.clear_hw_cntrs = e1000_clear_hw_cntrs_82540; in e1000_init_mac_params_82540()
250 * e1000_init_function_pointers_82540 - Init func ptrs.
259 hw->mac.ops.init_params = e1000_init_mac_params_82540; in e1000_init_function_pointers_82540()
260 hw->nvm.ops.init_params = e1000_init_nvm_params_82540; in e1000_init_function_pointers_82540()
261 hw->phy.ops.init_params = e1000_init_phy_params_82540; in e1000_init_function_pointers_82540()
265 * e1000_reset_hw_82540 - Reset hardware
292 DEBUGOUT("Issuing a global reset to 82540/82545/82546 MAC\n"); in e1000_reset_hw_82540()
293 switch (hw->mac.type) { in e1000_reset_hw_82540()
300 * These controllers can't ack the 64-bit write when in e1000_reset_hw_82540()
301 * issuing the reset, so we use IO-mapping as a in e1000_reset_hw_82540()
323 * e1000_init_hw_82540 - Initialize hardware
330 struct e1000_mac_info *mac = &hw->mac; in e1000_init_hw_82540() local
338 ret_val = mac->ops.id_led_init(hw); in e1000_init_hw_82540()
346 if (mac->type < e1000_82545_rev_3) in e1000_init_hw_82540()
349 mac->ops.clear_vfta(hw); in e1000_init_hw_82540()
351 /* Setup the receive address. */ in e1000_init_hw_82540()
352 e1000_init_rx_addrs_generic(hw, mac->rar_entry_count); in e1000_init_hw_82540()
356 for (i = 0; i < mac->mta_reg_count; i++) { in e1000_init_hw_82540()
369 if (mac->type < e1000_82545_rev_3) in e1000_init_hw_82540()
373 ret_val = mac->ops.setup_link(hw); in e1000_init_hw_82540()
388 if ((hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER) || in e1000_init_hw_82540()
389 (hw->device_id == E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3)) { in e1000_init_hw_82540()
403 * e1000_setup_copper_link_82540 - Configure copper link settings
406 * Calls the appropriate function to configure the link for auto-neg or forced
409 * not established, we return -E1000_ERR_PHY (-2).
428 if (hw->mac.type == e1000_82545_rev_3 || in e1000_setup_copper_link_82540()
429 hw->mac.type == e1000_82546_rev_3) { in e1000_setup_copper_link_82540()
430 ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_SPEC_CTRL, in e1000_setup_copper_link_82540()
435 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_SPEC_CTRL, in e1000_setup_copper_link_82540()
452 * e1000_setup_fiber_serdes_link_82540 - Setup link for fiber/serdes
462 struct e1000_mac_info *mac = &hw->mac; in e1000_setup_fiber_serdes_link_82540() local
467 switch (mac->type) { in e1000_setup_fiber_serdes_link_82540()
470 if (hw->phy.media_type == e1000_media_type_internal_serdes) { in e1000_setup_fiber_serdes_link_82540()
494 * e1000_adjust_serdes_amplitude_82540 - Adjust amplitude based on EEPROM
506 ret_val = hw->nvm.ops.read(hw, NVM_SERDES_AMPLITUDE, 1, &nvm_data); in e1000_adjust_serdes_amplitude_82540()
513 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_EXT_CTRL, in e1000_adjust_serdes_amplitude_82540()
524 * e1000_set_vco_speed_82540 - Set VCO speed for better performance
539 ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_PAGE_SELECT, in e1000_set_vco_speed_82540()
544 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0005); in e1000_set_vco_speed_82540()
548 ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_GEN_CONTROL, &phy_data); in e1000_set_vco_speed_82540()
553 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, phy_data); in e1000_set_vco_speed_82540()
559 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT, 0x0004); in e1000_set_vco_speed_82540()
563 ret_val = hw->phy.ops.read_reg(hw, M88E1000_PHY_GEN_CONTROL, &phy_data); in e1000_set_vco_speed_82540()
568 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, phy_data); in e1000_set_vco_speed_82540()
572 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT, in e1000_set_vco_speed_82540()
580 * e1000_set_phy_mode_82540 - Set PHY to class A mode
586 * 2. Restart auto-negotiation or force link.
595 if (hw->mac.type != e1000_82545_rev_3) in e1000_set_phy_mode_82540()
598 ret_val = hw->nvm.ops.read(hw, NVM_PHY_CLASS_WORD, 1, &nvm_data); in e1000_set_phy_mode_82540()
600 ret_val = -E1000_ERR_PHY; in e1000_set_phy_mode_82540()
605 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_PAGE_SELECT, in e1000_set_phy_mode_82540()
608 ret_val = -E1000_ERR_PHY; in e1000_set_phy_mode_82540()
611 ret_val = hw->phy.ops.write_reg(hw, M88E1000_PHY_GEN_CONTROL, in e1000_set_phy_mode_82540()
614 ret_val = -E1000_ERR_PHY; in e1000_set_phy_mode_82540()
625 * e1000_power_down_phy_copper_82540 - Remove link in case of PHY power down
628 * In the case of a PHY power down to save power, or to turn off link during a
641 * e1000_clear_hw_cntrs_82540 - Clear device specific hardware counters
678 * e1000_read_mac_addr_82540 - Read device MAC address
681 * Reads the device MAC address from the EEPROM and stores the value.
683 * last bit in the MAC address for the second port.
687 * the emulated 82545, RAR[0] does NOT have a valid address after a
700 ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); in e1000_read_mac_addr_82540()
705 hw->mac.perm_addr[i] = (u8)(nvm_data & 0xFF); in e1000_read_mac_addr_82540()
706 hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8); in e1000_read_mac_addr_82540()
709 /* Flip last bit of mac address if we're on second port */ in e1000_read_mac_addr_82540()
710 if (hw->bus.func == E1000_FUNC_1) in e1000_read_mac_addr_82540()
711 hw->mac.perm_addr[5] ^= 1; in e1000_read_mac_addr_82540()
714 hw->mac.addr[i] = hw->mac.perm_addr[i]; in e1000_read_mac_addr_82540()