Lines Matching refs:hw

41 static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed);
44 static s32 ixgbe_read_mng_if_sel_x550em(struct ixgbe_hw *hw);
53 s32 ixgbe_init_ops_X550(struct ixgbe_hw *hw) in ixgbe_init_ops_X550() argument
55 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_ops_X550()
56 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_ops_X550()
61 ret_val = ixgbe_init_ops_X540(hw); in ixgbe_init_ops_X550()
89 switch (hw->device_id) { in ixgbe_init_ops_X550()
91 hw->mac.ops.led_on = NULL; in ixgbe_init_ops_X550()
92 hw->mac.ops.led_off = NULL; in ixgbe_init_ops_X550()
96 hw->mac.ops.led_on = ixgbe_led_on_t_X550em; in ixgbe_init_ops_X550()
97 hw->mac.ops.led_off = ixgbe_led_off_t_X550em; in ixgbe_init_ops_X550()
113 static s32 ixgbe_read_cs4227(struct ixgbe_hw *hw, u16 reg, u16 *value) in ixgbe_read_cs4227() argument
115 return hw->link.ops.read_link_unlocked(hw, hw->link.addr, reg, value); in ixgbe_read_cs4227()
126 static s32 ixgbe_write_cs4227(struct ixgbe_hw *hw, u16 reg, u16 value) in ixgbe_write_cs4227() argument
128 return hw->link.ops.write_link_unlocked(hw, hw->link.addr, reg, value); in ixgbe_write_cs4227()
139 static s32 ixgbe_read_pe(struct ixgbe_hw *hw, u8 reg, u8 *value) in ixgbe_read_pe() argument
143 status = ixgbe_read_i2c_byte_unlocked(hw, reg, IXGBE_PE, value); in ixgbe_read_pe()
158 static s32 ixgbe_write_pe(struct ixgbe_hw *hw, u8 reg, u8 value) in ixgbe_write_pe() argument
162 status = ixgbe_write_i2c_byte_unlocked(hw, reg, IXGBE_PE, value); in ixgbe_write_pe()
176 static s32 ixgbe_reset_cs4227(struct ixgbe_hw *hw) in ixgbe_reset_cs4227() argument
184 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, &reg); in ixgbe_reset_cs4227()
188 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg); in ixgbe_reset_cs4227()
192 status = ixgbe_read_pe(hw, IXGBE_PE_CONFIG, &reg); in ixgbe_reset_cs4227()
196 status = ixgbe_write_pe(hw, IXGBE_PE_CONFIG, reg); in ixgbe_reset_cs4227()
200 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, &reg); in ixgbe_reset_cs4227()
204 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg); in ixgbe_reset_cs4227()
210 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, &reg); in ixgbe_reset_cs4227()
214 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg); in ixgbe_reset_cs4227()
221 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_EFUSE_STATUS, in ixgbe_reset_cs4227()
234 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_EEPROM_STATUS, &value); in ixgbe_reset_cs4227()
249 static void ixgbe_check_cs4227(struct ixgbe_hw *hw) in ixgbe_check_cs4227() argument
252 u32 swfw_mask = hw->phy.phy_semaphore_mask; in ixgbe_check_cs4227()
257 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
266 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_SCRATCH, &value); in ixgbe_check_cs4227()
277 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
283 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
292 status = ixgbe_reset_cs4227(hw); in ixgbe_check_cs4227()
302 ixgbe_write_cs4227(hw, IXGBE_CS4227_SCRATCH, in ixgbe_check_cs4227()
304 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
306 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
314 status = ixgbe_write_cs4227(hw, IXGBE_CS4227_SCRATCH, in ixgbe_check_cs4227()
318 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
319 msec_delay(hw->eeprom.semaphore_delay); in ixgbe_check_cs4227()
326 static void ixgbe_setup_mux_ctl(struct ixgbe_hw *hw) in ixgbe_setup_mux_ctl() argument
328 u32 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_setup_mux_ctl()
330 if (hw->bus.lan_id) { in ixgbe_setup_mux_ctl()
335 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); in ixgbe_setup_mux_ctl()
336 IXGBE_WRITE_FLUSH(hw); in ixgbe_setup_mux_ctl()
345 static s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) in ixgbe_identify_phy_x550em() argument
347 hw->mac.ops.set_lan_id(hw); in ixgbe_identify_phy_x550em()
349 ixgbe_read_mng_if_sel_x550em(hw); in ixgbe_identify_phy_x550em()
351 switch (hw->device_id) { in ixgbe_identify_phy_x550em()
353 return ixgbe_identify_sfp_module_X550em(hw); in ixgbe_identify_phy_x550em()
356 ixgbe_setup_mux_ctl(hw); in ixgbe_identify_phy_x550em()
357 ixgbe_check_cs4227(hw); in ixgbe_identify_phy_x550em()
361 return ixgbe_identify_sfp_module_X550em(hw); in ixgbe_identify_phy_x550em()
364 hw->phy.type = ixgbe_phy_x550em_kx4; in ixgbe_identify_phy_x550em()
367 hw->phy.type = ixgbe_phy_x550em_xfi; in ixgbe_identify_phy_x550em()
372 hw->phy.type = ixgbe_phy_x550em_kr; in ixgbe_identify_phy_x550em()
376 return ixgbe_identify_phy_generic(hw); in ixgbe_identify_phy_x550em()
378 hw->phy.type = ixgbe_phy_ext_1g_t; in ixgbe_identify_phy_x550em()
382 hw->phy.type = ixgbe_phy_fw; in ixgbe_identify_phy_x550em()
383 if (hw->bus.lan_id) in ixgbe_identify_phy_x550em()
384 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_x550em()
386 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_x550em()
400 s32 ixgbe_fw_phy_activity(struct ixgbe_hw *hw, u16 activity, in ixgbe_fw_phy_activity() argument
416 hic.cmd.port_number = hw->bus.lan_id; in ixgbe_fw_phy_activity()
421 rc = ixgbe_host_interface_command(hw, (u32 *)&hic.cmd, in ixgbe_fw_phy_activity()
458 static s32 ixgbe_get_phy_id_fw(struct ixgbe_hw *hw) in ixgbe_get_phy_id_fw() argument
466 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_PHY_INFO, &info); in ixgbe_get_phy_id_fw()
470 hw->phy.speeds_supported = 0; in ixgbe_get_phy_id_fw()
474 hw->phy.speeds_supported |= ixgbe_fw_map[i].phy_speed; in ixgbe_get_phy_id_fw()
476 if (!hw->phy.autoneg_advertised) in ixgbe_get_phy_id_fw()
477 hw->phy.autoneg_advertised = hw->phy.speeds_supported; in ixgbe_get_phy_id_fw()
479 hw->phy.id = info[0] & FW_PHY_INFO_ID_HI_MASK; in ixgbe_get_phy_id_fw()
481 hw->phy.id |= phy_id_lo & IXGBE_PHY_REVISION_MASK; in ixgbe_get_phy_id_fw()
482 hw->phy.revision = phy_id_lo & ~IXGBE_PHY_REVISION_MASK; in ixgbe_get_phy_id_fw()
483 if (!hw->phy.id || hw->phy.id == IXGBE_PHY_REVISION_MASK) in ixgbe_get_phy_id_fw()
494 static s32 ixgbe_identify_phy_fw(struct ixgbe_hw *hw) in ixgbe_identify_phy_fw() argument
496 if (hw->bus.lan_id) in ixgbe_identify_phy_fw()
497 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_fw()
499 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_fw()
501 hw->phy.type = ixgbe_phy_fw; in ixgbe_identify_phy_fw()
502 hw->phy.ops.read_reg = NULL; in ixgbe_identify_phy_fw()
503 hw->phy.ops.write_reg = NULL; in ixgbe_identify_phy_fw()
504 return ixgbe_get_phy_id_fw(hw); in ixgbe_identify_phy_fw()
513 s32 ixgbe_shutdown_fw_phy(struct ixgbe_hw *hw) in ixgbe_shutdown_fw_phy() argument
518 return ixgbe_fw_phy_activity(hw, FW_PHY_ACT_FORCE_LINK_DOWN, &setup); in ixgbe_shutdown_fw_phy()
521 static s32 ixgbe_read_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_phy_reg_x550em() argument
524 UNREFERENCED_4PARAMETER(*hw, reg_addr, device_type, *phy_data); in ixgbe_read_phy_reg_x550em()
528 static s32 ixgbe_write_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_phy_reg_x550em() argument
531 UNREFERENCED_4PARAMETER(*hw, reg_addr, device_type, phy_data); in ixgbe_write_phy_reg_x550em()
544 static s32 ixgbe_read_i2c_combined_generic(struct ixgbe_hw *hw, u8 addr, in ixgbe_read_i2c_combined_generic() argument
547 return ixgbe_read_i2c_combined_generic_int(hw, addr, reg, val, true); in ixgbe_read_i2c_combined_generic()
560 ixgbe_read_i2c_combined_generic_unlocked(struct ixgbe_hw *hw, u8 addr, in ixgbe_read_i2c_combined_generic_unlocked() argument
563 return ixgbe_read_i2c_combined_generic_int(hw, addr, reg, val, false); in ixgbe_read_i2c_combined_generic_unlocked()
575 static s32 ixgbe_write_i2c_combined_generic(struct ixgbe_hw *hw, in ixgbe_write_i2c_combined_generic() argument
578 return ixgbe_write_i2c_combined_generic_int(hw, addr, reg, val, true); in ixgbe_write_i2c_combined_generic()
591 ixgbe_write_i2c_combined_generic_unlocked(struct ixgbe_hw *hw, in ixgbe_write_i2c_combined_generic_unlocked() argument
594 return ixgbe_write_i2c_combined_generic_int(hw, addr, reg, val, false); in ixgbe_write_i2c_combined_generic_unlocked()
604 s32 ixgbe_init_ops_X550EM(struct ixgbe_hw *hw) in ixgbe_init_ops_X550EM() argument
606 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_ops_X550EM()
607 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_ops_X550EM()
608 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_init_ops_X550EM()
614 ret_val = ixgbe_init_ops_X550(hw); in ixgbe_init_ops_X550EM()
647 hw->bus.type = ixgbe_bus_type_internal; in ixgbe_init_ops_X550EM()
658 if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) in ixgbe_init_ops_X550EM()
665 switch (hw->device_id) { in ixgbe_init_ops_X550EM()
682 if (mac->ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_init_ops_X550EM()
703 static s32 ixgbe_setup_fw_link(struct ixgbe_hw *hw) in ixgbe_setup_fw_link() argument
709 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw)) in ixgbe_setup_fw_link()
712 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fw_link()
718 switch (hw->fc.requested_mode) { in ixgbe_setup_fw_link()
736 if (hw->phy.autoneg_advertised & ixgbe_fw_map[i].phy_speed) in ixgbe_setup_fw_link()
741 if (hw->phy.eee_speeds_advertised) in ixgbe_setup_fw_link()
744 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_SETUP_LINK, &setup); in ixgbe_setup_fw_link()
758 static s32 ixgbe_fc_autoneg_fw(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_fw() argument
760 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_fc_autoneg_fw()
761 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_fc_autoneg_fw()
763 return ixgbe_setup_fw_link(hw); in ixgbe_fc_autoneg_fw()
774 static s32 ixgbe_setup_eee_fw(struct ixgbe_hw *hw, bool enable_eee) in ixgbe_setup_eee_fw() argument
776 if (!!hw->phy.eee_speeds_advertised == enable_eee) in ixgbe_setup_eee_fw()
779 hw->phy.eee_speeds_advertised = hw->phy.eee_speeds_supported; in ixgbe_setup_eee_fw()
781 hw->phy.eee_speeds_advertised = 0; in ixgbe_setup_eee_fw()
782 return hw->phy.ops.setup_link(hw); in ixgbe_setup_eee_fw()
792 s32 ixgbe_init_ops_X550EM_a(struct ixgbe_hw *hw) in ixgbe_init_ops_X550EM_a() argument
794 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_ops_X550EM_a()
800 ret_val = ixgbe_init_ops_X550EM(hw); in ixgbe_init_ops_X550EM_a()
802 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII || in ixgbe_init_ops_X550EM_a()
803 hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII_L) { in ixgbe_init_ops_X550EM_a()
813 switch (mac->ops.get_media_type(hw)) { in ixgbe_init_ops_X550EM_a()
826 switch (hw->device_id) { in ixgbe_init_ops_X550EM_a()
832 hw->phy.eee_speeds_supported = IXGBE_LINK_SPEED_100_FULL | in ixgbe_init_ops_X550EM_a()
834 hw->phy.eee_speeds_advertised = hw->phy.eee_speeds_supported; in ixgbe_init_ops_X550EM_a()
850 s32 ixgbe_init_ops_X550EM_x(struct ixgbe_hw *hw) in ixgbe_init_ops_X550EM_x() argument
852 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_ops_X550EM_x()
853 struct ixgbe_link_info *link = &hw->link; in ixgbe_init_ops_X550EM_x()
859 ret_val = ixgbe_init_ops_X550EM(hw); in ixgbe_init_ops_X550EM_x()
872 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_1G_T) { in ixgbe_init_ops_X550EM_x()
888 s32 ixgbe_dmac_config_X550(struct ixgbe_hw *hw) in ixgbe_dmac_config_X550() argument
895 reg = IXGBE_READ_REG(hw, IXGBE_DMACR); in ixgbe_dmac_config_X550()
897 IXGBE_WRITE_REG(hw, IXGBE_DMACR, reg); in ixgbe_dmac_config_X550()
900 if (!hw->mac.dmac_config.watchdog_timer) in ixgbe_dmac_config_X550()
903 ixgbe_dmac_config_tcs_X550(hw); in ixgbe_dmac_config_X550()
906 reg = IXGBE_READ_REG(hw, IXGBE_DMACR); in ixgbe_dmac_config_X550()
910 reg |= (hw->mac.dmac_config.watchdog_timer * 100) / 4096; in ixgbe_dmac_config_X550()
914 if (hw->mac.dmac_config.fcoe_en) { in ixgbe_dmac_config_X550()
915 high_pri_tc = 1 << hw->mac.dmac_config.fcoe_tc; in ixgbe_dmac_config_X550()
923 IXGBE_WRITE_REG(hw, IXGBE_DMACR, reg); in ixgbe_dmac_config_X550()
936 s32 ixgbe_dmac_config_tcs_X550(struct ixgbe_hw *hw) in ixgbe_dmac_config_tcs_X550() argument
943 switch (hw->mac.dmac_config.link_speed) { in ixgbe_dmac_config_tcs_X550()
956 maxframe_size_kb = ((IXGBE_READ_REG(hw, IXGBE_MAXFRS) >> in ixgbe_dmac_config_tcs_X550()
961 reg = IXGBE_READ_REG(hw, IXGBE_DMCTH(tc)); in ixgbe_dmac_config_tcs_X550()
964 if (tc < hw->mac.dmac_config.num_tcs) { in ixgbe_dmac_config_tcs_X550()
966 rx_pb_size = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(tc)); in ixgbe_dmac_config_tcs_X550()
980 IXGBE_WRITE_REG(hw, IXGBE_DMCTH(tc), reg); in ixgbe_dmac_config_tcs_X550()
991 s32 ixgbe_dmac_update_tcs_X550(struct ixgbe_hw *hw) in ixgbe_dmac_update_tcs_X550() argument
998 reg = IXGBE_READ_REG(hw, IXGBE_DMACR); in ixgbe_dmac_update_tcs_X550()
1000 IXGBE_WRITE_REG(hw, IXGBE_DMACR, reg); in ixgbe_dmac_update_tcs_X550()
1002 ixgbe_dmac_config_tcs_X550(hw); in ixgbe_dmac_update_tcs_X550()
1005 reg = IXGBE_READ_REG(hw, IXGBE_DMACR); in ixgbe_dmac_update_tcs_X550()
1007 IXGBE_WRITE_REG(hw, IXGBE_DMACR, reg); in ixgbe_dmac_update_tcs_X550()
1019 s32 ixgbe_init_eeprom_params_X550(struct ixgbe_hw *hw) in ixgbe_init_eeprom_params_X550() argument
1021 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_X550()
1031 eec = IXGBE_READ_REG(hw, IXGBE_EEC); in ixgbe_init_eeprom_params_X550()
1050 void ixgbe_set_source_address_pruning_X550(struct ixgbe_hw *hw, bool enable, in ixgbe_set_source_address_pruning_X550() argument
1059 pfflp = (u64)IXGBE_READ_REG(hw, IXGBE_PFFLPL); in ixgbe_set_source_address_pruning_X550()
1060 pfflp |= (u64)IXGBE_READ_REG(hw, IXGBE_PFFLPH) << 32; in ixgbe_set_source_address_pruning_X550()
1067 IXGBE_WRITE_REG(hw, IXGBE_PFFLPL, (u32)pfflp); in ixgbe_set_source_address_pruning_X550()
1068 IXGBE_WRITE_REG(hw, IXGBE_PFFLPH, (u32)(pfflp >> 32)); in ixgbe_set_source_address_pruning_X550()
1078 void ixgbe_set_ethertype_anti_spoofing_X550(struct ixgbe_hw *hw, in ixgbe_set_ethertype_anti_spoofing_X550() argument
1087 pfvfspoof = IXGBE_READ_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg)); in ixgbe_set_ethertype_anti_spoofing_X550()
1093 IXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg), pfvfspoof); in ixgbe_set_ethertype_anti_spoofing_X550()
1105 static s32 ixgbe_iosf_wait(struct ixgbe_hw *hw, u32 *ctrl) in ixgbe_iosf_wait() argument
1114 command = IXGBE_READ_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL); in ixgbe_iosf_wait()
1137 s32 ixgbe_write_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_iosf_sb_reg_x550() argument
1144 ret = ixgbe_acquire_swfw_semaphore(hw, gssr); in ixgbe_write_iosf_sb_reg_x550()
1148 ret = ixgbe_iosf_wait(hw, NULL); in ixgbe_write_iosf_sb_reg_x550()
1156 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL, command); in ixgbe_write_iosf_sb_reg_x550()
1159 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_DATA, data); in ixgbe_write_iosf_sb_reg_x550()
1161 ret = ixgbe_iosf_wait(hw, &command); in ixgbe_write_iosf_sb_reg_x550()
1172 ixgbe_release_swfw_semaphore(hw, gssr); in ixgbe_write_iosf_sb_reg_x550()
1183 s32 ixgbe_read_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_iosf_sb_reg_x550() argument
1190 ret = ixgbe_acquire_swfw_semaphore(hw, gssr); in ixgbe_read_iosf_sb_reg_x550()
1194 ret = ixgbe_iosf_wait(hw, NULL); in ixgbe_read_iosf_sb_reg_x550()
1202 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL, command); in ixgbe_read_iosf_sb_reg_x550()
1204 ret = ixgbe_iosf_wait(hw, &command); in ixgbe_read_iosf_sb_reg_x550()
1215 *data = IXGBE_READ_REG(hw, IXGBE_SB_IOSF_INDIRECT_DATA); in ixgbe_read_iosf_sb_reg_x550()
1218 ixgbe_release_swfw_semaphore(hw, gssr); in ixgbe_read_iosf_sb_reg_x550()
1227 s32 ixgbe_get_phy_token(struct ixgbe_hw *hw) in ixgbe_get_phy_token() argument
1236 token_cmd.port_number = hw->bus.lan_id; in ixgbe_get_phy_token()
1239 status = ixgbe_host_interface_command(hw, (u32 *)&token_cmd, in ixgbe_get_phy_token()
1265 s32 ixgbe_put_phy_token(struct ixgbe_hw *hw) in ixgbe_put_phy_token() argument
1274 token_cmd.port_number = hw->bus.lan_id; in ixgbe_put_phy_token()
1277 status = ixgbe_host_interface_command(hw, (u32 *)&token_cmd, in ixgbe_put_phy_token()
1298 s32 ixgbe_write_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_iosf_sb_reg_x550a() argument
1309 write_cmd.port_number = hw->bus.lan_id; in ixgbe_write_iosf_sb_reg_x550a()
1314 status = ixgbe_host_interface_command(hw, (u32 *)&write_cmd, in ixgbe_write_iosf_sb_reg_x550a()
1328 s32 ixgbe_read_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_iosf_sb_reg_x550a() argument
1342 hic.cmd.port_number = hw->bus.lan_id; in ixgbe_read_iosf_sb_reg_x550a()
1346 status = ixgbe_host_interface_command(hw, (u32 *)&hic.cmd, in ixgbe_read_iosf_sb_reg_x550a()
1362 void ixgbe_disable_mdd_X550(struct ixgbe_hw *hw) in ixgbe_disable_mdd_X550() argument
1369 reg = IXGBE_READ_REG(hw, IXGBE_DMATXCTL); in ixgbe_disable_mdd_X550()
1371 IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, reg); in ixgbe_disable_mdd_X550()
1374 reg = IXGBE_READ_REG(hw, IXGBE_RDRXCTL); in ixgbe_disable_mdd_X550()
1376 IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, reg); in ixgbe_disable_mdd_X550()
1385 void ixgbe_enable_mdd_X550(struct ixgbe_hw *hw) in ixgbe_enable_mdd_X550() argument
1392 reg = IXGBE_READ_REG(hw, IXGBE_DMATXCTL); in ixgbe_enable_mdd_X550()
1394 IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, reg); in ixgbe_enable_mdd_X550()
1397 reg = IXGBE_READ_REG(hw, IXGBE_RDRXCTL); in ixgbe_enable_mdd_X550()
1399 IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, reg); in ixgbe_enable_mdd_X550()
1409 void ixgbe_restore_mdd_vf_X550(struct ixgbe_hw *hw, u32 vf) in ixgbe_restore_mdd_vf_X550() argument
1416 reg = IXGBE_READ_REG(hw, IXGBE_MRQC); in ixgbe_restore_mdd_vf_X550()
1438 IXGBE_WRITE_REG(hw, IXGBE_WQBR_TX(idx), reg); in ixgbe_restore_mdd_vf_X550()
1439 IXGBE_WRITE_REG(hw, IXGBE_WQBR_RX(idx), reg); in ixgbe_restore_mdd_vf_X550()
1449 void ixgbe_mdd_event_X550(struct ixgbe_hw *hw, u32 *vf_bitmap) in ixgbe_mdd_event_X550() argument
1457 reg = IXGBE_READ_REG(hw, IXGBE_MRQC); in ixgbe_mdd_event_X550()
1473 wqbr = IXGBE_READ_REG(hw, IXGBE_WQBR_TX(i)); in ixgbe_mdd_event_X550()
1474 wqbr |= IXGBE_READ_REG(hw, IXGBE_WQBR_RX(i)); in ixgbe_mdd_event_X550()
1505 enum ixgbe_media_type ixgbe_get_media_type_X550em(struct ixgbe_hw *hw) in ixgbe_get_media_type_X550em() argument
1512 switch (hw->device_id) { in ixgbe_get_media_type_X550em()
1535 hw->phy.type = ixgbe_phy_sgmii; in ixgbe_get_media_type_X550em()
1553 static s32 ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear) in ixgbe_supported_sfp_modules_X550em() argument
1557 switch (hw->phy.sfp_type) { in ixgbe_supported_sfp_modules_X550em()
1590 s32 ixgbe_identify_sfp_module_X550em(struct ixgbe_hw *hw) in ixgbe_identify_sfp_module_X550em() argument
1597 status = ixgbe_identify_module_generic(hw); in ixgbe_identify_sfp_module_X550em()
1603 status = ixgbe_supported_sfp_modules_X550em(hw, &linear); in ixgbe_identify_sfp_module_X550em()
1612 s32 ixgbe_setup_sfp_modules_X550em(struct ixgbe_hw *hw) in ixgbe_setup_sfp_modules_X550em() argument
1620 status = ixgbe_supported_sfp_modules_X550em(hw, &linear); in ixgbe_setup_sfp_modules_X550em()
1625 ixgbe_init_mac_link_ops_X550em(hw); in ixgbe_setup_sfp_modules_X550em()
1626 hw->phy.ops.reset = NULL; in ixgbe_setup_sfp_modules_X550em()
1636 static s32 ixgbe_restart_an_internal_phy_x550em(struct ixgbe_hw *hw) in ixgbe_restart_an_internal_phy_x550em() argument
1642 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1643 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1652 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1653 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1656 if (hw->mac.type == ixgbe_mac_X550EM_a) { in ixgbe_restart_an_internal_phy_x550em()
1660 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1661 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1670 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1671 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1684 static s32 ixgbe_setup_sgmii(struct ixgbe_hw *hw, ixgbe_link_speed speed, in ixgbe_setup_sgmii() argument
1687 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sgmii()
1691 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1692 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii()
1702 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1703 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii()
1708 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1709 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii()
1716 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1717 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii()
1722 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1723 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
1734 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1735 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
1740 rc = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_sgmii()
1744 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait); in ixgbe_setup_sgmii()
1753 static s32 ixgbe_setup_sgmii_fw(struct ixgbe_hw *hw, ixgbe_link_speed speed, in ixgbe_setup_sgmii_fw() argument
1756 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sgmii_fw()
1760 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
1761 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
1771 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
1772 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
1777 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
1778 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
1785 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
1786 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
1791 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
1792 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
1797 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
1798 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
1809 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
1810 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
1815 rc = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_sgmii_fw()
1817 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait); in ixgbe_setup_sgmii_fw()
1824 void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw) in ixgbe_init_mac_link_ops_X550em() argument
1826 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_mac_link_ops_X550em()
1830 switch (hw->mac.ops.get_media_type(hw)) { in ixgbe_init_mac_link_ops_X550em()
1842 if ((hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP_N) || in ixgbe_init_mac_link_ops_X550em()
1843 (hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP)) in ixgbe_init_mac_link_ops_X550em()
1851 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_1G_T) in ixgbe_init_mac_link_ops_X550em()
1853 if (hw->mac.type == ixgbe_mac_X550EM_a) { in ixgbe_init_mac_link_ops_X550em()
1854 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T || in ixgbe_init_mac_link_ops_X550em()
1855 hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T_L) { in ixgbe_init_mac_link_ops_X550em()
1869 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII || in ixgbe_init_mac_link_ops_X550em()
1870 hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII_L) in ixgbe_init_mac_link_ops_X550em()
1884 s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw, in ixgbe_get_link_capabilities_X550em() argument
1891 if (hw->phy.type == ixgbe_phy_fw) { in ixgbe_get_link_capabilities_X550em()
1893 *speed = hw->phy.speeds_supported; in ixgbe_get_link_capabilities_X550em()
1898 if (hw->phy.media_type == ixgbe_media_type_fiber) { in ixgbe_get_link_capabilities_X550em()
1904 if (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || in ixgbe_get_link_capabilities_X550em()
1905 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1 in ixgbe_get_link_capabilities_X550em()
1906 || hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 || in ixgbe_get_link_capabilities_X550em()
1907 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1) { in ixgbe_get_link_capabilities_X550em()
1913 if (hw->phy.multispeed_fiber) in ixgbe_get_link_capabilities_X550em()
1921 switch (hw->phy.type) { in ixgbe_get_link_capabilities_X550em()
1932 if (hw->mac.type == ixgbe_mac_X550EM_a) { in ixgbe_get_link_capabilities_X550em()
1934 if (hw->phy.nw_mng_if_sel & in ixgbe_get_link_capabilities_X550em()
1938 } else if (hw->device_id == in ixgbe_get_link_capabilities_X550em()
1967 static s32 ixgbe_get_lasi_ext_t_x550em(struct ixgbe_hw *hw, bool *lsc) in ixgbe_get_lasi_ext_t_x550em() argument
1975 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG, in ixgbe_get_lasi_ext_t_x550em()
1984 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_FLAG, in ixgbe_get_lasi_ext_t_x550em()
1994 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_ALARM_1, in ixgbe_get_lasi_ext_t_x550em()
2004 ixgbe_set_copper_phy_power(hw, false); in ixgbe_get_lasi_ext_t_x550em()
2008 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_FAULT_MSG, in ixgbe_get_lasi_ext_t_x550em()
2018 ixgbe_set_copper_phy_power(hw, false); in ixgbe_get_lasi_ext_t_x550em()
2024 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG, in ixgbe_get_lasi_ext_t_x550em()
2032 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM2, in ixgbe_get_lasi_ext_t_x550em()
2054 static s32 ixgbe_enable_lasi_ext_t_x550em(struct ixgbe_hw *hw) in ixgbe_enable_lasi_ext_t_x550em() argument
2061 status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc); in ixgbe_enable_lasi_ext_t_x550em()
2073 if (hw->mac.type != ixgbe_mac_X550EM_a) { in ixgbe_enable_lasi_ext_t_x550em()
2074 status = hw->phy.ops.read_reg(hw, in ixgbe_enable_lasi_ext_t_x550em()
2083 status = hw->phy.ops.write_reg(hw, in ixgbe_enable_lasi_ext_t_x550em()
2092 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2102 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2110 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2120 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2128 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2137 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2151 static s32 ixgbe_setup_kr_speed_x550em(struct ixgbe_hw *hw, in ixgbe_setup_kr_speed_x550em() argument
2157 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2158 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2175 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2176 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2179 if (hw->mac.type == ixgbe_mac_X550EM_a) { in ixgbe_setup_kr_speed_x550em()
2181 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2182 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2194 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2195 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2199 return ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_kr_speed_x550em()
2206 static s32 ixgbe_reset_phy_fw(struct ixgbe_hw *hw) in ixgbe_reset_phy_fw() argument
2211 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw)) in ixgbe_reset_phy_fw()
2214 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_PHY_SW_RESET, &store); in ixgbe_reset_phy_fw()
2219 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_INIT_PHY, &store); in ixgbe_reset_phy_fw()
2223 return ixgbe_setup_fw_link(hw); in ixgbe_reset_phy_fw()
2230 static s32 ixgbe_check_overtemp_fw(struct ixgbe_hw *hw) in ixgbe_check_overtemp_fw() argument
2235 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &store); in ixgbe_check_overtemp_fw()
2240 ixgbe_shutdown_fw_phy(hw); in ixgbe_check_overtemp_fw()
2253 static s32 ixgbe_read_mng_if_sel_x550em(struct ixgbe_hw *hw) in ixgbe_read_mng_if_sel_x550em() argument
2258 hw->phy.nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL); in ixgbe_read_mng_if_sel_x550em()
2263 if (hw->mac.type == ixgbe_mac_X550EM_a && in ixgbe_read_mng_if_sel_x550em()
2264 hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_MDIO_ACT) { in ixgbe_read_mng_if_sel_x550em()
2265 hw->phy.addr = (hw->phy.nw_mng_if_sel & in ixgbe_read_mng_if_sel_x550em()
2281 s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw) in ixgbe_init_phy_ops_X550em() argument
2283 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_init_phy_ops_X550em()
2288 hw->mac.ops.set_lan_id(hw); in ixgbe_init_phy_ops_X550em()
2289 ixgbe_read_mng_if_sel_x550em(hw); in ixgbe_init_phy_ops_X550em()
2291 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) { in ixgbe_init_phy_ops_X550em()
2293 ixgbe_setup_mux_ctl(hw); in ixgbe_init_phy_ops_X550em()
2297 switch (hw->device_id) { in ixgbe_init_phy_ops_X550em()
2302 hw->phy.ops.read_reg = NULL; in ixgbe_init_phy_ops_X550em()
2303 hw->phy.ops.write_reg = NULL; in ixgbe_init_phy_ops_X550em()
2305 if (hw->bus.lan_id) in ixgbe_init_phy_ops_X550em()
2306 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM; in ixgbe_init_phy_ops_X550em()
2308 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM; in ixgbe_init_phy_ops_X550em()
2313 hw->phy.ops.read_reg = ixgbe_read_phy_reg_x550a; in ixgbe_init_phy_ops_X550em()
2314 hw->phy.ops.write_reg = ixgbe_write_phy_reg_x550a; in ixgbe_init_phy_ops_X550em()
2315 if (hw->bus.lan_id) in ixgbe_init_phy_ops_X550em()
2316 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM; in ixgbe_init_phy_ops_X550em()
2318 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM; in ixgbe_init_phy_ops_X550em()
2322 hw->phy.phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM; in ixgbe_init_phy_ops_X550em()
2332 ret_val = phy->ops.identify(hw); in ixgbe_init_phy_ops_X550em()
2338 ixgbe_init_mac_link_ops_X550em(hw); in ixgbe_init_phy_ops_X550em()
2343 switch (hw->phy.type) { in ixgbe_init_phy_ops_X550em()
2373 if ((hw->mac.type == ixgbe_mac_X550EM_x) && in ixgbe_init_phy_ops_X550em()
2375 IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0)))) in ixgbe_init_phy_ops_X550em()
2398 static void ixgbe_set_mdio_speed(struct ixgbe_hw *hw) in ixgbe_set_mdio_speed() argument
2402 switch (hw->device_id) { in ixgbe_set_mdio_speed()
2410 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0); in ixgbe_set_mdio_speed()
2412 IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); in ixgbe_set_mdio_speed()
2417 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0); in ixgbe_set_mdio_speed()
2419 IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); in ixgbe_set_mdio_speed()
2434 s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw) in ixgbe_reset_hw_X550em() argument
2441 u32 swfw_mask = hw->phy.phy_semaphore_mask; in ixgbe_reset_hw_X550em()
2446 status = hw->mac.ops.stop_adapter(hw); in ixgbe_reset_hw_X550em()
2452 ixgbe_clear_tx_pending(hw); in ixgbe_reset_hw_X550em()
2454 ixgbe_set_mdio_speed(hw); in ixgbe_reset_hw_X550em()
2457 status = hw->phy.ops.init(hw); in ixgbe_reset_hw_X550em()
2470 if (hw->phy.type == ixgbe_phy_x550em_ext_t) { in ixgbe_reset_hw_X550em()
2471 status = ixgbe_init_ext_t_x550em(hw); in ixgbe_reset_hw_X550em()
2480 if (hw->phy.sfp_setup_needed) { in ixgbe_reset_hw_X550em()
2481 status = hw->mac.ops.setup_sfp(hw); in ixgbe_reset_hw_X550em()
2482 hw->phy.sfp_setup_needed = false; in ixgbe_reset_hw_X550em()
2489 if (!hw->phy.reset_disable && hw->phy.ops.reset) { in ixgbe_reset_hw_X550em()
2490 if (hw->phy.ops.reset(hw) == IXGBE_ERR_OVERTEMP) in ixgbe_reset_hw_X550em()
2501 if (!hw->force_full_reset) { in ixgbe_reset_hw_X550em()
2502 hw->mac.ops.check_link(hw, &link_speed, &link_up, false); in ixgbe_reset_hw_X550em()
2507 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X550em()
2513 ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X550em()
2514 IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl); in ixgbe_reset_hw_X550em()
2515 IXGBE_WRITE_FLUSH(hw); in ixgbe_reset_hw_X550em()
2516 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X550em()
2521 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X550em()
2537 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { in ixgbe_reset_hw_X550em()
2538 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_reset_hw_X550em()
2543 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); in ixgbe_reset_hw_X550em()
2549 hw->mac.num_rar_entries = 128; in ixgbe_reset_hw_X550em()
2550 hw->mac.ops.init_rx_addrs(hw); in ixgbe_reset_hw_X550em()
2552 ixgbe_set_mdio_speed(hw); in ixgbe_reset_hw_X550em()
2554 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP) in ixgbe_reset_hw_X550em()
2555 ixgbe_setup_mux_ctl(hw); in ixgbe_reset_hw_X550em()
2567 s32 ixgbe_init_ext_t_x550em(struct ixgbe_hw *hw) in ixgbe_init_ext_t_x550em() argument
2572 status = hw->phy.ops.read_reg(hw, in ixgbe_init_ext_t_x550em()
2584 status = hw->phy.ops.read_reg(hw, in ixgbe_init_ext_t_x550em()
2594 status = hw->phy.ops.write_reg(hw, in ixgbe_init_ext_t_x550em()
2610 s32 ixgbe_setup_kr_x550em(struct ixgbe_hw *hw) in ixgbe_setup_kr_x550em() argument
2613 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL) in ixgbe_setup_kr_x550em()
2616 if (ixgbe_check_reset_blocked(hw)) in ixgbe_setup_kr_x550em()
2619 return ixgbe_setup_kr_speed_x550em(hw, hw->phy.autoneg_advertised); in ixgbe_setup_kr_x550em()
2630 s32 ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_sfp_x550em() argument
2640 ret_val = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear); in ixgbe_setup_mac_link_sfp_x550em()
2653 ixgbe_setup_kr_speed_x550em(hw, speed); in ixgbe_setup_mac_link_sfp_x550em()
2657 (hw->bus.lan_id << 12); in ixgbe_setup_mac_link_sfp_x550em()
2662 ret_val = hw->link.ops.write_link(hw, hw->link.addr, reg_slice, in ixgbe_setup_mac_link_sfp_x550em()
2675 static s32 ixgbe_setup_sfi_x550a(struct ixgbe_hw *hw, ixgbe_link_speed *speed) in ixgbe_setup_sfi_x550a() argument
2677 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sfi_x550a()
2682 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sfi_x550a()
2683 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sfi_x550a()
2706 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sfi_x550a()
2707 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sfi_x550a()
2711 status = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_sfi_x550a()
2724 s32 ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_sfp_x550a() argument
2736 ret_val = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear); in ixgbe_setup_mac_link_sfp_x550a()
2747 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP_N) { in ixgbe_setup_mac_link_sfp_x550a()
2749 ret_val = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_mac_link_sfp_x550a()
2750 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_mac_link_sfp_x550a()
2760 ret_val = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_mac_link_sfp_x550a()
2761 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_mac_link_sfp_x550a()
2768 ret_val = ixgbe_setup_sfi_x550a(hw, &speed); in ixgbe_setup_mac_link_sfp_x550a()
2771 ixgbe_setup_kr_speed_x550em(hw, speed); in ixgbe_setup_mac_link_sfp_x550a()
2773 if (hw->phy.addr == 0x0 || hw->phy.addr == 0xFFFF) { in ixgbe_setup_mac_link_sfp_x550a()
2780 ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_EFUSE_PDF_SKU, in ixgbe_setup_mac_link_sfp_x550a()
2790 slice_offset = (hw->bus.lan_id + in ixgbe_setup_mac_link_sfp_x550a()
2791 (hw->bus.instance_id << 1)) << 12; in ixgbe_setup_mac_link_sfp_x550a()
2793 slice_offset = hw->bus.lan_id << 12; in ixgbe_setup_mac_link_sfp_x550a()
2798 ret_val = hw->phy.ops.read_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
2811 ret_val = hw->phy.ops.write_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
2815 ret_val = hw->phy.ops.read_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
2827 static s32 ixgbe_setup_ixfi_x550em_x(struct ixgbe_hw *hw) in ixgbe_setup_ixfi_x550em_x() argument
2829 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_ixfi_x550em_x()
2834 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2835 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2840 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2841 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2847 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2848 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2855 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2856 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2860 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2861 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2868 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2869 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2875 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2876 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2884 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2885 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2898 static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed) in ixgbe_setup_ixfi_x550em() argument
2900 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_ixfi_x550em()
2909 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em()
2910 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
2931 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em()
2932 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
2938 if (hw->mac.type == ixgbe_mac_X550EM_x) { in ixgbe_setup_ixfi_x550em()
2939 status = ixgbe_setup_ixfi_x550em_x(hw); in ixgbe_setup_ixfi_x550em()
2945 status = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_ixfi_x550em()
2957 static s32 ixgbe_ext_phy_t_x550em_get_link(struct ixgbe_hw *hw, bool *link_up) in ixgbe_ext_phy_t_x550em_get_link() argument
2965 ret = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS, in ixgbe_ext_phy_t_x550em_get_link()
2971 ret = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS, in ixgbe_ext_phy_t_x550em_get_link()
2994 s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw) in ixgbe_setup_internal_phy_t_x550em() argument
3001 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_setup_internal_phy_t_x550em()
3004 if (hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_setup_internal_phy_t_x550em()
3005 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) { in ixgbe_setup_internal_phy_t_x550em()
3007 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_setup_internal_phy_t_x550em()
3014 status = hw->phy.ops.read_reg(hw, in ixgbe_setup_internal_phy_t_x550em()
3022 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_setup_internal_phy_t_x550em()
3043 return ixgbe_setup_ixfi_x550em(hw, &force_speed); in ixgbe_setup_internal_phy_t_x550em()
3047 return ixgbe_setup_kr_speed_x550em(hw, speed); in ixgbe_setup_internal_phy_t_x550em()
3057 s32 ixgbe_setup_phy_loopback_x550em(struct ixgbe_hw *hw) in ixgbe_setup_phy_loopback_x550em() argument
3063 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
3064 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3071 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
3072 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3078 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
3079 IXGBE_KRM_PORT_CAR_GEN_CTRL(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3085 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
3086 IXGBE_KRM_PORT_CAR_GEN_CTRL(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3092 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
3093 IXGBE_KRM_PMD_DFX_BURNIN(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3098 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
3099 IXGBE_KRM_PMD_DFX_BURNIN(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3105 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
3106 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3111 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
3112 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3127 s32 ixgbe_read_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 *data) in ixgbe_read_ee_hostif_X550() argument
3147 status = hw->mac.ops.acquire_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_X550()
3151 status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer), in ixgbe_read_ee_hostif_X550()
3154 *data = (u16)IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, in ixgbe_read_ee_hostif_X550()
3158 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_X550()
3171 s32 ixgbe_read_ee_hostif_buffer_X550(struct ixgbe_hw *hw, in ixgbe_read_ee_hostif_buffer_X550() argument
3184 status = hw->mac.ops.acquire_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_buffer_X550()
3208 status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer), in ixgbe_read_ee_hostif_buffer_X550()
3219 u32 value = IXGBE_READ_REG(hw, reg); in ixgbe_read_ee_hostif_buffer_X550()
3234 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_buffer_X550()
3246 s32 ixgbe_write_ee_hostif_data_X550(struct ixgbe_hw *hw, u16 offset, in ixgbe_write_ee_hostif_data_X550() argument
3264 status = ixgbe_host_interface_command(hw, (u32 *)&buffer, in ixgbe_write_ee_hostif_data_X550()
3290 s32 ixgbe_write_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, in ixgbe_write_ee_hostif_X550() argument
3297 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == in ixgbe_write_ee_hostif_X550()
3299 status = ixgbe_write_ee_hostif_data_X550(hw, offset, data); in ixgbe_write_ee_hostif_X550()
3300 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_X550()
3318 s32 ixgbe_write_ee_hostif_buffer_X550(struct ixgbe_hw *hw, in ixgbe_write_ee_hostif_buffer_X550() argument
3327 status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_buffer_X550()
3334 status = ixgbe_write_ee_hostif_data_X550(hw, offset + i, in ixgbe_write_ee_hostif_buffer_X550()
3343 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_buffer_X550()
3360 static s32 ixgbe_checksum_ptr_x550(struct ixgbe_hw *hw, u16 ptr, in ixgbe_checksum_ptr_x550() argument
3373 status = ixgbe_read_ee_hostif_buffer_X550(hw, ptr, bufsz, buf); in ixgbe_checksum_ptr_x550()
3394 (ptr + length) >= hw->eeprom.word_size) in ixgbe_checksum_ptr_x550()
3409 status = ixgbe_read_ee_hostif_buffer_X550(hw, ptr, in ixgbe_checksum_ptr_x550()
3429 s32 ixgbe_calc_checksum_X550(struct ixgbe_hw *hw, u16 *buffer, u32 buffer_size) in ixgbe_calc_checksum_X550() argument
3439 hw->eeprom.ops.init_params(hw); in ixgbe_calc_checksum_X550()
3443 status = ixgbe_read_ee_hostif_buffer_X550(hw, 0, in ixgbe_calc_checksum_X550()
3477 pointer >= hw->eeprom.word_size) in ixgbe_calc_checksum_X550()
3493 status = ixgbe_checksum_ptr_x550(hw, pointer, size, &checksum, in ixgbe_calc_checksum_X550()
3510 s32 ixgbe_calc_eeprom_checksum_X550(struct ixgbe_hw *hw) in ixgbe_calc_eeprom_checksum_X550() argument
3512 return ixgbe_calc_checksum_X550(hw, NULL, 0); in ixgbe_calc_eeprom_checksum_X550()
3523 s32 ixgbe_validate_eeprom_checksum_X550(struct ixgbe_hw *hw, u16 *checksum_val) in ixgbe_validate_eeprom_checksum_X550() argument
3535 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_validate_eeprom_checksum_X550()
3541 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_validate_eeprom_checksum_X550()
3547 status = ixgbe_read_ee_hostif_X550(hw, IXGBE_EEPROM_CHECKSUM, in ixgbe_validate_eeprom_checksum_X550()
3576 s32 ixgbe_update_eeprom_checksum_X550(struct ixgbe_hw *hw) in ixgbe_update_eeprom_checksum_X550() argument
3587 status = ixgbe_read_ee_hostif_X550(hw, 0, &checksum); in ixgbe_update_eeprom_checksum_X550()
3593 status = ixgbe_calc_eeprom_checksum_X550(hw); in ixgbe_update_eeprom_checksum_X550()
3599 status = ixgbe_write_ee_hostif_X550(hw, IXGBE_EEPROM_CHECKSUM, in ixgbe_update_eeprom_checksum_X550()
3604 status = ixgbe_update_flash_X550(hw); in ixgbe_update_eeprom_checksum_X550()
3615 s32 ixgbe_update_flash_X550(struct ixgbe_hw *hw) in ixgbe_update_flash_X550() argument
3627 status = ixgbe_host_interface_command(hw, (u32 *)&buffer, in ixgbe_update_flash_X550()
3640 u64 ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw) in ixgbe_get_supported_physical_layer_X550em() argument
3647 hw->phy.ops.identify(hw); in ixgbe_get_supported_physical_layer_X550em()
3649 switch (hw->phy.type) { in ixgbe_get_supported_physical_layer_X550em()
3651 if (hw->mac.type == ixgbe_mac_X550EM_a) { in ixgbe_get_supported_physical_layer_X550em()
3652 if (hw->phy.nw_mng_if_sel & in ixgbe_get_supported_physical_layer_X550em()
3657 } else if (hw->device_id == in ixgbe_get_supported_physical_layer_X550em()
3674 hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_EXT_ABILITY, in ixgbe_get_supported_physical_layer_X550em()
3683 if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_1GB_FULL) in ixgbe_get_supported_physical_layer_X550em()
3685 if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_100_FULL) in ixgbe_get_supported_physical_layer_X550em()
3687 if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_10_FULL) in ixgbe_get_supported_physical_layer_X550em()
3700 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) in ixgbe_get_supported_physical_layer_X550em()
3701 physical_layer = ixgbe_get_supported_phy_sfp_layer_generic(hw); in ixgbe_get_supported_physical_layer_X550em()
3713 s32 ixgbe_get_bus_info_X550em(struct ixgbe_hw *hw) in ixgbe_get_bus_info_X550em() argument
3718 hw->bus.width = ixgbe_bus_width_unknown; in ixgbe_get_bus_info_X550em()
3719 hw->bus.speed = ixgbe_bus_speed_unknown; in ixgbe_get_bus_info_X550em()
3721 hw->mac.ops.set_lan_id(hw); in ixgbe_get_bus_info_X550em()
3732 void ixgbe_disable_rx_x550(struct ixgbe_hw *hw) in ixgbe_disable_rx_x550() argument
3740 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); in ixgbe_disable_rx_x550()
3742 pfdtxgswc = IXGBE_READ_REG(hw, IXGBE_PFDTXGSWC); in ixgbe_disable_rx_x550()
3745 IXGBE_WRITE_REG(hw, IXGBE_PFDTXGSWC, pfdtxgswc); in ixgbe_disable_rx_x550()
3746 hw->mac.set_lben = true; in ixgbe_disable_rx_x550()
3748 hw->mac.set_lben = false; in ixgbe_disable_rx_x550()
3754 fw_cmd.port_number = (u8)hw->bus.lan_id; in ixgbe_disable_rx_x550()
3756 status = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd, in ixgbe_disable_rx_x550()
3762 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); in ixgbe_disable_rx_x550()
3765 IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, rxctrl); in ixgbe_disable_rx_x550()
3779 s32 ixgbe_enter_lplu_t_x550em(struct ixgbe_hw *hw) in ixgbe_enter_lplu_t_x550em() argument
3788 if ((hw->mac.type == ixgbe_mac_X550EM_x) && in ixgbe_enter_lplu_t_x550em()
3790 IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0)))) in ixgbe_enter_lplu_t_x550em()
3794 if (ixgbe_check_reset_blocked(hw)) in ixgbe_enter_lplu_t_x550em()
3797 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_enter_lplu_t_x550em()
3801 status = ixgbe_read_eeprom(hw, NVM_INIT_CTRL_3, &hw->eeprom.ctrl_word_3); in ixgbe_enter_lplu_t_x550em()
3809 if (!link_up || !(hw->eeprom.ctrl_word_3 & NVM_INIT_CTRL_3_LPLU) || in ixgbe_enter_lplu_t_x550em()
3810 !(hw->wol_enabled || ixgbe_mng_present(hw))) in ixgbe_enter_lplu_t_x550em()
3811 return ixgbe_set_copper_phy_power(hw, false); in ixgbe_enter_lplu_t_x550em()
3814 status = ixgbe_get_lcd_t_x550em(hw, &lcd_speed); in ixgbe_enter_lplu_t_x550em()
3821 return ixgbe_set_copper_phy_power(hw, false); in ixgbe_enter_lplu_t_x550em()
3823 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT, in ixgbe_enter_lplu_t_x550em()
3831 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_enter_lplu_t_x550em()
3833 return ixgbe_set_copper_phy_power(hw, false); in ixgbe_enter_lplu_t_x550em()
3846 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM, in ixgbe_enter_lplu_t_x550em()
3853 status = hw->phy.ops.read_reg(hw, IXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG, in ixgbe_enter_lplu_t_x550em()
3860 status = hw->phy.ops.read_reg(hw, in ixgbe_enter_lplu_t_x550em()
3868 save_autoneg = hw->phy.autoneg_advertised; in ixgbe_enter_lplu_t_x550em()
3871 status = hw->mac.ops.setup_link(hw, lcd_speed, false); in ixgbe_enter_lplu_t_x550em()
3874 hw->phy.autoneg_advertised = save_autoneg; in ixgbe_enter_lplu_t_x550em()
3886 s32 ixgbe_get_lcd_t_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *lcd_speed) in ixgbe_get_lcd_t_x550em() argument
3890 u16 word = hw->eeprom.ctrl_word_3; in ixgbe_get_lcd_t_x550em()
3894 status = hw->phy.ops.read_reg(hw, IXGBE_AUTO_NEG_LP_STATUS, in ixgbe_get_lcd_t_x550em()
3908 if ((hw->bus.lan_id && (word & NVM_INIT_CTRL_3_D10GMP_PORT1)) || in ixgbe_get_lcd_t_x550em()
3923 s32 ixgbe_setup_fc_X550em(struct ixgbe_hw *hw) in ixgbe_setup_fc_X550em() argument
3931 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fc_X550em()
3941 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_setup_fc_X550em()
3942 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_setup_fc_X550em()
3945 switch (hw->fc.requested_mode) { in ixgbe_setup_fc_X550em()
3974 switch (hw->device_id) { in ixgbe_setup_fc_X550em()
3978 ret_val = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_fc_X550em()
3979 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_X550em()
3989 ret_val = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_fc_X550em()
3990 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_X550em()
3994 hw->fc.disable_fc_autoneg = true; in ixgbe_setup_fc_X550em()
3997 hw->fc.disable_fc_autoneg = true; in ixgbe_setup_fc_X550em()
4013 void ixgbe_fc_autoneg_backplane_x550em_a(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_backplane_x550em_a() argument
4025 if (hw->fc.disable_fc_autoneg) { in ixgbe_fc_autoneg_backplane_x550em_a()
4031 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_fc_autoneg_backplane_x550em_a()
4038 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
4039 IXGBE_KRM_LINK_S1(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
4052 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
4053 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
4061 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
4062 IXGBE_KRM_LP_BASE_PAGE_HIGH(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
4070 status = ixgbe_negotiate_fc(hw, an_cntl_1, lp_an_page_low, in ixgbe_fc_autoneg_backplane_x550em_a()
4078 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg_backplane_x550em_a()
4080 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_backplane_x550em_a()
4081 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_backplane_x550em_a()
4090 void ixgbe_fc_autoneg_fiber_x550em_a(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_fiber_x550em_a() argument
4092 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_fiber_x550em_a()
4093 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_fiber_x550em_a()
4102 void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_sgmii_x550em_a() argument
4114 if (hw->fc.disable_fc_autoneg) { in ixgbe_fc_autoneg_sgmii_x550em_a()
4120 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_fc_autoneg_sgmii_x550em_a()
4127 status = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &info); in ixgbe_fc_autoneg_sgmii_x550em_a()
4136 status = ixgbe_negotiate_fc(hw, info[0], info[0], in ixgbe_fc_autoneg_sgmii_x550em_a()
4144 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg_sgmii_x550em_a()
4146 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_sgmii_x550em_a()
4147 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_sgmii_x550em_a()
4157 s32 ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw) in ixgbe_setup_fc_backplane_x550em_a() argument
4165 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fc_backplane_x550em_a()
4171 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_setup_fc_backplane_x550em_a()
4172 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_setup_fc_backplane_x550em_a()
4178 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_fc_backplane_x550em_a()
4179 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_backplane_x550em_a()
4196 switch (hw->fc.requested_mode) { in ixgbe_setup_fc_backplane_x550em_a()
4229 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_fc_backplane_x550em_a()
4230 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_backplane_x550em_a()
4234 status = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_fc_backplane_x550em_a()
4244 static void ixgbe_set_mux(struct ixgbe_hw *hw, u8 state) in ixgbe_set_mux() argument
4248 if (!hw->bus.lan_id) in ixgbe_set_mux()
4250 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_set_mux()
4255 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); in ixgbe_set_mux()
4256 IXGBE_WRITE_FLUSH(hw); in ixgbe_set_mux()
4266 s32 ixgbe_acquire_swfw_sync_X550em(struct ixgbe_hw *hw, u32 mask) in ixgbe_acquire_swfw_sync_X550em() argument
4272 status = ixgbe_acquire_swfw_sync_X540(hw, mask); in ixgbe_acquire_swfw_sync_X550em()
4277 ixgbe_set_mux(hw, 1); in ixgbe_acquire_swfw_sync_X550em()
4289 void ixgbe_release_swfw_sync_X550em(struct ixgbe_hw *hw, u32 mask) in ixgbe_release_swfw_sync_X550em() argument
4294 ixgbe_set_mux(hw, 0); in ixgbe_release_swfw_sync_X550em()
4296 ixgbe_release_swfw_sync_X540(hw, mask); in ixgbe_release_swfw_sync_X550em()
4306 static s32 ixgbe_acquire_swfw_sync_X550a(struct ixgbe_hw *hw, u32 mask) in ixgbe_acquire_swfw_sync_X550a() argument
4317 status = ixgbe_acquire_swfw_sync_X540(hw, hmask); in ixgbe_acquire_swfw_sync_X550a()
4326 status = ixgbe_get_phy_token(hw); in ixgbe_acquire_swfw_sync_X550a()
4335 ixgbe_release_swfw_sync_X540(hw, hmask); in ixgbe_acquire_swfw_sync_X550a()
4345 hw->phy.id); in ixgbe_acquire_swfw_sync_X550a()
4356 static void ixgbe_release_swfw_sync_X550a(struct ixgbe_hw *hw, u32 mask) in ixgbe_release_swfw_sync_X550a() argument
4363 ixgbe_put_phy_token(hw); in ixgbe_release_swfw_sync_X550a()
4366 ixgbe_release_swfw_sync_X540(hw, hmask); in ixgbe_release_swfw_sync_X550a()
4380 s32 ixgbe_read_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_phy_reg_x550a() argument
4384 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM; in ixgbe_read_phy_reg_x550a()
4388 if (hw->mac.ops.acquire_swfw_sync(hw, mask)) in ixgbe_read_phy_reg_x550a()
4391 status = hw->phy.ops.read_reg_mdi(hw, reg_addr, device_type, phy_data); in ixgbe_read_phy_reg_x550a()
4393 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_phy_reg_x550a()
4408 s32 ixgbe_write_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_phy_reg_x550a() argument
4412 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM; in ixgbe_write_phy_reg_x550a()
4416 if (hw->mac.ops.acquire_swfw_sync(hw, mask) == IXGBE_SUCCESS) { in ixgbe_write_phy_reg_x550a()
4417 status = hw->phy.ops.write_reg_mdi(hw, reg_addr, device_type, in ixgbe_write_phy_reg_x550a()
4419 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_write_phy_reg_x550a()
4438 s32 ixgbe_handle_lasi_ext_t_x550em(struct ixgbe_hw *hw) in ixgbe_handle_lasi_ext_t_x550em() argument
4443 status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc); in ixgbe_handle_lasi_ext_t_x550em()
4449 return ixgbe_setup_internal_phy(hw); in ixgbe_handle_lasi_ext_t_x550em()
4465 s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_t_X550em() argument
4486 if (hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_setup_mac_link_t_X550em()
4487 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) { in ixgbe_setup_mac_link_t_X550em()
4488 status = ixgbe_setup_ixfi_x550em(hw, &force_speed); in ixgbe_setup_mac_link_t_X550em()
4497 status = ixgbe_check_link(hw, &force_speed, &link_up, in ixgbe_setup_mac_link_t_X550em()
4507 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait_to_complete); in ixgbe_setup_mac_link_t_X550em()
4519 s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed, in ixgbe_check_link_t_X550em() argument
4525 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_check_link_t_X550em()
4528 status = ixgbe_check_mac_link_generic(hw, speed, link_up, in ixgbe_check_link_t_X550em()
4541 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS, in ixgbe_check_link_t_X550em()
4560 s32 ixgbe_reset_phy_t_X550em(struct ixgbe_hw *hw) in ixgbe_reset_phy_t_X550em() argument
4564 status = ixgbe_reset_phy_generic(hw); in ixgbe_reset_phy_t_X550em()
4570 return ixgbe_enable_lasi_ext_t_x550em(hw); in ixgbe_reset_phy_t_X550em()
4578 s32 ixgbe_led_on_t_X550em(struct ixgbe_hw *hw, u32 led_idx) in ixgbe_led_on_t_X550em() argument
4588 ixgbe_read_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_on_t_X550em()
4591 ixgbe_write_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_on_t_X550em()
4595 return ixgbe_led_on_generic(hw, led_idx); in ixgbe_led_on_t_X550em()
4603 s32 ixgbe_led_off_t_X550em(struct ixgbe_hw *hw, u32 led_idx) in ixgbe_led_off_t_X550em() argument
4613 ixgbe_read_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_off_t_X550em()
4616 ixgbe_write_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_off_t_X550em()
4620 return ixgbe_led_off_generic(hw, led_idx); in ixgbe_led_off_t_X550em()
4638 s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min, in ixgbe_set_fw_drv_ver_x550() argument
4654 fw_cmd.port_num = (u8)hw->bus.func; in ixgbe_set_fw_drv_ver_x550()
4665 ret_val = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd, in ixgbe_set_fw_drv_ver_x550()
4690 bool ixgbe_fw_recovery_mode_X550(struct ixgbe_hw *hw) in ixgbe_fw_recovery_mode_X550() argument
4694 fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM_BY_MAC(hw)); in ixgbe_fw_recovery_mode_X550()