Lines Matching +full:read +full:- +full:out

1 // SPDX-License-Identifier: GPL-2.0
9 * igc_acquire_nvm_i225 - Acquire exclusive access to EEPROM
15 * EEPROM access and return -IGC_ERR_NVM (-1).
23 * igc_release_nvm_i225 - Release exclusive access to EEPROM
35 * igc_get_hw_semaphore_i225 - Acquire hardware semaphore
42 s32 timeout = hw->nvm.word_size + 1; in igc_get_hw_semaphore_i225()
60 if (hw->dev_spec._base.clear_semaphore_once) { in igc_get_hw_semaphore_i225()
61 hw->dev_spec._base.clear_semaphore_once = false; in igc_get_hw_semaphore_i225()
74 hw_dbg("Driver can't access device - SMBI bit is set.\n"); in igc_get_hw_semaphore_i225()
75 return -IGC_ERR_NVM; in igc_get_hw_semaphore_i225()
95 return -IGC_ERR_NVM; in igc_get_hw_semaphore_i225()
102 * igc_acquire_swfw_sync_i225 - Acquire SW/FW semaphore
119 ret_val = -IGC_ERR_SWFW_SYNC; in igc_acquire_swfw_sync_i225()
120 goto out; in igc_acquire_swfw_sync_i225()
135 ret_val = -IGC_ERR_SWFW_SYNC; in igc_acquire_swfw_sync_i225()
136 goto out; in igc_acquire_swfw_sync_i225()
143 out: in igc_acquire_swfw_sync_i225()
148 * igc_release_swfw_sync_i225 - Release SW/FW semaphore
177 * igc_read_nvm_srrd_i225 - Reads Shadow Ram using EERD register
179 * @offset: offset of word in the Shadow Ram to read
180 * @words: number of words to read
181 * @data: word read from the Shadow Ram
194 * to read in bursts than synchronizing access for each word. in igc_read_nvm_srrd_i225()
197 count = (words - i) / IGC_EERD_EEWR_MAX_COUNT > 0 ? in igc_read_nvm_srrd_i225()
198 IGC_EERD_EEWR_MAX_COUNT : (words - i); in igc_read_nvm_srrd_i225()
200 status = hw->nvm.ops.acquire(hw); in igc_read_nvm_srrd_i225()
205 hw->nvm.ops.release(hw); in igc_read_nvm_srrd_i225()
214 * igc_write_nvm_srwr - Write to Shadow Ram using EEWR
228 struct igc_nvm_info *nvm = &hw->nvm; in igc_write_nvm_srwr()
229 s32 ret_val = -IGC_ERR_NVM; in igc_write_nvm_srwr()
236 if (offset >= nvm->word_size || (words > (nvm->word_size - offset)) || in igc_write_nvm_srwr()
238 hw_dbg("nvm parameter(s) out of bounds\n"); in igc_write_nvm_srwr()
243 ret_val = -IGC_ERR_NVM; in igc_write_nvm_srwr()
260 hw_dbg("Shadow RAM write EEWR timed out\n"); in igc_write_nvm_srwr()
269 * igc_write_nvm_srwr_i225 - Write to Shadow RAM using EEWR
281 * If error code is returned, data and Shadow RAM may be inconsistent - buffer
295 count = (words - i) / IGC_EERD_EEWR_MAX_COUNT > 0 ? in igc_write_nvm_srwr_i225()
296 IGC_EERD_EEWR_MAX_COUNT : (words - i); in igc_write_nvm_srwr_i225()
298 status = hw->nvm.ops.acquire(hw); in igc_write_nvm_srwr_i225()
303 hw->nvm.ops.release(hw); in igc_write_nvm_srwr_i225()
312 * igc_validate_nvm_checksum_i225 - Validate EEPROM checksum
324 status = hw->nvm.ops.acquire(hw); in igc_validate_nvm_checksum_i225()
326 goto out; in igc_validate_nvm_checksum_i225()
328 /* Replace the read function with semaphore grabbing with in igc_validate_nvm_checksum_i225()
332 read_op_ptr = hw->nvm.ops.read; in igc_validate_nvm_checksum_i225()
333 hw->nvm.ops.read = igc_read_nvm_eerd; in igc_validate_nvm_checksum_i225()
337 /* Revert original read operation. */ in igc_validate_nvm_checksum_i225()
338 hw->nvm.ops.read = read_op_ptr; in igc_validate_nvm_checksum_i225()
340 hw->nvm.ops.release(hw); in igc_validate_nvm_checksum_i225()
342 out: in igc_validate_nvm_checksum_i225()
347 * igc_pool_flash_update_done_i225 - Pool FLUDONE status
352 s32 ret_val = -IGC_ERR_NVM; in igc_pool_flash_update_done_i225()
368 * igc_update_flash_i225 - Commit EEPROM to the flash
377 if (ret_val == -IGC_ERR_NVM) { in igc_update_flash_i225()
378 hw_dbg("Flash update time out\n"); in igc_update_flash_i225()
379 goto out; in igc_update_flash_i225()
387 hw_dbg("Flash update time out\n"); in igc_update_flash_i225()
391 out: in igc_update_flash_i225()
396 * igc_update_nvm_checksum_i225 - Update EEPROM checksum
409 /* Read the first word from the EEPROM. If this times out or fails, do in igc_update_nvm_checksum_i225()
411 * EEPROM read fails in igc_update_nvm_checksum_i225()
415 hw_dbg("EEPROM read failed\n"); in igc_update_nvm_checksum_i225()
416 goto out; in igc_update_nvm_checksum_i225()
419 ret_val = hw->nvm.ops.acquire(hw); in igc_update_nvm_checksum_i225()
421 goto out; in igc_update_nvm_checksum_i225()
423 /* Do not use hw->nvm.ops.write, hw->nvm.ops.read in igc_update_nvm_checksum_i225()
431 hw->nvm.ops.release(hw); in igc_update_nvm_checksum_i225()
432 hw_dbg("NVM Read Error while updating checksum.\n"); in igc_update_nvm_checksum_i225()
433 goto out; in igc_update_nvm_checksum_i225()
437 checksum = (u16)NVM_SUM - checksum; in igc_update_nvm_checksum_i225()
441 hw->nvm.ops.release(hw); in igc_update_nvm_checksum_i225()
443 goto out; in igc_update_nvm_checksum_i225()
446 hw->nvm.ops.release(hw); in igc_update_nvm_checksum_i225()
450 out: in igc_update_nvm_checksum_i225()
455 * igc_get_flash_presence_i225 - Check if flash device is detected
471 * igc_init_nvm_params_i225 - Init NVM func ptrs.
476 struct igc_nvm_info *nvm = &hw->nvm; in igc_init_nvm_params_i225()
478 nvm->ops.acquire = igc_acquire_nvm_i225; in igc_init_nvm_params_i225()
479 nvm->ops.release = igc_release_nvm_i225; in igc_init_nvm_params_i225()
483 nvm->ops.read = igc_read_nvm_srrd_i225; in igc_init_nvm_params_i225()
484 nvm->ops.write = igc_write_nvm_srwr_i225; in igc_init_nvm_params_i225()
485 nvm->ops.validate = igc_validate_nvm_checksum_i225; in igc_init_nvm_params_i225()
486 nvm->ops.update = igc_update_nvm_checksum_i225; in igc_init_nvm_params_i225()
488 nvm->ops.read = igc_read_nvm_eerd; in igc_init_nvm_params_i225()
489 nvm->ops.write = NULL; in igc_init_nvm_params_i225()
490 nvm->ops.validate = NULL; in igc_init_nvm_params_i225()
491 nvm->ops.update = NULL; in igc_init_nvm_params_i225()
497 * igc_set_eee_i225 - Enable/disable EEE support
514 if (hw->dev_spec._base.eee_enable) { in igc_set_eee_i225()
552 /* igc_set_ltr_i225 - Set Latency Tolerance Reporting thresholds
567 hw->mac.ops.get_speed_and_duplex(hw, &speed, &duplex); in igc_set_ltr_i225()
572 if (hw->dev_spec._base.eee_enable && in igc_set_ltr_i225()
598 size -= (rd32(IGC_DMACR) & in igc_set_ltr_i225()
614 return -IGC_ERR_CONFIG; in igc_set_ltr_i225()
629 ltr_min -= 1; in igc_set_ltr_i225()
631 ltr_max -= 1; in igc_set_ltr_i225()