Lines Matching full:hw
15 static s32 ixgbe_get_invariants_X550_x(struct ixgbe_hw *hw) in ixgbe_get_invariants_X550_x() argument
17 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_get_invariants_X550_x()
18 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_get_invariants_X550_x()
19 struct ixgbe_link_info *link = &hw->link; in ixgbe_get_invariants_X550_x()
22 ixgbe_get_invariants_X540(hw); in ixgbe_get_invariants_X550_x()
24 if (mac->ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_get_invariants_X550_x()
32 static s32 ixgbe_get_invariants_X550_x_fw(struct ixgbe_hw *hw) in ixgbe_get_invariants_X550_x_fw() argument
34 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_get_invariants_X550_x_fw()
37 ixgbe_get_invariants_X540(hw); in ixgbe_get_invariants_X550_x_fw()
44 static s32 ixgbe_get_invariants_X550_a(struct ixgbe_hw *hw) in ixgbe_get_invariants_X550_a() argument
46 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_get_invariants_X550_a()
47 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_get_invariants_X550_a()
50 ixgbe_get_invariants_X540(hw); in ixgbe_get_invariants_X550_a()
52 if (mac->ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_get_invariants_X550_a()
58 static s32 ixgbe_get_invariants_X550_a_fw(struct ixgbe_hw *hw) in ixgbe_get_invariants_X550_a_fw() argument
60 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_get_invariants_X550_a_fw()
63 ixgbe_get_invariants_X540(hw); in ixgbe_get_invariants_X550_a_fw()
71 * @hw: pointer to hardware structure
73 static void ixgbe_setup_mux_ctl(struct ixgbe_hw *hw) in ixgbe_setup_mux_ctl() argument
75 u32 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_setup_mux_ctl()
77 if (hw->bus.lan_id) { in ixgbe_setup_mux_ctl()
82 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); in ixgbe_setup_mux_ctl()
83 IXGBE_WRITE_FLUSH(hw); in ixgbe_setup_mux_ctl()
88 * @hw: pointer to hardware structure
94 static s32 ixgbe_read_cs4227(struct ixgbe_hw *hw, u16 reg, u16 *value) in ixgbe_read_cs4227() argument
96 return hw->link.ops.read_link_unlocked(hw, hw->link.addr, reg, value); in ixgbe_read_cs4227()
101 * @hw: pointer to hardware structure
107 static s32 ixgbe_write_cs4227(struct ixgbe_hw *hw, u16 reg, u16 value) in ixgbe_write_cs4227() argument
109 return hw->link.ops.write_link_unlocked(hw, hw->link.addr, reg, value); in ixgbe_write_cs4227()
114 * @hw: pointer to hardware structure
120 static s32 ixgbe_read_pe(struct ixgbe_hw *hw, u8 reg, u8 *value) in ixgbe_read_pe() argument
124 status = ixgbe_read_i2c_byte_generic_unlocked(hw, reg, IXGBE_PE, value); in ixgbe_read_pe()
126 hw_err(hw, "port expander access failed with %d\n", status); in ixgbe_read_pe()
132 * @hw: pointer to hardware structure
138 static s32 ixgbe_write_pe(struct ixgbe_hw *hw, u8 reg, u8 value) in ixgbe_write_pe() argument
142 status = ixgbe_write_i2c_byte_generic_unlocked(hw, reg, IXGBE_PE, in ixgbe_write_pe()
145 hw_err(hw, "port expander access failed with %d\n", status); in ixgbe_write_pe()
151 * @hw: pointer to hardware structure
156 static s32 ixgbe_reset_cs4227(struct ixgbe_hw *hw) in ixgbe_reset_cs4227() argument
164 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, ®); in ixgbe_reset_cs4227()
168 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg); in ixgbe_reset_cs4227()
172 status = ixgbe_read_pe(hw, IXGBE_PE_CONFIG, ®); in ixgbe_reset_cs4227()
176 status = ixgbe_write_pe(hw, IXGBE_PE_CONFIG, reg); in ixgbe_reset_cs4227()
180 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, ®); in ixgbe_reset_cs4227()
184 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg); in ixgbe_reset_cs4227()
190 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, ®); in ixgbe_reset_cs4227()
194 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg); in ixgbe_reset_cs4227()
201 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_EFUSE_STATUS, in ixgbe_reset_cs4227()
208 hw_err(hw, "CS4227 reset did not complete\n"); in ixgbe_reset_cs4227()
212 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_EEPROM_STATUS, &value); in ixgbe_reset_cs4227()
214 hw_err(hw, "CS4227 EEPROM did not load successfully\n"); in ixgbe_reset_cs4227()
223 * @hw: pointer to hardware structure
225 static void ixgbe_check_cs4227(struct ixgbe_hw *hw) in ixgbe_check_cs4227() argument
227 u32 swfw_mask = hw->phy.phy_semaphore_mask; in ixgbe_check_cs4227()
233 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
235 hw_err(hw, "semaphore failed with %d\n", status); in ixgbe_check_cs4227()
241 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_SCRATCH, &value); in ixgbe_check_cs4227()
249 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
254 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
256 hw_err(hw, "semaphore failed with %d\n", status); in ixgbe_check_cs4227()
262 status = ixgbe_reset_cs4227(hw); in ixgbe_check_cs4227()
264 hw_err(hw, "CS4227 reset failed: %d", status); in ixgbe_check_cs4227()
271 ixgbe_write_cs4227(hw, IXGBE_CS4227_SCRATCH, in ixgbe_check_cs4227()
273 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
275 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
277 hw_err(hw, "semaphore failed with %d", status); in ixgbe_check_cs4227()
282 status = ixgbe_write_cs4227(hw, IXGBE_CS4227_SCRATCH, in ixgbe_check_cs4227()
286 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
287 msleep(hw->eeprom.semaphore_delay); in ixgbe_check_cs4227()
291 * @hw: pointer to hardware structure
295 static s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) in ixgbe_identify_phy_x550em() argument
297 switch (hw->device_id) { in ixgbe_identify_phy_x550em()
299 if (hw->bus.lan_id) in ixgbe_identify_phy_x550em()
300 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_x550em()
302 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_x550em()
303 return ixgbe_identify_module_generic(hw); in ixgbe_identify_phy_x550em()
306 hw->phy.phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM; in ixgbe_identify_phy_x550em()
307 ixgbe_setup_mux_ctl(hw); in ixgbe_identify_phy_x550em()
308 ixgbe_check_cs4227(hw); in ixgbe_identify_phy_x550em()
311 return ixgbe_identify_module_generic(hw); in ixgbe_identify_phy_x550em()
313 hw->phy.type = ixgbe_phy_x550em_kx4; in ixgbe_identify_phy_x550em()
316 hw->phy.type = ixgbe_phy_x550em_xfi; in ixgbe_identify_phy_x550em()
321 hw->phy.type = ixgbe_phy_x550em_kr; in ixgbe_identify_phy_x550em()
324 if (hw->bus.lan_id) in ixgbe_identify_phy_x550em()
325 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_x550em()
327 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_x550em()
330 return ixgbe_identify_phy_generic(hw); in ixgbe_identify_phy_x550em()
332 hw->phy.type = ixgbe_phy_ext_1g_t; in ixgbe_identify_phy_x550em()
336 hw->phy.type = ixgbe_phy_fw; in ixgbe_identify_phy_x550em()
337 hw->phy.ops.read_reg = NULL; in ixgbe_identify_phy_x550em()
338 hw->phy.ops.write_reg = NULL; in ixgbe_identify_phy_x550em()
339 if (hw->bus.lan_id) in ixgbe_identify_phy_x550em()
340 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_x550em()
342 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_x550em()
350 static s32 ixgbe_read_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_phy_reg_x550em() argument
356 static s32 ixgbe_write_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_phy_reg_x550em() argument
364 * @hw: pointer to the hardware structure
371 static s32 ixgbe_read_i2c_combined_generic(struct ixgbe_hw *hw, u8 addr, in ixgbe_read_i2c_combined_generic() argument
374 return ixgbe_read_i2c_combined_generic_int(hw, addr, reg, val, true); in ixgbe_read_i2c_combined_generic()
379 * @hw: pointer to the hardware structure
387 ixgbe_read_i2c_combined_generic_unlocked(struct ixgbe_hw *hw, u8 addr, in ixgbe_read_i2c_combined_generic_unlocked() argument
390 return ixgbe_read_i2c_combined_generic_int(hw, addr, reg, val, false); in ixgbe_read_i2c_combined_generic_unlocked()
395 * @hw: pointer to the hardware structure
402 static s32 ixgbe_write_i2c_combined_generic(struct ixgbe_hw *hw, in ixgbe_write_i2c_combined_generic() argument
405 return ixgbe_write_i2c_combined_generic_int(hw, addr, reg, val, true); in ixgbe_write_i2c_combined_generic()
410 * @hw: pointer to the hardware structure
418 ixgbe_write_i2c_combined_generic_unlocked(struct ixgbe_hw *hw, in ixgbe_write_i2c_combined_generic_unlocked() argument
421 return ixgbe_write_i2c_combined_generic_int(hw, addr, reg, val, false); in ixgbe_write_i2c_combined_generic_unlocked()
426 * @hw: pointer to hardware structure
430 s32 ixgbe_fw_phy_activity(struct ixgbe_hw *hw, u16 activity, in ixgbe_fw_phy_activity() argument
446 hic.cmd.port_number = hw->bus.lan_id; in ixgbe_fw_phy_activity()
451 rc = ixgbe_host_interface_command(hw, &hic.cmd, sizeof(hic.cmd), in ixgbe_fw_phy_activity()
483 * @hw: pointer to hardware structure
487 static s32 ixgbe_get_phy_id_fw(struct ixgbe_hw *hw) in ixgbe_get_phy_id_fw() argument
495 if (hw->phy.id) in ixgbe_get_phy_id_fw()
498 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_PHY_INFO, &info); in ixgbe_get_phy_id_fw()
502 hw->phy.speeds_supported = 0; in ixgbe_get_phy_id_fw()
506 hw->phy.speeds_supported |= ixgbe_fw_map[i].phy_speed; in ixgbe_get_phy_id_fw()
509 hw->phy.id = info[0] & FW_PHY_INFO_ID_HI_MASK; in ixgbe_get_phy_id_fw()
511 hw->phy.id |= phy_id_lo & IXGBE_PHY_REVISION_MASK; in ixgbe_get_phy_id_fw()
512 hw->phy.revision = phy_id_lo & ~IXGBE_PHY_REVISION_MASK; in ixgbe_get_phy_id_fw()
513 if (!hw->phy.id || hw->phy.id == IXGBE_PHY_REVISION_MASK) in ixgbe_get_phy_id_fw()
516 hw->phy.autoneg_advertised = hw->phy.speeds_supported; in ixgbe_get_phy_id_fw()
517 hw->phy.eee_speeds_supported = IXGBE_LINK_SPEED_100_FULL | in ixgbe_get_phy_id_fw()
519 hw->phy.eee_speeds_advertised = hw->phy.eee_speeds_supported; in ixgbe_get_phy_id_fw()
525 * @hw: pointer to hardware structure
529 static s32 ixgbe_identify_phy_fw(struct ixgbe_hw *hw) in ixgbe_identify_phy_fw() argument
531 if (hw->bus.lan_id) in ixgbe_identify_phy_fw()
532 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM; in ixgbe_identify_phy_fw()
534 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM; in ixgbe_identify_phy_fw()
536 hw->phy.type = ixgbe_phy_fw; in ixgbe_identify_phy_fw()
537 hw->phy.ops.read_reg = NULL; in ixgbe_identify_phy_fw()
538 hw->phy.ops.write_reg = NULL; in ixgbe_identify_phy_fw()
539 return ixgbe_get_phy_id_fw(hw); in ixgbe_identify_phy_fw()
544 * @hw: pointer to hardware structure
548 static s32 ixgbe_shutdown_fw_phy(struct ixgbe_hw *hw) in ixgbe_shutdown_fw_phy() argument
553 return ixgbe_fw_phy_activity(hw, FW_PHY_ACT_FORCE_LINK_DOWN, &setup); in ixgbe_shutdown_fw_phy()
558 * @hw: pointer to hardware structure
560 static s32 ixgbe_setup_fw_link(struct ixgbe_hw *hw) in ixgbe_setup_fw_link() argument
566 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw)) in ixgbe_setup_fw_link()
569 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fw_link()
570 hw_err(hw, "rx_pause not valid in strict IEEE mode\n"); in ixgbe_setup_fw_link()
574 switch (hw->fc.requested_mode) { in ixgbe_setup_fw_link()
592 if (hw->phy.autoneg_advertised & ixgbe_fw_map[i].phy_speed) in ixgbe_setup_fw_link()
597 if (hw->phy.eee_speeds_advertised) in ixgbe_setup_fw_link()
600 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_SETUP_LINK, &setup); in ixgbe_setup_fw_link()
610 * @hw: pointer to hardware structure
614 static s32 ixgbe_fc_autoneg_fw(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_fw() argument
616 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_fc_autoneg_fw()
617 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_fc_autoneg_fw()
619 return ixgbe_setup_fw_link(hw); in ixgbe_fc_autoneg_fw()
623 * @hw: pointer to hardware structure
628 static s32 ixgbe_init_eeprom_params_X550(struct ixgbe_hw *hw) in ixgbe_init_eeprom_params_X550() argument
630 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_X550()
638 eec = IXGBE_READ_REG(hw, IXGBE_EEC(hw)); in ixgbe_init_eeprom_params_X550()
644 hw_dbg(hw, "Eeprom params: type = %d, size = %d\n", in ixgbe_init_eeprom_params_X550()
653 * @hw: pointer to hardware structure
660 static s32 ixgbe_iosf_wait(struct ixgbe_hw *hw, u32 *ctrl) in ixgbe_iosf_wait() argument
669 command = IXGBE_READ_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL); in ixgbe_iosf_wait()
677 hw_dbg(hw, "IOSF wait timed out\n"); in ixgbe_iosf_wait()
686 * @hw: pointer to hardware structure
691 static s32 ixgbe_read_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_iosf_sb_reg_x550() argument
698 ret = hw->mac.ops.acquire_swfw_sync(hw, gssr); in ixgbe_read_iosf_sb_reg_x550()
702 ret = ixgbe_iosf_wait(hw, NULL); in ixgbe_read_iosf_sb_reg_x550()
710 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL, command); in ixgbe_read_iosf_sb_reg_x550()
712 ret = ixgbe_iosf_wait(hw, &command); in ixgbe_read_iosf_sb_reg_x550()
717 hw_dbg(hw, "Failed to read, error %x\n", error); in ixgbe_read_iosf_sb_reg_x550()
722 *data = IXGBE_READ_REG(hw, IXGBE_SB_IOSF_INDIRECT_DATA); in ixgbe_read_iosf_sb_reg_x550()
725 hw->mac.ops.release_swfw_sync(hw, gssr); in ixgbe_read_iosf_sb_reg_x550()
731 * @hw: Pointer to hardware structure
733 static s32 ixgbe_get_phy_token(struct ixgbe_hw *hw) in ixgbe_get_phy_token() argument
742 token_cmd.port_number = hw->bus.lan_id; in ixgbe_get_phy_token()
745 status = ixgbe_host_interface_command(hw, &token_cmd, sizeof(token_cmd), in ixgbe_get_phy_token()
760 * @hw: Pointer to hardware structure
762 static s32 ixgbe_put_phy_token(struct ixgbe_hw *hw) in ixgbe_put_phy_token() argument
771 token_cmd.port_number = hw->bus.lan_id; in ixgbe_put_phy_token()
774 status = ixgbe_host_interface_command(hw, &token_cmd, sizeof(token_cmd), in ixgbe_put_phy_token()
786 * @hw: pointer to hardware structure
791 static s32 ixgbe_write_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_iosf_sb_reg_x550a() argument
801 write_cmd.port_number = hw->bus.lan_id; in ixgbe_write_iosf_sb_reg_x550a()
806 return ixgbe_host_interface_command(hw, &write_cmd, sizeof(write_cmd), in ixgbe_write_iosf_sb_reg_x550a()
812 * @hw: pointer to hardware structure
817 static s32 ixgbe_read_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_iosf_sb_reg_x550a() argument
831 hic.cmd.port_number = hw->bus.lan_id; in ixgbe_read_iosf_sb_reg_x550a()
835 status = ixgbe_host_interface_command(hw, &hic.cmd, sizeof(hic.cmd), in ixgbe_read_iosf_sb_reg_x550a()
845 * @hw: pointer to hardware structure
852 static s32 ixgbe_read_ee_hostif_buffer_X550(struct ixgbe_hw *hw, in ixgbe_read_ee_hostif_buffer_X550() argument
863 status = hw->mac.ops.acquire_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_buffer_X550()
865 hw_dbg(hw, "EEPROM read buffer - semaphore failed\n"); in ixgbe_read_ee_hostif_buffer_X550()
887 status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer), in ixgbe_read_ee_hostif_buffer_X550()
890 hw_dbg(hw, "Host interface command failed\n"); in ixgbe_read_ee_hostif_buffer_X550()
897 u32 value = IXGBE_READ_REG(hw, reg); in ixgbe_read_ee_hostif_buffer_X550()
912 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_buffer_X550()
917 * @hw: pointer to hardware structure
924 static s32 ixgbe_checksum_ptr_x550(struct ixgbe_hw *hw, u16 ptr, in ixgbe_checksum_ptr_x550() argument
937 status = ixgbe_read_ee_hostif_buffer_X550(hw, ptr, bufsz, buf); in ixgbe_checksum_ptr_x550()
939 hw_dbg(hw, "Failed to read EEPROM image\n"); in ixgbe_checksum_ptr_x550()
958 (ptr + length) >= hw->eeprom.word_size) in ixgbe_checksum_ptr_x550()
973 status = ixgbe_read_ee_hostif_buffer_X550(hw, ptr, in ixgbe_checksum_ptr_x550()
976 hw_dbg(hw, "Failed to read EEPROM image\n"); in ixgbe_checksum_ptr_x550()
986 * @hw: pointer to hardware structure
992 static s32 ixgbe_calc_checksum_X550(struct ixgbe_hw *hw, u16 *buffer, in ixgbe_calc_checksum_X550() argument
1001 hw->eeprom.ops.init_params(hw); in ixgbe_calc_checksum_X550()
1005 status = ixgbe_read_ee_hostif_buffer_X550(hw, 0, in ixgbe_calc_checksum_X550()
1009 hw_dbg(hw, "Failed to read EEPROM image\n"); in ixgbe_calc_checksum_X550()
1037 pointer >= hw->eeprom.word_size) in ixgbe_calc_checksum_X550()
1053 status = ixgbe_checksum_ptr_x550(hw, pointer, size, &checksum, in ixgbe_calc_checksum_X550()
1065 * @hw: pointer to hardware structure
1069 static s32 ixgbe_calc_eeprom_checksum_X550(struct ixgbe_hw *hw) in ixgbe_calc_eeprom_checksum_X550() argument
1071 return ixgbe_calc_checksum_X550(hw, NULL, 0); in ixgbe_calc_eeprom_checksum_X550()
1075 * @hw: pointer to hardware structure
1081 static s32 ixgbe_read_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 *data) in ixgbe_read_ee_hostif_X550() argument
1097 status = hw->mac.ops.acquire_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_X550()
1101 status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer), in ixgbe_read_ee_hostif_X550()
1104 *data = (u16)IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, in ixgbe_read_ee_hostif_X550()
1108 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_ee_hostif_X550()
1113 * @hw: pointer to hardware structure
1119 static s32 ixgbe_validate_eeprom_checksum_X550(struct ixgbe_hw *hw, in ixgbe_validate_eeprom_checksum_X550() argument
1130 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_validate_eeprom_checksum_X550()
1132 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_validate_eeprom_checksum_X550()
1136 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_validate_eeprom_checksum_X550()
1142 status = ixgbe_read_ee_hostif_X550(hw, IXGBE_EEPROM_CHECKSUM, in ixgbe_validate_eeprom_checksum_X550()
1152 hw_dbg(hw, "Invalid EEPROM checksum"); in ixgbe_validate_eeprom_checksum_X550()
1163 * @hw: pointer to hardware structure
1169 static s32 ixgbe_write_ee_hostif_data_X550(struct ixgbe_hw *hw, u16 offset, in ixgbe_write_ee_hostif_data_X550() argument
1185 status = ixgbe_host_interface_command(hw, &buffer, sizeof(buffer), in ixgbe_write_ee_hostif_data_X550()
1191 * @hw: pointer to hardware structure
1197 static s32 ixgbe_write_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 data) in ixgbe_write_ee_hostif_X550() argument
1201 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == 0) { in ixgbe_write_ee_hostif_X550()
1202 status = ixgbe_write_ee_hostif_data_X550(hw, offset, data); in ixgbe_write_ee_hostif_X550()
1203 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_X550()
1205 hw_dbg(hw, "write ee hostif failed to get semaphore"); in ixgbe_write_ee_hostif_X550()
1212 /** ixgbe_update_flash_X550 - Instruct HW to copy EEPROM to Flash device
1213 * @hw: pointer to hardware structure
1217 static s32 ixgbe_update_flash_X550(struct ixgbe_hw *hw) in ixgbe_update_flash_X550() argument
1227 status = ixgbe_host_interface_command(hw, &buffer, sizeof(buffer), in ixgbe_update_flash_X550()
1234 * @hw: pointer to hardware structure
1239 static s32 ixgbe_get_bus_info_X550em(struct ixgbe_hw *hw) in ixgbe_get_bus_info_X550em() argument
1241 hw->bus.type = ixgbe_bus_type_internal; in ixgbe_get_bus_info_X550em()
1242 hw->bus.width = ixgbe_bus_width_unknown; in ixgbe_get_bus_info_X550em()
1243 hw->bus.speed = ixgbe_bus_speed_unknown; in ixgbe_get_bus_info_X550em()
1245 hw->mac.ops.set_lan_id(hw); in ixgbe_get_bus_info_X550em()
1252 * @hw: pointer t hardware structure
1256 static bool ixgbe_fw_recovery_mode_X550(struct ixgbe_hw *hw) in ixgbe_fw_recovery_mode_X550() argument
1260 fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM(hw)); in ixgbe_fw_recovery_mode_X550()
1268 static void ixgbe_disable_rx_x550(struct ixgbe_hw *hw) in ixgbe_disable_rx_x550() argument
1274 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); in ixgbe_disable_rx_x550()
1276 pfdtxgswc = IXGBE_READ_REG(hw, IXGBE_PFDTXGSWC); in ixgbe_disable_rx_x550()
1279 IXGBE_WRITE_REG(hw, IXGBE_PFDTXGSWC, pfdtxgswc); in ixgbe_disable_rx_x550()
1280 hw->mac.set_lben = true; in ixgbe_disable_rx_x550()
1282 hw->mac.set_lben = false; in ixgbe_disable_rx_x550()
1288 fw_cmd.port_number = hw->bus.lan_id; in ixgbe_disable_rx_x550()
1290 status = ixgbe_host_interface_command(hw, &fw_cmd, in ixgbe_disable_rx_x550()
1296 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); in ixgbe_disable_rx_x550()
1299 IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, rxctrl); in ixgbe_disable_rx_x550()
1306 * @hw: pointer to hardware structure
1312 static s32 ixgbe_update_eeprom_checksum_X550(struct ixgbe_hw *hw) in ixgbe_update_eeprom_checksum_X550() argument
1321 status = ixgbe_read_ee_hostif_X550(hw, 0, &checksum); in ixgbe_update_eeprom_checksum_X550()
1323 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_update_eeprom_checksum_X550()
1327 status = ixgbe_calc_eeprom_checksum_X550(hw); in ixgbe_update_eeprom_checksum_X550()
1333 status = ixgbe_write_ee_hostif_X550(hw, IXGBE_EEPROM_CHECKSUM, in ixgbe_update_eeprom_checksum_X550()
1338 status = ixgbe_update_flash_X550(hw); in ixgbe_update_eeprom_checksum_X550()
1344 * @hw: pointer to hardware structure
1352 static s32 ixgbe_write_ee_hostif_buffer_X550(struct ixgbe_hw *hw, in ixgbe_write_ee_hostif_buffer_X550() argument
1360 status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_buffer_X550()
1362 hw_dbg(hw, "EEPROM write buffer - semaphore failed\n"); in ixgbe_write_ee_hostif_buffer_X550()
1367 status = ixgbe_write_ee_hostif_data_X550(hw, offset + i, in ixgbe_write_ee_hostif_buffer_X550()
1370 hw_dbg(hw, "Eeprom buffered write failed\n"); in ixgbe_write_ee_hostif_buffer_X550()
1375 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_buffer_X550()
1383 * @hw: pointer to hardware structure
1388 static s32 ixgbe_write_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_iosf_sb_reg_x550() argument
1395 ret = hw->mac.ops.acquire_swfw_sync(hw, gssr); in ixgbe_write_iosf_sb_reg_x550()
1399 ret = ixgbe_iosf_wait(hw, NULL); in ixgbe_write_iosf_sb_reg_x550()
1407 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL, command); in ixgbe_write_iosf_sb_reg_x550()
1410 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_DATA, data); in ixgbe_write_iosf_sb_reg_x550()
1412 ret = ixgbe_iosf_wait(hw, &command); in ixgbe_write_iosf_sb_reg_x550()
1417 hw_dbg(hw, "Failed to write, error %x\n", error); in ixgbe_write_iosf_sb_reg_x550()
1422 hw->mac.ops.release_swfw_sync(hw, gssr); in ixgbe_write_iosf_sb_reg_x550()
1428 * @hw: pointer to hardware structure
1432 static s32 ixgbe_setup_ixfi_x550em_x(struct ixgbe_hw *hw) in ixgbe_setup_ixfi_x550em_x() argument
1438 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1439 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1445 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1446 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1452 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1453 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1461 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1462 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1467 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1468 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1476 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1477 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1483 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1484 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1493 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em_x()
1494 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em_x()
1502 * @hw: pointer to hardware structure
1504 static s32 ixgbe_restart_an_internal_phy_x550em(struct ixgbe_hw *hw) in ixgbe_restart_an_internal_phy_x550em() argument
1510 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1511 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1515 hw_dbg(hw, "Auto-negotiation did not complete\n"); in ixgbe_restart_an_internal_phy_x550em()
1520 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1521 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1524 if (hw->mac.type == ixgbe_mac_x550em_a) { in ixgbe_restart_an_internal_phy_x550em()
1528 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1529 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1533 hw_dbg(hw, "Auto-negotiation did not complete\n"); in ixgbe_restart_an_internal_phy_x550em()
1538 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_restart_an_internal_phy_x550em()
1539 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_restart_an_internal_phy_x550em()
1547 * @hw: pointer to hardware structure
1553 static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed) in ixgbe_setup_ixfi_x550em() argument
1555 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_ixfi_x550em()
1564 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1565 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1586 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1587 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1593 if (hw->mac.type == ixgbe_mac_X550EM_x) { in ixgbe_setup_ixfi_x550em()
1594 status = ixgbe_setup_ixfi_x550em_x(hw); in ixgbe_setup_ixfi_x550em()
1600 status = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_ixfi_x550em()
1607 * @hw: pointer to hardware structure
1610 static s32 ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear) in ixgbe_supported_sfp_modules_X550em() argument
1612 switch (hw->phy.sfp_type) { in ixgbe_supported_sfp_modules_X550em()
1641 * @hw: pointer to hardware structure
1648 ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_sfp_x550em() argument
1657 status = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear); in ixgbe_setup_mac_link_sfp_x550em()
1670 ixgbe_setup_kr_speed_x550em(hw, speed); in ixgbe_setup_mac_link_sfp_x550em()
1673 reg_slice = IXGBE_CS4227_LINE_SPARE24_LSB + (hw->bus.lan_id << 12); in ixgbe_setup_mac_link_sfp_x550em()
1679 status = hw->link.ops.write_link(hw, hw->link.addr, reg_slice, in ixgbe_setup_mac_link_sfp_x550em()
1687 * @hw: pointer to hardware structure
1693 static s32 ixgbe_setup_sfi_x550a(struct ixgbe_hw *hw, ixgbe_link_speed *speed) in ixgbe_setup_sfi_x550a() argument
1695 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sfi_x550a()
1700 status = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sfi_x550a()
1701 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sfi_x550a()
1724 status = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sfi_x550a()
1725 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sfi_x550a()
1729 status = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_sfi_x550a()
1736 * @hw: pointer to hardware structure
1743 ixgbe_setup_mac_link_sfp_n(struct ixgbe_hw *hw, ixgbe_link_speed speed, in ixgbe_setup_mac_link_sfp_n() argument
1751 ret_val = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear); in ixgbe_setup_mac_link_sfp_n()
1763 ret_val = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_mac_link_sfp_n()
1764 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_mac_link_sfp_n()
1773 ret_val = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_mac_link_sfp_n()
1774 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_mac_link_sfp_n()
1780 return ixgbe_setup_sfi_x550a(hw, &speed); in ixgbe_setup_mac_link_sfp_n()
1785 * @hw: pointer to hardware structure
1792 ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed, in ixgbe_setup_mac_link_sfp_x550a() argument
1801 ret_val = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear); in ixgbe_setup_mac_link_sfp_x550a()
1813 ixgbe_setup_kr_speed_x550em(hw, speed); in ixgbe_setup_mac_link_sfp_x550a()
1815 if (hw->phy.mdio.prtad == MDIO_PRTAD_NONE) in ixgbe_setup_mac_link_sfp_x550a()
1819 ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_EFUSE_PDF_SKU, in ixgbe_setup_mac_link_sfp_x550a()
1828 slice_offset = (hw->bus.lan_id + in ixgbe_setup_mac_link_sfp_x550a()
1829 (hw->bus.instance_id << 1)) << 12; in ixgbe_setup_mac_link_sfp_x550a()
1831 slice_offset = hw->bus.lan_id << 12; in ixgbe_setup_mac_link_sfp_x550a()
1836 ret_val = hw->phy.ops.read_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
1849 ret_val = hw->phy.ops.write_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
1855 return hw->phy.ops.read_reg(hw, reg_slice, in ixgbe_setup_mac_link_sfp_x550a()
1861 * @hw: pointer to hardware structure
1870 static s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_t_X550em() argument
1887 if (hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_setup_mac_link_t_X550em()
1888 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) { in ixgbe_setup_mac_link_t_X550em()
1889 status = ixgbe_setup_ixfi_x550em(hw, &force_speed); in ixgbe_setup_mac_link_t_X550em()
1895 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait); in ixgbe_setup_mac_link_t_X550em()
1899 * @hw: pointer to hardware structure
1906 static s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, in ixgbe_check_link_t_X550em() argument
1914 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_check_link_t_X550em()
1917 status = ixgbe_check_mac_link_generic(hw, speed, link_up, in ixgbe_check_link_t_X550em()
1930 status = hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, in ixgbe_check_link_t_X550em()
1946 * @hw: pointer to hardware structure
1951 ixgbe_setup_sgmii(struct ixgbe_hw *hw, __always_unused ixgbe_link_speed speed, in ixgbe_setup_sgmii() argument
1954 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sgmii()
1958 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1959 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii()
1969 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1970 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii()
1975 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1976 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii()
1983 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1984 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii()
1989 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1990 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
1995 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
1996 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
2007 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii()
2008 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii()
2013 rc = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_sgmii()
2019 * @hw: pointer to hardware structure
2023 static s32 ixgbe_setup_sgmii_fw(struct ixgbe_hw *hw, ixgbe_link_speed speed, in ixgbe_setup_sgmii_fw() argument
2026 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_setup_sgmii_fw()
2030 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2031 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2041 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2042 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2047 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2048 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2055 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2056 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2061 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2062 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2067 rc = mac->ops.read_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2068 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2079 rc = mac->ops.write_iosf_sb_reg(hw, in ixgbe_setup_sgmii_fw()
2080 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_sgmii_fw()
2085 ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_sgmii_fw()
2087 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait); in ixgbe_setup_sgmii_fw()
2092 * @hw: pointer to hardware structure
2096 static void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_sgmii_x550em_a() argument
2108 if (hw->fc.disable_fc_autoneg) in ixgbe_fc_autoneg_sgmii_x550em_a()
2111 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_fc_autoneg_sgmii_x550em_a()
2116 status = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &info); in ixgbe_fc_autoneg_sgmii_x550em_a()
2123 status = ixgbe_negotiate_fc(hw, info[0], info[0], in ixgbe_fc_autoneg_sgmii_x550em_a()
2131 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg_sgmii_x550em_a()
2133 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_sgmii_x550em_a()
2134 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_sgmii_x550em_a()
2139 * @hw: pointer to hardware structure
2141 static void ixgbe_init_mac_link_ops_X550em_a(struct ixgbe_hw *hw) in ixgbe_init_mac_link_ops_X550em_a() argument
2143 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_mac_link_ops_X550em_a()
2145 switch (mac->ops.get_media_type(hw)) { in ixgbe_init_mac_link_ops_X550em_a()
2151 if (hw->device_id != IXGBE_DEV_ID_X550EM_A_1G_T && in ixgbe_init_mac_link_ops_X550em_a()
2152 hw->device_id != IXGBE_DEV_ID_X550EM_A_1G_T_L) { in ixgbe_init_mac_link_ops_X550em_a()
2171 * @hw: pointer to hardware structure
2173 static void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw) in ixgbe_init_mac_link_ops_X550em() argument
2175 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_mac_link_ops_X550em()
2179 switch (mac->ops.get_media_type(hw)) { in ixgbe_init_mac_link_ops_X550em()
2188 switch (hw->device_id) { in ixgbe_init_mac_link_ops_X550em()
2205 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_1G_T) in ixgbe_init_mac_link_ops_X550em()
2212 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII || in ixgbe_init_mac_link_ops_X550em()
2213 hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII_L) in ixgbe_init_mac_link_ops_X550em()
2221 if (hw->mac.type == ixgbe_mac_x550em_a) in ixgbe_init_mac_link_ops_X550em()
2222 ixgbe_init_mac_link_ops_X550em_a(hw); in ixgbe_init_mac_link_ops_X550em()
2226 * @hw: pointer to hardware structure
2228 static s32 ixgbe_setup_sfp_modules_X550em(struct ixgbe_hw *hw) in ixgbe_setup_sfp_modules_X550em() argument
2234 status = ixgbe_supported_sfp_modules_X550em(hw, &linear); in ixgbe_setup_sfp_modules_X550em()
2238 ixgbe_init_mac_link_ops_X550em(hw); in ixgbe_setup_sfp_modules_X550em()
2239 hw->phy.ops.reset = NULL; in ixgbe_setup_sfp_modules_X550em()
2245 * @hw: pointer to hardware structure
2249 static s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw, in ixgbe_get_link_capabilities_X550em() argument
2253 if (hw->phy.type == ixgbe_phy_fw) { in ixgbe_get_link_capabilities_X550em()
2255 *speed = hw->phy.speeds_supported; in ixgbe_get_link_capabilities_X550em()
2260 if (hw->phy.media_type == ixgbe_media_type_fiber) { in ixgbe_get_link_capabilities_X550em()
2264 if (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || in ixgbe_get_link_capabilities_X550em()
2265 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1 || in ixgbe_get_link_capabilities_X550em()
2266 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 || in ixgbe_get_link_capabilities_X550em()
2267 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1) { in ixgbe_get_link_capabilities_X550em()
2273 if (hw->phy.multispeed_fiber) in ixgbe_get_link_capabilities_X550em()
2279 switch (hw->phy.type) { in ixgbe_get_link_capabilities_X550em()
2294 if (hw->mac.type == ixgbe_mac_x550em_a) { in ixgbe_get_link_capabilities_X550em()
2296 if (hw->phy.nw_mng_if_sel & in ixgbe_get_link_capabilities_X550em()
2300 } else if (hw->device_id == in ixgbe_get_link_capabilities_X550em()
2319 * @hw: pointer to hardware structure
2329 static s32 ixgbe_get_lasi_ext_t_x550em(struct ixgbe_hw *hw, bool *lsc) in ixgbe_get_lasi_ext_t_x550em() argument
2337 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG, in ixgbe_get_lasi_ext_t_x550em()
2345 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_FLAG, in ixgbe_get_lasi_ext_t_x550em()
2354 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_ALARM_1, in ixgbe_get_lasi_ext_t_x550em()
2364 ixgbe_set_copper_phy_power(hw, false); in ixgbe_get_lasi_ext_t_x550em()
2369 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_FAULT_MSG, in ixgbe_get_lasi_ext_t_x550em()
2378 ixgbe_set_copper_phy_power(hw, false); in ixgbe_get_lasi_ext_t_x550em()
2384 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG, in ixgbe_get_lasi_ext_t_x550em()
2391 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM2, in ixgbe_get_lasi_ext_t_x550em()
2406 * @hw: pointer to hardware structure
2413 static s32 ixgbe_enable_lasi_ext_t_x550em(struct ixgbe_hw *hw) in ixgbe_enable_lasi_ext_t_x550em() argument
2420 status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc); in ixgbe_enable_lasi_ext_t_x550em()
2432 if (hw->mac.type != ixgbe_mac_x550em_a) { in ixgbe_enable_lasi_ext_t_x550em()
2433 status = hw->phy.ops.read_reg(hw, in ixgbe_enable_lasi_ext_t_x550em()
2441 status = hw->phy.ops.write_reg(hw, in ixgbe_enable_lasi_ext_t_x550em()
2449 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2458 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2465 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2474 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2481 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2489 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK, in ixgbe_enable_lasi_ext_t_x550em()
2498 * @hw: pointer to hardware structure
2507 static s32 ixgbe_handle_lasi_ext_t_x550em(struct ixgbe_hw *hw) in ixgbe_handle_lasi_ext_t_x550em() argument
2509 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_handle_lasi_ext_t_x550em()
2513 status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc); in ixgbe_handle_lasi_ext_t_x550em()
2518 return phy->ops.setup_internal_link(hw); in ixgbe_handle_lasi_ext_t_x550em()
2525 * @hw: pointer to hardware structure
2530 static s32 ixgbe_setup_kr_speed_x550em(struct ixgbe_hw *hw, in ixgbe_setup_kr_speed_x550em() argument
2536 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2537 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2554 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2555 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2558 if (hw->mac.type == ixgbe_mac_x550em_a) { in ixgbe_setup_kr_speed_x550em()
2560 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2561 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2573 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_kr_speed_x550em()
2574 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
2578 return ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_kr_speed_x550em()
2583 * @hw: pointer to hardware structure
2585 static s32 ixgbe_setup_kr_x550em(struct ixgbe_hw *hw) in ixgbe_setup_kr_x550em() argument
2588 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL) in ixgbe_setup_kr_x550em()
2591 if (ixgbe_check_reset_blocked(hw)) in ixgbe_setup_kr_x550em()
2594 return ixgbe_setup_kr_speed_x550em(hw, hw->phy.autoneg_advertised); in ixgbe_setup_kr_x550em()
2598 * @hw: address of hardware structure
2603 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
2611 ret = hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, in ixgbe_ext_phy_t_x550em_get_link()
2616 ret = hw->phy.ops.read_reg(hw, MDIO_STAT1, MDIO_MMD_AN, in ixgbe_ext_phy_t_x550em_get_link()
2627 * @hw: point to hardware structure
2637 static s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw) in ixgbe_setup_internal_phy_t_x550em() argument
2644 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_setup_internal_phy_t_x550em()
2647 if (!(hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_setup_internal_phy_t_x550em()
2648 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE))) { in ixgbe_setup_internal_phy_t_x550em()
2651 return ixgbe_setup_kr_speed_x550em(hw, speed); in ixgbe_setup_internal_phy_t_x550em()
2655 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_setup_internal_phy_t_x550em()
2662 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT, in ixgbe_setup_internal_phy_t_x550em()
2669 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_setup_internal_phy_t_x550em()
2691 return ixgbe_setup_ixfi_x550em(hw, &force_speed); in ixgbe_setup_internal_phy_t_x550em()
2695 * @hw: pointer to hardware structure
2697 static s32 ixgbe_reset_phy_t_X550em(struct ixgbe_hw *hw) in ixgbe_reset_phy_t_X550em() argument
2701 status = ixgbe_reset_phy_generic(hw); in ixgbe_reset_phy_t_X550em()
2707 return ixgbe_enable_lasi_ext_t_x550em(hw); in ixgbe_reset_phy_t_X550em()
2712 * @hw: pointer to hardware structure
2715 static s32 ixgbe_led_on_t_x550em(struct ixgbe_hw *hw, u32 led_idx) in ixgbe_led_on_t_x550em() argument
2723 hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_on_t_x550em()
2726 hw->phy.ops.write_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_on_t_x550em()
2734 * @hw: pointer to hardware structure
2737 static s32 ixgbe_led_off_t_x550em(struct ixgbe_hw *hw, u32 led_idx) in ixgbe_led_off_t_x550em() argument
2745 hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_off_t_x550em()
2748 hw->phy.ops.write_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx, in ixgbe_led_off_t_x550em()
2756 * @hw: pointer to the HW structure
2769 static s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min, in ixgbe_set_fw_drv_ver_x550() argument
2783 fw_cmd.port_num = (u8)hw->bus.func; in ixgbe_set_fw_drv_ver_x550()
2794 ret_val = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd, in ixgbe_set_fw_drv_ver_x550()
2811 * @hw: pointer to hardware structure
2816 static s32 ixgbe_get_lcd_t_x550em(struct ixgbe_hw *hw, in ixgbe_get_lcd_t_x550em() argument
2821 u16 word = hw->eeprom.ctrl_word_3; in ixgbe_get_lcd_t_x550em()
2825 status = hw->phy.ops.read_reg(hw, IXGBE_AUTO_NEG_LP_STATUS, in ixgbe_get_lcd_t_x550em()
2838 if ((hw->bus.lan_id && (word & NVM_INIT_CTRL_3_D10GMP_PORT1)) || in ixgbe_get_lcd_t_x550em()
2849 * @hw: pointer to hardware structure
2851 static s32 ixgbe_setup_fc_x550em(struct ixgbe_hw *hw) in ixgbe_setup_fc_x550em() argument
2858 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fc_x550em()
2859 hw_err(hw, "ixgbe_fc_rx_pause not valid in strict IEEE mode\n"); in ixgbe_setup_fc_x550em()
2866 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_setup_fc_x550em()
2867 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_setup_fc_x550em()
2870 switch (hw->fc.requested_mode) { in ixgbe_setup_fc_x550em()
2894 hw_err(hw, "Flow control param set incorrectly\n"); in ixgbe_setup_fc_x550em()
2898 switch (hw->device_id) { in ixgbe_setup_fc_x550em()
2902 rc = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_fc_x550em()
2903 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_x550em()
2915 rc = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_fc_x550em()
2916 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_x550em()
2921 hw->fc.disable_fc_autoneg = true; in ixgbe_setup_fc_x550em()
2924 hw->fc.disable_fc_autoneg = true; in ixgbe_setup_fc_x550em()
2934 * @hw: pointer to hardware structure
2936 static void ixgbe_fc_autoneg_backplane_x550em_a(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_backplane_x550em_a() argument
2948 if (hw->fc.disable_fc_autoneg) { in ixgbe_fc_autoneg_backplane_x550em_a()
2949 hw_err(hw, "Flow control autoneg is disabled"); in ixgbe_fc_autoneg_backplane_x550em_a()
2953 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_fc_autoneg_backplane_x550em_a()
2955 hw_err(hw, "The link is down"); in ixgbe_fc_autoneg_backplane_x550em_a()
2960 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
2961 IXGBE_KRM_LINK_S1(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
2965 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_fc_autoneg_backplane_x550em_a()
2973 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
2974 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
2978 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_fc_autoneg_backplane_x550em_a()
2982 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_fc_autoneg_backplane_x550em_a()
2983 IXGBE_KRM_LP_BASE_PAGE_HIGH(hw->bus.lan_id), in ixgbe_fc_autoneg_backplane_x550em_a()
2987 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_fc_autoneg_backplane_x550em_a()
2991 status = ixgbe_negotiate_fc(hw, an_cntl_1, lp_an_page_low, in ixgbe_fc_autoneg_backplane_x550em_a()
2999 hw->fc.fc_was_autonegged = true; in ixgbe_fc_autoneg_backplane_x550em_a()
3001 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_backplane_x550em_a()
3002 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_backplane_x550em_a()
3008 * @hw: pointer to hardware structure
3010 static void ixgbe_fc_autoneg_fiber_x550em_a(struct ixgbe_hw *hw) in ixgbe_fc_autoneg_fiber_x550em_a() argument
3012 hw->fc.fc_was_autonegged = false; in ixgbe_fc_autoneg_fiber_x550em_a()
3013 hw->fc.current_mode = hw->fc.requested_mode; in ixgbe_fc_autoneg_fiber_x550em_a()
3017 * @hw: pointer to hardware structure
3023 static s32 ixgbe_enter_lplu_t_x550em(struct ixgbe_hw *hw) in ixgbe_enter_lplu_t_x550em() argument
3032 if (ixgbe_check_reset_blocked(hw)) in ixgbe_enter_lplu_t_x550em()
3035 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_enter_lplu_t_x550em()
3039 status = hw->eeprom.ops.read(hw, NVM_INIT_CTRL_3, in ixgbe_enter_lplu_t_x550em()
3040 &hw->eeprom.ctrl_word_3); in ixgbe_enter_lplu_t_x550em()
3048 if (!link_up || !(hw->eeprom.ctrl_word_3 & NVM_INIT_CTRL_3_LPLU) || in ixgbe_enter_lplu_t_x550em()
3049 !(hw->wol_enabled || ixgbe_mng_present(hw))) in ixgbe_enter_lplu_t_x550em()
3050 return ixgbe_set_copper_phy_power(hw, false); in ixgbe_enter_lplu_t_x550em()
3053 status = ixgbe_get_lcd_t_x550em(hw, &lcd_speed); in ixgbe_enter_lplu_t_x550em()
3059 return ixgbe_set_copper_phy_power(hw, false); in ixgbe_enter_lplu_t_x550em()
3061 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT, in ixgbe_enter_lplu_t_x550em()
3068 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_enter_lplu_t_x550em()
3070 return ixgbe_set_copper_phy_power(hw, false); in ixgbe_enter_lplu_t_x550em()
3083 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM, in ixgbe_enter_lplu_t_x550em()
3089 status = hw->phy.ops.read_reg(hw, MDIO_AN_10GBT_CTRL, in ixgbe_enter_lplu_t_x550em()
3095 status = hw->phy.ops.read_reg(hw, in ixgbe_enter_lplu_t_x550em()
3102 save_autoneg = hw->phy.autoneg_advertised; in ixgbe_enter_lplu_t_x550em()
3105 status = hw->mac.ops.setup_link(hw, lcd_speed, false); in ixgbe_enter_lplu_t_x550em()
3108 hw->phy.autoneg_advertised = save_autoneg; in ixgbe_enter_lplu_t_x550em()
3115 * @hw: pointer to hardware structure
3117 static s32 ixgbe_reset_phy_fw(struct ixgbe_hw *hw) in ixgbe_reset_phy_fw() argument
3122 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw)) in ixgbe_reset_phy_fw()
3125 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_PHY_SW_RESET, &store); in ixgbe_reset_phy_fw()
3130 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_INIT_PHY, &store); in ixgbe_reset_phy_fw()
3134 return ixgbe_setup_fw_link(hw); in ixgbe_reset_phy_fw()
3139 * @hw: pointer to hardware structure
3141 static s32 ixgbe_check_overtemp_fw(struct ixgbe_hw *hw) in ixgbe_check_overtemp_fw() argument
3146 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &store); in ixgbe_check_overtemp_fw()
3151 ixgbe_shutdown_fw_phy(hw); in ixgbe_check_overtemp_fw()
3159 * @hw: pointer to hardware structure
3163 static void ixgbe_read_mng_if_sel_x550em(struct ixgbe_hw *hw) in ixgbe_read_mng_if_sel_x550em() argument
3168 hw->phy.nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL); in ixgbe_read_mng_if_sel_x550em()
3173 if (hw->mac.type == ixgbe_mac_x550em_a && in ixgbe_read_mng_if_sel_x550em()
3174 hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_MDIO_ACT) { in ixgbe_read_mng_if_sel_x550em()
3175 hw->phy.mdio.prtad = (hw->phy.nw_mng_if_sel & in ixgbe_read_mng_if_sel_x550em()
3182 * @hw: pointer to hardware structure
3188 static s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw) in ixgbe_init_phy_ops_X550em() argument
3190 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_init_phy_ops_X550em()
3193 hw->mac.ops.set_lan_id(hw); in ixgbe_init_phy_ops_X550em()
3195 ixgbe_read_mng_if_sel_x550em(hw); in ixgbe_init_phy_ops_X550em()
3197 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) { in ixgbe_init_phy_ops_X550em()
3199 ixgbe_setup_mux_ctl(hw); in ixgbe_init_phy_ops_X550em()
3203 ret_val = phy->ops.identify(hw); in ixgbe_init_phy_ops_X550em()
3209 ixgbe_init_mac_link_ops_X550em(hw); in ixgbe_init_phy_ops_X550em()
3214 switch (hw->phy.type) { in ixgbe_init_phy_ops_X550em()
3226 /* link is managed by HW */ in ixgbe_init_phy_ops_X550em()
3235 phy->nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL); in ixgbe_init_phy_ops_X550em()
3244 if (hw->mac.type == ixgbe_mac_X550EM_x && in ixgbe_init_phy_ops_X550em()
3245 !(IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0)) & in ixgbe_init_phy_ops_X550em()
3273 * @hw: pointer to hardware structure
3278 static enum ixgbe_media_type ixgbe_get_media_type_X550em(struct ixgbe_hw *hw) in ixgbe_get_media_type_X550em() argument
3283 switch (hw->device_id) { in ixgbe_get_media_type_X550em()
3286 hw->phy.type = ixgbe_phy_sgmii; in ixgbe_get_media_type_X550em()
3315 ** @hw: pointer to hardware structure
3317 static s32 ixgbe_init_ext_t_x550em(struct ixgbe_hw *hw) in ixgbe_init_ext_t_x550em() argument
3322 status = hw->phy.ops.read_reg(hw, in ixgbe_init_ext_t_x550em()
3333 status = hw->phy.ops.read_reg(hw, in ixgbe_init_ext_t_x550em()
3342 status = hw->phy.ops.write_reg(hw, in ixgbe_init_ext_t_x550em()
3355 * @hw: pointer to hardware structure
3357 static void ixgbe_set_mdio_speed(struct ixgbe_hw *hw) in ixgbe_set_mdio_speed() argument
3361 switch (hw->device_id) { in ixgbe_set_mdio_speed()
3368 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0); in ixgbe_set_mdio_speed()
3370 IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); in ixgbe_set_mdio_speed()
3375 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0); in ixgbe_set_mdio_speed()
3377 IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); in ixgbe_set_mdio_speed()
3385 ** @hw: pointer to hardware structure
3391 static s32 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()
3401 status = hw->mac.ops.stop_adapter(hw); in ixgbe_reset_hw_X550em()
3406 ixgbe_clear_tx_pending(hw); in ixgbe_reset_hw_X550em()
3409 status = hw->phy.ops.init(hw); in ixgbe_reset_hw_X550em()
3415 if (hw->phy.type == ixgbe_phy_x550em_ext_t) { in ixgbe_reset_hw_X550em()
3416 status = ixgbe_init_ext_t_x550em(hw); in ixgbe_reset_hw_X550em()
3422 if (hw->phy.sfp_setup_needed) { in ixgbe_reset_hw_X550em()
3423 status = hw->mac.ops.setup_sfp(hw); in ixgbe_reset_hw_X550em()
3424 hw->phy.sfp_setup_needed = false; in ixgbe_reset_hw_X550em()
3431 if (!hw->phy.reset_disable && hw->phy.ops.reset) in ixgbe_reset_hw_X550em()
3432 hw->phy.ops.reset(hw); in ixgbe_reset_hw_X550em()
3442 if (!hw->force_full_reset) { in ixgbe_reset_hw_X550em()
3443 hw->mac.ops.check_link(hw, &link_speed, &link_up, false); in ixgbe_reset_hw_X550em()
3448 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X550em()
3450 hw_dbg(hw, "semaphore failed with %d", status); in ixgbe_reset_hw_X550em()
3454 ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X550em()
3455 IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl); in ixgbe_reset_hw_X550em()
3456 IXGBE_WRITE_FLUSH(hw); in ixgbe_reset_hw_X550em()
3457 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X550em()
3462 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X550em()
3470 hw_dbg(hw, "Reset polling failed to complete.\n"); in ixgbe_reset_hw_X550em()
3479 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { in ixgbe_reset_hw_X550em()
3480 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_reset_hw_X550em()
3485 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); in ixgbe_reset_hw_X550em()
3491 hw->mac.num_rar_entries = 128; in ixgbe_reset_hw_X550em()
3492 hw->mac.ops.init_rx_addrs(hw); in ixgbe_reset_hw_X550em()
3494 ixgbe_set_mdio_speed(hw); in ixgbe_reset_hw_X550em()
3496 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP) in ixgbe_reset_hw_X550em()
3497 ixgbe_setup_mux_ctl(hw); in ixgbe_reset_hw_X550em()
3504 * @hw: pointer to hardware structure
3508 static void ixgbe_set_ethertype_anti_spoofing_X550(struct ixgbe_hw *hw, in ixgbe_set_ethertype_anti_spoofing_X550() argument
3515 pfvfspoof = IXGBE_READ_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg)); in ixgbe_set_ethertype_anti_spoofing_X550()
3521 IXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg), pfvfspoof); in ixgbe_set_ethertype_anti_spoofing_X550()
3525 * @hw: pointer to hardware structure
3529 static void ixgbe_set_source_address_pruning_X550(struct ixgbe_hw *hw, in ixgbe_set_source_address_pruning_X550() argument
3539 pfflp = (u64)IXGBE_READ_REG(hw, IXGBE_PFFLPL); in ixgbe_set_source_address_pruning_X550()
3540 pfflp |= (u64)IXGBE_READ_REG(hw, IXGBE_PFFLPH) << 32; in ixgbe_set_source_address_pruning_X550()
3547 IXGBE_WRITE_REG(hw, IXGBE_PFFLPL, (u32)pfflp); in ixgbe_set_source_address_pruning_X550()
3548 IXGBE_WRITE_REG(hw, IXGBE_PFFLPH, (u32)(pfflp >> 32)); in ixgbe_set_source_address_pruning_X550()
3553 * @hw: pointer to hardware structure
3557 static s32 ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw) in ixgbe_setup_fc_backplane_x550em_a() argument
3563 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) { in ixgbe_setup_fc_backplane_x550em_a()
3564 hw_err(hw, "ixgbe_fc_rx_pause not valid in strict IEEE mode\n"); in ixgbe_setup_fc_backplane_x550em_a()
3568 if (hw->fc.requested_mode == ixgbe_fc_default) in ixgbe_setup_fc_backplane_x550em_a()
3569 hw->fc.requested_mode = ixgbe_fc_full; in ixgbe_setup_fc_backplane_x550em_a()
3572 * HW will be able to do FC autoneg once the cable is plugged in. If in ixgbe_setup_fc_backplane_x550em_a()
3575 status = hw->mac.ops.read_iosf_sb_reg(hw, in ixgbe_setup_fc_backplane_x550em_a()
3576 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_backplane_x550em_a()
3580 hw_dbg(hw, "Auto-Negotiation did not complete\n"); in ixgbe_setup_fc_backplane_x550em_a()
3593 switch (hw->fc.requested_mode) { in ixgbe_setup_fc_backplane_x550em_a()
3621 hw_err(hw, "Flow control param set incorrectly\n"); in ixgbe_setup_fc_backplane_x550em_a()
3625 status = hw->mac.ops.write_iosf_sb_reg(hw, in ixgbe_setup_fc_backplane_x550em_a()
3626 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id), in ixgbe_setup_fc_backplane_x550em_a()
3630 status = ixgbe_restart_an_internal_phy_x550em(hw); in ixgbe_setup_fc_backplane_x550em_a()
3637 * @hw: pointer to hardware structure
3640 static void ixgbe_set_mux(struct ixgbe_hw *hw, u8 state) in ixgbe_set_mux() argument
3644 if (!hw->bus.lan_id) in ixgbe_set_mux()
3646 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_set_mux()
3651 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); in ixgbe_set_mux()
3652 IXGBE_WRITE_FLUSH(hw); in ixgbe_set_mux()
3657 * @hw: pointer to hardware structure
3662 static s32 ixgbe_acquire_swfw_sync_X550em(struct ixgbe_hw *hw, u32 mask) in ixgbe_acquire_swfw_sync_X550em() argument
3666 status = ixgbe_acquire_swfw_sync_X540(hw, mask); in ixgbe_acquire_swfw_sync_X550em()
3671 ixgbe_set_mux(hw, 1); in ixgbe_acquire_swfw_sync_X550em()
3678 * @hw: pointer to hardware structure
3683 static void ixgbe_release_swfw_sync_X550em(struct ixgbe_hw *hw, u32 mask) in ixgbe_release_swfw_sync_X550em() argument
3686 ixgbe_set_mux(hw, 0); in ixgbe_release_swfw_sync_X550em()
3688 ixgbe_release_swfw_sync_X540(hw, mask); in ixgbe_release_swfw_sync_X550em()
3693 * @hw: pointer to hardware structure
3698 static s32 ixgbe_acquire_swfw_sync_x550em_a(struct ixgbe_hw *hw, u32 mask) in ixgbe_acquire_swfw_sync_x550em_a() argument
3707 status = ixgbe_acquire_swfw_sync_X540(hw, hmask); in ixgbe_acquire_swfw_sync_x550em_a()
3713 status = ixgbe_get_phy_token(hw); in ixgbe_acquire_swfw_sync_x550em_a()
3717 ixgbe_release_swfw_sync_X540(hw, hmask); in ixgbe_acquire_swfw_sync_x550em_a()
3728 * @hw: pointer to hardware structure
3733 static void ixgbe_release_swfw_sync_x550em_a(struct ixgbe_hw *hw, u32 mask) in ixgbe_release_swfw_sync_x550em_a() argument
3738 ixgbe_put_phy_token(hw); in ixgbe_release_swfw_sync_x550em_a()
3741 ixgbe_release_swfw_sync_X540(hw, hmask); in ixgbe_release_swfw_sync_x550em_a()
3746 * @hw: pointer to hardware structure
3755 static s32 ixgbe_read_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_phy_reg_x550a() argument
3758 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM; in ixgbe_read_phy_reg_x550a()
3761 if (hw->mac.ops.acquire_swfw_sync(hw, mask)) in ixgbe_read_phy_reg_x550a()
3764 status = hw->phy.ops.read_reg_mdi(hw, reg_addr, device_type, phy_data); in ixgbe_read_phy_reg_x550a()
3766 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_read_phy_reg_x550a()
3773 * @hw: pointer to hardware structure
3781 static s32 ixgbe_write_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_phy_reg_x550a() argument
3784 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM; in ixgbe_write_phy_reg_x550a()
3787 if (hw->mac.ops.acquire_swfw_sync(hw, mask)) in ixgbe_write_phy_reg_x550a()
3790 status = ixgbe_write_phy_reg_mdi(hw, reg_addr, device_type, phy_data); in ixgbe_write_phy_reg_x550a()
3791 hw->mac.ops.release_swfw_sync(hw, mask); in ixgbe_write_phy_reg_x550a()