Lines Matching refs:hw

42 static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed);
45 static s32 ixgbe_read_mng_if_sel_x550em(struct ixgbe_hw *hw);
49 * @hw: pointer to hardware structure
54 s32 ixgbe_init_ops_X550(struct ixgbe_hw *hw)
56 struct ixgbe_mac_info *mac = &hw->mac;
57 struct ixgbe_eeprom_info *eeprom = &hw->eeprom;
62 ret_val = ixgbe_init_ops_X540(hw);
89 switch (hw->device_id) {
91 hw->mac.ops.led_on = NULL;
92 hw->mac.ops.led_off = NULL;
96 hw->mac.ops.led_on = ixgbe_led_on_t_X550em;
97 hw->mac.ops.led_off = ixgbe_led_off_t_X550em;
107 * @hw: pointer to hardware structure
113 static s32 ixgbe_read_cs4227(struct ixgbe_hw *hw, u16 reg, u16 *value)
115 return hw->link.ops.read_link_unlocked(hw, hw->link.addr, reg, value);
120 * @hw: pointer to hardware structure
126 static s32 ixgbe_write_cs4227(struct ixgbe_hw *hw, u16 reg, u16 value)
128 return hw->link.ops.write_link_unlocked(hw, hw->link.addr, reg, value);
133 * @hw: pointer to hardware structure
139 static s32 ixgbe_read_pe(struct ixgbe_hw *hw, u8 reg, u8 *value)
143 status = ixgbe_read_i2c_byte_unlocked(hw, reg, IXGBE_PE, value);
152 * @hw: pointer to hardware structure
158 static s32 ixgbe_write_pe(struct ixgbe_hw *hw, u8 reg, u8 value)
162 status = ixgbe_write_i2c_byte_unlocked(hw, reg, IXGBE_PE, value);
171 * @hw: pointer to hardware structure
176 static s32 ixgbe_reset_cs4227(struct ixgbe_hw *hw)
184 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, &reg);
188 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg);
192 status = ixgbe_read_pe(hw, IXGBE_PE_CONFIG, &reg);
196 status = ixgbe_write_pe(hw, IXGBE_PE_CONFIG, reg);
200 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, &reg);
204 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg);
210 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, &reg);
214 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg);
221 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_EFUSE_STATUS,
234 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_EEPROM_STATUS, &value);
247 * @hw: pointer to hardware structure
249 static void ixgbe_check_cs4227(struct ixgbe_hw *hw)
252 u32 swfw_mask = hw->phy.phy_semaphore_mask;
257 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
266 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_SCRATCH, &value);
277 hw->mac.ops.release_swfw_sync(hw, swfw_mask);
283 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
292 status = ixgbe_reset_cs4227(hw);
302 ixgbe_write_cs4227(hw, IXGBE_CS4227_SCRATCH,
304 hw->mac.ops.release_swfw_sync(hw, swfw_mask);
306 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
314 status = ixgbe_write_cs4227(hw, IXGBE_CS4227_SCRATCH,
318 hw->mac.ops.release_swfw_sync(hw, swfw_mask);
319 msec_delay(hw->eeprom.semaphore_delay);
324 * @hw: pointer to hardware structure
326 static void ixgbe_setup_mux_ctl(struct ixgbe_hw *hw)
328 u32 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP);
330 if (hw->bus.lan_id) {
335 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp);
336 IXGBE_WRITE_FLUSH(hw);
341 * @hw: pointer to hardware structure
346 static s32 ixgbe_read_phy_reg_mdi_22(struct ixgbe_hw *hw, u32 reg_addr,
354 (hw->phy.addr << IXGBE_MSCA_PHY_ADDR_SHIFT) |
358 IXGBE_WRITE_REG(hw, IXGBE_MSCA, command);
367 command = IXGBE_READ_REG(hw, IXGBE_MSCA);
379 data = IXGBE_READ_REG(hw, IXGBE_MSRWD);
388 * @hw: pointer to hardware structure
393 static s32 ixgbe_write_phy_reg_mdi_22(struct ixgbe_hw *hw, u32 reg_addr,
400 IXGBE_WRITE_REG(hw, IXGBE_MSRWD, (u32)phy_data);
404 (hw->phy.addr << IXGBE_MSCA_PHY_ADDR_SHIFT) |
408 IXGBE_WRITE_REG(hw, IXGBE_MSCA, command);
417 command = IXGBE_READ_REG(hw, IXGBE_MSCA);
433 * @hw: pointer to hardware structure
437 static s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw)
439 hw->mac.ops.set_lan_id(hw);
441 ixgbe_read_mng_if_sel_x550em(hw);
443 switch (hw->device_id) {
445 return ixgbe_identify_module_generic(hw);
448 ixgbe_setup_mux_ctl(hw);
449 ixgbe_check_cs4227(hw);
453 return ixgbe_identify_module_generic(hw);
456 hw->phy.type = ixgbe_phy_x550em_kx4;
459 hw->phy.type = ixgbe_phy_x550em_xfi;
464 hw->phy.type = ixgbe_phy_x550em_kr;
468 return ixgbe_identify_phy_generic(hw);
470 hw->phy.type = ixgbe_phy_ext_1g_t;
471 hw->phy.ops.read_reg = NULL;
472 hw->phy.ops.write_reg = NULL;
476 hw->phy.type = ixgbe_phy_fw;
477 hw->phy.ops.read_reg = NULL;
478 hw->phy.ops.write_reg = NULL;
479 if (hw->bus.lan_id)
480 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM;
482 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM;
492 * @hw: pointer to hardware structure
496 s32 ixgbe_fw_phy_activity(struct ixgbe_hw *hw, u16 activity,
512 hic.cmd.port_number = hw->bus.lan_id;
517 rc = ixgbe_host_interface_command(hw, (u32 *)&hic.cmd,
550 * @hw: pointer to hardware structure
554 static s32 ixgbe_get_phy_id_fw(struct ixgbe_hw *hw)
562 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_PHY_INFO, &info);
566 hw->phy.speeds_supported = 0;
570 hw->phy.speeds_supported |= ixgbe_fw_map[i].phy_speed;
572 if (!hw->phy.autoneg_advertised)
573 hw->phy.autoneg_advertised = hw->phy.speeds_supported;
575 hw->phy.id = info[0] & FW_PHY_INFO_ID_HI_MASK;
577 hw->phy.id |= phy_id_lo & IXGBE_PHY_REVISION_MASK;
578 hw->phy.revision = phy_id_lo & ~IXGBE_PHY_REVISION_MASK;
579 if (!hw->phy.id || hw->phy.id == IXGBE_PHY_REVISION_MASK)
586 * @hw: pointer to hardware structure
590 static s32 ixgbe_identify_phy_fw(struct ixgbe_hw *hw)
592 if (hw->bus.lan_id)
593 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY1_SM;
595 hw->phy.phy_semaphore_mask = IXGBE_GSSR_PHY0_SM;
597 hw->phy.type = ixgbe_phy_fw;
598 hw->phy.ops.read_reg = NULL;
599 hw->phy.ops.write_reg = NULL;
600 return ixgbe_get_phy_id_fw(hw);
605 * @hw: pointer to hardware structure
609 s32 ixgbe_shutdown_fw_phy(struct ixgbe_hw *hw)
614 return ixgbe_fw_phy_activity(hw, FW_PHY_ACT_FORCE_LINK_DOWN, &setup);
617 static s32 ixgbe_read_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr,
620 UNREFERENCED_4PARAMETER(*hw, reg_addr, device_type, *phy_data);
624 static s32 ixgbe_write_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr,
627 UNREFERENCED_4PARAMETER(*hw, reg_addr, device_type, phy_data);
633 * @hw: pointer to the hardware structure
640 static s32 ixgbe_read_i2c_combined_generic(struct ixgbe_hw *hw, u8 addr,
643 return ixgbe_read_i2c_combined_generic_int(hw, addr, reg, val, TRUE);
648 * @hw: pointer to the hardware structure
656 ixgbe_read_i2c_combined_generic_unlocked(struct ixgbe_hw *hw, u8 addr,
659 return ixgbe_read_i2c_combined_generic_int(hw, addr, reg, val, FALSE);
664 * @hw: pointer to the hardware structure
671 static s32 ixgbe_write_i2c_combined_generic(struct ixgbe_hw *hw,
674 return ixgbe_write_i2c_combined_generic_int(hw, addr, reg, val, TRUE);
679 * @hw: pointer to the hardware structure
687 ixgbe_write_i2c_combined_generic_unlocked(struct ixgbe_hw *hw,
690 return ixgbe_write_i2c_combined_generic_int(hw, addr, reg, val, FALSE);
695 * @hw: pointer to hardware structure
700 s32 ixgbe_init_ops_X550EM(struct ixgbe_hw *hw)
702 struct ixgbe_mac_info *mac = &hw->mac;
703 struct ixgbe_eeprom_info *eeprom = &hw->eeprom;
704 struct ixgbe_phy_info *phy = &hw->phy;
710 ret_val = ixgbe_init_ops_X550(hw);
739 hw->bus.type = ixgbe_bus_type_internal;
750 if (mac->ops.get_media_type(hw) == ixgbe_media_type_copper)
757 switch (hw->device_id) {
774 if (mac->ops.get_media_type(hw) != ixgbe_media_type_copper)
793 * @hw: pointer to hardware structure
795 static s32 ixgbe_setup_fw_link(struct ixgbe_hw *hw)
801 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw))
804 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
810 switch (hw->fc.requested_mode) {
828 if (hw->phy.autoneg_advertised & ixgbe_fw_map[i].phy_speed)
833 if (hw->phy.eee_speeds_advertised)
836 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_SETUP_LINK, &setup);
846 * @hw: pointer to hardware structure
850 static s32 ixgbe_fc_autoneg_fw(struct ixgbe_hw *hw)
852 if (hw->fc.requested_mode == ixgbe_fc_default)
853 hw->fc.requested_mode = ixgbe_fc_full;
855 return ixgbe_setup_fw_link(hw);
860 * @hw: pointer to the HW structure
866 static s32 ixgbe_setup_eee_fw(struct ixgbe_hw *hw, bool enable_eee)
868 if (!!hw->phy.eee_speeds_advertised == enable_eee)
871 hw->phy.eee_speeds_advertised = hw->phy.eee_speeds_supported;
873 hw->phy.eee_speeds_advertised = 0;
874 return hw->phy.ops.setup_link(hw);
879 * @hw: pointer to hardware structure
884 s32 ixgbe_init_ops_X550EM_a(struct ixgbe_hw *hw)
886 struct ixgbe_mac_info *mac = &hw->mac;
892 ret_val = ixgbe_init_ops_X550EM(hw);
894 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII ||
895 hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII_L) {
905 switch (mac->ops.get_media_type(hw)) {
918 switch (hw->device_id) {
924 hw->phy.eee_speeds_supported = IXGBE_LINK_SPEED_100_FULL |
926 hw->phy.eee_speeds_advertised = hw->phy.eee_speeds_supported;
937 * @hw: pointer to hardware structure
942 s32 ixgbe_init_ops_X550EM_x(struct ixgbe_hw *hw)
944 struct ixgbe_mac_info *mac = &hw->mac;
945 struct ixgbe_link_info *link = &hw->link;
951 ret_val = ixgbe_init_ops_X550EM(hw);
964 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_1G_T) {
975 * @hw: pointer to hardware structure
980 s32 ixgbe_dmac_config_X550(struct ixgbe_hw *hw)
987 reg = IXGBE_READ_REG(hw, IXGBE_DMACR);
989 IXGBE_WRITE_REG(hw, IXGBE_DMACR, reg);
992 if (!hw->mac.dmac_config.watchdog_timer)
995 ixgbe_dmac_config_tcs_X550(hw);
998 reg = IXGBE_READ_REG(hw, IXGBE_DMACR);
1002 reg |= (hw->mac.dmac_config.watchdog_timer * 100) / 4096;
1006 if (hw->mac.dmac_config.fcoe_en) {
1007 high_pri_tc = 1 << hw->mac.dmac_config.fcoe_tc;
1015 IXGBE_WRITE_REG(hw, IXGBE_DMACR, reg);
1023 * @hw: pointer to hardware structure
1028 s32 ixgbe_dmac_config_tcs_X550(struct ixgbe_hw *hw)
1035 switch (hw->mac.dmac_config.link_speed) {
1048 maxframe_size_kb = ((IXGBE_READ_REG(hw, IXGBE_MAXFRS) >>
1053 reg = IXGBE_READ_REG(hw, IXGBE_DMCTH(tc));
1056 if (tc < hw->mac.dmac_config.num_tcs) {
1058 rx_pb_size = IXGBE_READ_REG(hw, IXGBE_RXPBSIZE(tc));
1072 IXGBE_WRITE_REG(hw, IXGBE_DMCTH(tc), reg);
1079 * @hw: pointer to hardware structure
1083 s32 ixgbe_dmac_update_tcs_X550(struct ixgbe_hw *hw)
1090 reg = IXGBE_READ_REG(hw, IXGBE_DMACR);
1092 IXGBE_WRITE_REG(hw, IXGBE_DMACR, reg);
1094 ixgbe_dmac_config_tcs_X550(hw);
1097 reg = IXGBE_READ_REG(hw, IXGBE_DMACR);
1099 IXGBE_WRITE_REG(hw, IXGBE_DMACR, reg);
1106 * @hw: pointer to hardware structure
1111 s32 ixgbe_init_eeprom_params_X550(struct ixgbe_hw *hw)
1113 struct ixgbe_eeprom_info *eeprom = &hw->eeprom;
1123 eec = IXGBE_READ_REG(hw, IXGBE_EEC);
1138 * @hw: pointer to hardware structure
1142 void ixgbe_set_source_address_pruning_X550(struct ixgbe_hw *hw, bool enable,
1151 pfflp = (u64)IXGBE_READ_REG(hw, IXGBE_PFFLPL);
1152 pfflp |= (u64)IXGBE_READ_REG(hw, IXGBE_PFFLPH) << 32;
1159 IXGBE_WRITE_REG(hw, IXGBE_PFFLPL, (u32)pfflp);
1160 IXGBE_WRITE_REG(hw, IXGBE_PFFLPH, (u32)(pfflp >> 32));
1165 * @hw: pointer to hardware structure
1170 void ixgbe_set_ethertype_anti_spoofing_X550(struct ixgbe_hw *hw,
1179 pfvfspoof = IXGBE_READ_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg));
1185 IXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg), pfvfspoof);
1190 * @hw: pointer to hardware structure
1197 static s32 ixgbe_iosf_wait(struct ixgbe_hw *hw, u32 *ctrl)
1206 command = IXGBE_READ_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL);
1224 * @hw: pointer to hardware structure
1229 s32 ixgbe_write_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr,
1236 ret = ixgbe_acquire_swfw_semaphore(hw, gssr);
1240 ret = ixgbe_iosf_wait(hw, NULL);
1248 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL, command);
1251 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_DATA, data);
1253 ret = ixgbe_iosf_wait(hw, &command);
1264 ixgbe_release_swfw_semaphore(hw, gssr);
1270 * @hw: pointer to hardware structure
1275 s32 ixgbe_read_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr,
1282 ret = ixgbe_acquire_swfw_semaphore(hw, gssr);
1286 ret = ixgbe_iosf_wait(hw, NULL);
1294 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL, command);
1296 ret = ixgbe_iosf_wait(hw, &command);
1307 *data = IXGBE_READ_REG(hw, IXGBE_SB_IOSF_INDIRECT_DATA);
1310 ixgbe_release_swfw_semaphore(hw, gssr);
1316 * @hw: Pointer to hardware structure
1319 s32 ixgbe_get_phy_token(struct ixgbe_hw *hw)
1328 token_cmd.port_number = hw->bus.lan_id;
1331 status = ixgbe_host_interface_command(hw, (u32 *)&token_cmd,
1354 * @hw: Pointer to hardware structure
1357 s32 ixgbe_put_phy_token(struct ixgbe_hw *hw)
1366 token_cmd.port_number = hw->bus.lan_id;
1369 status = ixgbe_host_interface_command(hw, (u32 *)&token_cmd,
1385 * @hw: pointer to hardware structure
1390 s32 ixgbe_write_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr,
1401 write_cmd.port_number = hw->bus.lan_id;
1406 status = ixgbe_host_interface_command(hw, (u32 *)&write_cmd,
1415 * @hw: pointer to hardware structure
1420 s32 ixgbe_read_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr,
1434 hic.cmd.port_number = hw->bus.lan_id;
1438 status = ixgbe_host_interface_command(hw, (u32 *)&hic.cmd,
1450 * @hw: pointer to hardware structure
1454 void ixgbe_disable_mdd_X550(struct ixgbe_hw *hw)
1461 reg = IXGBE_READ_REG(hw, IXGBE_DMATXCTL);
1463 IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, reg);
1466 reg = IXGBE_READ_REG(hw, IXGBE_RDRXCTL);
1468 IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, reg);
1473 * @hw: pointer to hardware structure
1477 void ixgbe_enable_mdd_X550(struct ixgbe_hw *hw)
1484 reg = IXGBE_READ_REG(hw, IXGBE_DMATXCTL);
1486 IXGBE_WRITE_REG(hw, IXGBE_DMATXCTL, reg);
1489 reg = IXGBE_READ_REG(hw, IXGBE_RDRXCTL);
1491 IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, reg);
1496 * @hw: pointer to hardware structure
1501 void ixgbe_restore_mdd_vf_X550(struct ixgbe_hw *hw, u32 vf)
1508 reg = IXGBE_READ_REG(hw, IXGBE_MRQC);
1530 IXGBE_WRITE_REG(hw, IXGBE_WQBR_TX(idx), reg);
1531 IXGBE_WRITE_REG(hw, IXGBE_WQBR_RX(idx), reg);
1536 * @hw: pointer to hardware structure
1541 void ixgbe_mdd_event_X550(struct ixgbe_hw *hw, u32 *vf_bitmap)
1549 reg = IXGBE_READ_REG(hw, IXGBE_MRQC);
1565 wqbr = IXGBE_READ_REG(hw, IXGBE_WQBR_TX(i));
1566 wqbr |= IXGBE_READ_REG(hw, IXGBE_WQBR_RX(i));
1593 * @hw: pointer to hardware structure
1597 enum ixgbe_media_type ixgbe_get_media_type_X550em(struct ixgbe_hw *hw)
1604 switch (hw->device_id) {
1627 hw->phy.type = ixgbe_phy_sgmii;
1642 * @hw: pointer to hardware structure
1645 static s32 ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear)
1649 switch (hw->phy.sfp_type) {
1678 * @hw: pointer to hardware structure
1682 s32 ixgbe_identify_sfp_module_X550em(struct ixgbe_hw *hw)
1689 status = ixgbe_identify_module_generic(hw);
1695 status = ixgbe_supported_sfp_modules_X550em(hw, &linear);
1702 * @hw: pointer to hardware structure
1704 s32 ixgbe_setup_sfp_modules_X550em(struct ixgbe_hw *hw)
1712 status = ixgbe_supported_sfp_modules_X550em(hw, &linear);
1717 ixgbe_init_mac_link_ops_X550em(hw);
1718 hw->phy.ops.reset = NULL;
1726 * @hw: pointer to hardware structure
1728 static s32 ixgbe_restart_an_internal_phy_x550em(struct ixgbe_hw *hw)
1734 status = hw->mac.ops.read_iosf_sb_reg(hw,
1735 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1744 status = hw->mac.ops.write_iosf_sb_reg(hw,
1745 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1748 if (hw->mac.type == ixgbe_mac_X550EM_a) {
1752 status = hw->mac.ops.read_iosf_sb_reg(hw,
1753 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1762 status = hw->mac.ops.write_iosf_sb_reg(hw,
1763 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1772 * @hw: pointer to hardware structure
1774 static s32 ixgbe_setup_sgmii(struct ixgbe_hw *hw, ixgbe_link_speed speed,
1777 struct ixgbe_mac_info *mac = &hw->mac;
1781 rc = mac->ops.read_iosf_sb_reg(hw,
1782 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1792 rc = mac->ops.write_iosf_sb_reg(hw,
1793 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1798 rc = mac->ops.read_iosf_sb_reg(hw,
1799 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id),
1806 rc = mac->ops.write_iosf_sb_reg(hw,
1807 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id),
1812 rc = mac->ops.read_iosf_sb_reg(hw,
1813 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1824 rc = mac->ops.write_iosf_sb_reg(hw,
1825 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1830 rc = ixgbe_restart_an_internal_phy_x550em(hw);
1834 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait);
1839 * @hw: pointer to hardware structure
1841 static s32 ixgbe_setup_sgmii_fw(struct ixgbe_hw *hw, ixgbe_link_speed speed,
1844 struct ixgbe_mac_info *mac = &hw->mac;
1848 rc = mac->ops.read_iosf_sb_reg(hw,
1849 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1859 rc = mac->ops.write_iosf_sb_reg(hw,
1860 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1865 rc = mac->ops.read_iosf_sb_reg(hw,
1866 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id),
1873 rc = mac->ops.write_iosf_sb_reg(hw,
1874 IXGBE_KRM_SGMII_CTRL(hw->bus.lan_id),
1879 rc = mac->ops.write_iosf_sb_reg(hw,
1880 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
1885 rc = mac->ops.read_iosf_sb_reg(hw,
1886 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1897 rc = mac->ops.write_iosf_sb_reg(hw,
1898 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
1903 rc = ixgbe_restart_an_internal_phy_x550em(hw);
1905 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait);
1910 * @hw: pointer to hardware structure
1912 void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw)
1914 struct ixgbe_mac_info *mac = &hw->mac;
1918 switch (hw->mac.ops.get_media_type(hw)) {
1930 if ((hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP_N) ||
1931 (hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP))
1939 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_1G_T)
1941 if (hw->mac.type == ixgbe_mac_X550EM_a) {
1942 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T ||
1943 hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T_L) {
1957 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII ||
1958 hw->device_id == IXGBE_DEV_ID_X550EM_A_SGMII_L)
1968 * @hw: pointer to hardware structure
1972 s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw,
1979 if (hw->phy.type == ixgbe_phy_fw) {
1981 *speed = hw->phy.speeds_supported;
1986 if (hw->phy.media_type == ixgbe_media_type_fiber) {
1992 if (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
1993 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1
1994 || hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core0 ||
1995 hw->phy.sfp_type == ixgbe_sfp_type_1g_lx_core1) {
2001 if (hw->phy.multispeed_fiber)
2007 switch (hw->phy.type) {
2013 if (hw->mac.type == ixgbe_mac_X550EM_a) {
2015 if (hw->phy.nw_mng_if_sel &
2019 } else if (hw->device_id ==
2039 * @hw: pointer to hardware structure
2049 static s32 ixgbe_get_lasi_ext_t_x550em(struct ixgbe_hw *hw, bool *lsc)
2057 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG,
2066 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_FLAG,
2076 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_ALARM_1,
2086 ixgbe_set_copper_phy_power(hw, FALSE);
2090 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_FAULT_MSG,
2100 ixgbe_set_copper_phy_power(hw, FALSE);
2106 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG,
2114 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM2,
2129 * @hw: pointer to hardware structure
2136 static s32 ixgbe_enable_lasi_ext_t_x550em(struct ixgbe_hw *hw)
2143 status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc);
2155 if (hw->mac.type != ixgbe_mac_X550EM_a) {
2156 status = hw->phy.ops.read_reg(hw,
2165 status = hw->phy.ops.write_reg(hw,
2174 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK,
2184 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK,
2192 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK,
2202 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK,
2210 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK,
2219 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK,
2228 * @hw: pointer to hardware structure
2233 static s32 ixgbe_setup_kr_speed_x550em(struct ixgbe_hw *hw,
2239 status = hw->mac.ops.read_iosf_sb_reg(hw,
2240 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
2257 status = hw->mac.ops.write_iosf_sb_reg(hw,
2258 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
2261 if (hw->mac.type == ixgbe_mac_X550EM_a) {
2263 status = hw->mac.ops.read_iosf_sb_reg(hw,
2264 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2276 status = hw->mac.ops.write_iosf_sb_reg(hw,
2277 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2281 return ixgbe_restart_an_internal_phy_x550em(hw);
2286 * @hw: pointer to hardware structure
2288 static s32 ixgbe_reset_phy_fw(struct ixgbe_hw *hw)
2293 if (hw->phy.reset_disable || ixgbe_check_reset_blocked(hw))
2296 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_PHY_SW_RESET, &store);
2301 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_INIT_PHY, &store);
2305 return ixgbe_setup_fw_link(hw);
2310 * @hw: pointer to hardware structure
2312 static s32 ixgbe_check_overtemp_fw(struct ixgbe_hw *hw)
2317 rc = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &store);
2322 ixgbe_shutdown_fw_phy(hw);
2330 * @hw: pointer to hardware structure
2335 static s32 ixgbe_read_mng_if_sel_x550em(struct ixgbe_hw *hw)
2340 hw->phy.nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL);
2345 if (hw->mac.type == ixgbe_mac_X550EM_a &&
2346 hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_MDIO_ACT) {
2347 hw->phy.addr = (hw->phy.nw_mng_if_sel &
2357 * @hw: pointer to hardware structure
2363 s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
2365 struct ixgbe_phy_info *phy = &hw->phy;
2370 hw->mac.ops.set_lan_id(hw);
2371 ixgbe_read_mng_if_sel_x550em(hw);
2373 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) {
2375 ixgbe_setup_mux_ctl(hw);
2379 switch (hw->device_id) {
2384 hw->phy.ops.read_reg = ixgbe_read_phy_reg_x550a;
2385 hw->phy.ops.write_reg = ixgbe_write_phy_reg_x550a;
2387 if (hw->bus.lan_id)
2388 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM;
2390 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM;
2395 hw->phy.ops.read_reg = ixgbe_read_phy_reg_x550a;
2396 hw->phy.ops.write_reg = ixgbe_write_phy_reg_x550a;
2397 if (hw->bus.lan_id)
2398 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY1_SM;
2400 hw->phy.phy_semaphore_mask |= IXGBE_GSSR_PHY0_SM;
2404 hw->phy.phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM;
2411 ret_val = phy->ops.identify(hw);
2417 ixgbe_init_mac_link_ops_X550em(hw);
2422 switch (hw->phy.type) {
2452 if ((hw->mac.type == ixgbe_mac_X550EM_x) &&
2454 IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0))))
2475 * @hw: pointer to hardware structure
2477 static void ixgbe_set_mdio_speed(struct ixgbe_hw *hw)
2481 switch (hw->device_id) {
2489 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0);
2491 IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0);
2496 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0);
2498 IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0);
2507 * @hw: pointer to hardware structure
2513 s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
2520 u32 swfw_mask = hw->phy.phy_semaphore_mask;
2525 status = hw->mac.ops.stop_adapter(hw);
2531 ixgbe_clear_tx_pending(hw);
2533 ixgbe_set_mdio_speed(hw);
2536 status = hw->phy.ops.init(hw);
2548 if (hw->phy.type == ixgbe_phy_x550em_ext_t) {
2549 status = ixgbe_init_ext_t_x550em(hw);
2558 if (hw->phy.sfp_setup_needed) {
2559 status = hw->mac.ops.setup_sfp(hw);
2560 hw->phy.sfp_setup_needed = FALSE;
2567 if (!hw->phy.reset_disable && hw->phy.ops.reset) {
2568 if (hw->phy.ops.reset(hw) == IXGBE_ERR_OVERTEMP)
2579 if (!hw->force_full_reset) {
2580 hw->mac.ops.check_link(hw, &link_speed, &link_up, FALSE);
2585 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask);
2591 ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL);
2592 IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl);
2593 IXGBE_WRITE_FLUSH(hw);
2594 hw->mac.ops.release_swfw_sync(hw, swfw_mask);
2599 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL);
2615 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) {
2616 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED;
2621 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr);
2627 hw->mac.num_rar_entries = 128;
2628 hw->mac.ops.init_rx_addrs(hw);
2630 ixgbe_set_mdio_speed(hw);
2632 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP)
2633 ixgbe_setup_mux_ctl(hw);
2643 * @hw: pointer to hardware structure
2645 s32 ixgbe_init_ext_t_x550em(struct ixgbe_hw *hw)
2650 status = hw->phy.ops.read_reg(hw,
2662 status = hw->phy.ops.read_reg(hw,
2672 status = hw->phy.ops.write_reg(hw,
2686 * @hw: pointer to hardware structure
2688 s32 ixgbe_setup_kr_x550em(struct ixgbe_hw *hw)
2691 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL)
2694 if (ixgbe_check_reset_blocked(hw))
2697 return ixgbe_setup_kr_speed_x550em(hw, hw->phy.autoneg_advertised);
2702 * @hw: pointer to hardware structure
2706 s32 ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw,
2716 ret_val = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear);
2729 ixgbe_setup_kr_speed_x550em(hw, speed);
2733 (hw->bus.lan_id << 12);
2738 ret_val = hw->link.ops.write_link(hw, hw->link.addr, reg_slice,
2745 * @hw: pointer to hardware structure
2751 static s32 ixgbe_setup_sfi_x550a(struct ixgbe_hw *hw, ixgbe_link_speed *speed)
2753 struct ixgbe_mac_info *mac = &hw->mac;
2758 status = mac->ops.read_iosf_sb_reg(hw,
2759 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2782 status = mac->ops.write_iosf_sb_reg(hw,
2783 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2787 status = ixgbe_restart_an_internal_phy_x550em(hw);
2794 * @hw: pointer to hardware structure
2798 s32 ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw,
2810 ret_val = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear);
2821 if (hw->device_id == IXGBE_DEV_ID_X550EM_A_SFP_N) {
2823 ret_val = hw->mac.ops.read_iosf_sb_reg(hw,
2824 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2834 ret_val = hw->mac.ops.write_iosf_sb_reg(hw,
2835 IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
2842 ret_val = ixgbe_setup_sfi_x550a(hw, &speed);
2845 ixgbe_setup_kr_speed_x550em(hw, speed);
2847 if (hw->phy.addr == 0x0 || hw->phy.addr == 0xFFFF) {
2854 ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_EFUSE_PDF_SKU,
2864 slice_offset = (hw->bus.lan_id +
2865 (hw->bus.instance_id << 1)) << 12;
2867 slice_offset = hw->bus.lan_id << 12;
2872 ret_val = hw->phy.ops.read_reg(hw, reg_slice,
2885 ret_val = hw->phy.ops.write_reg(hw, reg_slice,
2889 ret_val = hw->phy.ops.read_reg(hw, reg_slice,
2897 * @hw: pointer to hardware structure
2901 static s32 ixgbe_setup_ixfi_x550em_x(struct ixgbe_hw *hw)
2903 struct ixgbe_mac_info *mac = &hw->mac;
2908 status = mac->ops.read_iosf_sb_reg(hw,
2909 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id),
2914 status = mac->ops.write_iosf_sb_reg(hw,
2915 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id),
2921 status = mac->ops.read_iosf_sb_reg(hw,
2922 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id),
2929 status = mac->ops.write_iosf_sb_reg(hw,
2930 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id),
2934 status = mac->ops.read_iosf_sb_reg(hw,
2935 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id),
2942 status = mac->ops.write_iosf_sb_reg(hw,
2943 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id),
2949 status = mac->ops.read_iosf_sb_reg(hw,
2950 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id),
2958 status = mac->ops.write_iosf_sb_reg(hw,
2959 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id),
2966 * @hw: pointer to hardware structure
2972 static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed)
2974 struct ixgbe_mac_info *mac = &hw->mac;
2983 status = mac->ops.read_iosf_sb_reg(hw,
2984 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
3005 status = mac->ops.write_iosf_sb_reg(hw,
3006 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
3012 if (hw->mac.type == ixgbe_mac_X550EM_x) {
3013 status = ixgbe_setup_ixfi_x550em_x(hw);
3019 status = ixgbe_restart_an_internal_phy_x550em(hw);
3026 * @hw: address of hardware structure
3031 static s32 ixgbe_ext_phy_t_x550em_get_link(struct ixgbe_hw *hw, bool *link_up)
3039 ret = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
3045 ret = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
3058 * @hw: point to hardware structure
3068 s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw)
3075 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
3078 if (hw->mac.type == ixgbe_mac_X550EM_x &&
3079 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) {
3081 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up);
3088 status = hw->phy.ops.read_reg(hw,
3096 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up);
3117 return ixgbe_setup_ixfi_x550em(hw, &force_speed);
3121 return ixgbe_setup_kr_speed_x550em(hw, speed);
3127 * @hw: pointer to hardware structure
3131 s32 ixgbe_setup_phy_loopback_x550em(struct ixgbe_hw *hw)
3137 status = hw->mac.ops.read_iosf_sb_reg(hw,
3138 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
3145 status = hw->mac.ops.write_iosf_sb_reg(hw,
3146 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
3152 status = hw->mac.ops.read_iosf_sb_reg(hw,
3153 IXGBE_KRM_PORT_CAR_GEN_CTRL(hw->bus.lan_id),
3159 status = hw->mac.ops.write_iosf_sb_reg(hw,
3160 IXGBE_KRM_PORT_CAR_GEN_CTRL(hw->bus.lan_id),
3166 status = hw->mac.ops.read_iosf_sb_reg(hw,
3167 IXGBE_KRM_PMD_DFX_BURNIN(hw->bus.lan_id),
3172 status = hw->mac.ops.write_iosf_sb_reg(hw,
3173 IXGBE_KRM_PMD_DFX_BURNIN(hw->bus.lan_id),
3179 status = hw->mac.ops.read_iosf_sb_reg(hw,
3180 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id),
3185 status = hw->mac.ops.write_iosf_sb_reg(hw,
3186 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id),
3195 * @hw: pointer to hardware structure
3201 s32 ixgbe_read_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 *data)
3218 status = hw->mac.ops.acquire_swfw_sync(hw, mask);
3222 status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer),
3225 *data = (u16)IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG,
3229 hw->mac.ops.release_swfw_sync(hw, mask);
3235 * @hw: pointer to hardware structure
3242 s32 ixgbe_read_ee_hostif_buffer_X550(struct ixgbe_hw *hw,
3255 status = hw->mac.ops.acquire_swfw_sync(hw, mask);
3276 status = ixgbe_hic_unlocked(hw, (u32 *)&buffer, sizeof(buffer),
3287 u32 value = IXGBE_READ_REG(hw, reg);
3302 hw->mac.ops.release_swfw_sync(hw, mask);
3308 * @hw: pointer to hardware structure
3314 s32 ixgbe_write_ee_hostif_data_X550(struct ixgbe_hw *hw, u16 offset,
3332 status = ixgbe_host_interface_command(hw, (u32 *)&buffer,
3341 * @hw: pointer to hardware structure
3347 s32 ixgbe_write_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset,
3354 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) ==
3356 status = ixgbe_write_ee_hostif_data_X550(hw, offset, data);
3357 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM);
3368 * @hw: pointer to hardware structure
3375 s32 ixgbe_write_ee_hostif_buffer_X550(struct ixgbe_hw *hw,
3384 status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM);
3391 status = ixgbe_write_ee_hostif_data_X550(hw, offset + i,
3400 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM);
3408 * @hw: pointer to hardware structure
3415 static s32 ixgbe_checksum_ptr_x550(struct ixgbe_hw *hw, u16 ptr,
3428 status = ixgbe_read_ee_hostif_buffer_X550(hw, ptr, bufsz, buf);
3449 (ptr + length) >= hw->eeprom.word_size)
3464 status = ixgbe_read_ee_hostif_buffer_X550(hw, ptr,
3478 * @hw: pointer to hardware structure
3484 s32 ixgbe_calc_checksum_X550(struct ixgbe_hw *hw, u16 *buffer, u32 buffer_size)
3494 hw->eeprom.ops.init_params(hw);
3498 status = ixgbe_read_ee_hostif_buffer_X550(hw, 0,
3532 pointer >= hw->eeprom.word_size)
3548 status = ixgbe_checksum_ptr_x550(hw, pointer, size, &checksum,
3561 * @hw: pointer to hardware structure
3565 s32 ixgbe_calc_eeprom_checksum_X550(struct ixgbe_hw *hw)
3567 return ixgbe_calc_checksum_X550(hw, NULL, 0);
3572 * @hw: pointer to hardware structure
3578 s32 ixgbe_validate_eeprom_checksum_X550(struct ixgbe_hw *hw, u16 *checksum_val)
3590 status = hw->eeprom.ops.read(hw, 0, &checksum);
3596 status = hw->eeprom.ops.calc_checksum(hw);
3602 status = ixgbe_read_ee_hostif_X550(hw, IXGBE_EEPROM_CHECKSUM,
3625 * @hw: pointer to hardware structure
3631 s32 ixgbe_update_eeprom_checksum_X550(struct ixgbe_hw *hw)
3642 status = ixgbe_read_ee_hostif_X550(hw, 0, &checksum);
3648 status = ixgbe_calc_eeprom_checksum_X550(hw);
3654 status = ixgbe_write_ee_hostif_X550(hw, IXGBE_EEPROM_CHECKSUM,
3659 status = ixgbe_update_flash_X550(hw);
3666 * @hw: pointer to hardware structure
3670 s32 ixgbe_update_flash_X550(struct ixgbe_hw *hw)
3682 status = ixgbe_host_interface_command(hw, (u32 *)&buffer,
3691 * @hw: pointer to hardware structure
3695 u64 ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw)
3702 hw->phy.ops.identify(hw);
3704 switch (hw->phy.type) {
3706 if (hw->mac.type == ixgbe_mac_X550EM_a) {
3707 if (hw->phy.nw_mng_if_sel &
3712 } else if (hw->device_id ==
3729 hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_EXT_ABILITY,
3738 if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_1GB_FULL)
3740 if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_100_FULL)
3742 if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_10_FULL)
3755 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber)
3756 physical_layer = ixgbe_get_supported_phy_sfp_layer_generic(hw);
3763 * @hw: pointer to hardware structure
3768 s32 ixgbe_get_bus_info_X550em(struct ixgbe_hw *hw)
3773 hw->bus.width = ixgbe_bus_width_unknown;
3774 hw->bus.speed = ixgbe_bus_speed_unknown;
3776 hw->mac.ops.set_lan_id(hw);
3786 void ixgbe_disable_rx_x550(struct ixgbe_hw *hw)
3794 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL);
3796 pfdtxgswc = IXGBE_READ_REG(hw, IXGBE_PFDTXGSWC);
3799 IXGBE_WRITE_REG(hw, IXGBE_PFDTXGSWC, pfdtxgswc);
3800 hw->mac.set_lben = TRUE;
3802 hw->mac.set_lben = FALSE;
3808 fw_cmd.port_number = (u8)hw->bus.lan_id;
3810 status = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd,
3816 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL);
3819 IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, rxctrl);
3827 * @hw: pointer to hardware structure
3833 s32 ixgbe_enter_lplu_t_x550em(struct ixgbe_hw *hw)
3842 if ((hw->mac.type == ixgbe_mac_X550EM_x) &&
3844 IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0))))
3848 if (ixgbe_check_reset_blocked(hw))
3851 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up);
3855 status = ixgbe_read_eeprom(hw, NVM_INIT_CTRL_3, &hw->eeprom.ctrl_word_3);
3863 if (!link_up || !(hw->eeprom.ctrl_word_3 & NVM_INIT_CTRL_3_LPLU) ||
3864 !(hw->wol_enabled || ixgbe_mng_present(hw)))
3865 return ixgbe_set_copper_phy_power(hw, FALSE);
3868 status = ixgbe_get_lcd_t_x550em(hw, &lcd_speed);
3875 return ixgbe_set_copper_phy_power(hw, FALSE);
3877 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT,
3885 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up);
3887 return ixgbe_set_copper_phy_power(hw, FALSE);
3900 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM,
3907 status = hw->phy.ops.read_reg(hw, IXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG,
3914 status = hw->phy.ops.read_reg(hw,
3922 save_autoneg = hw->phy.autoneg_advertised;
3925 status = hw->mac.ops.setup_link(hw, lcd_speed, FALSE);
3928 hw->phy.autoneg_advertised = save_autoneg;
3935 * @hw: pointer to hardware structure
3940 s32 ixgbe_get_lcd_t_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *lcd_speed)
3944 u16 word = hw->eeprom.ctrl_word_3;
3948 status = hw->phy.ops.read_reg(hw, IXGBE_AUTO_NEG_LP_STATUS,
3962 if ((hw->bus.lan_id && (word & NVM_INIT_CTRL_3_D10GMP_PORT1)) ||
3973 * @hw: pointer to hardware structure
3977 s32 ixgbe_setup_fc_X550em(struct ixgbe_hw *hw)
3985 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
3995 if (hw->fc.requested_mode == ixgbe_fc_default)
3996 hw->fc.requested_mode = ixgbe_fc_full;
3999 switch (hw->fc.requested_mode) {
4028 switch (hw->device_id) {
4032 ret_val = hw->mac.ops.read_iosf_sb_reg(hw,
4033 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
4043 ret_val = hw->mac.ops.write_iosf_sb_reg(hw,
4044 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
4048 hw->fc.disable_fc_autoneg = TRUE;
4051 hw->fc.disable_fc_autoneg = TRUE;
4063 * @hw: pointer to hardware structure
4067 void ixgbe_fc_autoneg_backplane_x550em_a(struct ixgbe_hw *hw)
4079 if (hw->fc.disable_fc_autoneg) {
4085 hw->mac.ops.check_link(hw, &speed, &link_up, FALSE);
4092 status = hw->mac.ops.read_iosf_sb_reg(hw,
4093 IXGBE_KRM_LINK_S1(hw->bus.lan_id),
4106 status = hw->mac.ops.read_iosf_sb_reg(hw,
4107 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
4115 status = hw->mac.ops.read_iosf_sb_reg(hw,
4116 IXGBE_KRM_LP_BASE_PAGE_HIGH(hw->bus.lan_id),
4124 status = ixgbe_negotiate_fc(hw, an_cntl_1, lp_an_page_low,
4132 hw->fc.fc_was_autonegged = TRUE;
4134 hw->fc.fc_was_autonegged = FALSE;
4135 hw->fc.current_mode = hw->fc.requested_mode;
4141 * @hw: pointer to hardware structure
4144 void ixgbe_fc_autoneg_fiber_x550em_a(struct ixgbe_hw *hw)
4146 hw->fc.fc_was_autonegged = FALSE;
4147 hw->fc.current_mode = hw->fc.requested_mode;
4152 * @hw: pointer to hardware structure
4156 void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw)
4168 if (hw->fc.disable_fc_autoneg) {
4174 hw->mac.ops.check_link(hw, &speed, &link_up, FALSE);
4181 status = ixgbe_fw_phy_activity(hw, FW_PHY_ACT_GET_LINK_INFO, &info);
4190 status = ixgbe_negotiate_fc(hw, info[0], info[0],
4198 hw->fc.fc_was_autonegged = TRUE;
4200 hw->fc.fc_was_autonegged = FALSE;
4201 hw->fc.current_mode = hw->fc.requested_mode;
4207 * @hw: pointer to hardware structure
4211 s32 ixgbe_setup_fc_backplane_x550em_a(struct ixgbe_hw *hw)
4219 if (hw->fc.strict_ieee && hw->fc.requested_mode == ixgbe_fc_rx_pause) {
4225 if (hw->fc.requested_mode == ixgbe_fc_default)
4226 hw->fc.requested_mode = ixgbe_fc_full;
4232 status = hw->mac.ops.read_iosf_sb_reg(hw,
4233 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
4250 switch (hw->fc.requested_mode) {
4283 status = hw->mac.ops.write_iosf_sb_reg(hw,
4284 IXGBE_KRM_AN_CNTL_1(hw->bus.lan_id),
4288 status = ixgbe_restart_an_internal_phy_x550em(hw);
4295 * @hw: pointer to hardware structure
4298 static void ixgbe_set_mux(struct ixgbe_hw *hw, u8 state)
4302 if (!hw->bus.lan_id)
4304 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP);
4309 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp);
4310 IXGBE_WRITE_FLUSH(hw);
4315 * @hw: pointer to hardware structure
4320 s32 ixgbe_acquire_swfw_sync_X550em(struct ixgbe_hw *hw, u32 mask)
4326 status = ixgbe_acquire_swfw_sync_X540(hw, mask);
4331 ixgbe_set_mux(hw, 1);
4338 * @hw: pointer to hardware structure
4343 void ixgbe_release_swfw_sync_X550em(struct ixgbe_hw *hw, u32 mask)
4348 ixgbe_set_mux(hw, 0);
4350 ixgbe_release_swfw_sync_X540(hw, mask);
4355 * @hw: pointer to hardware structure
4360 static s32 ixgbe_acquire_swfw_sync_X550a(struct ixgbe_hw *hw, u32 mask)
4371 status = ixgbe_acquire_swfw_sync_X540(hw, hmask);
4380 status = ixgbe_get_phy_token(hw);
4389 ixgbe_release_swfw_sync_X540(hw, hmask);
4399 hw->phy.id);
4405 * @hw: pointer to hardware structure
4410 static void ixgbe_release_swfw_sync_X550a(struct ixgbe_hw *hw, u32 mask)
4417 ixgbe_put_phy_token(hw);
4420 ixgbe_release_swfw_sync_X540(hw, hmask);
4425 * @hw: pointer to hardware structure
4433 s32 ixgbe_read_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr,
4437 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM;
4441 if (hw->mac.ops.acquire_swfw_sync(hw, mask))
4444 status = hw->phy.ops.read_reg_mdi(hw, reg_addr, device_type, phy_data);
4446 hw->mac.ops.release_swfw_sync(hw, mask);
4453 * @hw: pointer to hardware structure
4461 s32 ixgbe_write_phy_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr,
4465 u32 mask = hw->phy.phy_semaphore_mask | IXGBE_GSSR_TOKEN_SM;
4469 if (hw->mac.ops.acquire_swfw_sync(hw, mask) == IXGBE_SUCCESS) {
4470 status = hw->phy.ops.write_reg_mdi(hw, reg_addr, device_type,
4472 hw->mac.ops.release_swfw_sync(hw, mask);
4482 * @hw: pointer to hardware structure
4491 s32 ixgbe_handle_lasi_ext_t_x550em(struct ixgbe_hw *hw)
4496 status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc);
4502 return ixgbe_setup_internal_phy(hw);
4509 * @hw: pointer to hardware structure
4518 s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw,
4537 if (hw->mac.type == ixgbe_mac_X550EM_x &&
4538 !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) {
4539 status = ixgbe_setup_ixfi_x550em(hw, &force_speed);
4545 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait_to_complete);
4550 * @hw: pointer to hardware structure
4557 s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
4563 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
4566 status = ixgbe_check_mac_link_generic(hw, speed, link_up,
4579 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
4596 * @hw: pointer to hardware structure
4598 s32 ixgbe_reset_phy_t_X550em(struct ixgbe_hw *hw)
4602 status = ixgbe_reset_phy_generic(hw);
4608 return ixgbe_enable_lasi_ext_t_x550em(hw);
4613 * @hw: pointer to hardware structure
4616 s32 ixgbe_led_on_t_X550em(struct ixgbe_hw *hw, u32 led_idx)
4626 ixgbe_read_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
4629 ixgbe_write_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
4633 return ixgbe_led_on_generic(hw, led_idx);
4638 * @hw: pointer to hardware structure
4641 s32 ixgbe_led_off_t_X550em(struct ixgbe_hw *hw, u32 led_idx)
4651 ixgbe_read_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
4654 ixgbe_write_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
4658 return ixgbe_led_off_generic(hw, led_idx);
4663 * @hw: pointer to the HW structure
4676 s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min,
4692 fw_cmd.port_num = (u8)hw->bus.func;
4703 ret_val = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd,