Lines Matching full:hw

17 static int ixgbe_get_invariants_X550_x(struct ixgbe_hw *hw)  in ixgbe_get_invariants_X550_x()  argument
19 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_get_invariants_X550_x()
20 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_get_invariants_X550_x()
21 struct ixgbe_link_info *link = &hw->link; in ixgbe_get_invariants_X550_x()
24 ixgbe_get_invariants_X540(hw); in ixgbe_get_invariants_X550_x()
26 if (mac->ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_get_invariants_X550_x()
34 static int ixgbe_get_invariants_X550_x_fw(struct ixgbe_hw *hw) in ixgbe_get_invariants_X550_x_fw() argument
36 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_get_invariants_X550_x_fw()
39 ixgbe_get_invariants_X540(hw); in ixgbe_get_invariants_X550_x_fw()
46 static int ixgbe_get_invariants_X550_a(struct ixgbe_hw *hw) in ixgbe_get_invariants_X550_a() argument
48 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_get_invariants_X550_a()
49 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_get_invariants_X550_a()
52 ixgbe_get_invariants_X540(hw); in ixgbe_get_invariants_X550_a()
54 if (mac->ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_get_invariants_X550_a()
60 static int ixgbe_get_invariants_X550_a_fw(struct ixgbe_hw *hw) in ixgbe_get_invariants_X550_a_fw() argument
62 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_get_invariants_X550_a_fw()
65 ixgbe_get_invariants_X540(hw); in ixgbe_get_invariants_X550_a_fw()
73 * @hw: pointer to hardware structure
75 static void ixgbe_setup_mux_ctl(struct ixgbe_hw *hw) in ixgbe_setup_mux_ctl() argument
77 u32 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_setup_mux_ctl()
79 if (hw->bus.lan_id) { in ixgbe_setup_mux_ctl()
84 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); in ixgbe_setup_mux_ctl()
85 IXGBE_WRITE_FLUSH(hw); in ixgbe_setup_mux_ctl()
90 * @hw: pointer to hardware structure
96 static int ixgbe_read_cs4227(struct ixgbe_hw *hw, u16 reg, u16 *value) in ixgbe_read_cs4227() argument
98 return hw->link.ops.read_link_unlocked(hw, hw->link.addr, reg, value); in ixgbe_read_cs4227()
103 * @hw: pointer to hardware structure
109 static int ixgbe_write_cs4227(struct ixgbe_hw *hw, u16 reg, u16 value) in ixgbe_write_cs4227() argument
111 return hw->link.ops.write_link_unlocked(hw, hw->link.addr, reg, value); in ixgbe_write_cs4227()
116 * @hw: pointer to hardware structure
122 static int ixgbe_read_pe(struct ixgbe_hw *hw, u8 reg, u8 *value) in ixgbe_read_pe() argument
126 status = ixgbe_read_i2c_byte_generic_unlocked(hw, reg, IXGBE_PE, value); in ixgbe_read_pe()
128 hw_err(hw, "port expander access failed with %d\n", status); in ixgbe_read_pe()
134 * @hw: pointer to hardware structure
140 static int ixgbe_write_pe(struct ixgbe_hw *hw, u8 reg, u8 value) in ixgbe_write_pe() argument
144 status = ixgbe_write_i2c_byte_generic_unlocked(hw, reg, IXGBE_PE, in ixgbe_write_pe()
147 hw_err(hw, "port expander access failed with %d\n", status); in ixgbe_write_pe()
153 * @hw: pointer to hardware structure
158 static int ixgbe_reset_cs4227(struct ixgbe_hw *hw) in ixgbe_reset_cs4227() argument
166 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, &reg); in ixgbe_reset_cs4227()
170 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg); in ixgbe_reset_cs4227()
174 status = ixgbe_read_pe(hw, IXGBE_PE_CONFIG, &reg); in ixgbe_reset_cs4227()
178 status = ixgbe_write_pe(hw, IXGBE_PE_CONFIG, reg); in ixgbe_reset_cs4227()
182 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, &reg); in ixgbe_reset_cs4227()
186 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg); in ixgbe_reset_cs4227()
192 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, &reg); in ixgbe_reset_cs4227()
196 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg); in ixgbe_reset_cs4227()
203 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_EFUSE_STATUS, in ixgbe_reset_cs4227()
210 hw_err(hw, "CS4227 reset did not complete\n"); in ixgbe_reset_cs4227()
214 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_EEPROM_STATUS, &value); in ixgbe_reset_cs4227()
216 hw_err(hw, "CS4227 EEPROM did not load successfully\n"); in ixgbe_reset_cs4227()
225 * @hw: pointer to hardware structure
227 static void ixgbe_check_cs4227(struct ixgbe_hw *hw) in ixgbe_check_cs4227() argument
229 u32 swfw_mask = hw->phy.phy_semaphore_mask; in ixgbe_check_cs4227()
235 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
237 hw_err(hw, "semaphore failed with %d\n", status); in ixgbe_check_cs4227()
243 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_SCRATCH, &value); in ixgbe_check_cs4227()
251 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
256 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
258 hw_err(hw, "semaphore failed with %d\n", status); in ixgbe_check_cs4227()
264 status = ixgbe_reset_cs4227(hw); in ixgbe_check_cs4227()
266 hw_err(hw, "CS4227 reset failed: %d", status); in ixgbe_check_cs4227()
273 ixgbe_write_cs4227(hw, IXGBE_CS4227_SCRATCH, in ixgbe_check_cs4227()
275 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
277 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
279 hw_err(hw, "semaphore failed with %d", status); in ixgbe_check_cs4227()
284 status = ixgbe_write_cs4227(hw, IXGBE_CS4227_SCRATCH, in ixgbe_check_cs4227()
288 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
289 msleep(hw->eeprom.semaphore_delay); in ixgbe_check_cs4227()
293 * @hw: pointer to hardware structure
297 static int ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) in ixgbe_identify_phy_x550em() argument
299 switch (hw->device_id) { in ixgbe_identify_phy_x550em()
301 if (hw->bus.lan_id) in ixgbe_identify_phy_x550em()
302 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_x550em()
304 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_x550em()
305 return ixgbe_identify_module_generic(hw); in ixgbe_identify_phy_x550em()
308 hw->phy.phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM; in ixgbe_identify_phy_x550em()
309 ixgbe_setup_mux_ctl(hw); in ixgbe_identify_phy_x550em()
310 ixgbe_check_cs4227(hw); in ixgbe_identify_phy_x550em()
313 return ixgbe_identify_module_generic(hw); in ixgbe_identify_phy_x550em()
315 hw->phy.type = ixgbe_phy_x550em_kx4; in ixgbe_identify_phy_x550em()
318 hw->phy.type = ixgbe_phy_x550em_xfi; in ixgbe_identify_phy_x550em()
323 hw->phy.type = ixgbe_phy_x550em_kr; in ixgbe_identify_phy_x550em()
326 if (hw->bus.lan_id) in ixgbe_identify_phy_x550em()
327 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_x550em()
329 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_x550em()
332 return ixgbe_identify_phy_generic(hw); in ixgbe_identify_phy_x550em()
334 hw->phy.type = ixgbe_phy_ext_1g_t; in ixgbe_identify_phy_x550em()
338 hw->phy.type = ixgbe_phy_fw; in ixgbe_identify_phy_x550em()
339 hw->phy.ops.read_reg = NULL; in ixgbe_identify_phy_x550em()
340 hw->phy.ops.write_reg = NULL; in ixgbe_identify_phy_x550em()
341 if (hw->bus.lan_id) in ixgbe_identify_phy_x550em()
342 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_x550em()
344 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_x550em()
352 static int ixgbe_read_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_phy_reg_x550em() argument
358 static int ixgbe_write_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_phy_reg_x550em() argument
366 * @hw: pointer to the hardware structure
373 static int ixgbe_read_i2c_combined_generic(struct ixgbe_hw *hw, u8 addr, in ixgbe_read_i2c_combined_generic() argument
376 return ixgbe_read_i2c_combined_generic_int(hw, addr, reg, val, true); in ixgbe_read_i2c_combined_generic()
381 * @hw: pointer to the hardware structure
389 ixgbe_read_i2c_combined_generic_unlocked(struct ixgbe_hw *hw, u8 addr, in ixgbe_read_i2c_combined_generic_unlocked() argument
392 return ixgbe_read_i2c_combined_generic_int(hw, addr, reg, val, false); in ixgbe_read_i2c_combined_generic_unlocked()
397 * @hw: pointer to the hardware structure
404 static int ixgbe_write_i2c_combined_generic(struct ixgbe_hw *hw, in ixgbe_write_i2c_combined_generic() argument
407 return ixgbe_write_i2c_combined_generic_int(hw, addr, reg, val, true); in ixgbe_write_i2c_combined_generic()
412 * @hw: pointer to the hardware structure
420 ixgbe_write_i2c_combined_generic_unlocked(struct ixgbe_hw *hw, in ixgbe_write_i2c_combined_generic_unlocked() argument
423 return ixgbe_write_i2c_combined_generic_int(hw, addr, reg, val, false); in ixgbe_write_i2c_combined_generic_unlocked()
428 * @hw: pointer to hardware structure
432 int ixgbe_fw_phy_activity(struct ixgbe_hw *hw, u16 activity, in ixgbe_fw_phy_activity() argument
448 hic.cmd.port_number = hw->bus.lan_id; in ixgbe_fw_phy_activity()
453 rc = ixgbe_host_interface_command(hw, &hic.cmd, sizeof(hic.cmd), in ixgbe_fw_phy_activity()
485 * @hw: pointer to hardware structure
489 static int ixgbe_get_phy_id_fw(struct ixgbe_hw *hw) in ixgbe_get_phy_id_fw() argument
497 if (hw->phy.id) in ixgbe_get_phy_id_fw()
500 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_PHY_INFO, &info); in ixgbe_get_phy_id_fw()
504 hw->phy.speeds_supported = 0; in ixgbe_get_phy_id_fw()
508 hw->phy.speeds_supported |= ixgbe_fw_map[i].phy_speed; in ixgbe_get_phy_id_fw()
511 hw->phy.id = info[0] & FW_PHY_INFO_ID_HI_MASK; in ixgbe_get_phy_id_fw()
513 hw->phy.id |= phy_id_lo & IXGBE_PHY_REVISION_MASK; in ixgbe_get_phy_id_fw()
514 hw->phy.revision = phy_id_lo & ~IXGBE_PHY_REVISION_MASK; in ixgbe_get_phy_id_fw()
515 if (!hw->phy.id || hw->phy.id == IXGBE_PHY_REVISION_MASK) in ixgbe_get_phy_id_fw()
518 hw->phy.autoneg_advertised = hw->phy.speeds_supported; in ixgbe_get_phy_id_fw()
519 hw->phy.eee_speeds_supported = IXGBE_LINK_SPEED_100_FULL | in ixgbe_get_phy_id_fw()
521 hw->phy.eee_speeds_advertised = hw->phy.eee_speeds_supported; in ixgbe_get_phy_id_fw()
527 * @hw: pointer to hardware structure
531 static int ixgbe_identify_phy_fw(struct ixgbe_hw *hw) in ixgbe_identify_phy_fw() argument
533 if (hw->bus.lan_id) in ixgbe_identify_phy_fw()
534 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_fw()
536 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_fw()
538 hw->phy.type = ixgbe_phy_fw; in ixgbe_identify_phy_fw()
539 hw->phy.ops.read_reg = NULL; in ixgbe_identify_phy_fw()
540 hw->phy.ops.write_reg = NULL; in ixgbe_identify_phy_fw()
541 return ixgbe_get_phy_id_fw(hw); in ixgbe_identify_phy_fw()
546 * @hw: pointer to hardware structure
550 static int ixgbe_shutdown_fw_phy(struct ixgbe_hw *hw) in ixgbe_shutdown_fw_phy() argument
555 return ixgbe_fw_phy_activity(hw, FW_PHY_ACT_FORCE_LINK_DOWN, &setup); in ixgbe_shutdown_fw_phy()
560 * @hw: pointer to hardware structure
562 static int ixgbe_setup_fw_link(struct ixgbe_hw *hw) in ixgbe_setup_fw_link() argument
568 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw)) in ixgbe_setup_fw_link()
571 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fw_link()
572 hw_err(hw, "rx_pause not valid in strict IEEE mode\n"); in ixgbe_setup_fw_link()
576 switch (hw->fc.requested_mode) { in ixgbe_setup_fw_link()
594 if (hw->phy.autoneg_advertised & ixgbe_fw_map[i].phy_speed) in ixgbe_setup_fw_link()
599 if (hw->phy.eee_speeds_advertised) in ixgbe_setup_fw_link()
602 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_SETUP_LINK, &setup); in ixgbe_setup_fw_link()
614 * @hw: pointer to hardware structure
618 static int ixgbe_fc_autoneg_fw(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_fw() argument
620 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_fc_autoneg_fw()
621 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_fc_autoneg_fw()
623 return ixgbe_setup_fw_link(hw); in ixgbe_fc_autoneg_fw()
627 * @hw: pointer to hardware structure
632 static int ixgbe_init_eeprom_params_X550(struct ixgbe_hw *hw) in ixgbe_init_eeprom_params_X550() argument
634 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_X550()
643 eec = IXGBE_READ_REG(hw, IXGBE_EEC(hw)); in ixgbe_init_eeprom_params_X550()
648 hw_dbg(hw, "Eeprom params: type = %d, size = %d\n", in ixgbe_init_eeprom_params_X550()
657 * @hw: pointer to hardware structure
664 static int ixgbe_iosf_wait(struct ixgbe_hw *hw, u32 *ctrl) in ixgbe_iosf_wait() argument
673 command = IXGBE_READ_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL); in ixgbe_iosf_wait()
681 hw_dbg(hw, "IOSF wait timed out\n"); in ixgbe_iosf_wait()
690 * @hw: pointer to hardware structure
695 static int ixgbe_read_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_iosf_sb_reg_x550() argument
702 ret = hw->mac.ops.acquire_swfw_sync(hw, gssr); in ixgbe_read_iosf_sb_reg_x550()
706 ret = ixgbe_iosf_wait(hw, NULL); in ixgbe_read_iosf_sb_reg_x550()
714 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL, command); in ixgbe_read_iosf_sb_reg_x550()
716 ret = ixgbe_iosf_wait(hw, &command); in ixgbe_read_iosf_sb_reg_x550()
720 hw_dbg(hw, "Failed to read, error %x\n", error); in ixgbe_read_iosf_sb_reg_x550()
726 *data = IXGBE_READ_REG(hw, IXGBE_SB_IOSF_INDIRECT_DATA); in ixgbe_read_iosf_sb_reg_x550()
729 hw->mac.ops.release_swfw_sync(hw, gssr); in ixgbe_read_iosf_sb_reg_x550()
735 * @hw: Pointer to hardware structure
737 static int ixgbe_get_phy_token(struct ixgbe_hw *hw) in ixgbe_get_phy_token() argument
746 token_cmd.port_number = hw->bus.lan_id; in ixgbe_get_phy_token()
749 status = ixgbe_host_interface_command(hw, &token_cmd, sizeof(token_cmd), in ixgbe_get_phy_token()
764 * @hw: Pointer to hardware structure
766 static int ixgbe_put_phy_token(struct ixgbe_hw *hw) in ixgbe_put_phy_token() argument
775 token_cmd.port_number = hw->bus.lan_id; in ixgbe_put_phy_token()
778 status = ixgbe_host_interface_command(hw, &token_cmd, sizeof(token_cmd), in ixgbe_put_phy_token()
790 * @hw: pointer to hardware structure
795 static int ixgbe_write_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_iosf_sb_reg_x550a() argument
805 write_cmd.port_number = hw->bus.lan_id; in ixgbe_write_iosf_sb_reg_x550a()
810 return ixgbe_host_interface_command(hw, &write_cmd, sizeof(write_cmd), in ixgbe_write_iosf_sb_reg_x550a()
816 * @hw: pointer to hardware structure
821 static int ixgbe_read_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_iosf_sb_reg_x550a() argument
835 hic.cmd.port_number = hw->bus.lan_id; in ixgbe_read_iosf_sb_reg_x550a()
839 status = ixgbe_host_interface_command(hw, &hic.cmd, sizeof(hic.cmd), in ixgbe_read_iosf_sb_reg_x550a()
849 * @hw: pointer to hardware structure
856 static int ixgbe_read_ee_hostif_buffer_X550(struct ixgbe_hw *hw, in ixgbe_read_ee_hostif_buffer_X550() argument
867 status = hw->mac.ops.acquire_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_buffer_X550()
869 hw_dbg(hw, "EEPROM read buffer - semaphore failed\n"); in ixgbe_read_ee_hostif_buffer_X550()
891 status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer), in ixgbe_read_ee_hostif_buffer_X550()
894 hw_dbg(hw, "Host interface command failed\n"); in ixgbe_read_ee_hostif_buffer_X550()
901 u32 value = IXGBE_READ_REG(hw, reg); in ixgbe_read_ee_hostif_buffer_X550()
916 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_buffer_X550()
921 * @hw: pointer to hardware structure
928 static int ixgbe_checksum_ptr_x550(struct ixgbe_hw *hw, u16 ptr, in ixgbe_checksum_ptr_x550() argument
941 status = ixgbe_read_ee_hostif_buffer_X550(hw, ptr, bufsz, buf); in ixgbe_checksum_ptr_x550()
943 hw_dbg(hw, "Failed to read EEPROM image\n"); in ixgbe_checksum_ptr_x550()
962 (ptr + length) >= hw->eeprom.word_size) in ixgbe_checksum_ptr_x550()
977 status = ixgbe_read_ee_hostif_buffer_X550(hw, ptr, in ixgbe_checksum_ptr_x550()
980 hw_dbg(hw, "Failed to read EEPROM image\n"); in ixgbe_checksum_ptr_x550()
990 * @hw: pointer to hardware structure
996 static int ixgbe_calc_checksum_X550(struct ixgbe_hw *hw, u16 *buffer, in ixgbe_calc_checksum_X550() argument
1005 hw->eeprom.ops.init_params(hw); in ixgbe_calc_checksum_X550()
1009 status = ixgbe_read_ee_hostif_buffer_X550(hw, 0, in ixgbe_calc_checksum_X550()
1013 hw_dbg(hw, "Failed to read EEPROM image\n"); in ixgbe_calc_checksum_X550()
1041 pointer >= hw->eeprom.word_size) in ixgbe_calc_checksum_X550()
1057 status = ixgbe_checksum_ptr_x550(hw, pointer, size, &checksum, in ixgbe_calc_checksum_X550()
1069 * @hw: pointer to hardware structure
1073 static int ixgbe_calc_eeprom_checksum_X550(struct ixgbe_hw *hw) in ixgbe_calc_eeprom_checksum_X550() argument
1075 return ixgbe_calc_checksum_X550(hw, NULL, 0); in ixgbe_calc_eeprom_checksum_X550()
1079 * @hw: pointer to hardware structure
1085 static int ixgbe_read_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 *data) in ixgbe_read_ee_hostif_X550() argument
1101 status = hw->mac.ops.acquire_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_X550()
1105 status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer), in ixgbe_read_ee_hostif_X550()
1108 *data = (u16)IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, in ixgbe_read_ee_hostif_X550()
1112 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_X550()
1117 * @hw: pointer to hardware structure
1123 static int ixgbe_validate_eeprom_checksum_X550(struct ixgbe_hw *hw, in ixgbe_validate_eeprom_checksum_X550() argument
1134 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_validate_eeprom_checksum_X550()
1136 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_validate_eeprom_checksum_X550()
1140 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_validate_eeprom_checksum_X550()
1146 status = ixgbe_read_ee_hostif_X550(hw, IXGBE_EEPROM_CHECKSUM, in ixgbe_validate_eeprom_checksum_X550()
1156 hw_dbg(hw, "Invalid EEPROM checksum"); in ixgbe_validate_eeprom_checksum_X550()
1167 * @hw: pointer to hardware structure
1173 static int ixgbe_write_ee_hostif_data_X550(struct ixgbe_hw *hw, u16 offset, in ixgbe_write_ee_hostif_data_X550() argument
1189 status = ixgbe_host_interface_command(hw, &buffer, sizeof(buffer), in ixgbe_write_ee_hostif_data_X550()
1195 * @hw: pointer to hardware structure
1201 static int ixgbe_write_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 data) in ixgbe_write_ee_hostif_X550() argument
1205 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == 0) { in ixgbe_write_ee_hostif_X550()
1206 status = ixgbe_write_ee_hostif_data_X550(hw, offset, data); in ixgbe_write_ee_hostif_X550()
1207 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_X550()
1209 hw_dbg(hw, "write ee hostif failed to get semaphore"); in ixgbe_write_ee_hostif_X550()
1216 /** ixgbe_update_flash_X550 - Instruct HW to copy EEPROM to Flash device
1217 * @hw: pointer to hardware structure
1221 static int ixgbe_update_flash_X550(struct ixgbe_hw *hw) in ixgbe_update_flash_X550() argument
1231 status = ixgbe_host_interface_command(hw, &buffer, sizeof(buffer), in ixgbe_update_flash_X550()
1238 * @hw: pointer to hardware structure
1243 static int ixgbe_get_bus_info_X550em(struct ixgbe_hw *hw) in ixgbe_get_bus_info_X550em() argument
1245 hw->bus.type = ixgbe_bus_type_internal; in ixgbe_get_bus_info_X550em()
1246 hw->bus.width = ixgbe_bus_width_unknown; in ixgbe_get_bus_info_X550em()
1247 hw->bus.speed = ixgbe_bus_speed_unknown; in ixgbe_get_bus_info_X550em()
1249 hw->mac.ops.set_lan_id(hw); in ixgbe_get_bus_info_X550em()
1256 * @hw: pointer t hardware structure
1260 static bool ixgbe_fw_recovery_mode_X550(struct ixgbe_hw *hw) in ixgbe_fw_recovery_mode_X550() argument
1264 fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM(hw)); in ixgbe_fw_recovery_mode_X550()
1272 static void ixgbe_disable_rx_x550(struct ixgbe_hw *hw) in ixgbe_disable_rx_x550() argument
1278 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); in ixgbe_disable_rx_x550()
1280 pfdtxgswc = IXGBE_READ_REG(hw, IXGBE_PFDTXGSWC); in ixgbe_disable_rx_x550()
1283 IXGBE_WRITE_REG(hw, IXGBE_PFDTXGSWC, pfdtxgswc); in ixgbe_disable_rx_x550()
1284 hw->mac.set_lben = true; in ixgbe_disable_rx_x550()
1286 hw->mac.set_lben = false; in ixgbe_disable_rx_x550()
1292 fw_cmd.port_number = hw->bus.lan_id; in ixgbe_disable_rx_x550()
1294 status = ixgbe_host_interface_command(hw, &fw_cmd, in ixgbe_disable_rx_x550()
1300 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); in ixgbe_disable_rx_x550()
1303 IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, rxctrl); in ixgbe_disable_rx_x550()
1310 * @hw: pointer to hardware structure
1316 static int ixgbe_update_eeprom_checksum_X550(struct ixgbe_hw *hw) in ixgbe_update_eeprom_checksum_X550() argument
1325 status = ixgbe_read_ee_hostif_X550(hw, 0, &checksum); in ixgbe_update_eeprom_checksum_X550()
1327 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_update_eeprom_checksum_X550()
1331 status = ixgbe_calc_eeprom_checksum_X550(hw); in ixgbe_update_eeprom_checksum_X550()
1337 status = ixgbe_write_ee_hostif_X550(hw, IXGBE_EEPROM_CHECKSUM, in ixgbe_update_eeprom_checksum_X550()
1342 status = ixgbe_update_flash_X550(hw); in ixgbe_update_eeprom_checksum_X550()
1348 * @hw: pointer to hardware structure
1356 static int ixgbe_write_ee_hostif_buffer_X550(struct ixgbe_hw *hw, in ixgbe_write_ee_hostif_buffer_X550() argument
1364 status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_buffer_X550()
1366 hw_dbg(hw, "EEPROM write buffer - semaphore failed\n"); in ixgbe_write_ee_hostif_buffer_X550()
1371 status = ixgbe_write_ee_hostif_data_X550(hw, offset + i, in ixgbe_write_ee_hostif_buffer_X550()
1374 hw_dbg(hw, "Eeprom buffered write failed\n"); in ixgbe_write_ee_hostif_buffer_X550()
1379 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_buffer_X550()
1387 * @hw: pointer to hardware structure
1392 static int ixgbe_write_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_iosf_sb_reg_x550() argument
1399 ret = hw->mac.ops.acquire_swfw_sync(hw, gssr); in ixgbe_write_iosf_sb_reg_x550()
1403 ret = ixgbe_iosf_wait(hw, NULL); in ixgbe_write_iosf_sb_reg_x550()
1411 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL, command); in ixgbe_write_iosf_sb_reg_x550()
1414 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_DATA, data); in ixgbe_write_iosf_sb_reg_x550()
1416 ret = ixgbe_iosf_wait(hw, &command); in ixgbe_write_iosf_sb_reg_x550()
1420 hw_dbg(hw, "Failed to write, error %x\n", error); in ixgbe_write_iosf_sb_reg_x550()
1425 hw->mac.ops.release_swfw_sync(hw, gssr); in ixgbe_write_iosf_sb_reg_x550()
1431 * @hw: pointer to hardware structure
1435 static int ixgbe_setup_ixfi_x550em_x(struct ixgbe_hw *hw) in ixgbe_setup_ixfi_x550em_x() argument
1441 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1442 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1448 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1449 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1455 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1456 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1464 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1465 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1470 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1471 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1479 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1480 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1486 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1487 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1496 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1497 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1505 * @hw: pointer to hardware structure
1507 static int ixgbe_restart_an_internal_phy_x550em(struct ixgbe_hw *hw) in ixgbe_restart_an_internal_phy_x550em() argument
1513 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1514 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1518 hw_dbg(hw, "Auto-negotiation did not complete\n"); in ixgbe_restart_an_internal_phy_x550em()
1523 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1524 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1527 if (hw->mac.type == ixgbe_mac_x550em_a) { in ixgbe_restart_an_internal_phy_x550em()
1531 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1532 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1536 hw_dbg(hw, "Auto-negotiation did not complete\n"); in ixgbe_restart_an_internal_phy_x550em()
1541 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1542 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1550 * @hw: pointer to hardware structure
1556 static int ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed) in ixgbe_setup_ixfi_x550em() argument
1558 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_ixfi_x550em()
1567 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1568 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1589 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1590 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1596 if (hw->mac.type == ixgbe_mac_X550EM_x) { in ixgbe_setup_ixfi_x550em()
1597 status = ixgbe_setup_ixfi_x550em_x(hw); in ixgbe_setup_ixfi_x550em()
1603 status = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_ixfi_x550em()
1610 * @hw: pointer to hardware structure
1613 static int ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear) in ixgbe_supported_sfp_modules_X550em() argument
1615 switch (hw->phy.sfp_type) { in ixgbe_supported_sfp_modules_X550em()
1644 * @hw: pointer to hardware structure
1651 ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_sfp_x550em() argument
1660 status = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear); in ixgbe_setup_mac_link_sfp_x550em()
1673 ixgbe_setup_kr_speed_x550em(hw, speed); in ixgbe_setup_mac_link_sfp_x550em()
1676 reg_slice = IXGBE_CS4227_LINE_SPARE24_LSB + (hw->bus.lan_id << 12); in ixgbe_setup_mac_link_sfp_x550em()
1682 status = hw->link.ops.write_link(hw, hw->link.addr, reg_slice, in ixgbe_setup_mac_link_sfp_x550em()
1690 * @hw: pointer to hardware structure
1696 static int ixgbe_setup_sfi_x550a(struct ixgbe_hw *hw, ixgbe_link_speed *speed) in ixgbe_setup_sfi_x550a() argument
1698 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sfi_x550a()
1703 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sfi_x550a()
1704 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sfi_x550a()
1727 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sfi_x550a()
1728 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sfi_x550a()
1732 status = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_sfi_x550a()
1739 * @hw: pointer to hardware structure
1746 ixgbe_setup_mac_link_sfp_n(struct ixgbe_hw *hw, ixgbe_link_speed speed, in ixgbe_setup_mac_link_sfp_n() argument
1754 ret_val = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear); in ixgbe_setup_mac_link_sfp_n()
1766 ret_val = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_mac_link_sfp_n()
1767 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_mac_link_sfp_n()
1776 ret_val = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_mac_link_sfp_n()
1777 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_mac_link_sfp_n()
1783 return ixgbe_setup_sfi_x550a(hw, &speed); in ixgbe_setup_mac_link_sfp_n()
1788 * @hw: pointer to hardware structure
1795 ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed, in ixgbe_setup_mac_link_sfp_x550a() argument
1804 ret_val = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear); in ixgbe_setup_mac_link_sfp_x550a()
1816 ixgbe_setup_kr_speed_x550em(hw, speed); in ixgbe_setup_mac_link_sfp_x550a()
1818 if (hw->phy.mdio.prtad == MDIO_PRTAD_NONE) in ixgbe_setup_mac_link_sfp_x550a()
1822 ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_EFUSE_PDF_SKU, in ixgbe_setup_mac_link_sfp_x550a()
1831 slice_offset = (hw->bus.lan_id + in ixgbe_setup_mac_link_sfp_x550a()
1832 (hw->bus.instance_id << 1)) << 12; in ixgbe_setup_mac_link_sfp_x550a()
1834 slice_offset = hw->bus.lan_id << 12; in ixgbe_setup_mac_link_sfp_x550a()
1839 ret_val = hw->phy.ops.read_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
1852 ret_val = hw->phy.ops.write_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
1858 return hw->phy.ops.read_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
1864 * @hw: pointer to hardware structure
1873 static int ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_t_X550em() argument
1890 if (hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_setup_mac_link_t_X550em()
1891 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) { in ixgbe_setup_mac_link_t_X550em()
1892 status = ixgbe_setup_ixfi_x550em(hw, &force_speed); in ixgbe_setup_mac_link_t_X550em()
1898 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait); in ixgbe_setup_mac_link_t_X550em()
1902 * @hw: pointer to hardware structure
1909 static int ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, in ixgbe_check_link_t_X550em() argument
1917 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_check_link_t_X550em()
1920 status = ixgbe_check_mac_link_generic(hw, speed, link_up, in ixgbe_check_link_t_X550em()
1933 status = hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, in ixgbe_check_link_t_X550em()
1949 * @hw: pointer to hardware structure
1954 ixgbe_setup_sgmii(struct ixgbe_hw *hw, __always_unused ixgbe_link_speed speed, in ixgbe_setup_sgmii() argument
1957 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sgmii()
1961 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1962 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii()
1972 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1973 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii()
1978 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1979 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii()
1986 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1987 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii()
1992 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1993 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
1998 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1999 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
2010 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
2011 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
2016 rc = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_sgmii()
2022 * @hw: pointer to hardware structure
2026 static int ixgbe_setup_sgmii_fw(struct ixgbe_hw *hw, ixgbe_link_speed speed, in ixgbe_setup_sgmii_fw() argument
2029 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sgmii_fw()
2033 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2034 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2044 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2045 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2050 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2051 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2058 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2059 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2064 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2065 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2070 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2071 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2082 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2083 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2088 ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_sgmii_fw()
2090 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait); in ixgbe_setup_sgmii_fw()
2095 * @hw: pointer to hardware structure
2099 static void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_sgmii_x550em_a() argument
2111 if (hw->fc.disable_fc_autoneg) in ixgbe_fc_autoneg_sgmii_x550em_a()
2114 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_fc_autoneg_sgmii_x550em_a()
2119 status = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &info); in ixgbe_fc_autoneg_sgmii_x550em_a()
2126 status = ixgbe_negotiate_fc(hw, info[0], info[0], in ixgbe_fc_autoneg_sgmii_x550em_a()
2134 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg_sgmii_x550em_a()
2136 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_sgmii_x550em_a()
2137 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_sgmii_x550em_a()
2142 * @hw: pointer to hardware structure
2144 static void ixgbe_init_mac_link_ops_X550em_a(struct ixgbe_hw *hw) in ixgbe_init_mac_link_ops_X550em_a() argument
2146 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_mac_link_ops_X550em_a()
2148 switch (mac->ops.get_media_type(hw)) { in ixgbe_init_mac_link_ops_X550em_a()
2154 if (hw->device_id != IXGBE_DEV_ID_X550EM_A_1G_T && in ixgbe_init_mac_link_ops_X550em_a()
2155 hw->device_id != IXGBE_DEV_ID_X550EM_A_1G_T_L) { in ixgbe_init_mac_link_ops_X550em_a()
2174 * @hw: pointer to hardware structure
2176 static void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw) in ixgbe_init_mac_link_ops_X550em() argument
2178 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_mac_link_ops_X550em()
2182 switch (mac->ops.get_media_type(hw)) { in ixgbe_init_mac_link_ops_X550em()
2191 switch (hw->device_id) { in ixgbe_init_mac_link_ops_X550em()
2208 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_1G_T) in ixgbe_init_mac_link_ops_X550em()
2215 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII || in ixgbe_init_mac_link_ops_X550em()
2216 hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII_L) in ixgbe_init_mac_link_ops_X550em()
2224 if (hw->mac.type == ixgbe_mac_x550em_a) in ixgbe_init_mac_link_ops_X550em()
2225 ixgbe_init_mac_link_ops_X550em_a(hw); in ixgbe_init_mac_link_ops_X550em()
2229 * @hw: pointer to hardware structure
2231 static int ixgbe_setup_sfp_modules_X550em(struct ixgbe_hw *hw) in ixgbe_setup_sfp_modules_X550em() argument
2237 status = ixgbe_supported_sfp_modules_X550em(hw, &linear); in ixgbe_setup_sfp_modules_X550em()
2241 ixgbe_init_mac_link_ops_X550em(hw); in ixgbe_setup_sfp_modules_X550em()
2242 hw->phy.ops.reset = NULL; in ixgbe_setup_sfp_modules_X550em()
2248 * @hw: pointer to hardware structure
2252 static int ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw, in ixgbe_get_link_capabilities_X550em() argument
2256 if (hw->phy.type == ixgbe_phy_fw) { in ixgbe_get_link_capabilities_X550em()
2258 *speed = hw->phy.speeds_supported; in ixgbe_get_link_capabilities_X550em()
2263 if (hw->phy.media_type == ixgbe_media_type_fiber) { in ixgbe_get_link_capabilities_X550em()
2267 if (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || in ixgbe_get_link_capabilities_X550em()
2268 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1 || in ixgbe_get_link_capabilities_X550em()
2269 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 || in ixgbe_get_link_capabilities_X550em()
2270 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1) { in ixgbe_get_link_capabilities_X550em()
2276 if (hw->phy.multispeed_fiber) in ixgbe_get_link_capabilities_X550em()
2282 switch (hw->phy.type) { in ixgbe_get_link_capabilities_X550em()
2297 if (hw->mac.type == ixgbe_mac_x550em_a) { in ixgbe_get_link_capabilities_X550em()
2299 if (hw->phy.nw_mng_if_sel & in ixgbe_get_link_capabilities_X550em()
2303 } else if (hw->device_id == in ixgbe_get_link_capabilities_X550em()
2322 * @hw: pointer to hardware structure
2330 static int ixgbe_get_lasi_ext_t_x550em(struct ixgbe_hw *hw, bool *lsc, in ixgbe_get_lasi_ext_t_x550em() argument
2340 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG, in ixgbe_get_lasi_ext_t_x550em()
2348 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_FLAG, in ixgbe_get_lasi_ext_t_x550em()
2357 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_ALARM_1, in ixgbe_get_lasi_ext_t_x550em()
2367 ixgbe_set_copper_phy_power(hw, false); in ixgbe_get_lasi_ext_t_x550em()
2373 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_FAULT_MSG, in ixgbe_get_lasi_ext_t_x550em()
2382 ixgbe_set_copper_phy_power(hw, false); in ixgbe_get_lasi_ext_t_x550em()
2389 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG, in ixgbe_get_lasi_ext_t_x550em()
2396 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM2, in ixgbe_get_lasi_ext_t_x550em()
2411 * @hw: pointer to hardware structure
2418 static int ixgbe_enable_lasi_ext_t_x550em(struct ixgbe_hw *hw) in ixgbe_enable_lasi_ext_t_x550em() argument
2425 status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc, &overtemp); in ixgbe_enable_lasi_ext_t_x550em()
2437 if (hw->mac.type != ixgbe_mac_x550em_a) { in ixgbe_enable_lasi_ext_t_x550em()
2438 status = hw->phy.ops.read_reg(hw, in ixgbe_enable_lasi_ext_t_x550em()
2446 status = hw->phy.ops.write_reg(hw, in ixgbe_enable_lasi_ext_t_x550em()
2454 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2463 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2470 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2479 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2486 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2494 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2503 * @hw: pointer to hardware structure
2510 static int ixgbe_handle_lasi_ext_t_x550em(struct ixgbe_hw *hw, in ixgbe_handle_lasi_ext_t_x550em() argument
2513 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_handle_lasi_ext_t_x550em()
2517 status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc, is_overtemp); in ixgbe_handle_lasi_ext_t_x550em()
2522 return phy->ops.setup_internal_link(hw); in ixgbe_handle_lasi_ext_t_x550em()
2529 * @hw: pointer to hardware structure
2534 static int ixgbe_setup_kr_speed_x550em(struct ixgbe_hw *hw, in ixgbe_setup_kr_speed_x550em() argument
2540 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2541 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2558 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2559 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2562 if (hw->mac.type == ixgbe_mac_x550em_a) { in ixgbe_setup_kr_speed_x550em()
2564 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2565 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2577 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2578 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2582 return ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_kr_speed_x550em()
2587 * @hw: pointer to hardware structure
2589 static int ixgbe_setup_kr_x550em(struct ixgbe_hw *hw) in ixgbe_setup_kr_x550em() argument
2592 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL) in ixgbe_setup_kr_x550em()
2595 if (ixgbe_check_reset_blocked(hw)) in ixgbe_setup_kr_x550em()
2598 return ixgbe_setup_kr_speed_x550em(hw, hw->phy.autoneg_advertised); in ixgbe_setup_kr_x550em()
2602 * @hw: address of hardware structure
2607 static int ixgbe_ext_phy_t_x550em_get_link(struct ixgbe_hw *hw, bool *link_up) in ixgbe_ext_phy_t_x550em_get_link() argument
2615 ret = hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, in ixgbe_ext_phy_t_x550em_get_link()
2620 ret = hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, in ixgbe_ext_phy_t_x550em_get_link()
2631 * @hw: point to hardware structure
2641 static int ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw) in ixgbe_setup_internal_phy_t_x550em() argument
2648 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_setup_internal_phy_t_x550em()
2651 if (!(hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_setup_internal_phy_t_x550em()
2652 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE))) { in ixgbe_setup_internal_phy_t_x550em()
2655 return ixgbe_setup_kr_speed_x550em(hw, speed); in ixgbe_setup_internal_phy_t_x550em()
2659 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_setup_internal_phy_t_x550em()
2666 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT, in ixgbe_setup_internal_phy_t_x550em()
2673 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_setup_internal_phy_t_x550em()
2695 return ixgbe_setup_ixfi_x550em(hw, &force_speed); in ixgbe_setup_internal_phy_t_x550em()
2699 * @hw: pointer to hardware structure
2701 static int ixgbe_reset_phy_t_X550em(struct ixgbe_hw *hw) in ixgbe_reset_phy_t_X550em() argument
2705 status = ixgbe_reset_phy_generic(hw); in ixgbe_reset_phy_t_X550em()
2711 return ixgbe_enable_lasi_ext_t_x550em(hw); in ixgbe_reset_phy_t_X550em()
2716 * @hw: pointer to hardware structure
2719 static int ixgbe_led_on_t_x550em(struct ixgbe_hw *hw, u32 led_idx) in ixgbe_led_on_t_x550em() argument
2727 hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_on_t_x550em()
2730 hw->phy.ops.write_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_on_t_x550em()
2738 * @hw: pointer to hardware structure
2741 static int ixgbe_led_off_t_x550em(struct ixgbe_hw *hw, u32 led_idx) in ixgbe_led_off_t_x550em() argument
2749 hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_off_t_x550em()
2752 hw->phy.ops.write_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_off_t_x550em()
2760 * @hw: pointer to the HW structure
2774 int ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min, in ixgbe_set_fw_drv_ver_x550() argument
2788 fw_cmd.port_num = (u8)hw->bus.func; in ixgbe_set_fw_drv_ver_x550()
2799 ret_val = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd, in ixgbe_set_fw_drv_ver_x550()
2816 * @hw: pointer to hardware structure
2821 static int ixgbe_get_lcd_t_x550em(struct ixgbe_hw *hw, in ixgbe_get_lcd_t_x550em() argument
2824 u16 word = hw->eeprom.ctrl_word_3; in ixgbe_get_lcd_t_x550em()
2830 status = hw->phy.ops.read_reg(hw, IXGBE_AUTO_NEG_LP_STATUS, in ixgbe_get_lcd_t_x550em()
2843 if ((hw->bus.lan_id && (word & NVM_INIT_CTRL_3_D10GMP_PORT1)) || in ixgbe_get_lcd_t_x550em()
2854 * @hw: pointer to hardware structure
2856 static int ixgbe_setup_fc_x550em(struct ixgbe_hw *hw) in ixgbe_setup_fc_x550em() argument
2863 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fc_x550em()
2864 hw_err(hw, "ixgbe_fc_rx_pause not valid in strict IEEE mode\n"); in ixgbe_setup_fc_x550em()
2871 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_setup_fc_x550em()
2872 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_setup_fc_x550em()
2875 switch (hw->fc.requested_mode) { in ixgbe_setup_fc_x550em()
2899 hw_err(hw, "Flow control param set incorrectly\n"); in ixgbe_setup_fc_x550em()
2903 switch (hw->device_id) { in ixgbe_setup_fc_x550em()
2907 rc = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_fc_x550em()
2908 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_x550em()
2920 rc = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_fc_x550em()
2921 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_x550em()
2926 hw->fc.disable_fc_autoneg = true; in ixgbe_setup_fc_x550em()
2929 hw->fc.disable_fc_autoneg = true; in ixgbe_setup_fc_x550em()
2939 * @hw: pointer to hardware structure
2941 static void ixgbe_fc_autoneg_backplane_x550em_a(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_backplane_x550em_a() argument
2953 if (hw->fc.disable_fc_autoneg) { in ixgbe_fc_autoneg_backplane_x550em_a()
2954 hw_err(hw, "Flow control autoneg is disabled"); in ixgbe_fc_autoneg_backplane_x550em_a()
2958 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_fc_autoneg_backplane_x550em_a()
2960 hw_err(hw, "The link is down"); in ixgbe_fc_autoneg_backplane_x550em_a()
2965 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
2966 IXGBE_KRM_LINK_S1(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
2970 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_fc_autoneg_backplane_x550em_a()
2978 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
2979 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
2983 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_fc_autoneg_backplane_x550em_a()
2987 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
2988 IXGBE_KRM_LP_BASE_PAGE_HIGH(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
2992 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_fc_autoneg_backplane_x550em_a()
2996 status = ixgbe_negotiate_fc(hw, an_cntl_1, lp_an_page_low, in ixgbe_fc_autoneg_backplane_x550em_a()
3004 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg_backplane_x550em_a()
3006 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_backplane_x550em_a()
3007 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_backplane_x550em_a()
3013 * @hw: pointer to hardware structure
3015 static void ixgbe_fc_autoneg_fiber_x550em_a(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_fiber_x550em_a() argument
3017 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_fiber_x550em_a()
3018 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_fiber_x550em_a()
3022 * @hw: pointer to hardware structure
3028 static int ixgbe_enter_lplu_t_x550em(struct ixgbe_hw *hw) in ixgbe_enter_lplu_t_x550em() argument
3037 if (ixgbe_check_reset_blocked(hw)) in ixgbe_enter_lplu_t_x550em()
3040 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_enter_lplu_t_x550em()
3044 status = hw->eeprom.ops.read(hw, NVM_INIT_CTRL_3, in ixgbe_enter_lplu_t_x550em()
3045 &hw->eeprom.ctrl_word_3); in ixgbe_enter_lplu_t_x550em()
3053 if (!link_up || !(hw->eeprom.ctrl_word_3 & NVM_INIT_CTRL_3_LPLU) || in ixgbe_enter_lplu_t_x550em()
3054 !(hw->wol_enabled || ixgbe_mng_present(hw))) in ixgbe_enter_lplu_t_x550em()
3055 return ixgbe_set_copper_phy_power(hw, false); in ixgbe_enter_lplu_t_x550em()
3058 status = ixgbe_get_lcd_t_x550em(hw, &lcd_speed); in ixgbe_enter_lplu_t_x550em()
3064 return ixgbe_set_copper_phy_power(hw, false); in ixgbe_enter_lplu_t_x550em()
3066 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT, in ixgbe_enter_lplu_t_x550em()
3073 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_enter_lplu_t_x550em()
3075 return ixgbe_set_copper_phy_power(hw, false); in ixgbe_enter_lplu_t_x550em()
3088 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM, in ixgbe_enter_lplu_t_x550em()
3094 status = hw->phy.ops.read_reg(hw, MDIO_AN_10GBT_CTRL, in ixgbe_enter_lplu_t_x550em()
3100 status = hw->phy.ops.read_reg(hw, in ixgbe_enter_lplu_t_x550em()
3107 save_autoneg = hw->phy.autoneg_advertised; in ixgbe_enter_lplu_t_x550em()
3110 status = hw->mac.ops.setup_link(hw, lcd_speed, false); in ixgbe_enter_lplu_t_x550em()
3113 hw->phy.autoneg_advertised = save_autoneg; in ixgbe_enter_lplu_t_x550em()
3120 * @hw: pointer to hardware structure
3122 static int ixgbe_reset_phy_fw(struct ixgbe_hw *hw) in ixgbe_reset_phy_fw() argument
3127 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw)) in ixgbe_reset_phy_fw()
3130 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_PHY_SW_RESET, &store); in ixgbe_reset_phy_fw()
3135 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_INIT_PHY, &store); in ixgbe_reset_phy_fw()
3139 return ixgbe_setup_fw_link(hw); in ixgbe_reset_phy_fw()
3144 * @hw: pointer to hardware structure
3148 static bool ixgbe_check_overtemp_fw(struct ixgbe_hw *hw) in ixgbe_check_overtemp_fw() argument
3153 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &store); in ixgbe_check_overtemp_fw()
3158 ixgbe_shutdown_fw_phy(hw); in ixgbe_check_overtemp_fw()
3166 * @hw: pointer to hardware structure
3170 static void ixgbe_read_mng_if_sel_x550em(struct ixgbe_hw *hw) in ixgbe_read_mng_if_sel_x550em() argument
3175 hw->phy.nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL); in ixgbe_read_mng_if_sel_x550em()
3180 if (hw->mac.type == ixgbe_mac_x550em_a && in ixgbe_read_mng_if_sel_x550em()
3181 hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_MDIO_ACT) { in ixgbe_read_mng_if_sel_x550em()
3182 hw->phy.mdio.prtad = FIELD_GET(IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD, in ixgbe_read_mng_if_sel_x550em()
3183 hw->phy.nw_mng_if_sel); in ixgbe_read_mng_if_sel_x550em()
3188 * @hw: pointer to hardware structure
3194 static int ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw) in ixgbe_init_phy_ops_X550em() argument
3196 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_init_phy_ops_X550em()
3199 hw->mac.ops.set_lan_id(hw); in ixgbe_init_phy_ops_X550em()
3201 ixgbe_read_mng_if_sel_x550em(hw); in ixgbe_init_phy_ops_X550em()
3203 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) { in ixgbe_init_phy_ops_X550em()
3205 ixgbe_setup_mux_ctl(hw); in ixgbe_init_phy_ops_X550em()
3209 ret_val = phy->ops.identify(hw); in ixgbe_init_phy_ops_X550em()
3214 ixgbe_init_mac_link_ops_X550em(hw); in ixgbe_init_phy_ops_X550em()
3219 switch (hw->phy.type) { in ixgbe_init_phy_ops_X550em()
3231 /* link is managed by HW */ in ixgbe_init_phy_ops_X550em()
3240 phy->nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL); in ixgbe_init_phy_ops_X550em()
3249 if (hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_init_phy_ops_X550em()
3250 !(IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0)) & in ixgbe_init_phy_ops_X550em()
3278 * @hw: pointer to hardware structure
3283 static enum ixgbe_media_type ixgbe_get_media_type_X550em(struct ixgbe_hw *hw) in ixgbe_get_media_type_X550em() argument
3288 switch (hw->device_id) { in ixgbe_get_media_type_X550em()
3291 hw->phy.type = ixgbe_phy_sgmii; in ixgbe_get_media_type_X550em()
3320 ** @hw: pointer to hardware structure
3322 static int ixgbe_init_ext_t_x550em(struct ixgbe_hw *hw) in ixgbe_init_ext_t_x550em() argument
3327 status = hw->phy.ops.read_reg(hw, in ixgbe_init_ext_t_x550em()
3338 status = hw->phy.ops.read_reg(hw, in ixgbe_init_ext_t_x550em()
3347 status = hw->phy.ops.write_reg(hw, in ixgbe_init_ext_t_x550em()
3360 * @hw: pointer to hardware structure
3362 static void ixgbe_set_mdio_speed(struct ixgbe_hw *hw) in ixgbe_set_mdio_speed() argument
3366 switch (hw->device_id) { in ixgbe_set_mdio_speed()
3373 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0); in ixgbe_set_mdio_speed()
3375 IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); in ixgbe_set_mdio_speed()
3380 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0); in ixgbe_set_mdio_speed()
3382 IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); in ixgbe_set_mdio_speed()
3390 ** @hw: pointer to hardware structure
3396 static int ixgbe_reset_hw_X550em(struct ixgbe_hw *hw) in ixgbe_reset_hw_X550em() argument
3398 u32 swfw_mask = hw->phy.phy_semaphore_mask; in ixgbe_reset_hw_X550em()
3406 status = hw->mac.ops.stop_adapter(hw); in ixgbe_reset_hw_X550em()
3411 ixgbe_clear_tx_pending(hw); in ixgbe_reset_hw_X550em()
3414 ixgbe_set_mdio_speed(hw); in ixgbe_reset_hw_X550em()
3417 status = hw->phy.ops.init(hw); in ixgbe_reset_hw_X550em()
3422 if (hw->phy.type == ixgbe_phy_x550em_ext_t) { in ixgbe_reset_hw_X550em()
3423 status = ixgbe_init_ext_t_x550em(hw); in ixgbe_reset_hw_X550em()
3429 if (hw->phy.sfp_setup_needed) { in ixgbe_reset_hw_X550em()
3430 status = hw->mac.ops.setup_sfp(hw); in ixgbe_reset_hw_X550em()
3431 hw->phy.sfp_setup_needed = false; in ixgbe_reset_hw_X550em()
3438 if (!hw->phy.reset_disable && hw->phy.ops.reset) in ixgbe_reset_hw_X550em()
3439 hw->phy.ops.reset(hw); in ixgbe_reset_hw_X550em()
3449 if (!hw->force_full_reset) { in ixgbe_reset_hw_X550em()
3450 hw->mac.ops.check_link(hw, &link_speed, &link_up, false); in ixgbe_reset_hw_X550em()
3455 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X550em()
3457 hw_dbg(hw, "semaphore failed with %d", status); in ixgbe_reset_hw_X550em()
3461 ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X550em()
3462 IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl); in ixgbe_reset_hw_X550em()
3463 IXGBE_WRITE_FLUSH(hw); in ixgbe_reset_hw_X550em()
3464 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X550em()
3469 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X550em()
3477 hw_dbg(hw, "Reset polling failed to complete.\n"); in ixgbe_reset_hw_X550em()
3486 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { in ixgbe_reset_hw_X550em()
3487 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_reset_hw_X550em()
3492 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); in ixgbe_reset_hw_X550em()
3498 hw->mac.num_rar_entries = 128; in ixgbe_reset_hw_X550em()
3499 hw->mac.ops.init_rx_addrs(hw); in ixgbe_reset_hw_X550em()
3501 ixgbe_set_mdio_speed(hw); in ixgbe_reset_hw_X550em()
3503 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP) in ixgbe_reset_hw_X550em()
3504 ixgbe_setup_mux_ctl(hw); in ixgbe_reset_hw_X550em()
3511 * @hw: pointer to hardware structure
3515 void ixgbe_set_ethertype_anti_spoofing_x550(struct ixgbe_hw *hw, in ixgbe_set_ethertype_anti_spoofing_x550() argument
3522 pfvfspoof = IXGBE_READ_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg)); in ixgbe_set_ethertype_anti_spoofing_x550()
3528 IXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg), pfvfspoof); in ixgbe_set_ethertype_anti_spoofing_x550()
3532 * @hw: pointer to hardware structure
3536 void ixgbe_set_source_address_pruning_x550(struct ixgbe_hw *hw, in ixgbe_set_source_address_pruning_x550() argument
3546 pfflp = (u64)IXGBE_READ_REG(hw, IXGBE_PFFLPL); in ixgbe_set_source_address_pruning_x550()
3547 pfflp |= (u64)IXGBE_READ_REG(hw, IXGBE_PFFLPH) << 32; in ixgbe_set_source_address_pruning_x550()
3554 IXGBE_WRITE_REG(hw, IXGBE_PFFLPL, (u32)pfflp); in ixgbe_set_source_address_pruning_x550()
3555 IXGBE_WRITE_REG(hw, IXGBE_PFFLPH, (u32)(pfflp >> 32)); in ixgbe_set_source_address_pruning_x550()
3560 * @hw: pointer to hardware structure
3564 static int ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw) in ixgbe_setup_fc_backplane_x550em_a() argument
3570 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fc_backplane_x550em_a()
3571 hw_err(hw, "ixgbe_fc_rx_pause not valid in strict IEEE mode\n"); in ixgbe_setup_fc_backplane_x550em_a()
3575 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_setup_fc_backplane_x550em_a()
3576 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_setup_fc_backplane_x550em_a()
3579 * HW will be able to do FC autoneg once the cable is plugged in. If in ixgbe_setup_fc_backplane_x550em_a()
3582 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_fc_backplane_x550em_a()
3583 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_backplane_x550em_a()
3587 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_setup_fc_backplane_x550em_a()
3600 switch (hw->fc.requested_mode) { in ixgbe_setup_fc_backplane_x550em_a()
3628 hw_err(hw, "Flow control param set incorrectly\n"); in ixgbe_setup_fc_backplane_x550em_a()
3632 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_fc_backplane_x550em_a()
3633 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_backplane_x550em_a()
3637 status = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_fc_backplane_x550em_a()
3644 * @hw: pointer to hardware structure
3647 static void ixgbe_set_mux(struct ixgbe_hw *hw, u8 state) in ixgbe_set_mux() argument
3651 if (!hw->bus.lan_id) in ixgbe_set_mux()
3653 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_set_mux()
3658 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); in ixgbe_set_mux()
3659 IXGBE_WRITE_FLUSH(hw); in ixgbe_set_mux()
3664 * @hw: pointer to hardware structure
3669 static int ixgbe_acquire_swfw_sync_X550em(struct ixgbe_hw *hw, u32 mask) in ixgbe_acquire_swfw_sync_X550em() argument
3673 status = ixgbe_acquire_swfw_sync_X540(hw, mask); in ixgbe_acquire_swfw_sync_X550em()
3678 ixgbe_set_mux(hw, 1); in ixgbe_acquire_swfw_sync_X550em()
3685 * @hw: pointer to hardware structure
3690 static void ixgbe_release_swfw_sync_X550em(struct ixgbe_hw *hw, u32 mask) in ixgbe_release_swfw_sync_X550em() argument
3693 ixgbe_set_mux(hw, 0); in ixgbe_release_swfw_sync_X550em()
3695 ixgbe_release_swfw_sync_X540(hw, mask); in ixgbe_release_swfw_sync_X550em()
3700 * @hw: pointer to hardware structure
3705 static int ixgbe_acquire_swfw_sync_x550em_a(struct ixgbe_hw *hw, u32 mask) in ixgbe_acquire_swfw_sync_x550em_a() argument
3714 status = ixgbe_acquire_swfw_sync_X540(hw, hmask); in ixgbe_acquire_swfw_sync_x550em_a()
3720 status = ixgbe_get_phy_token(hw); in ixgbe_acquire_swfw_sync_x550em_a()
3724 ixgbe_release_swfw_sync_X540(hw, hmask); in ixgbe_acquire_swfw_sync_x550em_a()
3735 * @hw: pointer to hardware structure
3740 static void ixgbe_release_swfw_sync_x550em_a(struct ixgbe_hw *hw, u32 mask) in ixgbe_release_swfw_sync_x550em_a() argument
3745 ixgbe_put_phy_token(hw); in ixgbe_release_swfw_sync_x550em_a()
3748 ixgbe_release_swfw_sync_X540(hw, hmask); in ixgbe_release_swfw_sync_x550em_a()
3753 * @hw: pointer to hardware structure
3762 static int ixgbe_read_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_phy_reg_x550a() argument
3765 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM; in ixgbe_read_phy_reg_x550a()
3768 if (hw->mac.ops.acquire_swfw_sync(hw, mask)) in ixgbe_read_phy_reg_x550a()
3771 status = hw->phy.ops.read_reg_mdi(hw, reg_addr, device_type, phy_data); in ixgbe_read_phy_reg_x550a()
3773 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_phy_reg_x550a()
3780 * @hw: pointer to hardware structure
3788 static int ixgbe_write_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_phy_reg_x550a() argument
3791 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM; in ixgbe_write_phy_reg_x550a()
3794 if (hw->mac.ops.acquire_swfw_sync(hw, mask)) in ixgbe_write_phy_reg_x550a()
3797 status = ixgbe_write_phy_reg_mdi(hw, reg_addr, device_type, phy_data); in ixgbe_write_phy_reg_x550a()
3798 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_write_phy_reg_x550a()