Lines Matching refs:hw

19 static void ixgbe_disable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw);
20 static void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw);
21 static void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw);
24 static int ixgbe_setup_mac_link_smartspeed(struct ixgbe_hw *hw,
27 static void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw);
28 static int ixgbe_start_mac_link_82599(struct ixgbe_hw *hw,
30 static int ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
33 static int ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw,
36 static int ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw);
37 static int ixgbe_read_i2c_byte_82599(struct ixgbe_hw *hw, u8 byte_offset,
39 static int ixgbe_write_i2c_byte_82599(struct ixgbe_hw *hw, u8 byte_offset,
41 static int ixgbe_reset_pipeline_82599(struct ixgbe_hw *hw);
42 static bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw);
44 bool ixgbe_mng_enabled(struct ixgbe_hw *hw) in ixgbe_mng_enabled() argument
48 fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM(hw)); in ixgbe_mng_enabled()
52 manc = IXGBE_READ_REG(hw, IXGBE_MANC); in ixgbe_mng_enabled()
56 factps = IXGBE_READ_REG(hw, IXGBE_FACTPS(hw)); in ixgbe_mng_enabled()
63 static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) in ixgbe_init_mac_link_ops_82599() argument
65 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_mac_link_ops_82599()
70 if ((mac->ops.get_media_type(hw) == ixgbe_media_type_fiber) && in ixgbe_init_mac_link_ops_82599()
71 !ixgbe_mng_enabled(hw)) { in ixgbe_init_mac_link_ops_82599()
83 if (hw->phy.multispeed_fiber) { in ixgbe_init_mac_link_ops_82599()
90 if ((mac->ops.get_media_type(hw) == in ixgbe_init_mac_link_ops_82599()
92 (hw->phy.smart_speed == ixgbe_smart_speed_auto || in ixgbe_init_mac_link_ops_82599()
93 hw->phy.smart_speed == ixgbe_smart_speed_on) && in ixgbe_init_mac_link_ops_82599()
94 !ixgbe_verify_lesm_fw_enabled_82599(hw)) in ixgbe_init_mac_link_ops_82599()
101 static int ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw) in ixgbe_setup_sfp_modules_82599() argument
106 if (hw->phy.sfp_type != ixgbe_sfp_type_unknown) { in ixgbe_setup_sfp_modules_82599()
107 ixgbe_init_mac_link_ops_82599(hw); in ixgbe_setup_sfp_modules_82599()
109 hw->phy.ops.reset = NULL; in ixgbe_setup_sfp_modules_82599()
111 ret_val = ixgbe_get_sfp_init_sequence_offsets(hw, &list_offset, in ixgbe_setup_sfp_modules_82599()
117 ret_val = hw->mac.ops.acquire_swfw_sync(hw, in ixgbe_setup_sfp_modules_82599()
122 if (hw->eeprom.ops.read(hw, ++data_offset, &data_value)) in ixgbe_setup_sfp_modules_82599()
125 IXGBE_WRITE_REG(hw, IXGBE_CORECTL, data_value); in ixgbe_setup_sfp_modules_82599()
126 IXGBE_WRITE_FLUSH(hw); in ixgbe_setup_sfp_modules_82599()
127 if (hw->eeprom.ops.read(hw, ++data_offset, &data_value)) in ixgbe_setup_sfp_modules_82599()
132 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM); in ixgbe_setup_sfp_modules_82599()
137 usleep_range(hw->eeprom.semaphore_delay * 1000, in ixgbe_setup_sfp_modules_82599()
138 hw->eeprom.semaphore_delay * 2000); in ixgbe_setup_sfp_modules_82599()
141 ret_val = hw->mac.ops.prot_autoc_write(hw, in ixgbe_setup_sfp_modules_82599()
142 hw->mac.orig_autoc | IXGBE_AUTOC_LMS_10G_SERIAL, in ixgbe_setup_sfp_modules_82599()
146 hw_dbg(hw, " sfp module setup not complete\n"); in ixgbe_setup_sfp_modules_82599()
155 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM); in ixgbe_setup_sfp_modules_82599()
159 usleep_range(hw->eeprom.semaphore_delay * 1000, in ixgbe_setup_sfp_modules_82599()
160 hw->eeprom.semaphore_delay * 2000); in ixgbe_setup_sfp_modules_82599()
161 hw_err(hw, "eeprom read at offset %d failed\n", data_offset); in ixgbe_setup_sfp_modules_82599()
176 static int prot_autoc_read_82599(struct ixgbe_hw *hw, bool *locked, in prot_autoc_read_82599() argument
183 if (ixgbe_verify_lesm_fw_enabled_82599(hw)) { in prot_autoc_read_82599()
184 ret_val = hw->mac.ops.acquire_swfw_sync(hw, in prot_autoc_read_82599()
192 *reg_val = IXGBE_READ_REG(hw, IXGBE_AUTOC); in prot_autoc_read_82599()
206 static int prot_autoc_write_82599(struct ixgbe_hw *hw, u32 autoc, bool locked) in prot_autoc_write_82599() argument
211 if (ixgbe_check_reset_blocked(hw)) in prot_autoc_write_82599()
218 if (!locked && ixgbe_verify_lesm_fw_enabled_82599(hw)) { in prot_autoc_write_82599()
219 ret_val = hw->mac.ops.acquire_swfw_sync(hw, in prot_autoc_write_82599()
227 IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc); in prot_autoc_write_82599()
228 ret_val = ixgbe_reset_pipeline_82599(hw); in prot_autoc_write_82599()
235 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM); in prot_autoc_write_82599()
240 static int ixgbe_get_invariants_82599(struct ixgbe_hw *hw) in ixgbe_get_invariants_82599() argument
242 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_get_invariants_82599()
244 ixgbe_init_mac_link_ops_82599(hw); in ixgbe_get_invariants_82599()
252 mac->max_msix_vectors = ixgbe_get_pcie_msix_count_generic(hw); in ixgbe_get_invariants_82599()
266 static int ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw) in ixgbe_init_phy_ops_82599() argument
268 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_phy_ops_82599()
269 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_init_phy_ops_82599()
273 if (hw->device_id == IXGBE_DEV_ID_82599_QSFP_SF_QP) { in ixgbe_init_phy_ops_82599()
275 hw->phy.qsfp_shared_i2c_bus = true; in ixgbe_init_phy_ops_82599()
278 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_init_phy_ops_82599()
284 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); in ixgbe_init_phy_ops_82599()
285 IXGBE_WRITE_FLUSH(hw); in ixgbe_init_phy_ops_82599()
292 ret_val = phy->ops.identify(hw); in ixgbe_init_phy_ops_82599()
295 ixgbe_init_mac_link_ops_82599(hw); in ixgbe_init_phy_ops_82599()
298 if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) { in ixgbe_init_phy_ops_82599()
305 switch (hw->phy.type) { in ixgbe_init_phy_ops_82599()
325 static int ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw, in ixgbe_get_link_capabilities_82599() argument
332 if (hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 || in ixgbe_get_link_capabilities_82599()
333 hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 || in ixgbe_get_link_capabilities_82599()
334 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 || in ixgbe_get_link_capabilities_82599()
335 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 || in ixgbe_get_link_capabilities_82599()
336 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || in ixgbe_get_link_capabilities_82599()
337 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1 || in ixgbe_get_link_capabilities_82599()
338 hw->phy.sfp_type == ixgbe_sfp_type_1g_bx_core0 || in ixgbe_get_link_capabilities_82599()
339 hw->phy.sfp_type == ixgbe_sfp_type_1g_bx_core1) { in ixgbe_get_link_capabilities_82599()
350 if (hw->mac.orig_link_settings_stored) in ixgbe_get_link_capabilities_82599()
351 autoc = hw->mac.orig_autoc; in ixgbe_get_link_capabilities_82599()
353 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); in ixgbe_get_link_capabilities_82599()
408 if (hw->phy.multispeed_fiber) { in ixgbe_get_link_capabilities_82599()
413 if (hw->phy.media_type == ixgbe_media_type_fiber_qsfp) in ixgbe_get_link_capabilities_82599()
428 static enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw) in ixgbe_get_media_type_82599() argument
431 switch (hw->phy.type) { in ixgbe_get_media_type_82599()
440 switch (hw->device_id) { in ixgbe_get_media_type_82599()
482 static void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw) in ixgbe_stop_mac_link_on_d3_82599() argument
487 hw->eeprom.ops.read(hw, IXGBE_EEPROM_CTRL_2, &ee_ctrl_2); in ixgbe_stop_mac_link_on_d3_82599()
489 if (!ixgbe_mng_present(hw) && !hw->wol_enabled && in ixgbe_stop_mac_link_on_d3_82599()
491 autoc2_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC2); in ixgbe_stop_mac_link_on_d3_82599()
493 IXGBE_WRITE_REG(hw, IXGBE_AUTOC2, autoc2_reg); in ixgbe_stop_mac_link_on_d3_82599()
505 static int ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, in ixgbe_start_mac_link_82599() argument
514 if (ixgbe_verify_lesm_fw_enabled_82599(hw)) { in ixgbe_start_mac_link_82599()
515 status = hw->mac.ops.acquire_swfw_sync(hw, in ixgbe_start_mac_link_82599()
524 ixgbe_reset_pipeline_82599(hw); in ixgbe_start_mac_link_82599()
527 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM); in ixgbe_start_mac_link_82599()
531 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC); in ixgbe_start_mac_link_82599()
540 links_reg = IXGBE_READ_REG(hw, IXGBE_LINKS); in ixgbe_start_mac_link_82599()
547 hw_dbg(hw, "Autoneg did not complete.\n"); in ixgbe_start_mac_link_82599()
566 static void ixgbe_disable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) in ixgbe_disable_tx_laser_multispeed_fiber() argument
568 u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_disable_tx_laser_multispeed_fiber()
571 if (ixgbe_check_reset_blocked(hw)) in ixgbe_disable_tx_laser_multispeed_fiber()
576 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); in ixgbe_disable_tx_laser_multispeed_fiber()
577 IXGBE_WRITE_FLUSH(hw); in ixgbe_disable_tx_laser_multispeed_fiber()
589 static void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) in ixgbe_enable_tx_laser_multispeed_fiber() argument
591 u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_enable_tx_laser_multispeed_fiber()
595 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); in ixgbe_enable_tx_laser_multispeed_fiber()
596 IXGBE_WRITE_FLUSH(hw); in ixgbe_enable_tx_laser_multispeed_fiber()
612 static void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) in ixgbe_flap_tx_laser_multispeed_fiber() argument
615 if (ixgbe_check_reset_blocked(hw)) in ixgbe_flap_tx_laser_multispeed_fiber()
618 if (hw->mac.autotry_restart) { in ixgbe_flap_tx_laser_multispeed_fiber()
619 ixgbe_disable_tx_laser_multispeed_fiber(hw); in ixgbe_flap_tx_laser_multispeed_fiber()
620 ixgbe_enable_tx_laser_multispeed_fiber(hw); in ixgbe_flap_tx_laser_multispeed_fiber()
621 hw->mac.autotry_restart = false; in ixgbe_flap_tx_laser_multispeed_fiber()
633 ixgbe_set_hard_rate_select_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed) in ixgbe_set_hard_rate_select_speed() argument
635 u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_set_hard_rate_select_speed()
646 hw_dbg(hw, "Invalid fixed module speed\n"); in ixgbe_set_hard_rate_select_speed()
650 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); in ixgbe_set_hard_rate_select_speed()
651 IXGBE_WRITE_FLUSH(hw); in ixgbe_set_hard_rate_select_speed()
662 static int ixgbe_setup_mac_link_smartspeed(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_smartspeed() argument
667 u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC); in ixgbe_setup_mac_link_smartspeed()
673 hw->phy.autoneg_advertised = 0; in ixgbe_setup_mac_link_smartspeed()
676 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_10GB_FULL; in ixgbe_setup_mac_link_smartspeed()
679 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_1GB_FULL; in ixgbe_setup_mac_link_smartspeed()
682 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_100_FULL; in ixgbe_setup_mac_link_smartspeed()
692 hw->phy.smart_speed_active = false; in ixgbe_setup_mac_link_smartspeed()
694 status = ixgbe_setup_mac_link_82599(hw, speed, in ixgbe_setup_mac_link_smartspeed()
709 status = hw->mac.ops.check_link(hw, &link_speed, in ixgbe_setup_mac_link_smartspeed()
728 hw->phy.smart_speed_active = true; in ixgbe_setup_mac_link_smartspeed()
729 status = ixgbe_setup_mac_link_82599(hw, speed, in ixgbe_setup_mac_link_smartspeed()
744 status = hw->mac.ops.check_link(hw, &link_speed, in ixgbe_setup_mac_link_smartspeed()
754 hw->phy.smart_speed_active = false; in ixgbe_setup_mac_link_smartspeed()
755 status = ixgbe_setup_mac_link_82599(hw, speed, in ixgbe_setup_mac_link_smartspeed()
760 hw_dbg(hw, "Smartspeed has downgraded the link speed from the maximum advertised\n"); in ixgbe_setup_mac_link_smartspeed()
772 static int ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_82599() argument
778 u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2); in ixgbe_setup_mac_link_82599()
783 u32 current_autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); in ixgbe_setup_mac_link_82599()
792 status = hw->mac.ops.get_link_capabilities(hw, &link_capabilities, in ixgbe_setup_mac_link_82599()
803 if (hw->mac.orig_link_settings_stored) in ixgbe_setup_mac_link_82599()
804 orig_autoc = hw->mac.orig_autoc; in ixgbe_setup_mac_link_82599()
820 (hw->phy.smart_speed_active == false)) in ixgbe_setup_mac_link_82599()
849 status = hw->mac.ops.prot_autoc_write(hw, autoc, false); in ixgbe_setup_mac_link_82599()
861 IXGBE_READ_REG(hw, IXGBE_LINKS); in ixgbe_setup_mac_link_82599()
868 hw_dbg(hw, "Autoneg did not complete.\n"); in ixgbe_setup_mac_link_82599()
888 static int ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw, in ixgbe_setup_copper_link_82599() argument
895 status = hw->phy.ops.setup_link_speed(hw, speed, in ixgbe_setup_copper_link_82599()
898 ixgbe_start_mac_link_82599(hw, autoneg_wait_to_complete); in ixgbe_setup_copper_link_82599()
911 static int ixgbe_reset_hw_82599(struct ixgbe_hw *hw) in ixgbe_reset_hw_82599() argument
920 status = hw->mac.ops.stop_adapter(hw); in ixgbe_reset_hw_82599()
925 ixgbe_clear_tx_pending(hw); in ixgbe_reset_hw_82599()
930 status = hw->phy.ops.init(hw); in ixgbe_reset_hw_82599()
936 if (hw->phy.sfp_setup_needed) { in ixgbe_reset_hw_82599()
937 status = hw->mac.ops.setup_sfp(hw); in ixgbe_reset_hw_82599()
938 hw->phy.sfp_setup_needed = false; in ixgbe_reset_hw_82599()
945 if (hw->phy.reset_disable == false && hw->phy.ops.reset != NULL) in ixgbe_reset_hw_82599()
946 hw->phy.ops.reset(hw); in ixgbe_reset_hw_82599()
949 curr_lms = IXGBE_READ_REG(hw, IXGBE_AUTOC) & IXGBE_AUTOC_LMS_MASK; in ixgbe_reset_hw_82599()
959 if (!hw->force_full_reset) { in ixgbe_reset_hw_82599()
960 hw->mac.ops.check_link(hw, &link_speed, &link_up, false); in ixgbe_reset_hw_82599()
965 ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_82599()
966 IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl); in ixgbe_reset_hw_82599()
967 IXGBE_WRITE_FLUSH(hw); in ixgbe_reset_hw_82599()
972 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_82599()
980 hw_dbg(hw, "Reset polling failed to complete.\n"); in ixgbe_reset_hw_82599()
990 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { in ixgbe_reset_hw_82599()
991 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_reset_hw_82599()
1000 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); in ixgbe_reset_hw_82599()
1001 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2); in ixgbe_reset_hw_82599()
1006 IXGBE_WRITE_REG(hw, IXGBE_AUTOC2, autoc2); in ixgbe_reset_hw_82599()
1007 IXGBE_WRITE_FLUSH(hw); in ixgbe_reset_hw_82599()
1010 if (hw->mac.orig_link_settings_stored == false) { in ixgbe_reset_hw_82599()
1011 hw->mac.orig_autoc = autoc; in ixgbe_reset_hw_82599()
1012 hw->mac.orig_autoc2 = autoc2; in ixgbe_reset_hw_82599()
1013 hw->mac.orig_link_settings_stored = true; in ixgbe_reset_hw_82599()
1022 if ((hw->phy.multispeed_fiber && ixgbe_mng_enabled(hw)) || in ixgbe_reset_hw_82599()
1023 hw->wol_enabled) in ixgbe_reset_hw_82599()
1024 hw->mac.orig_autoc = in ixgbe_reset_hw_82599()
1025 (hw->mac.orig_autoc & ~IXGBE_AUTOC_LMS_MASK) | in ixgbe_reset_hw_82599()
1028 if (autoc != hw->mac.orig_autoc) { in ixgbe_reset_hw_82599()
1029 status = hw->mac.ops.prot_autoc_write(hw, in ixgbe_reset_hw_82599()
1030 hw->mac.orig_autoc, in ixgbe_reset_hw_82599()
1037 (hw->mac.orig_autoc2 & IXGBE_AUTOC2_UPPER_MASK)) { in ixgbe_reset_hw_82599()
1039 autoc2 |= (hw->mac.orig_autoc2 & in ixgbe_reset_hw_82599()
1041 IXGBE_WRITE_REG(hw, IXGBE_AUTOC2, autoc2); in ixgbe_reset_hw_82599()
1046 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); in ixgbe_reset_hw_82599()
1053 hw->mac.num_rar_entries = IXGBE_82599_RAR_ENTRIES; in ixgbe_reset_hw_82599()
1054 hw->mac.ops.init_rx_addrs(hw); in ixgbe_reset_hw_82599()
1057 hw->mac.ops.get_san_mac_addr(hw, hw->mac.san_addr); in ixgbe_reset_hw_82599()
1060 if (is_valid_ether_addr(hw->mac.san_addr)) { in ixgbe_reset_hw_82599()
1062 hw->mac.san_mac_rar_index = hw->mac.num_rar_entries - 1; in ixgbe_reset_hw_82599()
1064 hw->mac.ops.set_rar(hw, hw->mac.san_mac_rar_index, in ixgbe_reset_hw_82599()
1065 hw->mac.san_addr, 0, IXGBE_RAH_AV); in ixgbe_reset_hw_82599()
1068 hw->mac.ops.clear_vmdq(hw, hw->mac.san_mac_rar_index, in ixgbe_reset_hw_82599()
1072 hw->mac.num_rar_entries--; in ixgbe_reset_hw_82599()
1076 hw->mac.ops.get_wwn_prefix(hw, &hw->mac.wwnn_prefix, in ixgbe_reset_hw_82599()
1077 &hw->mac.wwpn_prefix); in ixgbe_reset_hw_82599()
1087 static int ixgbe_fdir_check_cmd_complete(struct ixgbe_hw *hw, u32 *fdircmd) in ixgbe_fdir_check_cmd_complete() argument
1092 *fdircmd = IXGBE_READ_REG(hw, IXGBE_FDIRCMD); in ixgbe_fdir_check_cmd_complete()
1105 int ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw) in ixgbe_reinit_fdir_tables_82599() argument
1107 u32 fdirctrl = IXGBE_READ_REG(hw, IXGBE_FDIRCTRL); in ixgbe_reinit_fdir_tables_82599()
1118 err = ixgbe_fdir_check_cmd_complete(hw, &fdircmd); in ixgbe_reinit_fdir_tables_82599()
1120 …hw_dbg(hw, "Flow Director previous command did not complete, aborting table re-initialization.\n"); in ixgbe_reinit_fdir_tables_82599()
1124 IXGBE_WRITE_REG(hw, IXGBE_FDIRFREE, 0); in ixgbe_reinit_fdir_tables_82599()
1125 IXGBE_WRITE_FLUSH(hw); in ixgbe_reinit_fdir_tables_82599()
1133 IXGBE_WRITE_REG(hw, IXGBE_FDIRCMD, in ixgbe_reinit_fdir_tables_82599()
1134 (IXGBE_READ_REG(hw, IXGBE_FDIRCMD) | in ixgbe_reinit_fdir_tables_82599()
1136 IXGBE_WRITE_FLUSH(hw); in ixgbe_reinit_fdir_tables_82599()
1137 IXGBE_WRITE_REG(hw, IXGBE_FDIRCMD, in ixgbe_reinit_fdir_tables_82599()
1138 (IXGBE_READ_REG(hw, IXGBE_FDIRCMD) & in ixgbe_reinit_fdir_tables_82599()
1140 IXGBE_WRITE_FLUSH(hw); in ixgbe_reinit_fdir_tables_82599()
1145 IXGBE_WRITE_REG(hw, IXGBE_FDIRHASH, 0x00); in ixgbe_reinit_fdir_tables_82599()
1146 IXGBE_WRITE_FLUSH(hw); in ixgbe_reinit_fdir_tables_82599()
1148 IXGBE_WRITE_REG(hw, IXGBE_FDIRCTRL, fdirctrl); in ixgbe_reinit_fdir_tables_82599()
1149 IXGBE_WRITE_FLUSH(hw); in ixgbe_reinit_fdir_tables_82599()
1153 if (IXGBE_READ_REG(hw, IXGBE_FDIRCTRL) & in ixgbe_reinit_fdir_tables_82599()
1159 hw_dbg(hw, "Flow Director Signature poll time exceeded!\n"); in ixgbe_reinit_fdir_tables_82599()
1164 IXGBE_READ_REG(hw, IXGBE_FDIRUSTAT); in ixgbe_reinit_fdir_tables_82599()
1165 IXGBE_READ_REG(hw, IXGBE_FDIRFSTAT); in ixgbe_reinit_fdir_tables_82599()
1166 IXGBE_READ_REG(hw, IXGBE_FDIRMATCH); in ixgbe_reinit_fdir_tables_82599()
1167 IXGBE_READ_REG(hw, IXGBE_FDIRMISS); in ixgbe_reinit_fdir_tables_82599()
1168 IXGBE_READ_REG(hw, IXGBE_FDIRLEN); in ixgbe_reinit_fdir_tables_82599()
1178 static void ixgbe_fdir_enable_82599(struct ixgbe_hw *hw, u32 fdirctrl) in ixgbe_fdir_enable_82599() argument
1183 IXGBE_WRITE_REG(hw, IXGBE_FDIRHKEY, IXGBE_ATR_BUCKET_HASH_KEY); in ixgbe_fdir_enable_82599()
1184 IXGBE_WRITE_REG(hw, IXGBE_FDIRSKEY, IXGBE_ATR_SIGNATURE_HASH_KEY); in ixgbe_fdir_enable_82599()
1199 IXGBE_WRITE_REG(hw, IXGBE_FDIRCTRL, fdirctrl); in ixgbe_fdir_enable_82599()
1200 IXGBE_WRITE_FLUSH(hw); in ixgbe_fdir_enable_82599()
1202 if (IXGBE_READ_REG(hw, IXGBE_FDIRCTRL) & in ixgbe_fdir_enable_82599()
1209 hw_dbg(hw, "Flow Director poll time exceeded!\n"); in ixgbe_fdir_enable_82599()
1218 int ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 fdirctrl) in ixgbe_init_fdir_signature_82599() argument
1231 ixgbe_fdir_enable_82599(hw, fdirctrl); in ixgbe_init_fdir_signature_82599()
1242 int ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 fdirctrl) in ixgbe_init_fdir_perfect_82599() argument
1259 ixgbe_fdir_enable_82599(hw, fdirctrl); in ixgbe_init_fdir_perfect_82599()
1365 int ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw, in ixgbe_fdir_add_signature_filter_82599() argument
1391 hw_dbg(hw, " Error on flow type input\n"); in ixgbe_fdir_add_signature_filter_82599()
1409 IXGBE_WRITE_REG64(hw, IXGBE_FDIRHASH, fdirhashcmd); in ixgbe_fdir_add_signature_filter_82599()
1411 hw_dbg(hw, "Tx Queue=%x hash=%x\n", queue, (u32)fdirhashcmd); in ixgbe_fdir_add_signature_filter_82599()
1521 int ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw, in ixgbe_fdir_set_input_mask_82599() argument
1540 hw_dbg(hw, " bucket hash should always be 0 in mask\n"); in ixgbe_fdir_set_input_mask_82599()
1550 hw_dbg(hw, " Error on vm pool mask\n"); in ixgbe_fdir_set_input_mask_82599()
1559 hw_dbg(hw, " Error on src/dst port mask\n"); in ixgbe_fdir_set_input_mask_82599()
1566 hw_dbg(hw, " Error on flow type mask\n"); in ixgbe_fdir_set_input_mask_82599()
1587 hw_dbg(hw, " Error on VLAN mask\n"); in ixgbe_fdir_set_input_mask_82599()
1599 hw_dbg(hw, " Error on flexible byte mask\n"); in ixgbe_fdir_set_input_mask_82599()
1604 IXGBE_WRITE_REG(hw, IXGBE_FDIRM, fdirm); in ixgbe_fdir_set_input_mask_82599()
1610 IXGBE_WRITE_REG(hw, IXGBE_FDIRTCPM, ~fdirtcpm); in ixgbe_fdir_set_input_mask_82599()
1611 IXGBE_WRITE_REG(hw, IXGBE_FDIRUDPM, ~fdirtcpm); in ixgbe_fdir_set_input_mask_82599()
1614 switch (hw->mac.type) { in ixgbe_fdir_set_input_mask_82599()
1618 IXGBE_WRITE_REG(hw, IXGBE_FDIRSCTPM, ~fdirtcpm); in ixgbe_fdir_set_input_mask_82599()
1625 IXGBE_WRITE_REG_BE32(hw, IXGBE_FDIRSIP4M, in ixgbe_fdir_set_input_mask_82599()
1627 IXGBE_WRITE_REG_BE32(hw, IXGBE_FDIRDIP4M, in ixgbe_fdir_set_input_mask_82599()
1633 int ixgbe_fdir_write_perfect_filter_82599(struct ixgbe_hw *hw, in ixgbe_fdir_write_perfect_filter_82599() argument
1641 IXGBE_WRITE_REG_BE32(hw, IXGBE_FDIRSIPv6(0), in ixgbe_fdir_write_perfect_filter_82599()
1643 IXGBE_WRITE_REG_BE32(hw, IXGBE_FDIRSIPv6(1), in ixgbe_fdir_write_perfect_filter_82599()
1645 IXGBE_WRITE_REG_BE32(hw, IXGBE_FDIRSIPv6(2), in ixgbe_fdir_write_perfect_filter_82599()
1649 IXGBE_WRITE_REG_BE32(hw, IXGBE_FDIRIPSA, input->formatted.src_ip[0]); in ixgbe_fdir_write_perfect_filter_82599()
1652 IXGBE_WRITE_REG_BE32(hw, IXGBE_FDIRIPDA, input->formatted.dst_ip[0]); in ixgbe_fdir_write_perfect_filter_82599()
1658 IXGBE_WRITE_REG(hw, IXGBE_FDIRPORT, fdirport); in ixgbe_fdir_write_perfect_filter_82599()
1664 IXGBE_WRITE_REG(hw, IXGBE_FDIRVLAN, fdirvlan); in ixgbe_fdir_write_perfect_filter_82599()
1669 IXGBE_WRITE_REG(hw, IXGBE_FDIRHASH, fdirhash); in ixgbe_fdir_write_perfect_filter_82599()
1675 IXGBE_WRITE_FLUSH(hw); in ixgbe_fdir_write_perfect_filter_82599()
1686 IXGBE_WRITE_REG(hw, IXGBE_FDIRCMD, fdircmd); in ixgbe_fdir_write_perfect_filter_82599()
1687 err = ixgbe_fdir_check_cmd_complete(hw, &fdircmd); in ixgbe_fdir_write_perfect_filter_82599()
1689 hw_dbg(hw, "Flow Director command did not complete!\n"); in ixgbe_fdir_write_perfect_filter_82599()
1696 int ixgbe_fdir_erase_perfect_filter_82599(struct ixgbe_hw *hw, in ixgbe_fdir_erase_perfect_filter_82599() argument
1707 IXGBE_WRITE_REG(hw, IXGBE_FDIRHASH, fdirhash); in ixgbe_fdir_erase_perfect_filter_82599()
1710 IXGBE_WRITE_FLUSH(hw); in ixgbe_fdir_erase_perfect_filter_82599()
1713 IXGBE_WRITE_REG(hw, IXGBE_FDIRCMD, IXGBE_FDIRCMD_CMD_QUERY_REM_FILT); in ixgbe_fdir_erase_perfect_filter_82599()
1715 err = ixgbe_fdir_check_cmd_complete(hw, &fdircmd); in ixgbe_fdir_erase_perfect_filter_82599()
1717 hw_dbg(hw, "Flow Director command did not complete!\n"); in ixgbe_fdir_erase_perfect_filter_82599()
1723 IXGBE_WRITE_REG(hw, IXGBE_FDIRHASH, fdirhash); in ixgbe_fdir_erase_perfect_filter_82599()
1724 IXGBE_WRITE_FLUSH(hw); in ixgbe_fdir_erase_perfect_filter_82599()
1725 IXGBE_WRITE_REG(hw, IXGBE_FDIRCMD, in ixgbe_fdir_erase_perfect_filter_82599()
1740 static int ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val) in ixgbe_read_analog_reg8_82599() argument
1744 IXGBE_WRITE_REG(hw, IXGBE_CORECTL, IXGBE_CORECTL_WRITE_CMD | in ixgbe_read_analog_reg8_82599()
1746 IXGBE_WRITE_FLUSH(hw); in ixgbe_read_analog_reg8_82599()
1748 core_ctl = IXGBE_READ_REG(hw, IXGBE_CORECTL); in ixgbe_read_analog_reg8_82599()
1762 static int ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val) in ixgbe_write_analog_reg8_82599() argument
1767 IXGBE_WRITE_REG(hw, IXGBE_CORECTL, core_ctl); in ixgbe_write_analog_reg8_82599()
1768 IXGBE_WRITE_FLUSH(hw); in ixgbe_write_analog_reg8_82599()
1782 static int ixgbe_start_hw_82599(struct ixgbe_hw *hw) in ixgbe_start_hw_82599() argument
1786 ret_val = ixgbe_start_hw_generic(hw); in ixgbe_start_hw_82599()
1790 ret_val = ixgbe_start_hw_gen2(hw); in ixgbe_start_hw_82599()
1795 hw->mac.autotry_restart = true; in ixgbe_start_hw_82599()
1797 return ixgbe_verify_fw_version_82599(hw); in ixgbe_start_hw_82599()
1808 static int ixgbe_identify_phy_82599(struct ixgbe_hw *hw) in ixgbe_identify_phy_82599() argument
1813 status = ixgbe_identify_phy_generic(hw); in ixgbe_identify_phy_82599()
1816 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper) in ixgbe_identify_phy_82599()
1818 status = ixgbe_identify_module_generic(hw); in ixgbe_identify_phy_82599()
1822 if (hw->phy.type == ixgbe_phy_unknown) { in ixgbe_identify_phy_82599()
1823 hw->phy.type = ixgbe_phy_none; in ixgbe_identify_phy_82599()
1828 if (hw->phy.type == ixgbe_phy_sfp_unsupported) in ixgbe_identify_phy_82599()
1841 static int ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval) in ixgbe_enable_rx_dma_82599() argument
1849 hw->mac.ops.disable_rx_buff(hw); in ixgbe_enable_rx_dma_82599()
1852 hw->mac.ops.enable_rx(hw); in ixgbe_enable_rx_dma_82599()
1854 hw->mac.ops.disable_rx(hw); in ixgbe_enable_rx_dma_82599()
1856 hw->mac.ops.enable_rx_buff(hw); in ixgbe_enable_rx_dma_82599()
1871 static int ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw) in ixgbe_verify_fw_version_82599() argument
1879 if (hw->phy.media_type != ixgbe_media_type_fiber) in ixgbe_verify_fw_version_82599()
1884 if (hw->eeprom.ops.read(hw, offset, &fw_offset)) in ixgbe_verify_fw_version_82599()
1892 if (hw->eeprom.ops.read(hw, offset, &fw_ptp_cfg_offset)) in ixgbe_verify_fw_version_82599()
1900 if (hw->eeprom.ops.read(hw, offset, &fw_version)) in ixgbe_verify_fw_version_82599()
1909 hw_err(hw, "eeprom read at offset %d failed\n", offset); in ixgbe_verify_fw_version_82599()
1920 static bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw) in ixgbe_verify_lesm_fw_enabled_82599() argument
1926 status = hw->eeprom.ops.read(hw, IXGBE_FW_PTR, &fw_offset); in ixgbe_verify_lesm_fw_enabled_82599()
1932 status = hw->eeprom.ops.read(hw, (fw_offset + in ixgbe_verify_lesm_fw_enabled_82599()
1941 status = hw->eeprom.ops.read(hw, (fw_lesm_param_offset + in ixgbe_verify_lesm_fw_enabled_82599()
1962 static int ixgbe_read_eeprom_buffer_82599(struct ixgbe_hw *hw, u16 offset, in ixgbe_read_eeprom_buffer_82599() argument
1965 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_read_eeprom_buffer_82599()
1972 return ixgbe_read_eerd_buffer_generic(hw, offset, words, data); in ixgbe_read_eeprom_buffer_82599()
1974 return ixgbe_read_eeprom_buffer_bit_bang_generic(hw, offset, words, in ixgbe_read_eeprom_buffer_82599()
1988 static int ixgbe_read_eeprom_82599(struct ixgbe_hw *hw, in ixgbe_read_eeprom_82599() argument
1991 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_read_eeprom_82599()
1998 return ixgbe_read_eerd_generic(hw, offset, data); in ixgbe_read_eeprom_82599()
2000 return ixgbe_read_eeprom_bit_bang_generic(hw, offset, data); in ixgbe_read_eeprom_82599()
2012 static int ixgbe_reset_pipeline_82599(struct ixgbe_hw *hw) in ixgbe_reset_pipeline_82599() argument
2019 autoc2_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC2); in ixgbe_reset_pipeline_82599()
2022 IXGBE_WRITE_REG(hw, IXGBE_AUTOC2, autoc2_reg); in ixgbe_reset_pipeline_82599()
2023 IXGBE_WRITE_FLUSH(hw); in ixgbe_reset_pipeline_82599()
2026 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC); in ixgbe_reset_pipeline_82599()
2030 IXGBE_WRITE_REG(hw, IXGBE_AUTOC, in ixgbe_reset_pipeline_82599()
2036 anlp1_reg = IXGBE_READ_REG(hw, IXGBE_ANLP1); in ixgbe_reset_pipeline_82599()
2042 hw_dbg(hw, "auto negotiation not completed\n"); in ixgbe_reset_pipeline_82599()
2051 IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg); in ixgbe_reset_pipeline_82599()
2052 IXGBE_WRITE_FLUSH(hw); in ixgbe_reset_pipeline_82599()
2067 static int ixgbe_read_i2c_byte_82599(struct ixgbe_hw *hw, u8 byte_offset, in ixgbe_read_i2c_byte_82599() argument
2074 if (hw->phy.qsfp_shared_i2c_bus == true) { in ixgbe_read_i2c_byte_82599()
2076 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_read_i2c_byte_82599()
2078 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); in ixgbe_read_i2c_byte_82599()
2079 IXGBE_WRITE_FLUSH(hw); in ixgbe_read_i2c_byte_82599()
2082 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_read_i2c_byte_82599()
2091 hw_dbg(hw, "Driver can't access resource, acquiring I2C bus timeout.\n"); in ixgbe_read_i2c_byte_82599()
2097 status = ixgbe_read_i2c_byte_generic(hw, byte_offset, dev_addr, data); in ixgbe_read_i2c_byte_82599()
2100 if (hw->phy.qsfp_shared_i2c_bus == true) { in ixgbe_read_i2c_byte_82599()
2102 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_read_i2c_byte_82599()
2104 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); in ixgbe_read_i2c_byte_82599()
2105 IXGBE_WRITE_FLUSH(hw); in ixgbe_read_i2c_byte_82599()
2121 static int ixgbe_write_i2c_byte_82599(struct ixgbe_hw *hw, u8 byte_offset, in ixgbe_write_i2c_byte_82599() argument
2128 if (hw->phy.qsfp_shared_i2c_bus == true) { in ixgbe_write_i2c_byte_82599()
2130 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_write_i2c_byte_82599()
2132 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); in ixgbe_write_i2c_byte_82599()
2133 IXGBE_WRITE_FLUSH(hw); in ixgbe_write_i2c_byte_82599()
2136 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_write_i2c_byte_82599()
2145 hw_dbg(hw, "Driver can't access resource, acquiring I2C bus timeout.\n"); in ixgbe_write_i2c_byte_82599()
2151 status = ixgbe_write_i2c_byte_generic(hw, byte_offset, dev_addr, data); in ixgbe_write_i2c_byte_82599()
2154 if (hw->phy.qsfp_shared_i2c_bus == true) { in ixgbe_write_i2c_byte_82599()
2156 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_write_i2c_byte_82599()
2158 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); in ixgbe_write_i2c_byte_82599()
2159 IXGBE_WRITE_FLUSH(hw); in ixgbe_write_i2c_byte_82599()