Lines Matching defs:hw
40 extern int32_t ixgbe_init_eeprom_params_X540(struct ixgbe_hw *hw);
41 extern int32_t ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, uint32_t mask);
42 extern void ixgbe_release_swfw_sync_X540(struct ixgbe_hw *hw, uint32_t mask);
46 int32_t ixgbe_read_mng_if_sel_x550em(struct ixgbe_hw *hw);
48 int32_t ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw,
52 int32_t ixgbe_dmac_config_X550(struct ixgbe_hw *hw);
53 int32_t ixgbe_dmac_config_tcs_X550(struct ixgbe_hw *hw);
54 int32_t ixgbe_dmac_update_tcs_X550(struct ixgbe_hw *hw);
56 int32_t ixgbe_get_bus_info_X550em(struct ixgbe_hw *hw);
57 int32_t ixgbe_init_eeprom_params_X550(struct ixgbe_hw *hw);
58 int32_t ixgbe_update_eeprom_checksum_X550(struct ixgbe_hw *hw);
59 int32_t ixgbe_calc_eeprom_checksum_X550(struct ixgbe_hw *hw);
60 int32_t ixgbe_calc_checksum_X550(struct ixgbe_hw *hw, uint16_t *buffer,
62 int32_t ixgbe_validate_eeprom_checksum_X550(struct ixgbe_hw *hw,
64 int32_t ixgbe_update_flash_X550(struct ixgbe_hw *hw);
65 int32_t ixgbe_write_ee_hostif_X550(struct ixgbe_hw *hw, uint16_t offset,
67 int32_t ixgbe_read_ee_hostif_buffer_X550(struct ixgbe_hw *hw,
70 int32_t ixgbe_read_ee_hostif_X550(struct ixgbe_hw *hw, uint16_t offset,
72 int32_t ixgbe_write_ee_hostif_data_X550(struct ixgbe_hw *hw, uint16_t offset,
74 void ixgbe_set_source_address_pruning_X550(struct ixgbe_hw *hw, bool enable,
76 int32_t ixgbe_write_iosf_sb_reg_x550(struct ixgbe_hw *hw, uint32_t reg_addr,
78 int32_t ixgbe_read_iosf_sb_reg_x550(struct ixgbe_hw *hw, uint32_t reg_addr,
82 int32_t ixgbe_write_iosf_sb_reg_x550a(struct ixgbe_hw *hw, uint32_t reg_addr,
84 int32_t ixgbe_read_iosf_sb_reg_x550a(struct ixgbe_hw *hw, uint32_t reg_addr,
86 enum ixgbe_media_type ixgbe_get_media_type_X550em(struct ixgbe_hw *hw);
87 int32_t ixgbe_setup_sfp_modules_X550em(struct ixgbe_hw *hw);
88 int32_t ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw,
91 void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw);
92 int32_t ixgbe_reset_hw_X550em(struct ixgbe_hw *hw);
93 int32_t ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw);
94 int32_t ixgbe_setup_kr_x550em(struct ixgbe_hw *hw);
95 int32_t ixgbe_init_ext_t_x550em(struct ixgbe_hw *hw);
96 int32_t ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw);
97 int32_t ixgbe_setup_phy_loopback_x550em(struct ixgbe_hw *hw);
98 uint64_t ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw);
99 void ixgbe_disable_rx_x550(struct ixgbe_hw *hw);
100 int32_t ixgbe_get_lcd_t_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *lcd_speed);
101 int32_t ixgbe_enter_lplu_t_x550em(struct ixgbe_hw *hw);
102 int32_t ixgbe_acquire_swfw_sync_X550em(struct ixgbe_hw *hw, uint32_t mask);
103 void ixgbe_release_swfw_sync_X550em(struct ixgbe_hw *hw, uint32_t mask);
104 int32_t ixgbe_setup_fc_X550em(struct ixgbe_hw *hw);
105 int32_t ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw,
108 int32_t ixgbe_read_phy_reg_x550a(struct ixgbe_hw *hw, uint32_t reg_addr,
110 int32_t ixgbe_write_phy_reg_x550a(struct ixgbe_hw *hw, uint32_t reg_addr,
112 int32_t ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw);
113 void ixgbe_fc_autoneg_fiber_x550em_a(struct ixgbe_hw *hw);
114 void ixgbe_fc_autoneg_backplane_x550em_a(struct ixgbe_hw *hw);
115 void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw);
116 int32_t ixgbe_handle_lasi_ext_t_x550em(struct ixgbe_hw *hw);
117 int32_t ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw,
120 int32_t ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
122 int32_t ixgbe_reset_phy_t_X550em(struct ixgbe_hw *hw);
123 int32_t ixgbe_identify_sfp_module_X550em(struct ixgbe_hw *hw);
124 int32_t ixgbe_led_on_t_X550em(struct ixgbe_hw *hw, uint32_t led_idx);
125 int32_t ixgbe_led_off_t_X550em(struct ixgbe_hw *hw, uint32_t led_idx);
127 int32_t ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed);
132 * @hw: pointer to hardware structure
137 int32_t ixgbe_init_ops_X550(struct ixgbe_hw *hw)
139 struct ixgbe_mac_info *mac = &hw->mac;
140 struct ixgbe_eeprom_info *eeprom = &hw->eeprom;
145 ret_val = ixgbe_init_ops_X540(hw);
161 switch (hw->device_id) {
163 hw->mac.ops.led_on = NULL;
164 hw->mac.ops.led_off = NULL;
168 hw->mac.ops.led_on = ixgbe_led_on_t_X550em;
169 hw->mac.ops.led_off = ixgbe_led_off_t_X550em;
179 * @hw: pointer to hardware structure
185 int32_t ixgbe_read_cs4227(struct ixgbe_hw *hw, uint16_t reg, uint16_t *value)
187 return hw->link.ops.read_link_unlocked(hw, hw->link.addr, reg, value);
192 * @hw: pointer to hardware structure
198 int32_t ixgbe_write_cs4227(struct ixgbe_hw *hw, uint16_t reg, uint16_t value)
200 return hw->link.ops.write_link_unlocked(hw, hw->link.addr, reg, value);
205 * @hw: pointer to hardware structure
211 int32_t ixgbe_read_pe(struct ixgbe_hw *hw, uint8_t reg, uint8_t *value)
215 if (hw->phy.ops.read_i2c_byte_unlocked)
216 status = hw->phy.ops.read_i2c_byte_unlocked(hw, reg, IXGBE_PE,
226 * @hw: pointer to hardware structure
232 int32_t ixgbe_write_pe(struct ixgbe_hw *hw, uint8_t reg, uint8_t value)
236 if (hw->phy.ops.write_i2c_byte_unlocked)
237 status = hw->phy.ops.write_i2c_byte_unlocked(hw, reg, IXGBE_PE,
247 * @hw: pointer to hardware structure
252 int32_t ixgbe_reset_cs4227(struct ixgbe_hw *hw)
260 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, ®);
264 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg);
268 status = ixgbe_read_pe(hw, IXGBE_PE_CONFIG, ®);
272 status = ixgbe_write_pe(hw, IXGBE_PE_CONFIG, reg);
276 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, ®);
280 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg);
286 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, ®);
290 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg);
297 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_EFUSE_STATUS,
310 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_EEPROM_STATUS, &value);
323 * @hw: pointer to hardware structure
325 void ixgbe_check_cs4227(struct ixgbe_hw *hw)
328 uint32_t swfw_mask = hw->phy.phy_semaphore_mask;
333 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
342 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_SCRATCH, &value);
353 hw->mac.ops.release_swfw_sync(hw, swfw_mask);
359 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
368 status = ixgbe_reset_cs4227(hw);
378 ixgbe_write_cs4227(hw, IXGBE_CS4227_SCRATCH,
380 hw->mac.ops.release_swfw_sync(hw, swfw_mask);
382 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
390 status = ixgbe_write_cs4227(hw, IXGBE_CS4227_SCRATCH,
394 hw->mac.ops.release_swfw_sync(hw, swfw_mask);
395 msec_delay(hw->eeprom.semaphore_delay);
400 * @hw: pointer to hardware structure
402 void ixgbe_setup_mux_ctl(struct ixgbe_hw *hw)
404 uint32_t esdp = IXGBE_READ_REG(hw, IXGBE_ESDP);
406 if (hw->bus.lan_id) {
411 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp);
412 IXGBE_WRITE_FLUSH(hw);
417 * @hw: pointer to hardware structure
421 int32_t ixgbe_identify_phy_x550em(struct ixgbe_hw *hw)
423 hw->mac.ops.set_lan_id(hw);
425 ixgbe_read_mng_if_sel_x550em(hw);
427 switch (hw->device_id) {
429 return ixgbe_identify_module_generic(hw);
432 ixgbe_setup_mux_ctl(hw);
433 ixgbe_check_cs4227(hw);
437 return ixgbe_identify_module_generic(hw);
440 hw->phy.type = ixgbe_phy_x550em_kx4;
443 hw->phy.type = ixgbe_phy_x550em_xfi;
448 hw->phy.type = ixgbe_phy_x550em_kr;
452 return ixgbe_identify_phy_generic(hw);
454 hw->phy.type = ixgbe_phy_ext_1g_t;
458 hw->phy.type = ixgbe_phy_fw;
459 if (hw->bus.lan_id)
460 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM;
462 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM;
472 * @hw: pointer to hardware structure
476 int32_t ixgbe_fw_phy_activity(struct ixgbe_hw *hw, uint16_t activity,
492 hic.cmd.port_number = hw->bus.lan_id;
497 rc = ixgbe_host_interface_command(hw, (uint32_t *)&hic.cmd,
530 * @hw: pointer to hardware structure
534 int32_t ixgbe_get_phy_id_fw(struct ixgbe_hw *hw)
542 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_PHY_INFO, &info);
546 hw->phy.speeds_supported = 0;
550 hw->phy.speeds_supported |= ixgbe_fw_map[i].phy_speed;
552 if (!hw->phy.autoneg_advertised)
553 hw->phy.autoneg_advertised = hw->phy.speeds_supported;
555 hw->phy.id = info[0] & FW_PHY_INFO_ID_HI_MASK;
557 hw->phy.id |= phy_id_lo & IXGBE_PHY_REVISION_MASK;
558 hw->phy.revision = phy_id_lo & ~IXGBE_PHY_REVISION_MASK;
559 if (!hw->phy.id || hw->phy.id == IXGBE_PHY_REVISION_MASK)
566 * @hw: pointer to hardware structure
570 int32_t ixgbe_identify_phy_fw(struct ixgbe_hw *hw)
572 if (hw->bus.lan_id)
573 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM;
575 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM;
577 hw->phy.type = ixgbe_phy_fw;
578 hw->phy.ops.read_reg = NULL;
579 hw->phy.ops.write_reg = NULL;
580 return ixgbe_get_phy_id_fw(hw);
585 * @hw: pointer to hardware structure
589 int32_t ixgbe_shutdown_fw_phy(struct ixgbe_hw *hw)
594 return ixgbe_fw_phy_activity(hw, FW_PHY_ACT_FORCE_LINK_DOWN, &setup);
597 int32_t ixgbe_read_phy_reg_x550em(struct ixgbe_hw *hw, uint32_t reg_addr,
603 int32_t ixgbe_write_phy_reg_x550em(struct ixgbe_hw *hw, uint32_t reg_addr,
611 * @hw: pointer to hardware structure
616 int32_t ixgbe_init_ops_X550EM(struct ixgbe_hw *hw)
618 struct ixgbe_mac_info *mac = &hw->mac;
619 struct ixgbe_eeprom_info *eeprom = &hw->eeprom;
620 struct ixgbe_phy_info *phy = &hw->phy;
626 ret_val = ixgbe_init_ops_X550(hw);
643 hw->bus.type = ixgbe_bus_type_internal;
654 if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper)
661 switch (hw->device_id) {
678 if (mac->ops.get_media_type(hw) != ixgbe_media_type_copper)
695 * @hw: pointer to hardware structure
697 int32_t ixgbe_setup_fw_link(struct ixgbe_hw *hw)
703 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw))
706 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
712 switch (hw->fc.requested_mode) {
730 if (hw->phy.autoneg_advertised & ixgbe_fw_map[i].phy_speed)
735 if (hw->phy.eee_speeds_advertised)
738 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_SETUP_LINK, &setup);
748 * @hw: pointer to hardware structure
752 int32_t ixgbe_fc_autoneg_fw(struct ixgbe_hw *hw)
754 if (hw->fc.requested_mode == ixgbe_fc_default)
755 hw->fc.requested_mode = ixgbe_fc_full;
757 return ixgbe_setup_fw_link(hw);
762 * @hw: pointer to the HW structure
768 int32_t ixgbe_setup_eee_fw(struct ixgbe_hw *hw, bool enable_eee)
770 if (!!hw->phy.eee_speeds_advertised == enable_eee)
773 hw->phy.eee_speeds_advertised = hw->phy.eee_speeds_supported;
775 hw->phy.eee_speeds_advertised = 0;
776 return hw->phy.ops.setup_link(hw);
781 * @hw: pointer to hardware structure
786 int32_t ixgbe_init_ops_X550EM_a(struct ixgbe_hw *hw)
788 struct ixgbe_mac_info *mac = &hw->mac;
794 ret_val = ixgbe_init_ops_X550EM(hw);
796 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII ||
797 hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII_L) {
807 switch (mac->ops.get_media_type(hw)) {
820 switch (hw->device_id) {
826 hw->phy.eee_speeds_supported = IXGBE_LINK_SPEED_100_FULL |
828 hw->phy.eee_speeds_advertised = hw->phy.eee_speeds_supported;
839 * @hw: pointer to hardware structure
844 int32_t ixgbe_init_ops_X550EM_x(struct ixgbe_hw *hw)
846 struct ixgbe_mac_info *mac = &hw->mac;
847 struct ixgbe_link_info *link = &hw->link;
853 ret_val = ixgbe_init_ops_X550EM(hw);
866 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_1G_T) {
876 * @hw: pointer to hardware structure
881 int32_t ixgbe_dmac_config_X550(struct ixgbe_hw *hw)
888 reg = IXGBE_READ_REG(hw, IXGBE_DMACR);
890 IXGBE_WRITE_REG(hw, IXGBE_DMACR, reg);
893 if (!hw->mac.dmac_config.watchdog_timer)
896 ixgbe_dmac_config_tcs_X550(hw);
899 reg = IXGBE_READ_REG(hw, IXGBE_DMACR);
903 reg |= (hw->mac.dmac_config.watchdog_timer * 100) / 4096;
910 IXGBE_WRITE_REG(hw, IXGBE_DMACR, reg);
918 * @hw: pointer to hardware structure
923 int32_t ixgbe_dmac_config_tcs_X550(struct ixgbe_hw *hw)
930 switch (hw->mac.dmac_config.link_speed) {
943 maxframe_size_kb = ((IXGBE_READ_REG(hw, IXGBE_MAXFRS) >>
948 reg = IXGBE_READ_REG(hw, IXGBE_DMCTH(tc));
951 if (tc < hw->mac.dmac_config.num_tcs) {
953 rx_pb_size = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(tc));
967 IXGBE_WRITE_REG(hw, IXGBE_DMCTH(tc), reg);
974 * @hw: pointer to hardware structure
978 int32_t ixgbe_dmac_update_tcs_X550(struct ixgbe_hw *hw)
985 reg = IXGBE_READ_REG(hw, IXGBE_DMACR);
987 IXGBE_WRITE_REG(hw, IXGBE_DMACR, reg);
989 ixgbe_dmac_config_tcs_X550(hw);
992 reg = IXGBE_READ_REG(hw, IXGBE_DMACR);
994 IXGBE_WRITE_REG(hw, IXGBE_DMACR, reg);
1001 * @hw: pointer to hardware structure
1006 int32_t ixgbe_init_eeprom_params_X550(struct ixgbe_hw *hw)
1008 struct ixgbe_eeprom_info *eeprom = &hw->eeprom;
1018 eec = IXGBE_READ_REG(hw, IXGBE_EEC);
1033 * @hw: pointer to hardware structure
1037 void ixgbe_set_source_address_pruning_X550(struct ixgbe_hw *hw, bool enable,
1046 pfflp = (uint64_t)IXGBE_READ_REG(hw, IXGBE_PFFLPL);
1047 pfflp |= (uint64_t)IXGBE_READ_REG(hw, IXGBE_PFFLPH) << 32;
1054 IXGBE_WRITE_REG(hw, IXGBE_PFFLPL, (uint32_t)pfflp);
1055 IXGBE_WRITE_REG(hw, IXGBE_PFFLPH, (uint32_t)(pfflp >> 32));
1060 * @hw: pointer to hardware structure
1067 int32_t ixgbe_iosf_wait(struct ixgbe_hw *hw, uint32_t *ctrl)
1076 command = IXGBE_READ_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL);
1094 * @hw: pointer to hardware structure
1099 int32_t ixgbe_write_iosf_sb_reg_x550(struct ixgbe_hw *hw, uint32_t reg_addr,
1106 ret = hw->mac.ops.acquire_swfw_sync(hw, gssr);
1110 ret = ixgbe_iosf_wait(hw, NULL);
1118 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL, command);
1121 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_DATA, data);
1123 ret = ixgbe_iosf_wait(hw, &command);
1134 hw->mac.ops.release_swfw_sync(hw, gssr);
1140 * @hw: pointer to hardware structure
1145 int32_t ixgbe_read_iosf_sb_reg_x550(struct ixgbe_hw *hw, uint32_t reg_addr,
1152 ret = hw->mac.ops.acquire_swfw_sync(hw, gssr);
1156 ret = ixgbe_iosf_wait(hw, NULL);
1164 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL, command);
1166 ret = ixgbe_iosf_wait(hw, &command);
1177 *data = IXGBE_READ_REG(hw, IXGBE_SB_IOSF_INDIRECT_DATA);
1180 hw->mac.ops.release_swfw_sync(hw, gssr);
1186 * @hw: Pointer to hardware structure
1189 int32_t ixgbe_get_phy_token(struct ixgbe_hw *hw)
1198 token_cmd.port_number = hw->bus.lan_id;
1201 status = ixgbe_host_interface_command(hw, (uint32_t *)&token_cmd,
1224 * @hw: Pointer to hardware structure
1227 int32_t ixgbe_put_phy_token(struct ixgbe_hw *hw)
1236 token_cmd.port_number = hw->bus.lan_id;
1239 status = ixgbe_host_interface_command(hw, (uint32_t *)&token_cmd,
1255 * @hw: pointer to hardware structure
1260 int32_t ixgbe_write_iosf_sb_reg_x550a(struct ixgbe_hw *hw, uint32_t reg_addr,
1270 write_cmd.port_number = hw->bus.lan_id;
1275 status = ixgbe_host_interface_command(hw, (uint32_t *)&write_cmd,
1284 * @hw: pointer to hardware structure
1289 int32_t ixgbe_read_iosf_sb_reg_x550a(struct ixgbe_hw *hw, uint32_t reg_addr,
1302 hic.cmd.port_number = hw->bus.lan_id;
1306 status = ixgbe_host_interface_command(hw, (uint32_t *)&hic.cmd,
1318 * @hw: pointer to hardware structure
1322 enum ixgbe_media_type ixgbe_get_media_type_X550em(struct ixgbe_hw *hw)
1329 switch (hw->device_id) {
1352 hw->phy.type = ixgbe_phy_sgmii;
1367 * @hw: pointer to hardware structure
1370 int32_t ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear)
1374 switch (hw->phy.sfp_type) {
1403 * @hw: pointer to hardware structure
1407 int32_t ixgbe_identify_sfp_module_X550em(struct ixgbe_hw *hw)
1414 status = ixgbe_identify_module_generic(hw);
1420 status = ixgbe_supported_sfp_modules_X550em(hw, &linear);
1427 * @hw: pointer to hardware structure
1429 int32_t ixgbe_setup_sfp_modules_X550em(struct ixgbe_hw *hw)
1437 status = ixgbe_supported_sfp_modules_X550em(hw, &linear);
1442 ixgbe_init_mac_link_ops_X550em(hw);
1443 hw->phy.ops.reset = NULL;
1451 * @hw: pointer to hardware structure
1453 int32_t ixgbe_restart_an_internal_phy_x550em(struct ixgbe_hw *hw)
1459 status = hw->mac.ops.read_iosf_sb_reg(hw,
1460 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1469 status = hw->mac.ops.write_iosf_sb_reg(hw,
1470 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1473 if (hw->mac.type == ixgbe_mac_X550EM_a) {
1477 status = hw->mac.ops.read_iosf_sb_reg(hw,
1478 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1487 status = hw->mac.ops.write_iosf_sb_reg(hw,
1488 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1497 * @hw: pointer to hardware structure
1501 int32_t ixgbe_setup_sgmii(struct ixgbe_hw *hw, ixgbe_link_speed speed,
1504 struct ixgbe_mac_info *mac = &hw->mac;
1508 rc = mac->ops.read_iosf_sb_reg(hw,
1509 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1519 rc = mac->ops.write_iosf_sb_reg(hw,
1520 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1525 rc = mac->ops.read_iosf_sb_reg(hw,
1526 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id),
1533 rc = mac->ops.write_iosf_sb_reg(hw,
1534 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id),
1539 rc = mac->ops.read_iosf_sb_reg(hw,
1540 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1551 rc = mac->ops.write_iosf_sb_reg(hw,
1552 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1557 rc = ixgbe_restart_an_internal_phy_x550em(hw);
1561 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait);
1566 * @hw: pointer to hardware structure
1570 int32_t ixgbe_setup_sgmii_fw(struct ixgbe_hw *hw, ixgbe_link_speed speed,
1573 struct ixgbe_mac_info *mac = &hw->mac;
1577 rc = mac->ops.read_iosf_sb_reg(hw,
1578 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1588 rc = mac->ops.write_iosf_sb_reg(hw,
1589 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1594 rc = mac->ops.read_iosf_sb_reg(hw,
1595 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id),
1602 rc = mac->ops.write_iosf_sb_reg(hw,
1603 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id),
1608 rc = mac->ops.write_iosf_sb_reg(hw,
1609 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1614 rc = mac->ops.read_iosf_sb_reg(hw,
1615 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1626 rc = mac->ops.write_iosf_sb_reg(hw,
1627 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1632 rc = ixgbe_restart_an_internal_phy_x550em(hw);
1634 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait);
1639 * @hw: pointer to hardware structure
1641 void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw)
1643 struct ixgbe_mac_info *mac = &hw->mac;
1647 switch (hw->mac.ops.get_media_type(hw)) {
1659 if ((hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP_N) ||
1660 (hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP))
1668 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_1G_T)
1670 if (hw->mac.type == ixgbe_mac_X550EM_a) {
1671 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T ||
1672 hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T_L) {
1686 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII ||
1687 hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII_L)
1697 * @hw: pointer to hardware structure
1701 int32_t ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw,
1708 if (hw->phy.type == ixgbe_phy_fw) {
1710 *speed = hw->phy.speeds_supported;
1715 if (hw->phy.media_type == ixgbe_media_type_fiber) {
1721 if (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
1722 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1
1723 || hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
1724 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1) {
1730 if (hw->phy.multispeed_fiber)
1736 switch (hw->phy.type) {
1742 if (hw->mac.type == ixgbe_mac_X550EM_a) {
1744 if (hw->phy.nw_mng_if_sel &
1748 } else if (hw->device_id ==
1768 * @hw: pointer to hardware structure
1778 int32_t ixgbe_get_lasi_ext_t_x550em(struct ixgbe_hw *hw, bool *lsc)
1786 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG,
1795 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_FLAG,
1805 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_ALARM_1,
1815 ixgbe_set_copper_phy_power(hw, FALSE);
1819 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_FAULT_MSG,
1829 ixgbe_set_copper_phy_power(hw, FALSE);
1835 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG,
1843 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM2,
1858 * @hw: pointer to hardware structure
1865 int32_t ixgbe_enable_lasi_ext_t_x550em(struct ixgbe_hw *hw)
1872 status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc);
1884 if (hw->mac.type != ixgbe_mac_X550EM_a) {
1885 status = hw->phy.ops.read_reg(hw,
1894 status = hw->phy.ops.write_reg(hw,
1903 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK,
1913 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK,
1921 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK,
1931 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK,
1939 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK,
1948 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK,
1957 * @hw: pointer to hardware structure
1962 int32_t ixgbe_setup_kr_speed_x550em(struct ixgbe_hw *hw,
1968 status = hw->mac.ops.read_iosf_sb_reg(hw,
1969 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1986 status = hw->mac.ops.write_iosf_sb_reg(hw,
1987 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1990 if (hw->mac.type == ixgbe_mac_X550EM_a) {
1992 status = hw->mac.ops.read_iosf_sb_reg(hw,
1993 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2005 status = hw->mac.ops.write_iosf_sb_reg(hw,
2006 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2010 return ixgbe_restart_an_internal_phy_x550em(hw);
2015 * @hw: pointer to hardware structure
2017 int32_t ixgbe_reset_phy_fw(struct ixgbe_hw *hw)
2022 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw))
2025 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_PHY_SW_RESET, &store);
2030 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_INIT_PHY, &store);
2034 return ixgbe_setup_fw_link(hw);
2039 * @hw: pointer to hardware structure
2041 int32_t ixgbe_check_overtemp_fw(struct ixgbe_hw *hw)
2046 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &store);
2051 ixgbe_shutdown_fw_phy(hw);
2059 * @hw: pointer to hardware structure
2064 int32_t ixgbe_read_mng_if_sel_x550em(struct ixgbe_hw *hw)
2069 hw->phy.nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL);
2074 if (hw->mac.type == ixgbe_mac_X550EM_a &&
2075 hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_MDIO_ACT) {
2076 hw->phy.addr = (hw->phy.nw_mng_if_sel &
2086 * @hw: pointer to hardware structure
2092 int32_t ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
2094 struct ixgbe_phy_info *phy = &hw->phy;
2099 hw->mac.ops.set_lan_id(hw);
2100 ixgbe_read_mng_if_sel_x550em(hw);
2102 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) {
2104 ixgbe_setup_mux_ctl(hw);
2108 switch (hw->device_id) {
2113 hw->phy.ops.read_reg = NULL;
2114 hw->phy.ops.write_reg = NULL;
2116 if (hw->bus.lan_id)
2117 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM;
2119 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM;
2124 hw->phy.ops.read_reg = ixgbe_read_phy_reg_x550a;
2125 hw->phy.ops.write_reg = ixgbe_write_phy_reg_x550a;
2126 if (hw->bus.lan_id)
2127 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM;
2129 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM;
2133 hw->phy.phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM;
2143 ret_val = phy->ops.identify(hw);
2149 ixgbe_init_mac_link_ops_X550em(hw);
2154 switch (hw->phy.type) {
2184 if ((hw->mac.type == ixgbe_mac_X550EM_x) &&
2186 IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0))))
2207 * @hw: pointer to hardware structure
2209 void ixgbe_set_mdio_speed(struct ixgbe_hw *hw)
2213 switch (hw->device_id) {
2221 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0);
2223 IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0);
2228 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0);
2230 IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0);
2239 * @hw: pointer to hardware structure
2245 int32_t ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
2252 uint32_t swfw_mask = hw->phy.phy_semaphore_mask;
2257 status = hw->mac.ops.stop_adapter(hw);
2263 ixgbe_clear_tx_pending(hw);
2265 ixgbe_set_mdio_speed(hw);
2268 status = hw->phy.ops.init(hw);
2281 if (hw->phy.type == ixgbe_phy_x550em_ext_t) {
2282 status = ixgbe_init_ext_t_x550em(hw);
2291 if (hw->phy.sfp_setup_needed) {
2292 status = hw->mac.ops.setup_sfp(hw);
2293 hw->phy.sfp_setup_needed = FALSE;
2300 if (!hw->phy.reset_disable && hw->phy.ops.reset) {
2301 if (hw->phy.ops.reset(hw) == IXGBE_ERR_OVERTEMP)
2312 if (!hw->force_full_reset) {
2313 hw->mac.ops.check_link(hw, &link_speed, &link_up, FALSE);
2318 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
2324 ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL);
2325 IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl);
2326 IXGBE_WRITE_FLUSH(hw);
2327 hw->mac.ops.release_swfw_sync(hw, swfw_mask);
2332 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
2348 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) {
2349 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED;
2354 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr);
2360 hw->mac.num_rar_entries = 128;
2361 hw->mac.ops.init_rx_addrs(hw);
2363 ixgbe_set_mdio_speed(hw);
2365 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP)
2366 ixgbe_setup_mux_ctl(hw);
2376 * @hw: pointer to hardware structure
2378 int32_t ixgbe_init_ext_t_x550em(struct ixgbe_hw *hw)
2383 status = hw->phy.ops.read_reg(hw,
2395 status = hw->phy.ops.read_reg(hw,
2405 status = hw->phy.ops.write_reg(hw,
2419 * @hw: pointer to hardware structure
2421 int32_t ixgbe_setup_kr_x550em(struct ixgbe_hw *hw)
2424 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL)
2427 if (ixgbe_check_reset_blocked(hw))
2430 return ixgbe_setup_kr_speed_x550em(hw, hw->phy.autoneg_advertised);
2435 * @hw: pointer to hardware structure
2441 int32_t ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw,
2450 ret_val = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear);
2463 ixgbe_setup_kr_speed_x550em(hw, speed);
2467 (hw->bus.lan_id << 12);
2472 ret_val = hw->link.ops.write_link(hw, hw->link.addr, reg_slice,
2479 * @hw: pointer to hardware structure
2485 int32_t ixgbe_setup_sfi_x550a(struct ixgbe_hw *hw, ixgbe_link_speed *speed)
2487 struct ixgbe_mac_info *mac = &hw->mac;
2492 status = mac->ops.read_iosf_sb_reg(hw,
2493 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2516 status = mac->ops.write_iosf_sb_reg(hw,
2517 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2521 status = ixgbe_restart_an_internal_phy_x550em(hw);
2528 * @hw: pointer to hardware structure
2534 int32_t ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw,
2544 ret_val = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear);
2555 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP_N) {
2557 ret_val = hw->mac.ops.read_iosf_sb_reg(hw,
2558 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2568 ret_val = hw->mac.ops.write_iosf_sb_reg(hw,
2569 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2576 ret_val = ixgbe_setup_sfi_x550a(hw, &speed);
2579 ixgbe_setup_kr_speed_x550em(hw, speed);
2581 if (hw->phy.addr == 0x0 || hw->phy.addr == 0xFFFF) {
2588 ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_EFUSE_PDF_SKU,
2598 slice_offset = (hw->bus.lan_id +
2599 (hw->bus.instance_id << 1)) << 12;
2601 slice_offset = hw->bus.lan_id << 12;
2606 ret_val = hw->phy.ops.read_reg(hw, reg_slice,
2619 ret_val = hw->phy.ops.write_reg(hw, reg_slice,
2623 ret_val = hw->phy.ops.read_reg(hw, reg_slice,
2631 * @hw: pointer to hardware structure
2635 int32_t ixgbe_setup_ixfi_x550em_x(struct ixgbe_hw *hw)
2637 struct ixgbe_mac_info *mac = &hw->mac;
2642 status = mac->ops.read_iosf_sb_reg(hw,
2643 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id),
2648 status = mac->ops.write_iosf_sb_reg(hw,
2649 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id),
2655 status = mac->ops.read_iosf_sb_reg(hw,
2656 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id),
2663 status = mac->ops.write_iosf_sb_reg(hw,
2664 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id),
2668 status = mac->ops.read_iosf_sb_reg(hw,
2669 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id),
2676 status = mac->ops.write_iosf_sb_reg(hw,
2677 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id),
2683 status = mac->ops.read_iosf_sb_reg(hw,
2684 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id),
2692 status = mac->ops.write_iosf_sb_reg(hw,
2693 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id),
2700 * @hw: pointer to hardware structure
2706 int32_t ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed)
2708 struct ixgbe_mac_info *mac = &hw->mac;
2717 status = mac->ops.read_iosf_sb_reg(hw,
2718 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
2739 status = mac->ops.write_iosf_sb_reg(hw,
2740 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
2746 if (hw->mac.type == ixgbe_mac_X550EM_x) {
2747 status = ixgbe_setup_ixfi_x550em_x(hw);
2753 status = ixgbe_restart_an_internal_phy_x550em(hw);
2760 * @hw: address of hardware structure
2765 int32_t ixgbe_ext_phy_t_x550em_get_link(struct ixgbe_hw *hw, bool *link_up)
2773 ret = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
2779 ret = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
2792 * @hw: point to hardware structure
2802 int32_t ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw)
2809 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
2812 if (hw->mac.type == ixgbe_mac_X550EM_x &&
2813 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) {
2815 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up);
2822 status = hw->phy.ops.read_reg(hw,
2830 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up);
2851 return ixgbe_setup_ixfi_x550em(hw, &force_speed);
2855 return ixgbe_setup_kr_speed_x550em(hw, speed);
2861 * @hw: pointer to hardware structure
2865 int32_t ixgbe_setup_phy_loopback_x550em(struct ixgbe_hw *hw)
2871 status = hw->mac.ops.read_iosf_sb_reg(hw,
2872 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
2879 status = hw->mac.ops.write_iosf_sb_reg(hw,
2880 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
2886 status = hw->mac.ops.read_iosf_sb_reg(hw,
2887 IXGBE_KRM_PORT_CAR_GEN_CTRL(hw->bus.lan_id),
2893 status = hw->mac.ops.write_iosf_sb_reg(hw,
2894 IXGBE_KRM_PORT_CAR_GEN_CTRL(hw->bus.lan_id),
2900 status = hw->mac.ops.read_iosf_sb_reg(hw,
2901 IXGBE_KRM_PMD_DFX_BURNIN(hw->bus.lan_id),
2906 status = hw->mac.ops.write_iosf_sb_reg(hw,
2907 IXGBE_KRM_PMD_DFX_BURNIN(hw->bus.lan_id),
2913 status = hw->mac.ops.read_iosf_sb_reg(hw,
2914 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id),
2919 status = hw->mac.ops.write_iosf_sb_reg(hw,
2920 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id),
2929 * @hw: pointer to hardware structure
2935 int32_t ixgbe_read_ee_hostif_X550(struct ixgbe_hw *hw, uint16_t offset,uint16_t *data)
2954 status = hw->mac.ops.acquire_swfw_sync(hw, mask);
2958 status = ixgbe_hic_unlocked(hw, (uint32_t *)&buffer, sizeof(buffer),
2961 *data = (uint16_t)IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG,
2965 hw->mac.ops.release_swfw_sync(hw, mask);
2971 * @hw: pointer to hardware structure
2978 int32_t ixgbe_read_ee_hostif_buffer_X550(struct ixgbe_hw *hw,
2992 status = hw->mac.ops.acquire_swfw_sync(hw, mask);
3015 status = ixgbe_hic_unlocked(hw, (uint32_t *)&buffer, sizeof(buffer),
3026 uint32_t value = IXGBE_READ_REG(hw, reg);
3041 hw->mac.ops.release_swfw_sync(hw, mask);
3047 * @hw: pointer to hardware structure
3053 int32_t ixgbe_write_ee_hostif_data_X550(struct ixgbe_hw *hw, uint16_t offset,
3071 status = ixgbe_host_interface_command(hw, (uint32_t *)&buffer,
3080 * @hw: pointer to hardware structure
3086 int32_t ixgbe_write_ee_hostif_X550(struct ixgbe_hw *hw, uint16_t offset,
3093 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) ==
3095 status = ixgbe_write_ee_hostif_data_X550(hw, offset, data);
3096 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM);
3107 * @hw: pointer to hardware structure
3116 int32_t ixgbe_checksum_ptr_x550(struct ixgbe_hw *hw, uint16_t ptr,
3129 status = ixgbe_read_ee_hostif_buffer_X550(hw, ptr, bufsz, buf);
3150 (ptr + length) >= hw->eeprom.word_size)
3165 status = ixgbe_read_ee_hostif_buffer_X550(hw, ptr,
3179 * @hw: pointer to hardware structure
3185 int32_t ixgbe_calc_checksum_X550(struct ixgbe_hw *hw, uint16_t *buffer,
3196 hw->eeprom.ops.init_params(hw);
3200 status = ixgbe_read_ee_hostif_buffer_X550(hw, 0,
3234 pointer >= hw->eeprom.word_size)
3250 status = ixgbe_checksum_ptr_x550(hw, pointer, size, &checksum,
3263 * @hw: pointer to hardware structure
3267 int32_t ixgbe_calc_eeprom_checksum_X550(struct ixgbe_hw *hw)
3269 return ixgbe_calc_checksum_X550(hw, NULL, 0);
3274 * @hw: pointer to hardware structure
3280 int32_t ixgbe_validate_eeprom_checksum_X550(struct ixgbe_hw *hw, uint16_t *checksum_val)
3292 status = hw->eeprom.ops.read(hw, 0, &checksum);
3298 status = hw->eeprom.ops.calc_checksum(hw);
3304 status = ixgbe_read_ee_hostif_X550(hw, IXGBE_EEPROM_CHECKSUM,
3327 * @hw: pointer to hardware structure
3333 int32_t ixgbe_update_eeprom_checksum_X550(struct ixgbe_hw *hw)
3344 status = ixgbe_read_ee_hostif_X550(hw, 0, &checksum);
3350 status = ixgbe_calc_eeprom_checksum_X550(hw);
3356 status = ixgbe_write_ee_hostif_X550(hw, IXGBE_EEPROM_CHECKSUM,
3361 status = ixgbe_update_flash_X550(hw);
3368 * @hw: pointer to hardware structure
3372 int32_t ixgbe_update_flash_X550(struct ixgbe_hw *hw)
3384 status = ixgbe_host_interface_command(hw, (uint32_t *)&buffer,
3393 * @hw: pointer to hardware structure
3397 uint64_t ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw)
3404 hw->phy.ops.identify(hw);
3406 switch (hw->phy.type) {
3408 if (hw->mac.type == ixgbe_mac_X550EM_a) {
3409 if (hw->phy.nw_mng_if_sel &
3414 } else if (hw->device_id ==
3431 hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_EXT_ABILITY,
3440 if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_1GB_FULL)
3442 if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_100_FULL)
3444 if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_10_FULL)
3457 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber)
3458 physical_layer = ixgbe_get_supported_phy_sfp_layer_generic(hw);
3465 * @hw: pointer to hardware structure
3470 int32_t ixgbe_get_bus_info_X550em(struct ixgbe_hw *hw)
3475 hw->bus.width = ixgbe_bus_width_unknown;
3476 hw->bus.speed = ixgbe_bus_speed_unknown;
3478 hw->mac.ops.set_lan_id(hw);
3485 * @hw: pointer to hardware structure
3489 void ixgbe_disable_rx_x550(struct ixgbe_hw *hw)
3497 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL);
3499 pfdtxgswc = IXGBE_READ_REG(hw, IXGBE_PFDTXGSWC);
3502 IXGBE_WRITE_REG(hw, IXGBE_PFDTXGSWC, pfdtxgswc);
3503 hw->mac.set_lben = TRUE;
3505 hw->mac.set_lben = FALSE;
3511 fw_cmd.port_number = (uint8_t)hw->bus.lan_id;
3513 status = ixgbe_host_interface_command(hw, (uint32_t *)&fw_cmd,
3519 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL);
3522 IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, rxctrl);
3530 * @hw: pointer to hardware structure
3536 int32_t ixgbe_enter_lplu_t_x550em(struct ixgbe_hw *hw)
3545 if ((hw->mac.type == ixgbe_mac_X550EM_x) &&
3547 IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0))))
3551 if (ixgbe_check_reset_blocked(hw))
3554 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up);
3558 status = hw->eeprom.ops.read(hw, NVM_INIT_CTRL_3, &hw->eeprom.ctrl_word_3);
3565 if (!link_up || !(hw->eeprom.ctrl_word_3 & NVM_INIT_CTRL_3_LPLU) ||
3566 !(hw->wol_enabled || ixgbe_mng_present(hw)))
3567 return ixgbe_set_copper_phy_power(hw, FALSE);
3570 status = ixgbe_get_lcd_t_x550em(hw, &lcd_speed);
3577 return ixgbe_set_copper_phy_power(hw, FALSE);
3579 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT,
3587 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up);
3589 return ixgbe_set_copper_phy_power(hw, FALSE);
3602 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM,
3609 status = hw->phy.ops.read_reg(hw, IXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG,
3616 status = hw->phy.ops.read_reg(hw,
3624 save_autoneg = hw->phy.autoneg_advertised;
3627 status = hw->mac.ops.setup_link(hw, lcd_speed, FALSE);
3630 hw->phy.autoneg_advertised = save_autoneg;
3637 * @hw: pointer to hardware structure
3642 int32_t ixgbe_get_lcd_t_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *lcd_speed)
3646 uint16_t word = hw->eeprom.ctrl_word_3;
3650 status = hw->phy.ops.read_reg(hw, IXGBE_AUTO_NEG_LP_STATUS,
3664 if ((hw->bus.lan_id && (word & NVM_INIT_CTRL_3_D10GMP_PORT1)) ||
3675 * @hw: pointer to hardware structure
3679 int32_t ixgbe_setup_fc_X550em(struct ixgbe_hw *hw)
3687 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
3697 if (hw->fc.requested_mode == ixgbe_fc_default)
3698 hw->fc.requested_mode = ixgbe_fc_full;
3701 switch (hw->fc.requested_mode) {
3730 switch (hw->device_id) {
3734 ret_val = hw->mac.ops.read_iosf_sb_reg(hw,
3735 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
3745 ret_val = hw->mac.ops.write_iosf_sb_reg(hw,
3746 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
3750 hw->fc.disable_fc_autoneg = TRUE;
3753 hw->fc.disable_fc_autoneg = TRUE;
3765 * @hw: pointer to hardware structure
3769 void ixgbe_fc_autoneg_backplane_x550em_a(struct ixgbe_hw *hw)
3781 if (hw->fc.disable_fc_autoneg) {
3787 hw->mac.ops.check_link(hw, &speed, &link_up, FALSE);
3794 status = hw->mac.ops.read_iosf_sb_reg(hw,
3795 IXGBE_KRM_LINK_S1(hw->bus.lan_id),
3808 status = hw->mac.ops.read_iosf_sb_reg(hw,
3809 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
3817 status = hw->mac.ops.read_iosf_sb_reg(hw,
3818 IXGBE_KRM_LP_BASE_PAGE_HIGH(hw->bus.lan_id),
3826 status = ixgbe_negotiate_fc(hw, an_cntl_1, lp_an_page_low,
3834 hw->fc.fc_was_autonegged = TRUE;
3836 hw->fc.fc_was_autonegged = FALSE;
3837 hw->fc.current_mode = hw->fc.requested_mode;
3843 * @hw: pointer to hardware structure
3846 void ixgbe_fc_autoneg_fiber_x550em_a(struct ixgbe_hw *hw)
3848 hw->fc.fc_was_autonegged = FALSE;
3849 hw->fc.current_mode = hw->fc.requested_mode;
3854 * @hw: pointer to hardware structure
3858 void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw)
3870 if (hw->fc.disable_fc_autoneg) {
3876 hw->mac.ops.check_link(hw, &speed, &link_up, FALSE);
3883 status = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &info);
3892 status = ixgbe_negotiate_fc(hw, info[0], info[0],
3900 hw->fc.fc_was_autonegged = TRUE;
3902 hw->fc.fc_was_autonegged = FALSE;
3903 hw->fc.current_mode = hw->fc.requested_mode;
3909 * @hw: pointer to hardware structure
3913 int32_t ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw)
3921 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
3927 if (hw->fc.requested_mode == ixgbe_fc_default)
3928 hw->fc.requested_mode = ixgbe_fc_full;
3934 status = hw->mac.ops.read_iosf_sb_reg(hw,
3935 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
3952 switch (hw->fc.requested_mode) {
3985 status = hw->mac.ops.write_iosf_sb_reg(hw,
3986 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
3990 status = ixgbe_restart_an_internal_phy_x550em(hw);
3997 * @hw: pointer to hardware structure
4000 void ixgbe_set_mux(struct ixgbe_hw *hw, uint8_t state)
4004 if (!hw->bus.lan_id)
4006 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP);
4011 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp);
4012 IXGBE_WRITE_FLUSH(hw);
4017 * @hw: pointer to hardware structure
4022 int32_t ixgbe_acquire_swfw_sync_X550em(struct ixgbe_hw *hw, uint32_t mask)
4028 status = ixgbe_acquire_swfw_sync_X540(hw, mask);
4033 ixgbe_set_mux(hw, 1);
4040 * @hw: pointer to hardware structure
4045 void ixgbe_release_swfw_sync_X550em(struct ixgbe_hw *hw, uint32_t mask)
4050 ixgbe_set_mux(hw, 0);
4052 ixgbe_release_swfw_sync_X540(hw, mask);
4057 * @hw: pointer to hardware structure
4062 int32_t ixgbe_acquire_swfw_sync_X550a(struct ixgbe_hw *hw, uint32_t mask)
4073 status = ixgbe_acquire_swfw_sync_X540(hw, hmask);
4082 status = ixgbe_get_phy_token(hw);
4091 ixgbe_release_swfw_sync_X540(hw, hmask);
4101 hw->phy.id);
4107 * @hw: pointer to hardware structure
4112 void ixgbe_release_swfw_sync_X550a(struct ixgbe_hw *hw, uint32_t mask)
4119 ixgbe_put_phy_token(hw);
4122 ixgbe_release_swfw_sync_X540(hw, hmask);
4127 * @hw: pointer to hardware structure
4136 int32_t ixgbe_read_phy_reg_x550a(struct ixgbe_hw *hw, uint32_t reg_addr,
4140 uint32_t mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM;
4144 if (hw->mac.ops.acquire_swfw_sync(hw, mask))
4147 status = hw->phy.ops.read_reg_mdi(hw, reg_addr, device_type, phy_data);
4149 hw->mac.ops.release_swfw_sync(hw, mask);
4156 * @hw: pointer to hardware structure
4164 int32_t ixgbe_write_phy_reg_x550a(struct ixgbe_hw *hw, uint32_t reg_addr,
4168 uint32_t mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM;
4172 if (hw->mac.ops.acquire_swfw_sync(hw, mask) == IXGBE_SUCCESS) {
4173 status = hw->phy.ops.write_reg_mdi(hw, reg_addr, device_type,
4175 hw->mac.ops.release_swfw_sync(hw, mask);
4185 * @hw: pointer to hardware structure
4194 int32_t ixgbe_handle_lasi_ext_t_x550em(struct ixgbe_hw *hw)
4199 status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc);
4205 return hw->phy.ops.setup_internal_link(hw);
4212 * @hw: pointer to hardware structure
4221 int32_t ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw,
4240 if (hw->mac.type == ixgbe_mac_X550EM_x &&
4241 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) {
4242 status = ixgbe_setup_ixfi_x550em(hw, &force_speed);
4248 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait_to_complete);
4253 * @hw: pointer to hardware structure
4260 int32_t ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
4266 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
4269 status = ixgbe_check_mac_link_generic(hw, speed, link_up,
4282 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
4299 * @hw: pointer to hardware structure
4301 int32_t ixgbe_reset_phy_t_X550em(struct ixgbe_hw *hw)
4305 status = ixgbe_reset_phy_generic(hw);
4311 return ixgbe_enable_lasi_ext_t_x550em(hw);
4316 * @hw: pointer to hardware structure
4319 int32_t ixgbe_led_on_t_X550em(struct ixgbe_hw *hw, uint32_t led_idx)
4328 if (hw->phy.id == 0)
4329 ixgbe_identify_phy(hw);
4332 hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
4335 hw->phy.ops.write_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
4339 return ixgbe_led_on_generic(hw, led_idx);
4344 * @hw: pointer to hardware structure
4347 int32_t ixgbe_led_off_t_X550em(struct ixgbe_hw *hw, uint32_t led_idx)
4356 if (hw->phy.id == 0)
4357 ixgbe_identify_phy(hw);
4360 hw->phy.ops.read_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
4363 hw->phy.ops.write_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
4367 return ixgbe_led_off_generic(hw, led_idx);