Lines Matching refs:hw
29 static s32 ixgbe_get_invariants_X550_x(struct ixgbe_hw *hw) in ixgbe_get_invariants_X550_x() argument
31 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_get_invariants_X550_x()
32 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_get_invariants_X550_x()
35 ixgbe_get_invariants_X540(hw); in ixgbe_get_invariants_X550_x()
37 if (mac->ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_get_invariants_X550_x()
46 static void ixgbe_setup_mux_ctl(struct ixgbe_hw *hw) in ixgbe_setup_mux_ctl() argument
48 u32 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_setup_mux_ctl()
50 if (hw->bus.lan_id) { in ixgbe_setup_mux_ctl()
55 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); in ixgbe_setup_mux_ctl()
56 IXGBE_WRITE_FLUSH(hw); in ixgbe_setup_mux_ctl()
67 static s32 ixgbe_read_cs4227(struct ixgbe_hw *hw, u16 reg, u16 *value) in ixgbe_read_cs4227() argument
69 return hw->phy.ops.read_i2c_combined_unlocked(hw, IXGBE_CS4227, reg, in ixgbe_read_cs4227()
81 static s32 ixgbe_write_cs4227(struct ixgbe_hw *hw, u16 reg, u16 value) in ixgbe_write_cs4227() argument
83 return hw->phy.ops.write_i2c_combined_unlocked(hw, IXGBE_CS4227, reg, in ixgbe_write_cs4227()
96 static s32 ixgbe_check_cs4227_reg(struct ixgbe_hw *hw, u16 reg) in ixgbe_check_cs4227_reg() argument
103 status = ixgbe_write_cs4227(hw, reg, reg_val); in ixgbe_check_cs4227_reg()
109 ixgbe_read_cs4227(hw, reg, ®_val); in ixgbe_check_cs4227_reg()
114 hw_err(hw, "CS4227 reg 0x%04X failed diagnostic\n", reg); in ixgbe_check_cs4227_reg()
129 static s32 ixgbe_get_cs4227_status(struct ixgbe_hw *hw) in ixgbe_get_cs4227_status() argument
135 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_SCRATCH, &value); in ixgbe_get_cs4227_status()
142 status = ixgbe_check_cs4227_reg(hw, IXGBE_CS4227_LINE_SPARE24_LSB); in ixgbe_get_cs4227_status()
146 status = ixgbe_check_cs4227_reg(hw, IXGBE_CS4227_HOST_SPARE24_LSB); in ixgbe_get_cs4227_status()
151 status = ixgbe_check_cs4227_reg(hw, IXGBE_CS4227_LINE_SPARE24_LSB + in ixgbe_get_cs4227_status()
156 return ixgbe_check_cs4227_reg(hw, IXGBE_CS4227_HOST_SPARE24_LSB + in ixgbe_get_cs4227_status()
168 static s32 ixgbe_read_pe(struct ixgbe_hw *hw, u8 reg, u8 *value) in ixgbe_read_pe() argument
172 status = ixgbe_read_i2c_byte_generic_unlocked(hw, reg, IXGBE_PE, value); in ixgbe_read_pe()
174 hw_err(hw, "port expander access failed with %d\n", status); in ixgbe_read_pe()
186 static s32 ixgbe_write_pe(struct ixgbe_hw *hw, u8 reg, u8 value) in ixgbe_write_pe() argument
190 status = ixgbe_write_i2c_byte_generic_unlocked(hw, reg, IXGBE_PE, in ixgbe_write_pe()
193 hw_err(hw, "port expander access failed with %d\n", status); in ixgbe_write_pe()
204 static s32 ixgbe_reset_cs4227(struct ixgbe_hw *hw) in ixgbe_reset_cs4227() argument
212 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, ®); in ixgbe_reset_cs4227()
216 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg); in ixgbe_reset_cs4227()
220 status = ixgbe_read_pe(hw, IXGBE_PE_CONFIG, ®); in ixgbe_reset_cs4227()
224 status = ixgbe_write_pe(hw, IXGBE_PE_CONFIG, reg); in ixgbe_reset_cs4227()
228 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, ®); in ixgbe_reset_cs4227()
232 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg); in ixgbe_reset_cs4227()
238 status = ixgbe_read_pe(hw, IXGBE_PE_OUTPUT, ®); in ixgbe_reset_cs4227()
242 status = ixgbe_write_pe(hw, IXGBE_PE_OUTPUT, reg); in ixgbe_reset_cs4227()
249 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_EFUSE_STATUS, in ixgbe_reset_cs4227()
256 hw_err(hw, "CS4227 reset did not complete\n"); in ixgbe_reset_cs4227()
260 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_EEPROM_STATUS, &value); in ixgbe_reset_cs4227()
262 hw_err(hw, "CS4227 EEPROM did not load successfully\n"); in ixgbe_reset_cs4227()
273 static void ixgbe_check_cs4227(struct ixgbe_hw *hw) in ixgbe_check_cs4227() argument
275 u32 swfw_mask = hw->phy.phy_semaphore_mask; in ixgbe_check_cs4227()
281 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
283 hw_err(hw, "semaphore failed with %d\n", status); in ixgbe_check_cs4227()
289 status = ixgbe_read_cs4227(hw, IXGBE_CS4227_SCRATCH, &value); in ixgbe_check_cs4227()
297 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
302 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
304 hw_err(hw, "semaphore failed with %d\n", status); in ixgbe_check_cs4227()
310 status = ixgbe_reset_cs4227(hw); in ixgbe_check_cs4227()
312 hw_err(hw, "CS4227 reset failed: %d", status); in ixgbe_check_cs4227()
319 ixgbe_write_cs4227(hw, IXGBE_CS4227_SCRATCH, in ixgbe_check_cs4227()
321 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
323 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
325 hw_err(hw, "semaphore failed with %d", status); in ixgbe_check_cs4227()
330 status = ixgbe_get_cs4227_status(hw); in ixgbe_check_cs4227()
332 hw_err(hw, "CS4227 status failed: %d", status); in ixgbe_check_cs4227()
337 status = ixgbe_write_cs4227(hw, IXGBE_CS4227_SCRATCH, in ixgbe_check_cs4227()
341 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_check_cs4227()
342 msleep(hw->eeprom.semaphore_delay); in ixgbe_check_cs4227()
350 static s32 ixgbe_identify_phy_x550em(struct ixgbe_hw *hw) in ixgbe_identify_phy_x550em() argument
352 switch (hw->device_id) { in ixgbe_identify_phy_x550em()
355 hw->phy.phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM; in ixgbe_identify_phy_x550em()
356 ixgbe_setup_mux_ctl(hw); in ixgbe_identify_phy_x550em()
357 ixgbe_check_cs4227(hw); in ixgbe_identify_phy_x550em()
358 return ixgbe_identify_module_generic(hw); in ixgbe_identify_phy_x550em()
360 hw->phy.type = ixgbe_phy_x550em_kx4; in ixgbe_identify_phy_x550em()
363 hw->phy.type = ixgbe_phy_x550em_kr; in ixgbe_identify_phy_x550em()
367 return ixgbe_identify_phy_generic(hw); in ixgbe_identify_phy_x550em()
374 static s32 ixgbe_read_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_phy_reg_x550em() argument
380 static s32 ixgbe_write_phy_reg_x550em(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_phy_reg_x550em() argument
392 static s32 ixgbe_init_eeprom_params_X550(struct ixgbe_hw *hw) in ixgbe_init_eeprom_params_X550() argument
394 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_X550()
402 eec = IXGBE_READ_REG(hw, IXGBE_EEC(hw)); in ixgbe_init_eeprom_params_X550()
408 hw_dbg(hw, "Eeprom params: type = %d, size = %d\n", in ixgbe_init_eeprom_params_X550()
424 static s32 ixgbe_iosf_wait(struct ixgbe_hw *hw, u32 *ctrl) in ixgbe_iosf_wait() argument
433 command = IXGBE_READ_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL); in ixgbe_iosf_wait()
441 hw_dbg(hw, "IOSF wait timed out\n"); in ixgbe_iosf_wait()
455 static s32 ixgbe_read_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_read_iosf_sb_reg_x550() argument
462 ret = hw->mac.ops.acquire_swfw_sync(hw, gssr); in ixgbe_read_iosf_sb_reg_x550()
466 ret = ixgbe_iosf_wait(hw, NULL); in ixgbe_read_iosf_sb_reg_x550()
474 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL, command); in ixgbe_read_iosf_sb_reg_x550()
476 ret = ixgbe_iosf_wait(hw, &command); in ixgbe_read_iosf_sb_reg_x550()
481 hw_dbg(hw, "Failed to read, error %x\n", error); in ixgbe_read_iosf_sb_reg_x550()
486 *data = IXGBE_READ_REG(hw, IXGBE_SB_IOSF_INDIRECT_DATA); in ixgbe_read_iosf_sb_reg_x550()
489 hw->mac.ops.release_swfw_sync(hw, gssr); in ixgbe_read_iosf_sb_reg_x550()
501 static s32 ixgbe_read_ee_hostif_data_X550(struct ixgbe_hw *hw, u16 offset, in ixgbe_read_ee_hostif_data_X550() argument
517 status = ixgbe_host_interface_command(hw, (u32 *)&buffer, in ixgbe_read_ee_hostif_data_X550()
523 *data = (u16)IXGBE_READ_REG_ARRAY(hw, IXGBE_FLEX_MNG, in ixgbe_read_ee_hostif_data_X550()
537 static s32 ixgbe_read_ee_hostif_buffer_X550(struct ixgbe_hw *hw, in ixgbe_read_ee_hostif_buffer_X550() argument
547 status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_read_ee_hostif_buffer_X550()
549 hw_dbg(hw, "EEPROM read buffer - semaphore failed\n"); in ixgbe_read_ee_hostif_buffer_X550()
568 status = ixgbe_host_interface_command(hw, (u32 *)&buffer, in ixgbe_read_ee_hostif_buffer_X550()
573 hw_dbg(hw, "Host interface command failed\n"); in ixgbe_read_ee_hostif_buffer_X550()
580 u32 value = IXGBE_READ_REG(hw, reg); in ixgbe_read_ee_hostif_buffer_X550()
595 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_read_ee_hostif_buffer_X550()
607 static s32 ixgbe_checksum_ptr_x550(struct ixgbe_hw *hw, u16 ptr, in ixgbe_checksum_ptr_x550() argument
620 status = ixgbe_read_ee_hostif_buffer_X550(hw, ptr, bufsz, buf); in ixgbe_checksum_ptr_x550()
622 hw_dbg(hw, "Failed to read EEPROM image\n"); in ixgbe_checksum_ptr_x550()
641 (ptr + length) >= hw->eeprom.word_size) in ixgbe_checksum_ptr_x550()
656 status = ixgbe_read_ee_hostif_buffer_X550(hw, ptr, in ixgbe_checksum_ptr_x550()
659 hw_dbg(hw, "Failed to read EEPROM image\n"); in ixgbe_checksum_ptr_x550()
675 static s32 ixgbe_calc_checksum_X550(struct ixgbe_hw *hw, u16 *buffer, in ixgbe_calc_checksum_X550() argument
684 hw->eeprom.ops.init_params(hw); in ixgbe_calc_checksum_X550()
688 status = ixgbe_read_ee_hostif_buffer_X550(hw, 0, in ixgbe_calc_checksum_X550()
692 hw_dbg(hw, "Failed to read EEPROM image\n"); in ixgbe_calc_checksum_X550()
720 pointer >= hw->eeprom.word_size) in ixgbe_calc_checksum_X550()
736 status = ixgbe_checksum_ptr_x550(hw, pointer, size, &checksum, in ixgbe_calc_checksum_X550()
752 static s32 ixgbe_calc_eeprom_checksum_X550(struct ixgbe_hw *hw) in ixgbe_calc_eeprom_checksum_X550() argument
754 return ixgbe_calc_checksum_X550(hw, NULL, 0); in ixgbe_calc_eeprom_checksum_X550()
764 static s32 ixgbe_read_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 *data) in ixgbe_read_ee_hostif_X550() argument
768 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == 0) { in ixgbe_read_ee_hostif_X550()
769 status = ixgbe_read_ee_hostif_data_X550(hw, offset, data); in ixgbe_read_ee_hostif_X550()
770 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_read_ee_hostif_X550()
785 static s32 ixgbe_validate_eeprom_checksum_X550(struct ixgbe_hw *hw, in ixgbe_validate_eeprom_checksum_X550() argument
796 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_validate_eeprom_checksum_X550()
798 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_validate_eeprom_checksum_X550()
802 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_validate_eeprom_checksum_X550()
808 status = ixgbe_read_ee_hostif_X550(hw, IXGBE_EEPROM_CHECKSUM, in ixgbe_validate_eeprom_checksum_X550()
818 hw_dbg(hw, "Invalid EEPROM checksum"); in ixgbe_validate_eeprom_checksum_X550()
835 static s32 ixgbe_write_ee_hostif_data_X550(struct ixgbe_hw *hw, u16 offset, in ixgbe_write_ee_hostif_data_X550() argument
851 status = ixgbe_host_interface_command(hw, (u32 *)&buffer, in ixgbe_write_ee_hostif_data_X550()
864 static s32 ixgbe_write_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset, u16 data) in ixgbe_write_ee_hostif_X550() argument
868 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == 0) { in ixgbe_write_ee_hostif_X550()
869 status = ixgbe_write_ee_hostif_data_X550(hw, offset, data); in ixgbe_write_ee_hostif_X550()
870 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_X550()
872 hw_dbg(hw, "write ee hostif failed to get semaphore"); in ixgbe_write_ee_hostif_X550()
884 static s32 ixgbe_update_flash_X550(struct ixgbe_hw *hw) in ixgbe_update_flash_X550() argument
894 status = ixgbe_host_interface_command(hw, (u32 *)&buffer, in ixgbe_update_flash_X550()
907 static s32 ixgbe_get_bus_info_X550em(struct ixgbe_hw *hw) in ixgbe_get_bus_info_X550em() argument
909 hw->bus.type = ixgbe_bus_type_internal; in ixgbe_get_bus_info_X550em()
910 hw->bus.width = ixgbe_bus_width_unknown; in ixgbe_get_bus_info_X550em()
911 hw->bus.speed = ixgbe_bus_speed_unknown; in ixgbe_get_bus_info_X550em()
913 hw->mac.ops.set_lan_id(hw); in ixgbe_get_bus_info_X550em()
922 static void ixgbe_disable_rx_x550(struct ixgbe_hw *hw) in ixgbe_disable_rx_x550() argument
928 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); in ixgbe_disable_rx_x550()
930 pfdtxgswc = IXGBE_READ_REG(hw, IXGBE_PFDTXGSWC); in ixgbe_disable_rx_x550()
933 IXGBE_WRITE_REG(hw, IXGBE_PFDTXGSWC, pfdtxgswc); in ixgbe_disable_rx_x550()
934 hw->mac.set_lben = true; in ixgbe_disable_rx_x550()
936 hw->mac.set_lben = false; in ixgbe_disable_rx_x550()
942 fw_cmd.port_number = (u8)hw->bus.lan_id; in ixgbe_disable_rx_x550()
944 status = ixgbe_host_interface_command(hw, (u32 *)&fw_cmd, in ixgbe_disable_rx_x550()
950 rxctrl = IXGBE_READ_REG(hw, IXGBE_RXCTRL); in ixgbe_disable_rx_x550()
953 IXGBE_WRITE_REG(hw, IXGBE_RXCTRL, rxctrl); in ixgbe_disable_rx_x550()
966 static s32 ixgbe_update_eeprom_checksum_X550(struct ixgbe_hw *hw) in ixgbe_update_eeprom_checksum_X550() argument
975 status = ixgbe_read_ee_hostif_X550(hw, 0, &checksum); in ixgbe_update_eeprom_checksum_X550()
977 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_update_eeprom_checksum_X550()
981 status = ixgbe_calc_eeprom_checksum_X550(hw); in ixgbe_update_eeprom_checksum_X550()
987 status = ixgbe_write_ee_hostif_X550(hw, IXGBE_EEPROM_CHECKSUM, in ixgbe_update_eeprom_checksum_X550()
992 status = ixgbe_update_flash_X550(hw); in ixgbe_update_eeprom_checksum_X550()
1006 static s32 ixgbe_write_ee_hostif_buffer_X550(struct ixgbe_hw *hw, in ixgbe_write_ee_hostif_buffer_X550() argument
1014 status = hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_buffer_X550()
1016 hw_dbg(hw, "EEPROM write buffer - semaphore failed\n"); in ixgbe_write_ee_hostif_buffer_X550()
1021 status = ixgbe_write_ee_hostif_data_X550(hw, offset + i, in ixgbe_write_ee_hostif_buffer_X550()
1024 hw_dbg(hw, "Eeprom buffered write failed\n"); in ixgbe_write_ee_hostif_buffer_X550()
1029 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_ee_hostif_buffer_X550()
1042 static s32 ixgbe_write_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr, in ixgbe_write_iosf_sb_reg_x550() argument
1049 ret = hw->mac.ops.acquire_swfw_sync(hw, gssr); in ixgbe_write_iosf_sb_reg_x550()
1053 ret = ixgbe_iosf_wait(hw, NULL); in ixgbe_write_iosf_sb_reg_x550()
1061 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_CTRL, command); in ixgbe_write_iosf_sb_reg_x550()
1064 IXGBE_WRITE_REG(hw, IXGBE_SB_IOSF_INDIRECT_DATA, data); in ixgbe_write_iosf_sb_reg_x550()
1066 ret = ixgbe_iosf_wait(hw, &command); in ixgbe_write_iosf_sb_reg_x550()
1071 hw_dbg(hw, "Failed to write, error %x\n", error); in ixgbe_write_iosf_sb_reg_x550()
1076 hw->mac.ops.release_swfw_sync(hw, gssr); in ixgbe_write_iosf_sb_reg_x550()
1087 static s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed) in ixgbe_setup_ixfi_x550em() argument
1093 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1094 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1115 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1116 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1122 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1123 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1129 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1130 IXGBE_KRM_RX_TRN_LINKUP_CTRL(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1136 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1137 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1145 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1146 IXGBE_KRM_DSP_TXFFE_STATE_4(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1151 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1152 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1160 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1161 IXGBE_KRM_DSP_TXFFE_STATE_5(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1167 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1168 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1177 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1178 IXGBE_KRM_TX_COEFF_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1184 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1185 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1191 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_ixfi_x550em()
1192 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_ixfi_x550em()
1203 static s32 ixgbe_supported_sfp_modules_X550em(struct ixgbe_hw *hw, bool *linear) in ixgbe_supported_sfp_modules_X550em() argument
1205 switch (hw->phy.sfp_type) { in ixgbe_supported_sfp_modules_X550em()
1239 ixgbe_setup_mac_link_sfp_x550em(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_sfp_x550em() argument
1248 status = ixgbe_supported_sfp_modules_X550em(hw, &setup_linear); in ixgbe_setup_mac_link_sfp_x550em()
1261 slice = IXGBE_CS4227_LINE_SPARE22_MSB + (hw->bus.lan_id << 12); in ixgbe_setup_mac_link_sfp_x550em()
1263 status = ixgbe_write_i2c_combined_generic(hw, IXGBE_CS4227, slice, in ixgbe_setup_mac_link_sfp_x550em()
1267 slice = IXGBE_CS4227_HOST_SPARE22_MSB + (hw->bus.lan_id << 12); in ixgbe_setup_mac_link_sfp_x550em()
1270 status = ixgbe_write_i2c_combined_generic(hw, IXGBE_CS4227, slice, in ixgbe_setup_mac_link_sfp_x550em()
1273 slice = IXGBE_CS4227_HOST_SPARE24_LSB + (hw->bus.lan_id << 12); in ixgbe_setup_mac_link_sfp_x550em()
1278 status = ixgbe_write_i2c_combined_generic(hw, IXGBE_CS4227, slice, in ixgbe_setup_mac_link_sfp_x550em()
1282 if (!(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) in ixgbe_setup_mac_link_sfp_x550em()
1283 status = ixgbe_setup_ixfi_x550em(hw, &speed); in ixgbe_setup_mac_link_sfp_x550em()
1299 static s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_t_X550em() argument
1315 if (!(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) { in ixgbe_setup_mac_link_t_X550em()
1316 status = ixgbe_setup_ixfi_x550em(hw, &force_speed); in ixgbe_setup_mac_link_t_X550em()
1322 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait); in ixgbe_setup_mac_link_t_X550em()
1333 static s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, in ixgbe_check_link_t_X550em() argument
1341 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_check_link_t_X550em()
1344 status = ixgbe_check_mac_link_generic(hw, speed, link_up, in ixgbe_check_link_t_X550em()
1354 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS, in ixgbe_check_link_t_X550em()
1370 static void ixgbe_init_mac_link_ops_X550em(struct ixgbe_hw *hw) in ixgbe_init_mac_link_ops_X550em() argument
1372 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_mac_link_ops_X550em()
1374 switch (mac->ops.get_media_type(hw)) { in ixgbe_init_mac_link_ops_X550em()
1399 static s32 ixgbe_setup_sfp_modules_X550em(struct ixgbe_hw *hw) in ixgbe_setup_sfp_modules_X550em() argument
1405 status = ixgbe_supported_sfp_modules_X550em(hw, &linear); in ixgbe_setup_sfp_modules_X550em()
1409 ixgbe_init_mac_link_ops_X550em(hw); in ixgbe_setup_sfp_modules_X550em()
1410 hw->phy.ops.reset = NULL; in ixgbe_setup_sfp_modules_X550em()
1420 static s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw, in ixgbe_get_link_capabilities_X550em() argument
1425 if (hw->phy.media_type == ixgbe_media_type_fiber) { in ixgbe_get_link_capabilities_X550em()
1429 if (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 || in ixgbe_get_link_capabilities_X550em()
1430 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1) { in ixgbe_get_link_capabilities_X550em()
1436 if (hw->phy.multispeed_fiber) in ixgbe_get_link_capabilities_X550em()
1461 static s32 ixgbe_get_lasi_ext_t_x550em(struct ixgbe_hw *hw, bool *lsc) in ixgbe_get_lasi_ext_t_x550em() argument
1469 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG, in ixgbe_get_lasi_ext_t_x550em()
1477 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_FLAG, in ixgbe_get_lasi_ext_t_x550em()
1486 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_ALARM_1, in ixgbe_get_lasi_ext_t_x550em()
1496 ixgbe_set_copper_phy_power(hw, false); in ixgbe_get_lasi_ext_t_x550em()
1501 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_CHIP_STD_INT_FLAG, in ixgbe_get_lasi_ext_t_x550em()
1508 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM2, in ixgbe_get_lasi_ext_t_x550em()
1530 static s32 ixgbe_enable_lasi_ext_t_x550em(struct ixgbe_hw *hw) in ixgbe_enable_lasi_ext_t_x550em() argument
1537 status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc); in ixgbe_enable_lasi_ext_t_x550em()
1540 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_PMA_TX_VEN_LASI_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
1547 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_PMA_TX_VEN_LASI_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
1553 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
1561 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK, in ixgbe_enable_lasi_ext_t_x550em()
1568 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK, in ixgbe_enable_lasi_ext_t_x550em()
1577 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_VEN_MASK, in ixgbe_enable_lasi_ext_t_x550em()
1584 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK, in ixgbe_enable_lasi_ext_t_x550em()
1592 status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_GLOBAL_INT_CHIP_STD_MASK, in ixgbe_enable_lasi_ext_t_x550em()
1610 static s32 ixgbe_handle_lasi_ext_t_x550em(struct ixgbe_hw *hw) in ixgbe_handle_lasi_ext_t_x550em() argument
1612 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_handle_lasi_ext_t_x550em()
1616 status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc); in ixgbe_handle_lasi_ext_t_x550em()
1621 return phy->ops.setup_internal_link(hw); in ixgbe_handle_lasi_ext_t_x550em()
1633 static s32 ixgbe_setup_kr_speed_x550em(struct ixgbe_hw *hw, in ixgbe_setup_kr_speed_x550em() argument
1639 status = ixgbe_read_iosf_sb_reg_x550(hw, in ixgbe_setup_kr_speed_x550em()
1640 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
1661 status = ixgbe_write_iosf_sb_reg_x550(hw, in ixgbe_setup_kr_speed_x550em()
1662 IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id), in ixgbe_setup_kr_speed_x550em()
1673 static s32 ixgbe_setup_kx4_x550em(struct ixgbe_hw *hw) in ixgbe_setup_kx4_x550em() argument
1678 status = ixgbe_read_iosf_sb_reg_x550(hw, IXGBE_KX4_LINK_CNTL_1, in ixgbe_setup_kx4_x550em()
1680 hw->bus.lan_id, ®_val); in ixgbe_setup_kx4_x550em()
1690 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL) in ixgbe_setup_kx4_x550em()
1694 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL) in ixgbe_setup_kx4_x550em()
1699 status = ixgbe_write_iosf_sb_reg_x550(hw, IXGBE_KX4_LINK_CNTL_1, in ixgbe_setup_kx4_x550em()
1701 hw->bus.lan_id, reg_val); in ixgbe_setup_kx4_x550em()
1711 static s32 ixgbe_setup_kr_x550em(struct ixgbe_hw *hw) in ixgbe_setup_kr_x550em() argument
1713 return ixgbe_setup_kr_speed_x550em(hw, hw->phy.autoneg_advertised); in ixgbe_setup_kr_x550em()
1722 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
1730 ret = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS, in ixgbe_ext_phy_t_x550em_get_link()
1736 ret = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS, in ixgbe_ext_phy_t_x550em_get_link()
1758 static s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw) in ixgbe_setup_internal_phy_t_x550em() argument
1765 if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper) in ixgbe_setup_internal_phy_t_x550em()
1769 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_setup_internal_phy_t_x550em()
1776 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT, in ixgbe_setup_internal_phy_t_x550em()
1783 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_setup_internal_phy_t_x550em()
1805 return ixgbe_setup_ixfi_x550em(hw, &force_speed); in ixgbe_setup_internal_phy_t_x550em()
1811 static s32 ixgbe_reset_phy_t_X550em(struct ixgbe_hw *hw) in ixgbe_reset_phy_t_X550em() argument
1815 status = ixgbe_reset_phy_generic(hw); in ixgbe_reset_phy_t_X550em()
1821 return ixgbe_enable_lasi_ext_t_x550em(hw); in ixgbe_reset_phy_t_X550em()
1830 static s32 ixgbe_get_lcd_t_x550em(struct ixgbe_hw *hw, in ixgbe_get_lcd_t_x550em() argument
1835 u16 word = hw->eeprom.ctrl_word_3; in ixgbe_get_lcd_t_x550em()
1839 status = hw->phy.ops.read_reg(hw, IXGBE_AUTO_NEG_LP_STATUS, in ixgbe_get_lcd_t_x550em()
1852 if ((hw->bus.lan_id && (word & NVM_INIT_CTRL_3_D10GMP_PORT1)) || in ixgbe_get_lcd_t_x550em()
1868 static s32 ixgbe_enter_lplu_t_x550em(struct ixgbe_hw *hw) in ixgbe_enter_lplu_t_x550em() argument
1877 if (IXGBE_FUSES0_REV1 & IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0))) in ixgbe_enter_lplu_t_x550em()
1881 if (ixgbe_check_reset_blocked(hw)) in ixgbe_enter_lplu_t_x550em()
1884 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_enter_lplu_t_x550em()
1888 status = hw->eeprom.ops.read(hw, NVM_INIT_CTRL_3, in ixgbe_enter_lplu_t_x550em()
1889 &hw->eeprom.ctrl_word_3); in ixgbe_enter_lplu_t_x550em()
1897 if (!link_up || !(hw->eeprom.ctrl_word_3 & NVM_INIT_CTRL_3_LPLU) || in ixgbe_enter_lplu_t_x550em()
1898 !(hw->wol_enabled || ixgbe_mng_present(hw))) in ixgbe_enter_lplu_t_x550em()
1899 return ixgbe_set_copper_phy_power(hw, false); in ixgbe_enter_lplu_t_x550em()
1902 status = ixgbe_get_lcd_t_x550em(hw, &lcd_speed); in ixgbe_enter_lplu_t_x550em()
1908 return ixgbe_set_copper_phy_power(hw, false); in ixgbe_enter_lplu_t_x550em()
1910 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_STAT, in ixgbe_enter_lplu_t_x550em()
1917 status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up); in ixgbe_enter_lplu_t_x550em()
1919 return ixgbe_set_copper_phy_power(hw, false); in ixgbe_enter_lplu_t_x550em()
1932 status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_VENDOR_TX_ALARM, in ixgbe_enter_lplu_t_x550em()
1938 status = hw->phy.ops.read_reg(hw, IXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG, in ixgbe_enter_lplu_t_x550em()
1944 status = hw->phy.ops.read_reg(hw, in ixgbe_enter_lplu_t_x550em()
1951 save_autoneg = hw->phy.autoneg_advertised; in ixgbe_enter_lplu_t_x550em()
1954 status = hw->mac.ops.setup_link(hw, lcd_speed, false); in ixgbe_enter_lplu_t_x550em()
1957 hw->phy.autoneg_advertised = save_autoneg; in ixgbe_enter_lplu_t_x550em()
1969 static s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw) in ixgbe_init_phy_ops_X550em() argument
1971 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_init_phy_ops_X550em()
1975 hw->mac.ops.set_lan_id(hw); in ixgbe_init_phy_ops_X550em()
1977 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) { in ixgbe_init_phy_ops_X550em()
1979 ixgbe_setup_mux_ctl(hw); in ixgbe_init_phy_ops_X550em()
1984 phy->nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL); in ixgbe_init_phy_ops_X550em()
1990 ret_val = ixgbe_setup_kr_speed_x550em(hw, speed); in ixgbe_init_phy_ops_X550em()
1995 ret_val = phy->ops.identify(hw); in ixgbe_init_phy_ops_X550em()
1998 ixgbe_init_mac_link_ops_X550em(hw); in ixgbe_init_phy_ops_X550em()
2003 switch (hw->phy.type) { in ixgbe_init_phy_ops_X550em()
2018 phy->nw_mng_if_sel = IXGBE_READ_REG(hw, IXGBE_NW_MNG_IF_SEL); in ixgbe_init_phy_ops_X550em()
2029 ret_val = ixgbe_setup_kr_speed_x550em(hw, speed); in ixgbe_init_phy_ops_X550em()
2033 if (!(IXGBE_FUSES0_REV1 & IXGBE_READ_REG(hw, in ixgbe_init_phy_ops_X550em()
2053 static enum ixgbe_media_type ixgbe_get_media_type_X550em(struct ixgbe_hw *hw) in ixgbe_get_media_type_X550em() argument
2058 switch (hw->device_id) { in ixgbe_get_media_type_X550em()
2080 static s32 ixgbe_init_ext_t_x550em(struct ixgbe_hw *hw) in ixgbe_init_ext_t_x550em() argument
2085 status = hw->phy.ops.read_reg(hw, in ixgbe_init_ext_t_x550em()
2096 status = hw->phy.ops.read_reg(hw, in ixgbe_init_ext_t_x550em()
2105 status = hw->phy.ops.write_reg(hw, in ixgbe_init_ext_t_x550em()
2123 static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw) in ixgbe_reset_hw_X550em() argument
2133 status = hw->mac.ops.stop_adapter(hw); in ixgbe_reset_hw_X550em()
2138 ixgbe_clear_tx_pending(hw); in ixgbe_reset_hw_X550em()
2143 status = hw->phy.ops.init(hw); in ixgbe_reset_hw_X550em()
2146 if (hw->phy.type == ixgbe_phy_x550em_ext_t) { in ixgbe_reset_hw_X550em()
2147 status = ixgbe_init_ext_t_x550em(hw); in ixgbe_reset_hw_X550em()
2153 if (hw->phy.sfp_setup_needed) { in ixgbe_reset_hw_X550em()
2154 status = hw->mac.ops.setup_sfp(hw); in ixgbe_reset_hw_X550em()
2155 hw->phy.sfp_setup_needed = false; in ixgbe_reset_hw_X550em()
2159 if (!hw->phy.reset_disable && hw->phy.ops.reset) in ixgbe_reset_hw_X550em()
2160 hw->phy.ops.reset(hw); in ixgbe_reset_hw_X550em()
2170 if (!hw->force_full_reset) { in ixgbe_reset_hw_X550em()
2171 hw->mac.ops.check_link(hw, &link_speed, &link_up, false); in ixgbe_reset_hw_X550em()
2176 ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X550em()
2177 IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl); in ixgbe_reset_hw_X550em()
2178 IXGBE_WRITE_FLUSH(hw); in ixgbe_reset_hw_X550em()
2183 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X550em()
2190 hw_dbg(hw, "Reset polling failed to complete.\n"); in ixgbe_reset_hw_X550em()
2199 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { in ixgbe_reset_hw_X550em()
2200 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_reset_hw_X550em()
2205 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); in ixgbe_reset_hw_X550em()
2211 hw->mac.num_rar_entries = 128; in ixgbe_reset_hw_X550em()
2212 hw->mac.ops.init_rx_addrs(hw); in ixgbe_reset_hw_X550em()
2214 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) { in ixgbe_reset_hw_X550em()
2215 hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0); in ixgbe_reset_hw_X550em()
2217 IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0); in ixgbe_reset_hw_X550em()
2220 if (hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP) in ixgbe_reset_hw_X550em()
2221 ixgbe_setup_mux_ctl(hw); in ixgbe_reset_hw_X550em()
2232 static void ixgbe_set_ethertype_anti_spoofing_X550(struct ixgbe_hw *hw, in ixgbe_set_ethertype_anti_spoofing_X550() argument
2239 pfvfspoof = IXGBE_READ_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg)); in ixgbe_set_ethertype_anti_spoofing_X550()
2245 IXGBE_WRITE_REG(hw, IXGBE_PFVFSPOOF(vf_target_reg), pfvfspoof); in ixgbe_set_ethertype_anti_spoofing_X550()
2253 static void ixgbe_set_source_address_pruning_X550(struct ixgbe_hw *hw, in ixgbe_set_source_address_pruning_X550() argument
2263 pfflp = (u64)IXGBE_READ_REG(hw, IXGBE_PFFLPL); in ixgbe_set_source_address_pruning_X550()
2264 pfflp |= (u64)IXGBE_READ_REG(hw, IXGBE_PFFLPH) << 32; in ixgbe_set_source_address_pruning_X550()
2271 IXGBE_WRITE_REG(hw, IXGBE_PFFLPL, (u32)pfflp); in ixgbe_set_source_address_pruning_X550()
2272 IXGBE_WRITE_REG(hw, IXGBE_PFFLPH, (u32)(pfflp >> 32)); in ixgbe_set_source_address_pruning_X550()
2280 static void ixgbe_set_mux(struct ixgbe_hw *hw, u8 state) in ixgbe_set_mux() argument
2284 if (!hw->bus.lan_id) in ixgbe_set_mux()
2286 esdp = IXGBE_READ_REG(hw, IXGBE_ESDP); in ixgbe_set_mux()
2291 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp); in ixgbe_set_mux()
2292 IXGBE_WRITE_FLUSH(hw); in ixgbe_set_mux()
2302 static s32 ixgbe_acquire_swfw_sync_X550em(struct ixgbe_hw *hw, u32 mask) in ixgbe_acquire_swfw_sync_X550em() argument
2306 status = ixgbe_acquire_swfw_sync_X540(hw, mask); in ixgbe_acquire_swfw_sync_X550em()
2311 ixgbe_set_mux(hw, 1); in ixgbe_acquire_swfw_sync_X550em()
2323 static void ixgbe_release_swfw_sync_X550em(struct ixgbe_hw *hw, u32 mask) in ixgbe_release_swfw_sync_X550em() argument
2326 ixgbe_set_mux(hw, 0); in ixgbe_release_swfw_sync_X550em()
2328 ixgbe_release_swfw_sync_X540(hw, mask); in ixgbe_release_swfw_sync_X550em()