Lines Matching full:hw
48 static s32 ixgbe_poll_flash_update_done_X540(struct ixgbe_hw *hw);
49 static s32 ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw);
50 static void ixgbe_release_swfw_sync_semaphore(struct ixgbe_hw *hw);
54 * @hw: pointer to hardware structure
59 s32 ixgbe_init_ops_X540(struct ixgbe_hw *hw) in ixgbe_init_ops_X540() argument
61 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_init_ops_X540()
62 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_init_ops_X540()
63 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_ops_X540()
69 ret_val = ixgbe_init_phy_ops_generic(hw); in ixgbe_init_ops_X540()
70 ret_val = ixgbe_init_ops_generic(hw); in ixgbe_init_ops_X540()
139 mac->max_msix_vectors = ixgbe_get_pcie_msix_count_generic(hw); in ixgbe_init_ops_X540()
146 mac->arc_subsystem_valid = !!(IXGBE_READ_REG(hw, IXGBE_FWSM_BY_MAC(hw)) in ixgbe_init_ops_X540()
150 hw->mbx.ops[i].init_params = ixgbe_init_mbx_params_pf; in ixgbe_init_ops_X540()
166 * @hw: pointer to hardware structure
172 s32 ixgbe_get_link_capabilities_X540(struct ixgbe_hw *hw, in ixgbe_get_link_capabilities_X540() argument
176 ixgbe_get_copper_link_capabilities_generic(hw, speed, autoneg); in ixgbe_get_link_capabilities_X540()
183 * @hw: pointer to hardware structure
187 enum ixgbe_media_type ixgbe_get_media_type_X540(struct ixgbe_hw *hw) in ixgbe_get_media_type_X540() argument
189 UNREFERENCED_1PARAMETER(hw); in ixgbe_get_media_type_X540()
195 * @hw: pointer to hardware structure
199 s32 ixgbe_setup_mac_link_X540(struct ixgbe_hw *hw, in ixgbe_setup_mac_link_X540() argument
204 return hw->phy.ops.setup_link_speed(hw, speed, autoneg_wait_to_complete); in ixgbe_setup_mac_link_X540()
209 * @hw: pointer to hardware structure
214 s32 ixgbe_reset_hw_X540(struct ixgbe_hw *hw) in ixgbe_reset_hw_X540() argument
218 u32 swfw_mask = hw->phy.phy_semaphore_mask; in ixgbe_reset_hw_X540()
223 status = hw->mac.ops.stop_adapter(hw); in ixgbe_reset_hw_X540()
228 ixgbe_clear_tx_pending(hw); in ixgbe_reset_hw_X540()
231 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X540()
238 ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X540()
239 IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl); in ixgbe_reset_hw_X540()
240 IXGBE_WRITE_FLUSH(hw); in ixgbe_reset_hw_X540()
241 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X540()
246 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X540()
261 * for any pending HW events to complete. in ixgbe_reset_hw_X540()
263 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { in ixgbe_reset_hw_X540()
264 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_reset_hw_X540()
269 IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(0), 384 << IXGBE_RXPBSIZE_SHIFT); in ixgbe_reset_hw_X540()
272 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); in ixgbe_reset_hw_X540()
279 hw->mac.num_rar_entries = 128; in ixgbe_reset_hw_X540()
280 hw->mac.ops.init_rx_addrs(hw); in ixgbe_reset_hw_X540()
283 hw->mac.ops.get_san_mac_addr(hw, hw->mac.san_addr); in ixgbe_reset_hw_X540()
286 if (ixgbe_validate_mac_addr(hw->mac.san_addr) == 0) { in ixgbe_reset_hw_X540()
288 hw->mac.san_mac_rar_index = hw->mac.num_rar_entries - 1; in ixgbe_reset_hw_X540()
290 hw->mac.ops.set_rar(hw, hw->mac.san_mac_rar_index, in ixgbe_reset_hw_X540()
291 hw->mac.san_addr, 0, IXGBE_RAH_AV); in ixgbe_reset_hw_X540()
294 hw->mac.ops.clear_vmdq(hw, hw->mac.san_mac_rar_index, in ixgbe_reset_hw_X540()
298 hw->mac.num_rar_entries--; in ixgbe_reset_hw_X540()
302 hw->mac.ops.get_wwn_prefix(hw, &hw->mac.wwnn_prefix, in ixgbe_reset_hw_X540()
303 &hw->mac.wwpn_prefix); in ixgbe_reset_hw_X540()
311 * @hw: pointer to hardware structure
317 s32 ixgbe_start_hw_X540(struct ixgbe_hw *hw) in ixgbe_start_hw_X540() argument
323 ret_val = ixgbe_start_hw_generic(hw); in ixgbe_start_hw_X540()
327 ixgbe_start_hw_gen2(hw); in ixgbe_start_hw_X540()
335 * @hw: pointer to hardware structure
339 u64 ixgbe_get_supported_physical_layer_X540(struct ixgbe_hw *hw) in ixgbe_get_supported_physical_layer_X540() argument
346 hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_EXT_ABILITY, in ixgbe_get_supported_physical_layer_X540()
360 * @hw: pointer to hardware structure
365 s32 ixgbe_init_eeprom_params_X540(struct ixgbe_hw *hw) in ixgbe_init_eeprom_params_X540() argument
367 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_X540()
377 eec = IXGBE_READ_REG(hw, IXGBE_EEC_BY_MAC(hw)); in ixgbe_init_eeprom_params_X540()
392 * @hw: pointer to hardware structure
398 s32 ixgbe_read_eerd_X540(struct ixgbe_hw *hw, u16 offset, u16 *data) in ixgbe_read_eerd_X540() argument
403 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == in ixgbe_read_eerd_X540()
405 status = ixgbe_read_eerd_generic(hw, offset, data); in ixgbe_read_eerd_X540()
406 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_read_eerd_X540()
416 * @hw: pointer to hardware structure
423 s32 ixgbe_read_eerd_buffer_X540(struct ixgbe_hw *hw, in ixgbe_read_eerd_buffer_X540() argument
429 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == in ixgbe_read_eerd_buffer_X540()
431 status = ixgbe_read_eerd_buffer_generic(hw, offset, in ixgbe_read_eerd_buffer_X540()
433 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_read_eerd_buffer_X540()
443 * @hw: pointer to hardware structure
449 s32 ixgbe_write_eewr_X540(struct ixgbe_hw *hw, u16 offset, u16 data) in ixgbe_write_eewr_X540() argument
454 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == in ixgbe_write_eewr_X540()
456 status = ixgbe_write_eewr_generic(hw, offset, data); in ixgbe_write_eewr_X540()
457 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_eewr_X540()
467 * @hw: pointer to hardware structure
474 s32 ixgbe_write_eewr_buffer_X540(struct ixgbe_hw *hw, in ixgbe_write_eewr_buffer_X540() argument
480 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == in ixgbe_write_eewr_buffer_X540()
482 status = ixgbe_write_eewr_buffer_generic(hw, offset, in ixgbe_write_eewr_buffer_X540()
484 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_eewr_buffer_X540()
498 * @hw: pointer to hardware structure
502 s32 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw) in ixgbe_calc_eeprom_checksum_X540() argument
511 /* Do not use hw->eeprom.ops.read because we do not want to take in ixgbe_calc_eeprom_checksum_X540()
522 if (ixgbe_read_eerd_generic(hw, i, &word)) { in ixgbe_calc_eeprom_checksum_X540()
536 if (ixgbe_read_eerd_generic(hw, i, &pointer)) { in ixgbe_calc_eeprom_checksum_X540()
543 pointer >= hw->eeprom.word_size) in ixgbe_calc_eeprom_checksum_X540()
546 if (ixgbe_read_eerd_generic(hw, pointer, &length)) { in ixgbe_calc_eeprom_checksum_X540()
553 (pointer + length) >= hw->eeprom.word_size) in ixgbe_calc_eeprom_checksum_X540()
557 if (ixgbe_read_eerd_generic(hw, j, &word)) { in ixgbe_calc_eeprom_checksum_X540()
572 * @hw: pointer to hardware structure
578 s32 ixgbe_validate_eeprom_checksum_X540(struct ixgbe_hw *hw, in ixgbe_validate_eeprom_checksum_X540() argument
591 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_validate_eeprom_checksum_X540()
597 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) in ixgbe_validate_eeprom_checksum_X540()
600 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_validate_eeprom_checksum_X540()
606 /* Do not use hw->eeprom.ops.read because we do not want to take in ixgbe_validate_eeprom_checksum_X540()
609 status = ixgbe_read_eerd_generic(hw, IXGBE_EEPROM_CHECKSUM, in ixgbe_validate_eeprom_checksum_X540()
628 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_validate_eeprom_checksum_X540()
635 * @hw: pointer to hardware structure
641 s32 ixgbe_update_eeprom_checksum_X540(struct ixgbe_hw *hw) in ixgbe_update_eeprom_checksum_X540() argument
652 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_update_eeprom_checksum_X540()
658 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) in ixgbe_update_eeprom_checksum_X540()
661 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_update_eeprom_checksum_X540()
667 /* Do not use hw->eeprom.ops.write because we do not want to in ixgbe_update_eeprom_checksum_X540()
670 status = ixgbe_write_eewr_generic(hw, IXGBE_EEPROM_CHECKSUM, checksum); in ixgbe_update_eeprom_checksum_X540()
674 status = ixgbe_update_flash_X540(hw); in ixgbe_update_eeprom_checksum_X540()
677 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_update_eeprom_checksum_X540()
683 * ixgbe_update_flash_X540 - Instruct HW to copy EEPROM to Flash device
684 * @hw: pointer to hardware structure
689 s32 ixgbe_update_flash_X540(struct ixgbe_hw *hw) in ixgbe_update_flash_X540() argument
696 status = ixgbe_poll_flash_update_done_X540(hw); in ixgbe_update_flash_X540()
702 flup = IXGBE_READ_REG(hw, IXGBE_EEC_BY_MAC(hw)) | IXGBE_EEC_FLUP; in ixgbe_update_flash_X540()
703 IXGBE_WRITE_REG(hw, IXGBE_EEC_BY_MAC(hw), flup); in ixgbe_update_flash_X540()
705 status = ixgbe_poll_flash_update_done_X540(hw); in ixgbe_update_flash_X540()
711 if (hw->mac.type == ixgbe_mac_X540 && hw->revision_id == 0) { in ixgbe_update_flash_X540()
712 flup = IXGBE_READ_REG(hw, IXGBE_EEC_BY_MAC(hw)); in ixgbe_update_flash_X540()
716 IXGBE_WRITE_REG(hw, IXGBE_EEC_BY_MAC(hw), flup); in ixgbe_update_flash_X540()
719 status = ixgbe_poll_flash_update_done_X540(hw); in ixgbe_update_flash_X540()
731 * @hw: pointer to hardware structure
736 static s32 ixgbe_poll_flash_update_done_X540(struct ixgbe_hw *hw) in ixgbe_poll_flash_update_done_X540() argument
745 reg = IXGBE_READ_REG(hw, IXGBE_EEC_BY_MAC(hw)); in ixgbe_poll_flash_update_done_X540()
762 * @hw: pointer to hardware structure
768 s32 ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask) in ixgbe_acquire_swfw_sync_X540() argument
789 if (hw->mac.type >= ixgbe_mac_X550) in ixgbe_acquire_swfw_sync_X540()
796 if (ixgbe_get_swfw_sync_semaphore(hw)) { in ixgbe_acquire_swfw_sync_X540()
801 swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC_BY_MAC(hw)); in ixgbe_acquire_swfw_sync_X540()
804 IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC_BY_MAC(hw), in ixgbe_acquire_swfw_sync_X540()
806 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_acquire_swfw_sync_X540()
813 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_acquire_swfw_sync_X540()
817 /* If the resource is not released by the FW/HW the SW can assume that in ixgbe_acquire_swfw_sync_X540()
818 * the FW/HW malfunctions. In that case the SW should set the SW bit(s) in ixgbe_acquire_swfw_sync_X540()
819 * of the requested resource(s) while ignoring the corresponding FW/HW in ixgbe_acquire_swfw_sync_X540()
822 if (ixgbe_get_swfw_sync_semaphore(hw)) { in ixgbe_acquire_swfw_sync_X540()
826 swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC_BY_MAC(hw)); in ixgbe_acquire_swfw_sync_X540()
829 IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC_BY_MAC(hw), swfw_sync); in ixgbe_acquire_swfw_sync_X540()
830 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_acquire_swfw_sync_X540()
846 ixgbe_release_swfw_sync_X540(hw, rmask); in ixgbe_acquire_swfw_sync_X540()
847 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_acquire_swfw_sync_X540()
851 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_acquire_swfw_sync_X540()
859 * @hw: pointer to hardware structure
865 void ixgbe_release_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask) in ixgbe_release_swfw_sync_X540() argument
874 ixgbe_get_swfw_sync_semaphore(hw); in ixgbe_release_swfw_sync_X540()
876 swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC_BY_MAC(hw)); in ixgbe_release_swfw_sync_X540()
878 IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC_BY_MAC(hw), swfw_sync); in ixgbe_release_swfw_sync_X540()
880 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_release_swfw_sync_X540()
886 * @hw: pointer to hardware structure
890 static s32 ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw) in ixgbe_get_swfw_sync_semaphore() argument
905 swsm = IXGBE_READ_REG(hw, IXGBE_SWSM_BY_MAC(hw)); in ixgbe_get_swfw_sync_semaphore()
916 swsm = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC_BY_MAC(hw)); in ixgbe_get_swfw_sync_semaphore()
930 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_get_swfw_sync_semaphore()
944 * @hw: pointer to hardware structure
948 static void ixgbe_release_swfw_sync_semaphore(struct ixgbe_hw *hw) in ixgbe_release_swfw_sync_semaphore() argument
956 swsm = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC_BY_MAC(hw)); in ixgbe_release_swfw_sync_semaphore()
958 IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC_BY_MAC(hw), swsm); in ixgbe_release_swfw_sync_semaphore()
960 swsm = IXGBE_READ_REG(hw, IXGBE_SWSM_BY_MAC(hw)); in ixgbe_release_swfw_sync_semaphore()
962 IXGBE_WRITE_REG(hw, IXGBE_SWSM_BY_MAC(hw), swsm); in ixgbe_release_swfw_sync_semaphore()
964 IXGBE_WRITE_FLUSH(hw); in ixgbe_release_swfw_sync_semaphore()
969 * @hw: pointer to hardware structure
974 void ixgbe_init_swfw_sync_X540(struct ixgbe_hw *hw) in ixgbe_init_swfw_sync_X540() argument
984 ixgbe_get_swfw_sync_semaphore(hw); in ixgbe_init_swfw_sync_X540()
985 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_init_swfw_sync_X540()
993 ixgbe_acquire_swfw_sync_X540(hw, rmask); in ixgbe_init_swfw_sync_X540()
994 ixgbe_release_swfw_sync_X540(hw, rmask); in ixgbe_init_swfw_sync_X540()
999 * @hw: pointer to hardware structure
1005 s32 ixgbe_blink_led_start_X540(struct ixgbe_hw *hw, u32 index) in ixgbe_blink_led_start_X540() argument
1022 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_blink_led_start_X540()
1024 macc_reg = IXGBE_READ_REG(hw, IXGBE_MACC); in ixgbe_blink_led_start_X540()
1026 IXGBE_WRITE_REG(hw, IXGBE_MACC, macc_reg); in ixgbe_blink_led_start_X540()
1029 ledctl_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); in ixgbe_blink_led_start_X540()
1032 IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, ledctl_reg); in ixgbe_blink_led_start_X540()
1033 IXGBE_WRITE_FLUSH(hw); in ixgbe_blink_led_start_X540()
1040 * @hw: pointer to hardware structure
1046 s32 ixgbe_blink_led_stop_X540(struct ixgbe_hw *hw, u32 index) in ixgbe_blink_led_stop_X540() argument
1057 ledctl_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); in ixgbe_blink_led_stop_X540()
1061 IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, ledctl_reg); in ixgbe_blink_led_stop_X540()
1064 macc_reg = IXGBE_READ_REG(hw, IXGBE_MACC); in ixgbe_blink_led_stop_X540()
1066 IXGBE_WRITE_REG(hw, IXGBE_MACC, macc_reg); in ixgbe_blink_led_stop_X540()
1067 IXGBE_WRITE_FLUSH(hw); in ixgbe_blink_led_stop_X540()