Lines Matching full:hw
20 static int ixgbe_update_flash_X540(struct ixgbe_hw *hw);
21 static int ixgbe_poll_flash_update_done_X540(struct ixgbe_hw *hw);
22 static int ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw);
23 static void ixgbe_release_swfw_sync_semaphore(struct ixgbe_hw *hw);
25 enum ixgbe_media_type ixgbe_get_media_type_X540(struct ixgbe_hw *hw) in ixgbe_get_media_type_X540() argument
30 int ixgbe_get_invariants_X540(struct ixgbe_hw *hw) in ixgbe_get_invariants_X540() argument
32 struct ixgbe_mac_info *mac = &hw->mac; in ixgbe_get_invariants_X540()
33 struct ixgbe_phy_info *phy = &hw->phy; in ixgbe_get_invariants_X540()
44 mac->max_msix_vectors = ixgbe_get_pcie_msix_count_generic(hw); in ixgbe_get_invariants_X540()
51 * @hw: pointer to hardware structure
55 int ixgbe_setup_mac_link_X540(struct ixgbe_hw *hw, ixgbe_link_speed speed, in ixgbe_setup_mac_link_X540() argument
58 return hw->phy.ops.setup_link_speed(hw, speed, in ixgbe_setup_mac_link_X540()
64 * @hw: pointer to hardware structure
72 int ixgbe_reset_hw_X540(struct ixgbe_hw *hw) in ixgbe_reset_hw_X540() argument
74 u32 swfw_mask = hw->phy.phy_semaphore_mask; in ixgbe_reset_hw_X540()
79 status = hw->mac.ops.stop_adapter(hw); in ixgbe_reset_hw_X540()
84 ixgbe_clear_tx_pending(hw); in ixgbe_reset_hw_X540()
87 status = hw->mac.ops.acquire_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X540()
89 hw_dbg(hw, "semaphore failed with %d", status); in ixgbe_reset_hw_X540()
94 ctrl |= IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X540()
95 IXGBE_WRITE_REG(hw, IXGBE_CTRL, ctrl); in ixgbe_reset_hw_X540()
96 IXGBE_WRITE_FLUSH(hw); in ixgbe_reset_hw_X540()
97 hw->mac.ops.release_swfw_sync(hw, swfw_mask); in ixgbe_reset_hw_X540()
102 ctrl = IXGBE_READ_REG(hw, IXGBE_CTRL); in ixgbe_reset_hw_X540()
110 hw_dbg(hw, "Reset polling failed to complete.\n"); in ixgbe_reset_hw_X540()
117 * for any pending HW events to complete. in ixgbe_reset_hw_X540()
119 if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { in ixgbe_reset_hw_X540()
120 hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; in ixgbe_reset_hw_X540()
125 IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(0), 384 << IXGBE_RXPBSIZE_SHIFT); in ixgbe_reset_hw_X540()
128 hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr); in ixgbe_reset_hw_X540()
135 hw->mac.num_rar_entries = IXGBE_X540_MAX_TX_QUEUES; in ixgbe_reset_hw_X540()
136 hw->mac.ops.init_rx_addrs(hw); in ixgbe_reset_hw_X540()
139 if (hw->mac.type == ixgbe_mac_e610) in ixgbe_reset_hw_X540()
143 hw->mac.ops.get_san_mac_addr(hw, hw->mac.san_addr); in ixgbe_reset_hw_X540()
146 if (is_valid_ether_addr(hw->mac.san_addr)) { in ixgbe_reset_hw_X540()
148 hw->mac.san_mac_rar_index = hw->mac.num_rar_entries - 1; in ixgbe_reset_hw_X540()
150 hw->mac.ops.set_rar(hw, hw->mac.san_mac_rar_index, in ixgbe_reset_hw_X540()
151 hw->mac.san_addr, 0, IXGBE_RAH_AV); in ixgbe_reset_hw_X540()
154 hw->mac.ops.clear_vmdq(hw, hw->mac.san_mac_rar_index, in ixgbe_reset_hw_X540()
158 hw->mac.num_rar_entries--; in ixgbe_reset_hw_X540()
162 hw->mac.ops.get_wwn_prefix(hw, &hw->mac.wwnn_prefix, in ixgbe_reset_hw_X540()
163 &hw->mac.wwpn_prefix); in ixgbe_reset_hw_X540()
170 * @hw: pointer to hardware structure
176 int ixgbe_start_hw_X540(struct ixgbe_hw *hw) in ixgbe_start_hw_X540() argument
180 ret_val = ixgbe_start_hw_generic(hw); in ixgbe_start_hw_X540()
184 return ixgbe_start_hw_gen2(hw); in ixgbe_start_hw_X540()
189 * @hw: pointer to hardware structure
194 int ixgbe_init_eeprom_params_X540(struct ixgbe_hw *hw) in ixgbe_init_eeprom_params_X540() argument
196 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_X540()
205 eec = IXGBE_READ_REG(hw, IXGBE_EEC(hw)); in ixgbe_init_eeprom_params_X540()
210 hw_dbg(hw, "Eeprom params: type = %d, size = %d\n", in ixgbe_init_eeprom_params_X540()
219 * @hw: pointer to hardware structure
225 static int ixgbe_read_eerd_X540(struct ixgbe_hw *hw, u16 offset, u16 *data) in ixgbe_read_eerd_X540() argument
229 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) in ixgbe_read_eerd_X540()
232 status = ixgbe_read_eerd_generic(hw, offset, data); in ixgbe_read_eerd_X540()
234 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_read_eerd_X540()
240 * @hw: pointer to hardware structure
247 static int ixgbe_read_eerd_buffer_X540(struct ixgbe_hw *hw, in ixgbe_read_eerd_buffer_X540() argument
252 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) in ixgbe_read_eerd_buffer_X540()
255 status = ixgbe_read_eerd_buffer_generic(hw, offset, words, data); in ixgbe_read_eerd_buffer_X540()
257 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_read_eerd_buffer_X540()
263 * @hw: pointer to hardware structure
269 static int ixgbe_write_eewr_X540(struct ixgbe_hw *hw, u16 offset, u16 data) in ixgbe_write_eewr_X540() argument
273 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) in ixgbe_write_eewr_X540()
276 status = ixgbe_write_eewr_generic(hw, offset, data); in ixgbe_write_eewr_X540()
278 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_eewr_X540()
284 * @hw: pointer to hardware structure
291 static int ixgbe_write_eewr_buffer_X540(struct ixgbe_hw *hw, in ixgbe_write_eewr_buffer_X540() argument
296 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) in ixgbe_write_eewr_buffer_X540()
299 status = ixgbe_write_eewr_buffer_generic(hw, offset, words, data); in ixgbe_write_eewr_buffer_X540()
301 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_write_eewr_buffer_X540()
311 * @hw: pointer to hardware structure
313 static int ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw) in ixgbe_calc_eeprom_checksum_X540() argument
325 * Do not use hw->eeprom.ops.read because we do not want to take in ixgbe_calc_eeprom_checksum_X540()
332 if (ixgbe_read_eerd_generic(hw, i, &word)) { in ixgbe_calc_eeprom_checksum_X540()
333 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_X540()
347 if (ixgbe_read_eerd_generic(hw, i, &pointer)) { in ixgbe_calc_eeprom_checksum_X540()
348 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_X540()
354 pointer >= hw->eeprom.word_size) in ixgbe_calc_eeprom_checksum_X540()
357 if (ixgbe_read_eerd_generic(hw, pointer, &length)) { in ixgbe_calc_eeprom_checksum_X540()
358 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_X540()
364 (pointer + length) >= hw->eeprom.word_size) in ixgbe_calc_eeprom_checksum_X540()
368 if (ixgbe_read_eerd_generic(hw, j, &word)) { in ixgbe_calc_eeprom_checksum_X540()
369 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_X540()
383 * @hw: pointer to hardware structure
389 static int ixgbe_validate_eeprom_checksum_X540(struct ixgbe_hw *hw, in ixgbe_validate_eeprom_checksum_X540() argument
400 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_validate_eeprom_checksum_X540()
402 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_validate_eeprom_checksum_X540()
406 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) in ixgbe_validate_eeprom_checksum_X540()
409 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_validate_eeprom_checksum_X540()
415 /* Do not use hw->eeprom.ops.read because we do not want to take in ixgbe_validate_eeprom_checksum_X540()
418 status = ixgbe_read_eerd_generic(hw, IXGBE_EEPROM_CHECKSUM, in ixgbe_validate_eeprom_checksum_X540()
427 hw_dbg(hw, "Invalid EEPROM checksum"); in ixgbe_validate_eeprom_checksum_X540()
436 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_validate_eeprom_checksum_X540()
443 * @hw: pointer to hardware structure
449 static int ixgbe_update_eeprom_checksum_X540(struct ixgbe_hw *hw) in ixgbe_update_eeprom_checksum_X540() argument
458 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_update_eeprom_checksum_X540()
460 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_update_eeprom_checksum_X540()
464 if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM)) in ixgbe_update_eeprom_checksum_X540()
467 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_update_eeprom_checksum_X540()
473 /* Do not use hw->eeprom.ops.write because we do not want to in ixgbe_update_eeprom_checksum_X540()
476 status = ixgbe_write_eewr_generic(hw, IXGBE_EEPROM_CHECKSUM, checksum); in ixgbe_update_eeprom_checksum_X540()
480 status = ixgbe_update_flash_X540(hw); in ixgbe_update_eeprom_checksum_X540()
483 hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_EEP_SM); in ixgbe_update_eeprom_checksum_X540()
488 * ixgbe_update_flash_X540 - Instruct HW to copy EEPROM to Flash device
489 * @hw: pointer to hardware structure
494 static int ixgbe_update_flash_X540(struct ixgbe_hw *hw) in ixgbe_update_flash_X540() argument
499 status = ixgbe_poll_flash_update_done_X540(hw); in ixgbe_update_flash_X540()
501 hw_dbg(hw, "Flash update time out\n"); in ixgbe_update_flash_X540()
505 flup = IXGBE_READ_REG(hw, IXGBE_EEC(hw)) | IXGBE_EEC_FLUP; in ixgbe_update_flash_X540()
506 IXGBE_WRITE_REG(hw, IXGBE_EEC(hw), flup); in ixgbe_update_flash_X540()
508 status = ixgbe_poll_flash_update_done_X540(hw); in ixgbe_update_flash_X540()
510 hw_dbg(hw, "Flash update complete\n"); in ixgbe_update_flash_X540()
512 hw_dbg(hw, "Flash update time out\n"); in ixgbe_update_flash_X540()
514 if (hw->revision_id == 0) { in ixgbe_update_flash_X540()
515 flup = IXGBE_READ_REG(hw, IXGBE_EEC(hw)); in ixgbe_update_flash_X540()
519 IXGBE_WRITE_REG(hw, IXGBE_EEC(hw), flup); in ixgbe_update_flash_X540()
522 status = ixgbe_poll_flash_update_done_X540(hw); in ixgbe_update_flash_X540()
524 hw_dbg(hw, "Flash update complete\n"); in ixgbe_update_flash_X540()
526 hw_dbg(hw, "Flash update time out\n"); in ixgbe_update_flash_X540()
534 * @hw: pointer to hardware structure
539 static int ixgbe_poll_flash_update_done_X540(struct ixgbe_hw *hw) in ixgbe_poll_flash_update_done_X540() argument
545 reg = IXGBE_READ_REG(hw, IXGBE_EEC(hw)); in ixgbe_poll_flash_update_done_X540()
555 * @hw: pointer to hardware structure
561 int ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask) in ixgbe_acquire_swfw_sync_X540() argument
584 if (ixgbe_get_swfw_sync_semaphore(hw)) in ixgbe_acquire_swfw_sync_X540()
587 swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw)); in ixgbe_acquire_swfw_sync_X540()
590 IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC(hw), swfw_sync); in ixgbe_acquire_swfw_sync_X540()
591 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_acquire_swfw_sync_X540()
599 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_acquire_swfw_sync_X540()
603 /* If the resource is not released by the FW/HW the SW can assume that in ixgbe_acquire_swfw_sync_X540()
604 * the FW/HW malfunctions. In that case the SW should set the SW bit(s) in ixgbe_acquire_swfw_sync_X540()
605 * of the requested resource(s) while ignoring the corresponding FW/HW in ixgbe_acquire_swfw_sync_X540()
608 if (ixgbe_get_swfw_sync_semaphore(hw)) in ixgbe_acquire_swfw_sync_X540()
610 swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw)); in ixgbe_acquire_swfw_sync_X540()
613 IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC(hw), swfw_sync); in ixgbe_acquire_swfw_sync_X540()
614 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_acquire_swfw_sync_X540()
630 ixgbe_release_swfw_sync_X540(hw, rmask); in ixgbe_acquire_swfw_sync_X540()
631 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_acquire_swfw_sync_X540()
634 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_acquire_swfw_sync_X540()
641 * @hw: pointer to hardware structure
647 void ixgbe_release_swfw_sync_X540(struct ixgbe_hw *hw, u32 mask) in ixgbe_release_swfw_sync_X540() argument
654 ixgbe_get_swfw_sync_semaphore(hw); in ixgbe_release_swfw_sync_X540()
656 swfw_sync = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw)); in ixgbe_release_swfw_sync_X540()
658 IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC(hw), swfw_sync); in ixgbe_release_swfw_sync_X540()
660 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_release_swfw_sync_X540()
666 * @hw: pointer to hardware structure
670 static int ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw) in ixgbe_get_swfw_sync_semaphore() argument
681 swsm = IXGBE_READ_REG(hw, IXGBE_SWSM(hw)); in ixgbe_get_swfw_sync_semaphore()
688 hw_dbg(hw, in ixgbe_get_swfw_sync_semaphore()
695 swsm = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw)); in ixgbe_get_swfw_sync_semaphore()
705 hw_dbg(hw, "REGSMP Software NVM semaphore not granted\n"); in ixgbe_get_swfw_sync_semaphore()
706 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_get_swfw_sync_semaphore()
712 * @hw: pointer to hardware structure
716 static void ixgbe_release_swfw_sync_semaphore(struct ixgbe_hw *hw) in ixgbe_release_swfw_sync_semaphore() argument
722 swsm = IXGBE_READ_REG(hw, IXGBE_SWFW_SYNC(hw)); in ixgbe_release_swfw_sync_semaphore()
724 IXGBE_WRITE_REG(hw, IXGBE_SWFW_SYNC(hw), swsm); in ixgbe_release_swfw_sync_semaphore()
726 swsm = IXGBE_READ_REG(hw, IXGBE_SWSM(hw)); in ixgbe_release_swfw_sync_semaphore()
728 IXGBE_WRITE_REG(hw, IXGBE_SWSM(hw), swsm); in ixgbe_release_swfw_sync_semaphore()
730 IXGBE_WRITE_FLUSH(hw); in ixgbe_release_swfw_sync_semaphore()
735 * @hw: pointer to hardware structure
740 void ixgbe_init_swfw_sync_X540(struct ixgbe_hw *hw) in ixgbe_init_swfw_sync_X540() argument
750 ixgbe_get_swfw_sync_semaphore(hw); in ixgbe_init_swfw_sync_X540()
751 ixgbe_release_swfw_sync_semaphore(hw); in ixgbe_init_swfw_sync_X540()
758 ixgbe_acquire_swfw_sync_X540(hw, rmask); in ixgbe_init_swfw_sync_X540()
759 ixgbe_release_swfw_sync_X540(hw, rmask); in ixgbe_init_swfw_sync_X540()
764 * @hw: pointer to hardware structure
770 int ixgbe_blink_led_start_X540(struct ixgbe_hw *hw, u32 index) in ixgbe_blink_led_start_X540() argument
784 hw->mac.ops.check_link(hw, &speed, &link_up, false); in ixgbe_blink_led_start_X540()
786 macc_reg = IXGBE_READ_REG(hw, IXGBE_MACC); in ixgbe_blink_led_start_X540()
788 IXGBE_WRITE_REG(hw, IXGBE_MACC, macc_reg); in ixgbe_blink_led_start_X540()
791 ledctl_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); in ixgbe_blink_led_start_X540()
794 IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, ledctl_reg); in ixgbe_blink_led_start_X540()
795 IXGBE_WRITE_FLUSH(hw); in ixgbe_blink_led_start_X540()
802 * @hw: pointer to hardware structure
808 int ixgbe_blink_led_stop_X540(struct ixgbe_hw *hw, u32 index) in ixgbe_blink_led_stop_X540() argument
817 ledctl_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); in ixgbe_blink_led_stop_X540()
821 IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, ledctl_reg); in ixgbe_blink_led_stop_X540()
824 macc_reg = IXGBE_READ_REG(hw, IXGBE_MACC); in ixgbe_blink_led_stop_X540()
826 IXGBE_WRITE_REG(hw, IXGBE_MACC, macc_reg); in ixgbe_blink_led_stop_X540()
827 IXGBE_WRITE_FLUSH(hw); in ixgbe_blink_led_stop_X540()