Lines Matching full: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);
48 * @hw: pointer to hardware structure
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()
107 * @hw: pointer to hardware structure
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()
120 * @hw: pointer to hardware structure
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()
133 * @hw: pointer to hardware structure
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()
152 * @hw: pointer to hardware structure
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()
171 * @hw: pointer to hardware structure
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()
247 * @hw: pointer to hardware structure
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()
324 * @hw: pointer to hardware structure
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()
341 * @hw: pointer to hardware structure
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()
358 return ixgbe_identify_sfp_module_X550em(hw); in ixgbe_identify_phy_x550em()
360 return ixgbe_identify_sfp_module_X550em(hw); in ixgbe_identify_phy_x550em()
363 hw->phy.type = ixgbe_phy_x550em_kx4; in ixgbe_identify_phy_x550em()
366 hw->phy.type = ixgbe_phy_x550em_xfi; in ixgbe_identify_phy_x550em()
371 hw->phy.type = ixgbe_phy_x550em_kr; in ixgbe_identify_phy_x550em()
375 return ixgbe_identify_phy_generic(hw); in ixgbe_identify_phy_x550em()
377 hw->phy.type = ixgbe_phy_ext_1g_t; in ixgbe_identify_phy_x550em()
381 hw->phy.type = ixgbe_phy_fw; in ixgbe_identify_phy_x550em()
382 if (hw->bus.lan_id) in ixgbe_identify_phy_x550em()
383 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_x550em()
385 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_x550em()
395 * @hw: pointer to hardware structure
399 s32 ixgbe_fw_phy_activity(struct ixgbe_hw *hw, u16 activity, in ixgbe_fw_phy_activity() argument
415 hic.cmd.port_number = hw->bus.lan_id; in ixgbe_fw_phy_activity()
420 rc = ixgbe_host_interface_command(hw, (u32 *)&hic.cmd, in ixgbe_fw_phy_activity()
453 * @hw: pointer to hardware structure
457 static s32 ixgbe_get_phy_id_fw(struct ixgbe_hw *hw) in ixgbe_get_phy_id_fw() argument
465 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_PHY_INFO, &info); in ixgbe_get_phy_id_fw()
469 hw->phy.speeds_supported = 0; in ixgbe_get_phy_id_fw()
473 hw->phy.speeds_supported |= ixgbe_fw_map[i].phy_speed; in ixgbe_get_phy_id_fw()
475 if (!hw->phy.autoneg_advertised) in ixgbe_get_phy_id_fw()
476 hw->phy.autoneg_advertised = hw->phy.speeds_supported; in ixgbe_get_phy_id_fw()
478 hw->phy.id = info[0] & FW_PHY_INFO_ID_HI_MASK; in ixgbe_get_phy_id_fw()
480 hw->phy.id |= phy_id_lo & IXGBE_PHY_REVISION_MASK; in ixgbe_get_phy_id_fw()
481 hw->phy.revision = phy_id_lo & ~IXGBE_PHY_REVISION_MASK; in ixgbe_get_phy_id_fw()
482 if (!hw->phy.id || hw->phy.id == IXGBE_PHY_REVISION_MASK) in ixgbe_get_phy_id_fw()
489 * @hw: pointer to hardware structure
493 static s32 ixgbe_identify_phy_fw(struct ixgbe_hw *hw) in ixgbe_identify_phy_fw() argument
495 if (hw->bus.lan_id) in ixgbe_identify_phy_fw()
496 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_fw()
498 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_fw()
500 hw->phy.type = ixgbe_phy_fw; in ixgbe_identify_phy_fw()
501 hw->phy.ops.read_reg = NULL; in ixgbe_identify_phy_fw()
502 hw->phy.ops.write_reg = NULL; in ixgbe_identify_phy_fw()
503 return ixgbe_get_phy_id_fw(hw); in ixgbe_identify_phy_fw()
508 * @hw: pointer to hardware structure
512 s32 ixgbe_shutdown_fw_phy(struct ixgbe_hw *hw) in ixgbe_shutdown_fw_phy() argument
517 return ixgbe_fw_phy_activity(hw, FW_PHY_ACT_FORCE_LINK_DOWN, &setup); in ixgbe_shutdown_fw_phy()
520 static s32 ixgbe_read_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_phy_reg_x550em() argument
523 UNREFERENCED_4PARAMETER(*hw, reg_addr, device_type, *phy_data); in ixgbe_read_phy_reg_x550em()
527 static s32 ixgbe_write_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_phy_reg_x550em() argument
530 UNREFERENCED_4PARAMETER(*hw, reg_addr, device_type, phy_data); in ixgbe_write_phy_reg_x550em()
536 * @hw: pointer to the hardware structure
543 static s32 ixgbe_read_i2c_combined_generic(struct ixgbe_hw *hw, u8 addr, in ixgbe_read_i2c_combined_generic() argument
546 return ixgbe_read_i2c_combined_generic_int(hw, addr, reg, val, true); in ixgbe_read_i2c_combined_generic()
551 * @hw: pointer to the hardware structure
559 ixgbe_read_i2c_combined_generic_unlocked(struct ixgbe_hw *hw, u8 addr, in ixgbe_read_i2c_combined_generic_unlocked() argument
562 return ixgbe_read_i2c_combined_generic_int(hw, addr, reg, val, false); in ixgbe_read_i2c_combined_generic_unlocked()
567 * @hw: pointer to the hardware structure
574 static s32 ixgbe_write_i2c_combined_generic(struct ixgbe_hw *hw, in ixgbe_write_i2c_combined_generic() argument
577 return ixgbe_write_i2c_combined_generic_int(hw, addr, reg, val, true); in ixgbe_write_i2c_combined_generic()
582 * @hw: pointer to the hardware structure
590 ixgbe_write_i2c_combined_generic_unlocked(struct ixgbe_hw *hw, in ixgbe_write_i2c_combined_generic_unlocked() argument
593 return ixgbe_write_i2c_combined_generic_int(hw, addr, reg, val, false); in ixgbe_write_i2c_combined_generic_unlocked()
598 * @hw: pointer to hardware structure
603 s32 ixgbe_init_ops_X550EM(struct ixgbe_hw *hw) in ixgbe_init_ops_X550EM() argument
605 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_ops_X550EM()
606 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_ops_X550EM()
607 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_init_ops_X550EM()
613 ret_val = ixgbe_init_ops_X550(hw); in ixgbe_init_ops_X550EM()
646 hw->bus.type = ixgbe_bus_type_internal; in ixgbe_init_ops_X550EM()
657 if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper) in ixgbe_init_ops_X550EM()
664 switch (hw->device_id) { in ixgbe_init_ops_X550EM()
681 if (mac->ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_init_ops_X550EM()
700 * @hw: pointer to hardware structure
702 static s32 ixgbe_setup_fw_link(struct ixgbe_hw *hw) in ixgbe_setup_fw_link() argument
708 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw)) in ixgbe_setup_fw_link()
711 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fw_link()
717 switch (hw->fc.requested_mode) { in ixgbe_setup_fw_link()
735 if (hw->phy.autoneg_advertised & ixgbe_fw_map[i].phy_speed) in ixgbe_setup_fw_link()
740 if (hw->phy.eee_speeds_advertised) in ixgbe_setup_fw_link()
743 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_SETUP_LINK, &setup); in ixgbe_setup_fw_link()
753 * @hw: pointer to hardware structure
757 static s32 ixgbe_fc_autoneg_fw(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_fw() argument
759 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_fc_autoneg_fw()
760 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_fc_autoneg_fw()
762 return ixgbe_setup_fw_link(hw); in ixgbe_fc_autoneg_fw()
767 * @hw: pointer to the HW structure
773 static s32 ixgbe_setup_eee_fw(struct ixgbe_hw *hw, bool enable_eee) in ixgbe_setup_eee_fw() argument
775 if (!!hw->phy.eee_speeds_advertised == enable_eee) in ixgbe_setup_eee_fw()
778 hw->phy.eee_speeds_advertised = hw->phy.eee_speeds_supported; in ixgbe_setup_eee_fw()
780 hw->phy.eee_speeds_advertised = 0; in ixgbe_setup_eee_fw()
781 return hw->phy.ops.setup_link(hw); in ixgbe_setup_eee_fw()
786 * @hw: pointer to hardware structure
791 s32 ixgbe_init_ops_X550EM_a(struct ixgbe_hw *hw) in ixgbe_init_ops_X550EM_a() argument
793 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_ops_X550EM_a()
799 ret_val = ixgbe_init_ops_X550EM(hw); in ixgbe_init_ops_X550EM_a()
806 switch (mac->ops.get_media_type(hw)) { in ixgbe_init_ops_X550EM_a()
819 switch (hw->device_id) { in ixgbe_init_ops_X550EM_a()
825 hw->phy.eee_speeds_supported = IXGBE_LINK_SPEED_100_FULL | in ixgbe_init_ops_X550EM_a()
827 hw->phy.eee_speeds_advertised = hw->phy.eee_speeds_supported; in ixgbe_init_ops_X550EM_a()
838 * @hw: pointer to hardware structure
843 s32 ixgbe_init_ops_X550EM_x(struct ixgbe_hw *hw) in ixgbe_init_ops_X550EM_x() argument
845 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_ops_X550EM_x()
846 struct ixgbe_link_info *link = &hw->link; in ixgbe_init_ops_X550EM_x()
852 ret_val = ixgbe_init_ops_X550EM(hw); in ixgbe_init_ops_X550EM_x()
865 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_1G_T) { in ixgbe_init_ops_X550EM_x()
876 * @hw: pointer to hardware structure
881 s32 ixgbe_dmac_config_X550(struct ixgbe_hw *hw) in ixgbe_dmac_config_X550() argument
888 reg = IXGBE_READ_REG(hw, IXGBE_DMACR); in ixgbe_dmac_config_X550()
890 IXGBE_WRITE_REG(hw, IXGBE_DMACR, reg); in ixgbe_dmac_config_X550()
893 if (!hw->mac.dmac_config.watchdog_timer) in ixgbe_dmac_config_X550()
896 ixgbe_dmac_config_tcs_X550(hw); in ixgbe_dmac_config_X550()
899 reg = IXGBE_READ_REG(hw, IXGBE_DMACR); in ixgbe_dmac_config_X550()
903 reg |= (hw->mac.dmac_config.watchdog_timer * 100) / 4096; in ixgbe_dmac_config_X550()
907 if (hw->mac.dmac_config.fcoe_en) { in ixgbe_dmac_config_X550()
908 high_pri_tc = 1 << hw->mac.dmac_config.fcoe_tc; in ixgbe_dmac_config_X550()
916 IXGBE_WRITE_REG(hw, IXGBE_DMACR, reg); in ixgbe_dmac_config_X550()
924 * @hw: pointer to hardware structure
929 s32 ixgbe_dmac_config_tcs_X550(struct ixgbe_hw *hw) in ixgbe_dmac_config_tcs_X550() argument
936 switch (hw->mac.dmac_config.link_speed) { in ixgbe_dmac_config_tcs_X550()
949 maxframe_size_kb = ((IXGBE_READ_REG(hw, IXGBE_MAXFRS) >> in ixgbe_dmac_config_tcs_X550()
954 reg = IXGBE_READ_REG(hw, IXGBE_DMCTH(tc)); in ixgbe_dmac_config_tcs_X550()
957 if (tc < hw->mac.dmac_config.num_tcs) { in ixgbe_dmac_config_tcs_X550()
959 rx_pb_size = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(tc)); in ixgbe_dmac_config_tcs_X550()
973 IXGBE_WRITE_REG(hw, IXGBE_DMCTH(tc), reg); in ixgbe_dmac_config_tcs_X550()
980 * @hw: pointer to hardware structure
984 s32 ixgbe_dmac_update_tcs_X550(struct ixgbe_hw *hw) in ixgbe_dmac_update_tcs_X550() argument
991 reg = IXGBE_READ_REG(hw, IXGBE_DMACR); in ixgbe_dmac_update_tcs_X550()
993 IXGBE_WRITE_REG(hw, IXGBE_DMACR, reg); in ixgbe_dmac_update_tcs_X550()
995 ixgbe_dmac_config_tcs_X550(hw); in ixgbe_dmac_update_tcs_X550()
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()
1007 * @hw: pointer to hardware structure
1012 s32 ixgbe_init_eeprom_params_X550(struct ixgbe_hw *hw) in ixgbe_init_eeprom_params_X550() argument
1014 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_X550()
1024 eec = IXGBE_READ_REG(hw, IXGBE_EEC); in ixgbe_init_eeprom_params_X550()
1039 * @hw: pointer to hardware structure
1043 void ixgbe_set_source_address_pruning_X550(struct ixgbe_hw *hw, bool enable, in ixgbe_set_source_address_pruning_X550() argument
1052 pfflp = (u64)IXGBE_READ_REG(hw, IXGBE_PFFLPL); in ixgbe_set_source_address_pruning_X550()
1053 pfflp |= (u64)IXGBE_READ_REG(hw, IXGBE_PFFLPH) << 32; in ixgbe_set_source_address_pruning_X550()
1060 IXGBE_WRITE_REG(hw, IXGBE_PFFLPL, (u32)pfflp); in ixgbe_set_source_address_pruning_X550()
1061 IXGBE_WRITE_REG(hw, IXGBE_PFFLPH, (u32)(pfflp >> 32)); in ixgbe_set_source_address_pruning_X550()
1066 * @hw: pointer to hardware structure
1071 void ixgbe_set_ethertype_anti_spoofing_X550(struct ixgbe_hw *hw, in ixgbe_set_ethertype_anti_spoofing_X550() argument
1080 pfvfspoof = IXGBE_READ_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg)); in ixgbe_set_ethertype_anti_spoofing_X550()
1086 IXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg), pfvfspoof); in ixgbe_set_ethertype_anti_spoofing_X550()
1091 * @hw: pointer to hardware structure
1098 static s32 ixgbe_iosf_wait(struct ixgbe_hw *hw, u32 *ctrl) in ixgbe_iosf_wait() argument
1107 command = IXGBE_READ_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL); in ixgbe_iosf_wait()
1125 * @hw: pointer to hardware structure
1130 s32 ixgbe_write_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_iosf_sb_reg_x550() argument
1137 ret = ixgbe_acquire_swfw_semaphore(hw, gssr); in ixgbe_write_iosf_sb_reg_x550()
1141 ret = ixgbe_iosf_wait(hw, NULL); in ixgbe_write_iosf_sb_reg_x550()
1149 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL, command); in ixgbe_write_iosf_sb_reg_x550()
1152 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_DATA, data); in ixgbe_write_iosf_sb_reg_x550()
1154 ret = ixgbe_iosf_wait(hw, &command); in ixgbe_write_iosf_sb_reg_x550()
1165 ixgbe_release_swfw_semaphore(hw, gssr); in ixgbe_write_iosf_sb_reg_x550()
1171 * @hw: pointer to hardware structure
1176 s32 ixgbe_read_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_iosf_sb_reg_x550() argument
1183 ret = ixgbe_acquire_swfw_semaphore(hw, gssr); in ixgbe_read_iosf_sb_reg_x550()
1187 ret = ixgbe_iosf_wait(hw, NULL); in ixgbe_read_iosf_sb_reg_x550()
1195 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL, command); in ixgbe_read_iosf_sb_reg_x550()
1197 ret = ixgbe_iosf_wait(hw, &command); in ixgbe_read_iosf_sb_reg_x550()
1208 *data = IXGBE_READ_REG(hw, IXGBE_SB_IOSF_INDIRECT_DATA); in ixgbe_read_iosf_sb_reg_x550()
1211 ixgbe_release_swfw_semaphore(hw, gssr); in ixgbe_read_iosf_sb_reg_x550()
1217 * @hw: Pointer to hardware structure
1220 s32 ixgbe_get_phy_token(struct ixgbe_hw *hw) in ixgbe_get_phy_token() argument
1229 token_cmd.port_number = hw->bus.lan_id; in ixgbe_get_phy_token()
1232 status = ixgbe_host_interface_command(hw, (u32 *)&token_cmd, in ixgbe_get_phy_token()
1255 * @hw: Pointer to hardware structure
1258 s32 ixgbe_put_phy_token(struct ixgbe_hw *hw) in ixgbe_put_phy_token() argument
1267 token_cmd.port_number = hw->bus.lan_id; in ixgbe_put_phy_token()
1270 status = ixgbe_host_interface_command(hw, (u32 *)&token_cmd, in ixgbe_put_phy_token()
1285 * @hw: pointer to hardware structure
1289 void ixgbe_disable_mdd_X550(struct ixgbe_hw *hw) in ixgbe_disable_mdd_X550() argument
1296 reg = IXGBE_READ_REG(hw, IXGBE_DMATXCTL); in ixgbe_disable_mdd_X550()
1298 IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, reg); in ixgbe_disable_mdd_X550()
1301 reg = IXGBE_READ_REG(hw, IXGBE_RDRXCTL); in ixgbe_disable_mdd_X550()
1303 IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, reg); in ixgbe_disable_mdd_X550()
1308 * @hw: pointer to hardware structure
1312 void ixgbe_enable_mdd_X550(struct ixgbe_hw *hw) in ixgbe_enable_mdd_X550() argument
1319 reg = IXGBE_READ_REG(hw, IXGBE_DMATXCTL); in ixgbe_enable_mdd_X550()
1321 IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, reg); in ixgbe_enable_mdd_X550()
1324 reg = IXGBE_READ_REG(hw, IXGBE_RDRXCTL); in ixgbe_enable_mdd_X550()
1326 IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, reg); in ixgbe_enable_mdd_X550()
1331 * @hw: pointer to hardware structure
1336 void ixgbe_restore_mdd_vf_X550(struct ixgbe_hw *hw, u32 vf) in ixgbe_restore_mdd_vf_X550() argument
1343 reg = IXGBE_READ_REG(hw, IXGBE_MRQC); in ixgbe_restore_mdd_vf_X550()
1365 IXGBE_WRITE_REG(hw, IXGBE_WQBR_TX(idx), reg); in ixgbe_restore_mdd_vf_X550()
1366 IXGBE_WRITE_REG(hw, IXGBE_WQBR_RX(idx), reg); in ixgbe_restore_mdd_vf_X550()
1371 * @hw: pointer to hardware structure
1376 void ixgbe_mdd_event_X550(struct ixgbe_hw *hw, u32 *vf_bitmap) in ixgbe_mdd_event_X550() argument
1384 reg = IXGBE_READ_REG(hw, IXGBE_MRQC); in ixgbe_mdd_event_X550()
1400 wqbr = IXGBE_READ_REG(hw, IXGBE_WQBR_TX(i)); in ixgbe_mdd_event_X550()
1401 wqbr |= IXGBE_READ_REG(hw, IXGBE_WQBR_RX(i)); in ixgbe_mdd_event_X550()
1428 * @hw: pointer to hardware structure
1432 enum ixgbe_media_type ixgbe_get_media_type_X550em(struct ixgbe_hw *hw) in ixgbe_get_media_type_X550em() argument
1439 switch (hw->device_id) { in ixgbe_get_media_type_X550em()
1462 hw->phy.type = ixgbe_phy_sgmii; in ixgbe_get_media_type_X550em()
1477 * @hw: pointer to hardware structure
1480 static s32 ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear) in ixgbe_supported_sfp_modules_X550em() argument
1484 switch (hw->phy.sfp_type) { in ixgbe_supported_sfp_modules_X550em()
1515 * @hw: pointer to hardware structure
1519 s32 ixgbe_identify_sfp_module_X550em(struct ixgbe_hw *hw) in ixgbe_identify_sfp_module_X550em() argument
1526 status = ixgbe_identify_module_generic(hw); in ixgbe_identify_sfp_module_X550em()
1532 status = ixgbe_supported_sfp_modules_X550em(hw, &linear); in ixgbe_identify_sfp_module_X550em()
1539 * @hw: pointer to hardware structure
1541 s32 ixgbe_setup_sfp_modules_X550em(struct ixgbe_hw *hw) in ixgbe_setup_sfp_modules_X550em() argument
1549 status = ixgbe_supported_sfp_modules_X550em(hw, &linear); in ixgbe_setup_sfp_modules_X550em()
1554 ixgbe_init_mac_link_ops_X550em(hw); in ixgbe_setup_sfp_modules_X550em()
1555 hw->phy.ops.reset = NULL; in ixgbe_setup_sfp_modules_X550em()
1563 * @hw: pointer to hardware structure
1565 static s32 ixgbe_restart_an_internal_phy_x550em(struct ixgbe_hw *hw) in ixgbe_restart_an_internal_phy_x550em() argument
1571 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1572 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1581 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1582 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1585 if (hw->mac.type == ixgbe_mac_X550EM_a) { in ixgbe_restart_an_internal_phy_x550em()
1589 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1590 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1599 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1600 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1609 * @hw: pointer to hardware structure
1613 static s32 ixgbe_setup_sgmii(struct ixgbe_hw *hw, ixgbe_link_speed speed, in ixgbe_setup_sgmii() argument
1616 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sgmii()
1620 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1621 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii()
1631 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1632 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii()
1637 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1638 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii()
1645 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1646 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii()
1651 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1652 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
1663 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1664 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
1669 rc = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_sgmii()
1673 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait); in ixgbe_setup_sgmii()
1678 * @hw: pointer to hardware structure
1682 static s32 ixgbe_setup_sgmii_fw(struct ixgbe_hw *hw, ixgbe_link_speed speed, in ixgbe_setup_sgmii_fw() argument
1685 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sgmii_fw()
1689 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
1690 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
1700 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
1701 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
1706 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
1707 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
1714 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
1715 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
1720 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
1721 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
1726 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
1727 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
1738 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
1739 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
1744 rc = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_sgmii_fw()
1746 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait); in ixgbe_setup_sgmii_fw()
1751 * @hw: pointer to hardware structure
1753 void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw) in ixgbe_init_mac_link_ops_X550em() argument
1755 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_mac_link_ops_X550em()
1759 switch (hw->mac.ops.get_media_type(hw)) { in ixgbe_init_mac_link_ops_X550em()
1771 if ((hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP_N) || in ixgbe_init_mac_link_ops_X550em()
1772 (hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP)) in ixgbe_init_mac_link_ops_X550em()
1780 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_1G_T) in ixgbe_init_mac_link_ops_X550em()
1782 if (hw->mac.type == ixgbe_mac_X550EM_a) { in ixgbe_init_mac_link_ops_X550em()
1783 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T || in ixgbe_init_mac_link_ops_X550em()
1784 hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T_L) { in ixgbe_init_mac_link_ops_X550em()
1798 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII || in ixgbe_init_mac_link_ops_X550em()
1799 hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII_L) in ixgbe_init_mac_link_ops_X550em()
1809 * @hw: pointer to hardware structure
1813 s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw, in ixgbe_get_link_capabilities_X550em() argument
1820 if (hw->phy.type == ixgbe_phy_fw) { in ixgbe_get_link_capabilities_X550em()
1822 *speed = hw->phy.speeds_supported; in ixgbe_get_link_capabilities_X550em()
1827 if (hw->phy.media_type == ixgbe_media_type_fiber) { in ixgbe_get_link_capabilities_X550em()
1833 if (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || in ixgbe_get_link_capabilities_X550em()
1834 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1 || in ixgbe_get_link_capabilities_X550em()
1835 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 || in ixgbe_get_link_capabilities_X550em()
1836 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1 || in ixgbe_get_link_capabilities_X550em()
1837 hw->phy.sfp_type == ixgbe_sfp_type_1g_bx_core0 || in ixgbe_get_link_capabilities_X550em()
1838 hw->phy.sfp_type == ixgbe_sfp_type_1g_bx_core1) { in ixgbe_get_link_capabilities_X550em()
1844 if (hw->phy.multispeed_fiber) in ixgbe_get_link_capabilities_X550em()
1852 switch (hw->phy.type) { in ixgbe_get_link_capabilities_X550em()
1863 if (hw->mac.type == ixgbe_mac_X550EM_a) { in ixgbe_get_link_capabilities_X550em()
1865 if (hw->phy.nw_mng_if_sel & in ixgbe_get_link_capabilities_X550em()
1869 } else if (hw->device_id == in ixgbe_get_link_capabilities_X550em()
1890 * @hw: pointer to hardware structure
1900 static s32 ixgbe_get_lasi_ext_t_x550em(struct ixgbe_hw *hw, bool *lsc) in ixgbe_get_lasi_ext_t_x550em() argument
1908 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG, in ixgbe_get_lasi_ext_t_x550em()
1917 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_FLAG, in ixgbe_get_lasi_ext_t_x550em()
1927 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_ALARM_1, in ixgbe_get_lasi_ext_t_x550em()
1937 ixgbe_set_copper_phy_power(hw, false); in ixgbe_get_lasi_ext_t_x550em()
1941 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_FAULT_MSG, in ixgbe_get_lasi_ext_t_x550em()
1951 ixgbe_set_copper_phy_power(hw, false); in ixgbe_get_lasi_ext_t_x550em()
1957 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG, in ixgbe_get_lasi_ext_t_x550em()
1965 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM2, in ixgbe_get_lasi_ext_t_x550em()
1980 * @hw: pointer to hardware structure
1987 static s32 ixgbe_enable_lasi_ext_t_x550em(struct ixgbe_hw *hw) in ixgbe_enable_lasi_ext_t_x550em() argument
1994 status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc); in ixgbe_enable_lasi_ext_t_x550em()
2006 if (hw->mac.type != ixgbe_mac_X550EM_a) { in ixgbe_enable_lasi_ext_t_x550em()
2007 status = hw->phy.ops.read_reg(hw, in ixgbe_enable_lasi_ext_t_x550em()
2016 status = hw->phy.ops.write_reg(hw, in ixgbe_enable_lasi_ext_t_x550em()
2025 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2035 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2043 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2053 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2061 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2070 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2079 * @hw: pointer to hardware structure
2084 static s32 ixgbe_setup_kr_speed_x550em(struct ixgbe_hw *hw, in ixgbe_setup_kr_speed_x550em() argument
2090 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2091 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2108 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2109 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2112 if (hw->mac.type == ixgbe_mac_X550EM_a) { in ixgbe_setup_kr_speed_x550em()
2114 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2115 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2127 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2128 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2132 return ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_kr_speed_x550em()
2137 * @hw: pointer to hardware structure
2139 static s32 ixgbe_reset_phy_fw(struct ixgbe_hw *hw) in ixgbe_reset_phy_fw() argument
2144 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw)) in ixgbe_reset_phy_fw()
2147 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_PHY_SW_RESET, &store); in ixgbe_reset_phy_fw()
2152 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_INIT_PHY, &store); in ixgbe_reset_phy_fw()
2156 return ixgbe_setup_fw_link(hw); in ixgbe_reset_phy_fw()
2161 * @hw: pointer to hardware structure
2163 static s32 ixgbe_check_overtemp_fw(struct ixgbe_hw *hw) in ixgbe_check_overtemp_fw() argument
2168 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &store); in ixgbe_check_overtemp_fw()
2173 ixgbe_shutdown_fw_phy(hw); in ixgbe_check_overtemp_fw()
2181 * @hw: pointer to hardware structure
2186 static s32 ixgbe_read_mng_if_sel_x550em(struct ixgbe_hw *hw) in ixgbe_read_mng_if_sel_x550em() argument
2191 hw->phy.nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL); in ixgbe_read_mng_if_sel_x550em()
2196 if (hw->mac.type == ixgbe_mac_X550EM_a && in ixgbe_read_mng_if_sel_x550em()
2197 hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_MDIO_ACT) { in ixgbe_read_mng_if_sel_x550em()
2198 hw->phy.addr = (hw->phy.nw_mng_if_sel & in ixgbe_read_mng_if_sel_x550em()
2208 * @hw: pointer to hardware structure
2214 s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw) in ixgbe_init_phy_ops_X550em() argument
2216 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_init_phy_ops_X550em()
2221 hw->mac.ops.set_lan_id(hw); in ixgbe_init_phy_ops_X550em()
2222 ixgbe_read_mng_if_sel_x550em(hw); in ixgbe_init_phy_ops_X550em()
2224 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) { in ixgbe_init_phy_ops_X550em()
2226 ixgbe_setup_mux_ctl(hw); in ixgbe_init_phy_ops_X550em()
2230 switch (hw->device_id) { in ixgbe_init_phy_ops_X550em()
2235 hw->phy.ops.read_reg = NULL; in ixgbe_init_phy_ops_X550em()
2236 hw->phy.ops.write_reg = NULL; in ixgbe_init_phy_ops_X550em()
2238 if (hw->bus.lan_id) in ixgbe_init_phy_ops_X550em()
2239 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM; in ixgbe_init_phy_ops_X550em()
2241 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM; in ixgbe_init_phy_ops_X550em()
2246 hw->phy.ops.read_reg = ixgbe_read_phy_reg_x550a; in ixgbe_init_phy_ops_X550em()
2247 hw->phy.ops.write_reg = ixgbe_write_phy_reg_x550a; in ixgbe_init_phy_ops_X550em()
2248 if (hw->bus.lan_id) in ixgbe_init_phy_ops_X550em()
2249 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM; in ixgbe_init_phy_ops_X550em()
2251 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM; in ixgbe_init_phy_ops_X550em()
2255 hw->phy.phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM; in ixgbe_init_phy_ops_X550em()
2265 ret_val = phy->ops.identify(hw); in ixgbe_init_phy_ops_X550em()
2271 ixgbe_init_mac_link_ops_X550em(hw); in ixgbe_init_phy_ops_X550em()
2276 switch (hw->phy.type) { in ixgbe_init_phy_ops_X550em()
2293 /* link is managed by HW */ in ixgbe_init_phy_ops_X550em()
2306 if ((hw->mac.type == ixgbe_mac_X550EM_x) && in ixgbe_init_phy_ops_X550em()
2308 IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0)))) in ixgbe_init_phy_ops_X550em()
2329 * @hw: pointer to hardware structure
2331 static void ixgbe_set_mdio_speed(struct ixgbe_hw *hw) in ixgbe_set_mdio_speed() argument
2335 switch (hw->device_id) { in ixgbe_set_mdio_speed()
2343 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0); in ixgbe_set_mdio_speed()
2345 IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); in ixgbe_set_mdio_speed()
2350 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0); in ixgbe_set_mdio_speed()
2352 IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); in ixgbe_set_mdio_speed()
2361 * @hw: pointer to hardware structure
2367 s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw) in ixgbe_reset_hw_X550em() argument
2374 u32 swfw_mask = hw->phy.phy_semaphore_mask; in ixgbe_reset_hw_X550em()
2379 status = hw->mac.ops.stop_adapter(hw); in ixgbe_reset_hw_X550em()
2385 ixgbe_clear_tx_pending(hw); in ixgbe_reset_hw_X550em()
2387 ixgbe_set_mdio_speed(hw); in ixgbe_reset_hw_X550em()
2390 status = hw->phy.ops.init(hw); in ixgbe_reset_hw_X550em()
2398 DEBUGOUT("Returning from reset HW due to PHY init failure\n"); in ixgbe_reset_hw_X550em()
2403 if (hw->phy.type == ixgbe_phy_x550em_ext_t) { in ixgbe_reset_hw_X550em()
2404 status = ixgbe_init_ext_t_x550em(hw); in ixgbe_reset_hw_X550em()
2413 if (hw->phy.sfp_setup_needed) { in ixgbe_reset_hw_X550em()
2414 status = hw->mac.ops.setup_sfp(hw); in ixgbe_reset_hw_X550em()
2415 hw->phy.sfp_setup_needed = false; in ixgbe_reset_hw_X550em()
2422 if (!hw->phy.reset_disable && hw->phy.ops.reset) { in ixgbe_reset_hw_X550em()
2423 if (hw->phy.ops.reset(hw) == IXGBE_ERR_OVERTEMP) in ixgbe_reset_hw_X550em()
2434 if (!hw->force_full_reset) { in ixgbe_reset_hw_X550em()
2435 hw->mac.ops.check_link(hw, &link_speed, &link_up, false); in ixgbe_reset_hw_X550em()
2440 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X550em()
2446 ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X550em()
2447 IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl); in ixgbe_reset_hw_X550em()
2448 IXGBE_WRITE_FLUSH(hw); in ixgbe_reset_hw_X550em()
2449 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X550em()
2454 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X550em()
2468 * allow time for any pending HW events to complete. in ixgbe_reset_hw_X550em()
2470 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { in ixgbe_reset_hw_X550em()
2471 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_reset_hw_X550em()
2476 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); in ixgbe_reset_hw_X550em()
2482 hw->mac.num_rar_entries = 128; in ixgbe_reset_hw_X550em()
2483 hw->mac.ops.init_rx_addrs(hw); in ixgbe_reset_hw_X550em()
2485 ixgbe_set_mdio_speed(hw); in ixgbe_reset_hw_X550em()
2487 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP) in ixgbe_reset_hw_X550em()
2488 ixgbe_setup_mux_ctl(hw); in ixgbe_reset_hw_X550em()
2491 DEBUGOUT1("Reset HW failed, STATUS = %d\n", status); in ixgbe_reset_hw_X550em()
2498 * @hw: pointer to hardware structure
2500 s32 ixgbe_init_ext_t_x550em(struct ixgbe_hw *hw) in ixgbe_init_ext_t_x550em() argument
2505 status = hw->phy.ops.read_reg(hw, in ixgbe_init_ext_t_x550em()
2517 status = hw->phy.ops.read_reg(hw, in ixgbe_init_ext_t_x550em()
2527 status = hw->phy.ops.write_reg(hw, in ixgbe_init_ext_t_x550em()
2541 * @hw: pointer to hardware structure
2543 s32 ixgbe_setup_kr_x550em(struct ixgbe_hw *hw) in ixgbe_setup_kr_x550em() argument
2546 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL) in ixgbe_setup_kr_x550em()
2549 if (ixgbe_check_reset_blocked(hw)) in ixgbe_setup_kr_x550em()
2552 return ixgbe_setup_kr_speed_x550em(hw, hw->phy.autoneg_advertised); in ixgbe_setup_kr_x550em()
2557 * @hw: pointer to hardware structure
2563 s32 ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_sfp_x550em() argument
2573 ret_val = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear); in ixgbe_setup_mac_link_sfp_x550em()
2586 ixgbe_setup_kr_speed_x550em(hw, speed); in ixgbe_setup_mac_link_sfp_x550em()
2590 (hw->bus.lan_id << 12); in ixgbe_setup_mac_link_sfp_x550em()
2595 ret_val = hw->link.ops.write_link(hw, hw->link.addr, reg_slice, in ixgbe_setup_mac_link_sfp_x550em()
2602 * @hw: pointer to hardware structure
2608 static s32 ixgbe_setup_sfi_x550a(struct ixgbe_hw *hw, ixgbe_link_speed *speed) in ixgbe_setup_sfi_x550a() argument
2610 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sfi_x550a()
2615 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sfi_x550a()
2616 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sfi_x550a()
2639 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sfi_x550a()
2640 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sfi_x550a()
2644 status = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_sfi_x550a()
2651 * @hw: pointer to hardware structure
2657 s32 ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_sfp_x550a() argument
2669 ret_val = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear); in ixgbe_setup_mac_link_sfp_x550a()
2680 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP_N) { in ixgbe_setup_mac_link_sfp_x550a()
2682 ret_val = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_mac_link_sfp_x550a()
2683 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_mac_link_sfp_x550a()
2693 ret_val = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_mac_link_sfp_x550a()
2694 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_mac_link_sfp_x550a()
2701 ret_val = ixgbe_setup_sfi_x550a(hw, &speed); in ixgbe_setup_mac_link_sfp_x550a()
2704 ixgbe_setup_kr_speed_x550em(hw, speed); in ixgbe_setup_mac_link_sfp_x550a()
2706 if (hw->phy.addr == 0x0 || hw->phy.addr == 0xFFFF) { in ixgbe_setup_mac_link_sfp_x550a()
2713 ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_EFUSE_PDF_SKU, in ixgbe_setup_mac_link_sfp_x550a()
2723 slice_offset = (hw->bus.lan_id + in ixgbe_setup_mac_link_sfp_x550a()
2724 (hw->bus.instance_id << 1)) << 12; in ixgbe_setup_mac_link_sfp_x550a()
2726 slice_offset = hw->bus.lan_id << 12; in ixgbe_setup_mac_link_sfp_x550a()
2731 ret_val = hw->phy.ops.read_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
2744 ret_val = hw->phy.ops.write_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
2748 ret_val = hw->phy.ops.read_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
2756 * @hw: pointer to hardware structure
2760 static s32 ixgbe_setup_ixfi_x550em_x(struct ixgbe_hw *hw) in ixgbe_setup_ixfi_x550em_x() argument
2762 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_ixfi_x550em_x()
2767 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2768 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2773 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2774 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2780 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2781 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2788 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2789 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2793 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2794 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2801 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2802 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2808 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2809 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2817 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em_x()
2818 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
2825 * @hw: pointer to hardware structure
2831 static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed) in ixgbe_setup_ixfi_x550em() argument
2833 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_ixfi_x550em()
2842 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em()
2843 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
2864 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_ixfi_x550em()
2865 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
2871 if (hw->mac.type == ixgbe_mac_X550EM_x) { in ixgbe_setup_ixfi_x550em()
2872 status = ixgbe_setup_ixfi_x550em_x(hw); in ixgbe_setup_ixfi_x550em()
2878 status = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_ixfi_x550em()
2885 * @hw: address of hardware structure
2890 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
2898 ret = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS, in ixgbe_ext_phy_t_x550em_get_link()
2904 ret = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS, in ixgbe_ext_phy_t_x550em_get_link()
2917 * @hw: point to hardware structure
2927 s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw) in ixgbe_setup_internal_phy_t_x550em() argument
2934 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_setup_internal_phy_t_x550em()
2937 if (hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_setup_internal_phy_t_x550em()
2938 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) { in ixgbe_setup_internal_phy_t_x550em()
2940 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_setup_internal_phy_t_x550em()
2947 status = hw->phy.ops.read_reg(hw, in ixgbe_setup_internal_phy_t_x550em()
2955 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_setup_internal_phy_t_x550em()
2976 return ixgbe_setup_ixfi_x550em(hw, &force_speed); in ixgbe_setup_internal_phy_t_x550em()
2980 return ixgbe_setup_kr_speed_x550em(hw, speed); in ixgbe_setup_internal_phy_t_x550em()
2986 * @hw: pointer to hardware structure
2990 s32 ixgbe_setup_phy_loopback_x550em(struct ixgbe_hw *hw) in ixgbe_setup_phy_loopback_x550em() argument
2996 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
2997 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3004 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
3005 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3011 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
3012 IXGBE_KRM_PORT_CAR_GEN_CTRL(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3018 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
3019 IXGBE_KRM_PORT_CAR_GEN_CTRL(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3025 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
3026 IXGBE_KRM_PMD_DFX_BURNIN(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3031 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
3032 IXGBE_KRM_PMD_DFX_BURNIN(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3038 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
3039 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3044 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_phy_loopback_x550em()
3045 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_phy_loopback_x550em()
3054 * @hw: pointer to hardware structure
3060 s32 ixgbe_read_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 *data) in ixgbe_read_ee_hostif_X550() argument
3080 status = hw->mac.ops.acquire_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_X550()
3084 status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer), in ixgbe_read_ee_hostif_X550()
3087 *data = (u16)IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, in ixgbe_read_ee_hostif_X550()
3091 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_X550()
3097 * @hw: pointer to hardware structure
3104 s32 ixgbe_read_ee_hostif_buffer_X550(struct ixgbe_hw *hw, in ixgbe_read_ee_hostif_buffer_X550() argument
3117 status = hw->mac.ops.acquire_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_buffer_X550()
3141 status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer), in ixgbe_read_ee_hostif_buffer_X550()
3152 u32 value = IXGBE_READ_REG(hw, reg); in ixgbe_read_ee_hostif_buffer_X550()
3167 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_buffer_X550()
3173 * @hw: pointer to hardware structure
3179 s32 ixgbe_write_ee_hostif_data_X550(struct ixgbe_hw *hw, u16 offset, in ixgbe_write_ee_hostif_data_X550() argument
3197 status = ixgbe_host_interface_command(hw, (u32 *)&buffer, in ixgbe_write_ee_hostif_data_X550()
3217 * @hw: pointer to hardware structure
3223 s32 ixgbe_write_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, in ixgbe_write_ee_hostif_X550() argument
3230 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == in ixgbe_write_ee_hostif_X550()
3232 status = ixgbe_write_ee_hostif_data_X550(hw, offset, data); in ixgbe_write_ee_hostif_X550()
3233 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_X550()
3244 * @hw: pointer to hardware structure
3251 s32 ixgbe_write_ee_hostif_buffer_X550(struct ixgbe_hw *hw, in ixgbe_write_ee_hostif_buffer_X550() argument
3260 status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_buffer_X550()
3267 status = ixgbe_write_ee_hostif_data_X550(hw, offset + i, in ixgbe_write_ee_hostif_buffer_X550()
3276 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_buffer_X550()
3284 * @hw: pointer to hardware structure
3293 static s32 ixgbe_checksum_ptr_x550(struct ixgbe_hw *hw, u16 ptr, in ixgbe_checksum_ptr_x550() argument
3306 status = ixgbe_read_ee_hostif_buffer_X550(hw, ptr, bufsz, buf); in ixgbe_checksum_ptr_x550()
3327 (ptr + length) >= hw->eeprom.word_size) in ixgbe_checksum_ptr_x550()
3342 status = ixgbe_read_ee_hostif_buffer_X550(hw, ptr, in ixgbe_checksum_ptr_x550()
3356 * @hw: pointer to hardware structure
3362 s32 ixgbe_calc_checksum_X550(struct ixgbe_hw *hw, u16 *buffer, u32 buffer_size) in ixgbe_calc_checksum_X550() argument
3372 hw->eeprom.ops.init_params(hw); in ixgbe_calc_checksum_X550()
3376 status = ixgbe_read_ee_hostif_buffer_X550(hw, 0, in ixgbe_calc_checksum_X550()
3410 pointer >= hw->eeprom.word_size) in ixgbe_calc_checksum_X550()
3426 status = ixgbe_checksum_ptr_x550(hw, pointer, size, &checksum, in ixgbe_calc_checksum_X550()
3439 * @hw: pointer to hardware structure
3443 s32 ixgbe_calc_eeprom_checksum_X550(struct ixgbe_hw *hw) in ixgbe_calc_eeprom_checksum_X550() argument
3445 return ixgbe_calc_checksum_X550(hw, NULL, 0); in ixgbe_calc_eeprom_checksum_X550()
3450 * @hw: pointer to hardware structure
3456 s32 ixgbe_validate_eeprom_checksum_X550(struct ixgbe_hw *hw, u16 *checksum_val) in ixgbe_validate_eeprom_checksum_X550() argument
3468 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_validate_eeprom_checksum_X550()
3474 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_validate_eeprom_checksum_X550()
3480 status = ixgbe_read_ee_hostif_X550(hw, IXGBE_EEPROM_CHECKSUM, in ixgbe_validate_eeprom_checksum_X550()
3503 * @hw: pointer to hardware structure
3509 s32 ixgbe_update_eeprom_checksum_X550(struct ixgbe_hw *hw) in ixgbe_update_eeprom_checksum_X550() argument
3520 status = ixgbe_read_ee_hostif_X550(hw, 0, &checksum); in ixgbe_update_eeprom_checksum_X550()
3526 status = ixgbe_calc_eeprom_checksum_X550(hw); in ixgbe_update_eeprom_checksum_X550()
3532 status = ixgbe_write_ee_hostif_X550(hw, IXGBE_EEPROM_CHECKSUM, in ixgbe_update_eeprom_checksum_X550()
3537 status = ixgbe_update_flash_X550(hw); in ixgbe_update_eeprom_checksum_X550()
3543 * ixgbe_update_flash_X550 - Instruct HW to copy EEPROM to Flash device
3544 * @hw: pointer to hardware structure
3548 s32 ixgbe_update_flash_X550(struct ixgbe_hw *hw) in ixgbe_update_flash_X550() argument
3560 status = ixgbe_host_interface_command(hw, (u32 *)&buffer, in ixgbe_update_flash_X550()
3569 * @hw: pointer to hardware structure
3573 u64 ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw) in ixgbe_get_supported_physical_layer_X550em() argument
3580 hw->phy.ops.identify(hw); in ixgbe_get_supported_physical_layer_X550em()
3582 switch (hw->phy.type) { in ixgbe_get_supported_physical_layer_X550em()
3584 if (hw->mac.type == ixgbe_mac_X550EM_a) { in ixgbe_get_supported_physical_layer_X550em()
3585 if (hw->phy.nw_mng_if_sel & in ixgbe_get_supported_physical_layer_X550em()
3590 } else if (hw->device_id == in ixgbe_get_supported_physical_layer_X550em()
3609 hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_EXT_ABILITY, in ixgbe_get_supported_physical_layer_X550em()
3618 if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_1GB_FULL) in ixgbe_get_supported_physical_layer_X550em()
3620 if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_100_FULL) in ixgbe_get_supported_physical_layer_X550em()
3622 if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_10_FULL) in ixgbe_get_supported_physical_layer_X550em()
3635 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) in ixgbe_get_supported_physical_layer_X550em()
3636 physical_layer = ixgbe_get_supported_phy_sfp_layer_generic(hw); in ixgbe_get_supported_physical_layer_X550em()
3643 * @hw: pointer to hardware structure
3648 s32 ixgbe_get_bus_info_X550em(struct ixgbe_hw *hw) in ixgbe_get_bus_info_X550em() argument
3653 hw->bus.width = ixgbe_bus_width_unknown; in ixgbe_get_bus_info_X550em()
3654 hw->bus.speed = ixgbe_bus_speed_unknown; in ixgbe_get_bus_info_X550em()
3656 hw->mac.ops.set_lan_id(hw); in ixgbe_get_bus_info_X550em()
3663 * @hw: pointer to hardware structure
3667 void ixgbe_disable_rx_x550(struct ixgbe_hw *hw) in ixgbe_disable_rx_x550() argument
3675 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); in ixgbe_disable_rx_x550()
3677 pfdtxgswc = IXGBE_READ_REG(hw, IXGBE_PFDTXGSWC); in ixgbe_disable_rx_x550()
3680 IXGBE_WRITE_REG(hw, IXGBE_PFDTXGSWC, pfdtxgswc); in ixgbe_disable_rx_x550()
3681 hw->mac.set_lben = true; in ixgbe_disable_rx_x550()
3683 hw->mac.set_lben = false; in ixgbe_disable_rx_x550()
3689 fw_cmd.port_number = (u8)hw->bus.lan_id; in ixgbe_disable_rx_x550()
3691 status = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd, in ixgbe_disable_rx_x550()
3697 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); in ixgbe_disable_rx_x550()
3700 IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, rxctrl); in ixgbe_disable_rx_x550()
3708 * @hw: pointer to hardware structure
3714 s32 ixgbe_enter_lplu_t_x550em(struct ixgbe_hw *hw) in ixgbe_enter_lplu_t_x550em() argument
3722 /* SW LPLU not required on later HW revisions. */ in ixgbe_enter_lplu_t_x550em()
3723 if ((hw->mac.type == ixgbe_mac_X550EM_x) && in ixgbe_enter_lplu_t_x550em()
3725 IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0)))) in ixgbe_enter_lplu_t_x550em()
3729 if (ixgbe_check_reset_blocked(hw)) in ixgbe_enter_lplu_t_x550em()
3732 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_enter_lplu_t_x550em()
3736 status = ixgbe_read_eeprom(hw, NVM_INIT_CTRL_3, &hw->eeprom.ctrl_word_3); in ixgbe_enter_lplu_t_x550em()
3744 if (!link_up || !(hw->eeprom.ctrl_word_3 & NVM_INIT_CTRL_3_LPLU) || in ixgbe_enter_lplu_t_x550em()
3745 !(hw->wol_enabled || ixgbe_mng_present(hw))) in ixgbe_enter_lplu_t_x550em()
3746 return ixgbe_set_copper_phy_power(hw, false); in ixgbe_enter_lplu_t_x550em()
3749 status = ixgbe_get_lcd_t_x550em(hw, &lcd_speed); in ixgbe_enter_lplu_t_x550em()
3756 return ixgbe_set_copper_phy_power(hw, false); in ixgbe_enter_lplu_t_x550em()
3758 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT, in ixgbe_enter_lplu_t_x550em()
3766 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_enter_lplu_t_x550em()
3768 return ixgbe_set_copper_phy_power(hw, false); in ixgbe_enter_lplu_t_x550em()
3781 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM, in ixgbe_enter_lplu_t_x550em()
3788 status = hw->phy.ops.read_reg(hw, IXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG, in ixgbe_enter_lplu_t_x550em()
3795 status = hw->phy.ops.read_reg(hw, in ixgbe_enter_lplu_t_x550em()
3803 save_autoneg = hw->phy.autoneg_advertised; in ixgbe_enter_lplu_t_x550em()
3806 status = hw->mac.ops.setup_link(hw, lcd_speed, false); in ixgbe_enter_lplu_t_x550em()
3809 hw->phy.autoneg_advertised = save_autoneg; in ixgbe_enter_lplu_t_x550em()
3816 * @hw: pointer to hardware structure
3821 s32 ixgbe_get_lcd_t_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *lcd_speed) in ixgbe_get_lcd_t_x550em() argument
3825 u16 word = hw->eeprom.ctrl_word_3; in ixgbe_get_lcd_t_x550em()
3829 status = hw->phy.ops.read_reg(hw, IXGBE_AUTO_NEG_LP_STATUS, in ixgbe_get_lcd_t_x550em()
3843 if ((hw->bus.lan_id && (word & NVM_INIT_CTRL_3_D10GMP_PORT1)) || in ixgbe_get_lcd_t_x550em()
3854 * @hw: pointer to hardware structure
3858 s32 ixgbe_setup_fc_X550em(struct ixgbe_hw *hw) in ixgbe_setup_fc_X550em() argument
3866 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fc_X550em()
3876 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_setup_fc_X550em()
3877 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_setup_fc_X550em()
3880 switch (hw->fc.requested_mode) { in ixgbe_setup_fc_X550em()
3909 switch (hw->device_id) { in ixgbe_setup_fc_X550em()
3913 ret_val = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_fc_X550em()
3914 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_X550em()
3924 ret_val = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_fc_X550em()
3925 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_X550em()
3929 hw->fc.disable_fc_autoneg = true; in ixgbe_setup_fc_X550em()
3932 hw->fc.disable_fc_autoneg = true; in ixgbe_setup_fc_X550em()
3944 * @hw: pointer to hardware structure
3948 void ixgbe_fc_autoneg_backplane_x550em_a(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_backplane_x550em_a() argument
3960 if (hw->fc.disable_fc_autoneg) { in ixgbe_fc_autoneg_backplane_x550em_a()
3966 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_fc_autoneg_backplane_x550em_a()
3973 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
3974 IXGBE_KRM_LINK_S1(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
3987 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
3988 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
3996 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
3997 IXGBE_KRM_LP_BASE_PAGE_HIGH(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
4005 status = ixgbe_negotiate_fc(hw, an_cntl_1, lp_an_page_low, in ixgbe_fc_autoneg_backplane_x550em_a()
4013 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg_backplane_x550em_a()
4015 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_backplane_x550em_a()
4016 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_backplane_x550em_a()
4022 * @hw: pointer to hardware structure
4025 void ixgbe_fc_autoneg_fiber_x550em_a(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_fiber_x550em_a() argument
4027 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_fiber_x550em_a()
4028 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_fiber_x550em_a()
4033 * @hw: pointer to hardware structure
4037 void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_sgmii_x550em_a() argument
4049 if (hw->fc.disable_fc_autoneg) { in ixgbe_fc_autoneg_sgmii_x550em_a()
4055 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_fc_autoneg_sgmii_x550em_a()
4062 status = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &info); in ixgbe_fc_autoneg_sgmii_x550em_a()
4071 status = ixgbe_negotiate_fc(hw, info[0], info[0], in ixgbe_fc_autoneg_sgmii_x550em_a()
4079 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg_sgmii_x550em_a()
4081 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_sgmii_x550em_a()
4082 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_sgmii_x550em_a()
4088 * @hw: pointer to hardware structure
4092 s32 ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw) in ixgbe_setup_fc_backplane_x550em_a() argument
4100 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fc_backplane_x550em_a()
4106 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_setup_fc_backplane_x550em_a()
4107 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_setup_fc_backplane_x550em_a()
4110 * HW will be able to do FC autoneg once the cable is plugged in. If in ixgbe_setup_fc_backplane_x550em_a()
4113 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_fc_backplane_x550em_a()
4114 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_backplane_x550em_a()
4131 switch (hw->fc.requested_mode) { in ixgbe_setup_fc_backplane_x550em_a()
4164 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_fc_backplane_x550em_a()
4165 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_backplane_x550em_a()
4169 status = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_fc_backplane_x550em_a()
4176 * @hw: pointer to hardware structure
4179 static void ixgbe_set_mux(struct ixgbe_hw *hw, u8 state) in ixgbe_set_mux() argument
4183 if (!hw->bus.lan_id) in ixgbe_set_mux()
4185 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_set_mux()
4190 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); in ixgbe_set_mux()
4191 IXGBE_WRITE_FLUSH(hw); in ixgbe_set_mux()
4196 * @hw: pointer to hardware structure
4201 s32 ixgbe_acquire_swfw_sync_X550em(struct ixgbe_hw *hw, u32 mask) in ixgbe_acquire_swfw_sync_X550em() argument
4207 status = ixgbe_acquire_swfw_sync_X540(hw, mask); in ixgbe_acquire_swfw_sync_X550em()
4212 ixgbe_set_mux(hw, 1); in ixgbe_acquire_swfw_sync_X550em()
4219 * @hw: pointer to hardware structure
4224 void ixgbe_release_swfw_sync_X550em(struct ixgbe_hw *hw, u32 mask) in ixgbe_release_swfw_sync_X550em() argument
4229 ixgbe_set_mux(hw, 0); in ixgbe_release_swfw_sync_X550em()
4231 ixgbe_release_swfw_sync_X540(hw, mask); in ixgbe_release_swfw_sync_X550em()
4236 * @hw: pointer to hardware structure
4241 static s32 ixgbe_acquire_swfw_sync_X550a(struct ixgbe_hw *hw, u32 mask) in ixgbe_acquire_swfw_sync_X550a() argument
4251 status = ixgbe_acquire_swfw_sync_X540(hw, hmask); in ixgbe_acquire_swfw_sync_X550a()
4262 status = ixgbe_get_phy_token(hw); in ixgbe_acquire_swfw_sync_X550a()
4270 ixgbe_release_swfw_sync_X540(hw, hmask); in ixgbe_acquire_swfw_sync_X550a()
4280 ixgbe_release_swfw_sync_X540(hw, hmask); in ixgbe_acquire_swfw_sync_X550a()
4283 hw->phy.id); in ixgbe_acquire_swfw_sync_X550a()
4289 * @hw: pointer to hardware structure
4294 static void ixgbe_release_swfw_sync_X550a(struct ixgbe_hw *hw, u32 mask) in ixgbe_release_swfw_sync_X550a() argument
4301 ixgbe_put_phy_token(hw); in ixgbe_release_swfw_sync_X550a()
4304 ixgbe_release_swfw_sync_X540(hw, hmask); in ixgbe_release_swfw_sync_X550a()
4309 * @hw: pointer to hardware structure
4318 s32 ixgbe_read_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_phy_reg_x550a() argument
4322 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM; in ixgbe_read_phy_reg_x550a()
4326 if (hw->mac.ops.acquire_swfw_sync(hw, mask)) in ixgbe_read_phy_reg_x550a()
4329 status = hw->phy.ops.read_reg_mdi(hw, reg_addr, device_type, phy_data); in ixgbe_read_phy_reg_x550a()
4331 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_phy_reg_x550a()
4338 * @hw: pointer to hardware structure
4346 s32 ixgbe_write_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_phy_reg_x550a() argument
4350 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM; in ixgbe_write_phy_reg_x550a()
4354 if (hw->mac.ops.acquire_swfw_sync(hw, mask) == IXGBE_SUCCESS) { in ixgbe_write_phy_reg_x550a()
4355 status = hw->phy.ops.write_reg_mdi(hw, reg_addr, device_type, in ixgbe_write_phy_reg_x550a()
4357 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_write_phy_reg_x550a()
4367 * @hw: pointer to hardware structure
4376 s32 ixgbe_handle_lasi_ext_t_x550em(struct ixgbe_hw *hw) in ixgbe_handle_lasi_ext_t_x550em() argument
4381 status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc); in ixgbe_handle_lasi_ext_t_x550em()
4387 return ixgbe_setup_internal_phy(hw); in ixgbe_handle_lasi_ext_t_x550em()
4394 * @hw: pointer to hardware structure
4403 s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_t_X550em() argument
4424 if (hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_setup_mac_link_t_X550em()
4425 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) { in ixgbe_setup_mac_link_t_X550em()
4426 status = ixgbe_setup_ixfi_x550em(hw, &force_speed); in ixgbe_setup_mac_link_t_X550em()
4435 status = ixgbe_check_link(hw, &force_speed, &link_up, in ixgbe_setup_mac_link_t_X550em()
4445 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait_to_complete); in ixgbe_setup_mac_link_t_X550em()
4450 * @hw: pointer to hardware structure
4457 s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed, in ixgbe_check_link_t_X550em() argument
4463 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_check_link_t_X550em()
4466 status = ixgbe_check_mac_link_generic(hw, speed, link_up, in ixgbe_check_link_t_X550em()
4479 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS, in ixgbe_check_link_t_X550em()
4496 * @hw: pointer to hardware structure
4498 s32 ixgbe_reset_phy_t_X550em(struct ixgbe_hw *hw) in ixgbe_reset_phy_t_X550em() argument
4502 status = ixgbe_reset_phy_generic(hw); in ixgbe_reset_phy_t_X550em()
4508 return ixgbe_enable_lasi_ext_t_x550em(hw); in ixgbe_reset_phy_t_X550em()
4513 * @hw: pointer to hardware structure
4516 s32 ixgbe_led_on_t_X550em(struct ixgbe_hw *hw, u32 led_idx) in ixgbe_led_on_t_X550em() argument
4526 ixgbe_read_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_on_t_X550em()
4529 ixgbe_write_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_on_t_X550em()
4533 return ixgbe_led_on_generic(hw, led_idx); in ixgbe_led_on_t_X550em()
4538 * @hw: pointer to hardware structure
4541 s32 ixgbe_led_off_t_X550em(struct ixgbe_hw *hw, u32 led_idx) in ixgbe_led_off_t_X550em() argument
4551 ixgbe_read_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_off_t_X550em()
4554 ixgbe_write_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_off_t_X550em()
4558 return ixgbe_led_off_generic(hw, led_idx); in ixgbe_led_off_t_X550em()
4563 * @hw: pointer to the HW structure
4576 s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min, in ixgbe_set_fw_drv_ver_x550() argument
4592 fw_cmd.port_num = (u8)hw->bus.func; in ixgbe_set_fw_drv_ver_x550()
4603 ret_val = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd, in ixgbe_set_fw_drv_ver_x550()
4624 * @hw: pointer t hardware structure
4628 bool ixgbe_fw_recovery_mode_X550(struct ixgbe_hw *hw) in ixgbe_fw_recovery_mode_X550() argument
4632 fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM_BY_MAC(hw)); in ixgbe_fw_recovery_mode_X550()