Lines Matching full:hw

19 static int ixgbe_update_flash_X540(struct ixgbe_hw *hw);
20 static int ixgbe_poll_flash_update_done_X540(struct ixgbe_hw *hw);
21 static int ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw);
22 static void ixgbe_release_swfw_sync_semaphore(struct ixgbe_hw *hw);
24 enum ixgbe_media_type ixgbe_get_media_type_X540(struct ixgbe_hw *hw) in ixgbe_get_media_type_X540() argument
29 int ixgbe_get_invariants_X540(struct ixgbe_hw *hw) in ixgbe_get_invariants_X540() argument
31 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_get_invariants_X540()
32 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_get_invariants_X540()
43 mac->max_msix_vectors = ixgbe_get_pcie_msix_count_generic(hw); in ixgbe_get_invariants_X540()
50 * @hw: pointer to hardware structure
54 int ixgbe_setup_mac_link_X540(struct ixgbe_hw *hw, ixgbe_link_speed speed, in ixgbe_setup_mac_link_X540() argument
57 return hw->phy.ops.setup_link_speed(hw, speed, in ixgbe_setup_mac_link_X540()
63 * @hw: pointer to hardware structure
69 int ixgbe_reset_hw_X540(struct ixgbe_hw *hw) in ixgbe_reset_hw_X540() argument
71 u32 swfw_mask = hw->phy.phy_semaphore_mask; in ixgbe_reset_hw_X540()
76 status = hw->mac.ops.stop_adapter(hw); in ixgbe_reset_hw_X540()
81 ixgbe_clear_tx_pending(hw); in ixgbe_reset_hw_X540()
84 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X540()
86 hw_dbg(hw, "semaphore failed with %d", status); in ixgbe_reset_hw_X540()
91 ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X540()
92 IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl); in ixgbe_reset_hw_X540()
93 IXGBE_WRITE_FLUSH(hw); in ixgbe_reset_hw_X540()
94 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X540()
99 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X540()
107 hw_dbg(hw, "Reset polling failed to complete.\n"); in ixgbe_reset_hw_X540()
114 * for any pending HW events to complete. in ixgbe_reset_hw_X540()
116 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { in ixgbe_reset_hw_X540()
117 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_reset_hw_X540()
122 IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(0), 384 << IXGBE_RXPBSIZE_SHIFT); in ixgbe_reset_hw_X540()
125 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); in ixgbe_reset_hw_X540()
132 hw->mac.num_rar_entries = IXGBE_X540_MAX_TX_QUEUES; in ixgbe_reset_hw_X540()
133 hw->mac.ops.init_rx_addrs(hw); in ixgbe_reset_hw_X540()
136 hw->mac.ops.get_san_mac_addr(hw, hw->mac.san_addr); in ixgbe_reset_hw_X540()
139 if (is_valid_ether_addr(hw->mac.san_addr)) { in ixgbe_reset_hw_X540()
141 hw->mac.san_mac_rar_index = hw->mac.num_rar_entries - 1; in ixgbe_reset_hw_X540()
143 hw->mac.ops.set_rar(hw, hw->mac.san_mac_rar_index, in ixgbe_reset_hw_X540()
144 hw->mac.san_addr, 0, IXGBE_RAH_AV); in ixgbe_reset_hw_X540()
147 hw->mac.ops.clear_vmdq(hw, hw->mac.san_mac_rar_index, in ixgbe_reset_hw_X540()
151 hw->mac.num_rar_entries--; in ixgbe_reset_hw_X540()
155 hw->mac.ops.get_wwn_prefix(hw, &hw->mac.wwnn_prefix, in ixgbe_reset_hw_X540()
156 &hw->mac.wwpn_prefix); in ixgbe_reset_hw_X540()
163 * @hw: pointer to hardware structure
169 int ixgbe_start_hw_X540(struct ixgbe_hw *hw) in ixgbe_start_hw_X540() argument
173 ret_val = ixgbe_start_hw_generic(hw); in ixgbe_start_hw_X540()
177 return ixgbe_start_hw_gen2(hw); in ixgbe_start_hw_X540()
182 * @hw: pointer to hardware structure
187 int ixgbe_init_eeprom_params_X540(struct ixgbe_hw *hw) in ixgbe_init_eeprom_params_X540() argument
189 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_X540()
198 eec = IXGBE_READ_REG(hw, IXGBE_EEC(hw)); in ixgbe_init_eeprom_params_X540()
203 hw_dbg(hw, "Eeprom params: type = %d, size = %d\n", in ixgbe_init_eeprom_params_X540()
212 * @hw: pointer to hardware structure
218 static int ixgbe_read_eerd_X540(struct ixgbe_hw *hw, u16 offset, u16 *data) in ixgbe_read_eerd_X540() argument
222 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) in ixgbe_read_eerd_X540()
225 status = ixgbe_read_eerd_generic(hw, offset, data); in ixgbe_read_eerd_X540()
227 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_read_eerd_X540()
233 * @hw: pointer to hardware structure
240 static int ixgbe_read_eerd_buffer_X540(struct ixgbe_hw *hw, in ixgbe_read_eerd_buffer_X540() argument
245 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) in ixgbe_read_eerd_buffer_X540()
248 status = ixgbe_read_eerd_buffer_generic(hw, offset, words, data); in ixgbe_read_eerd_buffer_X540()
250 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_read_eerd_buffer_X540()
256 * @hw: pointer to hardware structure
262 static int ixgbe_write_eewr_X540(struct ixgbe_hw *hw, u16 offset, u16 data) in ixgbe_write_eewr_X540() argument
266 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) in ixgbe_write_eewr_X540()
269 status = ixgbe_write_eewr_generic(hw, offset, data); in ixgbe_write_eewr_X540()
271 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_eewr_X540()
277 * @hw: pointer to hardware structure
284 static int ixgbe_write_eewr_buffer_X540(struct ixgbe_hw *hw, in ixgbe_write_eewr_buffer_X540() argument
289 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) in ixgbe_write_eewr_buffer_X540()
292 status = ixgbe_write_eewr_buffer_generic(hw, offset, words, data); in ixgbe_write_eewr_buffer_X540()
294 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_eewr_buffer_X540()
304 * @hw: pointer to hardware structure
306 static int ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw) in ixgbe_calc_eeprom_checksum_X540() argument
318 * Do not use hw->eeprom.ops.read because we do not want to take in ixgbe_calc_eeprom_checksum_X540()
325 if (ixgbe_read_eerd_generic(hw, i, &word)) { in ixgbe_calc_eeprom_checksum_X540()
326 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_X540()
340 if (ixgbe_read_eerd_generic(hw, i, &pointer)) { in ixgbe_calc_eeprom_checksum_X540()
341 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_X540()
347 pointer >= hw->eeprom.word_size) in ixgbe_calc_eeprom_checksum_X540()
350 if (ixgbe_read_eerd_generic(hw, pointer, &length)) { in ixgbe_calc_eeprom_checksum_X540()
351 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_X540()
357 (pointer + length) >= hw->eeprom.word_size) in ixgbe_calc_eeprom_checksum_X540()
361 if (ixgbe_read_eerd_generic(hw, j, &word)) { in ixgbe_calc_eeprom_checksum_X540()
362 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_X540()
376 * @hw: pointer to hardware structure
382 static int ixgbe_validate_eeprom_checksum_X540(struct ixgbe_hw *hw, in ixgbe_validate_eeprom_checksum_X540() argument
393 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_validate_eeprom_checksum_X540()
395 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_validate_eeprom_checksum_X540()
399 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) in ixgbe_validate_eeprom_checksum_X540()
402 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_validate_eeprom_checksum_X540()
408 /* Do not use hw->eeprom.ops.read because we do not want to take in ixgbe_validate_eeprom_checksum_X540()
411 status = ixgbe_read_eerd_generic(hw, IXGBE_EEPROM_CHECKSUM, in ixgbe_validate_eeprom_checksum_X540()
420 hw_dbg(hw, "Invalid EEPROM checksum"); in ixgbe_validate_eeprom_checksum_X540()
429 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_validate_eeprom_checksum_X540()
436 * @hw: pointer to hardware structure
442 static int ixgbe_update_eeprom_checksum_X540(struct ixgbe_hw *hw) in ixgbe_update_eeprom_checksum_X540() argument
451 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_update_eeprom_checksum_X540()
453 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_update_eeprom_checksum_X540()
457 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) in ixgbe_update_eeprom_checksum_X540()
460 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_update_eeprom_checksum_X540()
466 /* Do not use hw->eeprom.ops.write because we do not want to in ixgbe_update_eeprom_checksum_X540()
469 status = ixgbe_write_eewr_generic(hw, IXGBE_EEPROM_CHECKSUM, checksum); in ixgbe_update_eeprom_checksum_X540()
473 status = ixgbe_update_flash_X540(hw); in ixgbe_update_eeprom_checksum_X540()
476 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_update_eeprom_checksum_X540()
481 * ixgbe_update_flash_X540 - Instruct HW to copy EEPROM to Flash device
482 * @hw: pointer to hardware structure
487 static int ixgbe_update_flash_X540(struct ixgbe_hw *hw) in ixgbe_update_flash_X540() argument
492 status = ixgbe_poll_flash_update_done_X540(hw); in ixgbe_update_flash_X540()
494 hw_dbg(hw, "Flash update time out\n"); in ixgbe_update_flash_X540()
498 flup = IXGBE_READ_REG(hw, IXGBE_EEC(hw)) | IXGBE_EEC_FLUP; in ixgbe_update_flash_X540()
499 IXGBE_WRITE_REG(hw, IXGBE_EEC(hw), flup); in ixgbe_update_flash_X540()
501 status = ixgbe_poll_flash_update_done_X540(hw); in ixgbe_update_flash_X540()
503 hw_dbg(hw, "Flash update complete\n"); in ixgbe_update_flash_X540()
505 hw_dbg(hw, "Flash update time out\n"); in ixgbe_update_flash_X540()
507 if (hw->revision_id == 0) { in ixgbe_update_flash_X540()
508 flup = IXGBE_READ_REG(hw, IXGBE_EEC(hw)); in ixgbe_update_flash_X540()
512 IXGBE_WRITE_REG(hw, IXGBE_EEC(hw), flup); in ixgbe_update_flash_X540()
515 status = ixgbe_poll_flash_update_done_X540(hw); in ixgbe_update_flash_X540()
517 hw_dbg(hw, "Flash update complete\n"); in ixgbe_update_flash_X540()
519 hw_dbg(hw, "Flash update time out\n"); in ixgbe_update_flash_X540()
527 * @hw: pointer to hardware structure
532 static int ixgbe_poll_flash_update_done_X540(struct ixgbe_hw *hw) in ixgbe_poll_flash_update_done_X540() argument
538 reg = IXGBE_READ_REG(hw, IXGBE_EEC(hw)); in ixgbe_poll_flash_update_done_X540()
548 * @hw: pointer to hardware structure
554 int ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask) in ixgbe_acquire_swfw_sync_X540() argument
577 if (ixgbe_get_swfw_sync_semaphore(hw)) in ixgbe_acquire_swfw_sync_X540()
580 swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw)); in ixgbe_acquire_swfw_sync_X540()
583 IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC(hw), swfw_sync); in ixgbe_acquire_swfw_sync_X540()
584 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_acquire_swfw_sync_X540()
592 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_acquire_swfw_sync_X540()
596 /* If the resource is not released by the FW/HW the SW can assume that in ixgbe_acquire_swfw_sync_X540()
597 * the FW/HW malfunctions. In that case the SW should set the SW bit(s) in ixgbe_acquire_swfw_sync_X540()
598 * of the requested resource(s) while ignoring the corresponding FW/HW in ixgbe_acquire_swfw_sync_X540()
601 if (ixgbe_get_swfw_sync_semaphore(hw)) in ixgbe_acquire_swfw_sync_X540()
603 swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw)); in ixgbe_acquire_swfw_sync_X540()
606 IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC(hw), swfw_sync); in ixgbe_acquire_swfw_sync_X540()
607 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_acquire_swfw_sync_X540()
623 ixgbe_release_swfw_sync_X540(hw, rmask); in ixgbe_acquire_swfw_sync_X540()
624 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_acquire_swfw_sync_X540()
627 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_acquire_swfw_sync_X540()
634 * @hw: pointer to hardware structure
640 void ixgbe_release_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask) in ixgbe_release_swfw_sync_X540() argument
647 ixgbe_get_swfw_sync_semaphore(hw); in ixgbe_release_swfw_sync_X540()
649 swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw)); in ixgbe_release_swfw_sync_X540()
651 IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC(hw), swfw_sync); in ixgbe_release_swfw_sync_X540()
653 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_release_swfw_sync_X540()
659 * @hw: pointer to hardware structure
663 static int ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw) in ixgbe_get_swfw_sync_semaphore() argument
674 swsm = IXGBE_READ_REG(hw, IXGBE_SWSM(hw)); in ixgbe_get_swfw_sync_semaphore()
681 hw_dbg(hw, in ixgbe_get_swfw_sync_semaphore()
688 swsm = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw)); in ixgbe_get_swfw_sync_semaphore()
698 hw_dbg(hw, "REGSMP Software NVM semaphore not granted\n"); in ixgbe_get_swfw_sync_semaphore()
699 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_get_swfw_sync_semaphore()
705 * @hw: pointer to hardware structure
709 static void ixgbe_release_swfw_sync_semaphore(struct ixgbe_hw *hw) in ixgbe_release_swfw_sync_semaphore() argument
715 swsm = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw)); in ixgbe_release_swfw_sync_semaphore()
717 IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC(hw), swsm); in ixgbe_release_swfw_sync_semaphore()
719 swsm = IXGBE_READ_REG(hw, IXGBE_SWSM(hw)); in ixgbe_release_swfw_sync_semaphore()
721 IXGBE_WRITE_REG(hw, IXGBE_SWSM(hw), swsm); in ixgbe_release_swfw_sync_semaphore()
723 IXGBE_WRITE_FLUSH(hw); in ixgbe_release_swfw_sync_semaphore()
728 * @hw: pointer to hardware structure
733 void ixgbe_init_swfw_sync_X540(struct ixgbe_hw *hw) in ixgbe_init_swfw_sync_X540() argument
743 ixgbe_get_swfw_sync_semaphore(hw); in ixgbe_init_swfw_sync_X540()
744 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_init_swfw_sync_X540()
751 ixgbe_acquire_swfw_sync_X540(hw, rmask); in ixgbe_init_swfw_sync_X540()
752 ixgbe_release_swfw_sync_X540(hw, rmask); in ixgbe_init_swfw_sync_X540()
757 * @hw: pointer to hardware structure
763 int ixgbe_blink_led_start_X540(struct ixgbe_hw *hw, u32 index) in ixgbe_blink_led_start_X540() argument
777 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_blink_led_start_X540()
779 macc_reg = IXGBE_READ_REG(hw, IXGBE_MACC); in ixgbe_blink_led_start_X540()
781 IXGBE_WRITE_REG(hw, IXGBE_MACC, macc_reg); in ixgbe_blink_led_start_X540()
784 ledctl_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); in ixgbe_blink_led_start_X540()
787 IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, ledctl_reg); in ixgbe_blink_led_start_X540()
788 IXGBE_WRITE_FLUSH(hw); in ixgbe_blink_led_start_X540()
795 * @hw: pointer to hardware structure
801 int ixgbe_blink_led_stop_X540(struct ixgbe_hw *hw, u32 index) in ixgbe_blink_led_stop_X540() argument
810 ledctl_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); in ixgbe_blink_led_stop_X540()
814 IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, ledctl_reg); in ixgbe_blink_led_stop_X540()
817 macc_reg = IXGBE_READ_REG(hw, IXGBE_MACC); in ixgbe_blink_led_stop_X540()
819 IXGBE_WRITE_REG(hw, IXGBE_MACC, macc_reg); in ixgbe_blink_led_stop_X540()
820 IXGBE_WRITE_FLUSH(hw); in ixgbe_blink_led_stop_X540()