Lines Matching +full:read +full:- +full:out
2 SPDX-License-Identifier: BSD-3-Clause
4 Copyright (c) 2001-2020, Intel Corporation
30 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
46 * e1000_acquire_nvm_i210 - Request for access to EEPROM
52 * EEPROM access and return -E1000_ERR_NVM (-1).
66 * e1000_release_nvm_i210 - Release exclusive access to EEPROM
80 * e1000_read_nvm_srrd_i210 - Reads Shadow Ram using EERD register
82 * @offset: offset of word in the Shadow Ram to read
83 * @words: number of words to read
84 * @data: word read from the Shadow Ram
99 * to read in bursts than synchronizing access for each word. */ in e1000_read_nvm_srrd_i210()
101 count = (words - i) / E1000_EERD_EEWR_MAX_COUNT > 0 ? in e1000_read_nvm_srrd_i210()
102 E1000_EERD_EEWR_MAX_COUNT : (words - i); in e1000_read_nvm_srrd_i210()
103 if (hw->nvm.ops.acquire(hw) == E1000_SUCCESS) { in e1000_read_nvm_srrd_i210()
106 hw->nvm.ops.release(hw); in e1000_read_nvm_srrd_i210()
119 * e1000_write_nvm_srwr_i210 - Write to Shadow RAM using EEWR
131 * If error code is returned, data and Shadow RAM may be inconsistent - buffer
146 count = (words - i) / E1000_EERD_EEWR_MAX_COUNT > 0 ? in e1000_write_nvm_srwr_i210()
147 E1000_EERD_EEWR_MAX_COUNT : (words - i); in e1000_write_nvm_srwr_i210()
148 if (hw->nvm.ops.acquire(hw) == E1000_SUCCESS) { in e1000_write_nvm_srwr_i210()
151 hw->nvm.ops.release(hw); in e1000_write_nvm_srwr_i210()
164 * e1000_write_nvm_srwr - Write to Shadow Ram using EEWR
178 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_write_nvm_srwr()
189 if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || in e1000_write_nvm_srwr()
191 DEBUGOUT("nvm parameter(s) out of bounds\n"); in e1000_write_nvm_srwr()
192 ret_val = -E1000_ERR_NVM; in e1000_write_nvm_srwr()
193 goto out; in e1000_write_nvm_srwr()
197 ret_val = -E1000_ERR_NVM; in e1000_write_nvm_srwr()
215 DEBUGOUT("Shadow RAM write EEWR timed out\n"); in e1000_write_nvm_srwr()
220 out: in e1000_write_nvm_srwr()
224 /** e1000_read_invm_word_i210 - Reads OTP
226 * @address: the word address (aka eeprom offset) to read
227 * @data: pointer to the data read
229 * Reads 16-bit words from the OTP. Return error when the word is not
234 s32 status = -E1000_ERR_INVM_VALUE_NOT_FOUND; in e1000_read_invm_word_i210()
255 DEBUGOUT2("Read INVM Word 0x%02x = %x", in e1000_read_invm_word_i210()
267 /** e1000_read_invm_i210 - Read invm wrapper function for I210/I211
269 * @address: the word address (aka eeprom offset) to read
270 * @data: pointer to the data read
328 *data = hw->subsystem_device_id; in e1000_read_invm_i210()
331 *data = hw->subsystem_vendor_id; in e1000_read_invm_i210()
334 *data = hw->device_id; in e1000_read_invm_i210()
337 *data = hw->vendor_id; in e1000_read_invm_i210()
348 * e1000_read_invm_version - Reads iNVM version and image type
350 * @invm_ver: version structure for the version read
361 u32 invm_blocks = E1000_INVM_SIZE - (E1000_INVM_ULT_BYTES_SIZE / in e1000_read_invm_version()
364 s32 status = -E1000_ERR_INVM_VALUE_NOT_FOUND; in e1000_read_invm_version()
369 /* Read iNVM memory */ in e1000_read_invm_version()
375 /* Read version number */ in e1000_read_invm_version()
377 record = &buffer[invm_blocks - i]; in e1000_read_invm_version()
378 next_record = &buffer[invm_blocks - i + 1]; in e1000_read_invm_version()
418 invm_ver->invm_major = (nvm_version & E1000_INVM_MAJOR_MASK) in e1000_read_invm_version()
420 invm_ver->invm_minor = nvm_version & E1000_INVM_MINOR_MASK; in e1000_read_invm_version()
422 /* Read Image Type */ in e1000_read_invm_version()
424 record = &buffer[invm_blocks - i]; in e1000_read_invm_version()
425 next_record = &buffer[invm_blocks - i + 1]; in e1000_read_invm_version()
429 invm_ver->invm_img_type = 0; in e1000_read_invm_version()
437 invm_ver->invm_img_type = in e1000_read_invm_version()
447 * e1000_validate_nvm_checksum_i210 - Validate EEPROM checksum
460 if (hw->nvm.ops.acquire(hw) == E1000_SUCCESS) { in e1000_validate_nvm_checksum_i210()
463 * Replace the read function with semaphore grabbing with in e1000_validate_nvm_checksum_i210()
467 read_op_ptr = hw->nvm.ops.read; in e1000_validate_nvm_checksum_i210()
468 hw->nvm.ops.read = e1000_read_nvm_eerd; in e1000_validate_nvm_checksum_i210()
472 /* Revert original read operation. */ in e1000_validate_nvm_checksum_i210()
473 hw->nvm.ops.read = read_op_ptr; in e1000_validate_nvm_checksum_i210()
475 hw->nvm.ops.release(hw); in e1000_validate_nvm_checksum_i210()
485 * e1000_update_nvm_checksum_i210 - Update EEPROM checksum
501 * Read the first word from the EEPROM. If this times out or fails, do in e1000_update_nvm_checksum_i210()
503 * EEPROM read fails in e1000_update_nvm_checksum_i210()
507 DEBUGOUT("EEPROM read failed\n"); in e1000_update_nvm_checksum_i210()
508 goto out; in e1000_update_nvm_checksum_i210()
511 if (hw->nvm.ops.acquire(hw) == E1000_SUCCESS) { in e1000_update_nvm_checksum_i210()
513 * Do not use hw->nvm.ops.write, hw->nvm.ops.read in e1000_update_nvm_checksum_i210()
521 hw->nvm.ops.release(hw); in e1000_update_nvm_checksum_i210()
522 DEBUGOUT("NVM Read Error while updating checksum.\n"); in e1000_update_nvm_checksum_i210()
523 goto out; in e1000_update_nvm_checksum_i210()
527 checksum = (u16) NVM_SUM - checksum; in e1000_update_nvm_checksum_i210()
531 hw->nvm.ops.release(hw); in e1000_update_nvm_checksum_i210()
533 goto out; in e1000_update_nvm_checksum_i210()
536 hw->nvm.ops.release(hw); in e1000_update_nvm_checksum_i210()
542 out: in e1000_update_nvm_checksum_i210()
547 * e1000_get_flash_presence_i210 - Check if flash device is detected.
567 * e1000_update_flash_i210 - Commit EEPROM to the flash
579 if (ret_val == -E1000_ERR_NVM) { in e1000_update_flash_i210()
580 DEBUGOUT("Flash update time out\n"); in e1000_update_flash_i210()
581 goto out; in e1000_update_flash_i210()
591 DEBUGOUT("Flash update time out\n"); in e1000_update_flash_i210()
593 out: in e1000_update_flash_i210()
598 * e1000_pool_flash_update_done_i210 - Pool FLUDONE status.
604 s32 ret_val = -E1000_ERR_NVM; in e1000_pool_flash_update_done_i210()
622 * e1000_init_nvm_params_i210 - Initialize i210 NVM function pointers
630 struct e1000_nvm_info *nvm = &hw->nvm; in e1000_init_nvm_params_i210()
635 nvm->ops.acquire = e1000_acquire_nvm_i210; in e1000_init_nvm_params_i210()
636 nvm->ops.release = e1000_release_nvm_i210; in e1000_init_nvm_params_i210()
637 nvm->ops.valid_led_default = e1000_valid_led_default_i210; in e1000_init_nvm_params_i210()
639 hw->nvm.type = e1000_nvm_flash_hw; in e1000_init_nvm_params_i210()
640 nvm->ops.read = e1000_read_nvm_srrd_i210; in e1000_init_nvm_params_i210()
641 nvm->ops.write = e1000_write_nvm_srwr_i210; in e1000_init_nvm_params_i210()
642 nvm->ops.validate = e1000_validate_nvm_checksum_i210; in e1000_init_nvm_params_i210()
643 nvm->ops.update = e1000_update_nvm_checksum_i210; in e1000_init_nvm_params_i210()
645 hw->nvm.type = e1000_nvm_invm; in e1000_init_nvm_params_i210()
646 nvm->ops.read = e1000_read_invm_i210; in e1000_init_nvm_params_i210()
647 nvm->ops.write = e1000_null_write_nvm; in e1000_init_nvm_params_i210()
648 nvm->ops.validate = e1000_null_ops_generic; in e1000_init_nvm_params_i210()
649 nvm->ops.update = e1000_null_ops_generic; in e1000_init_nvm_params_i210()
655 * e1000_init_function_pointers_i210 - Init func ptrs.
663 hw->nvm.ops.init_params = e1000_init_nvm_params_i210; in e1000_init_function_pointers_i210()
667 * e1000_valid_led_default_i210 - Verify a valid default LED config
671 * Read the EEPROM for the current default LED configuration. If the
680 ret_val = hw->nvm.ops.read(hw, NVM_ID_LED_SETTINGS, 1, data); in e1000_valid_led_default_i210()
682 DEBUGOUT("NVM Read Error\n"); in e1000_valid_led_default_i210()
683 goto out; in e1000_valid_led_default_i210()
687 switch (hw->phy.media_type) { in e1000_valid_led_default_i210()
697 out: in e1000_valid_led_default_i210()
716 hw->phy.ops.acquire(hw); in e1000_pll_workaround_i210()
742 ret_val = -E1000_ERR_PHY; in e1000_pll_workaround_i210()
771 hw->phy.ops.release(hw); in e1000_pll_workaround_i210()
776 * e1000_get_cfg_done_i210 - Read config done bit
779 * Read the management control register for the config done bit for
780 * completion status. NOTE: silicon which is EEPROM-less will fail trying
781 * to read the config done bit, so an error is *ONLY* logged and returns
782 * E1000_SUCCESS. If we were to return with error, EEPROM-less silicon
796 timeout--; in e1000_get_cfg_done_i210()
805 * e1000_init_hw_i210 - Init hw for I210/I211
812 struct e1000_mac_info *mac = &hw->mac; in e1000_init_hw_i210()
816 if ((hw->mac.type >= e1000_i210) && in e1000_init_hw_i210()
822 hw->phy.ops.get_cfg_done = e1000_get_cfg_done_i210; in e1000_init_hw_i210()
825 mac->ops.id_led_init(hw); in e1000_init_hw_i210()