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. */
101 count = (words - i) / E1000_EERD_EEWR_MAX_COUNT > 0 ?
102 E1000_EERD_EEWR_MAX_COUNT : (words - i);
103 if (hw->nvm.ops.acquire(hw) == E1000_SUCCESS) {
106 hw->nvm.ops.release(hw);
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 ?
147 E1000_EERD_EEWR_MAX_COUNT : (words - i);
148 if (hw->nvm.ops.acquire(hw) == E1000_SUCCESS) {
151 hw->nvm.ops.release(hw);
164 * e1000_write_nvm_srwr - Write to Shadow Ram using EEWR
178 struct e1000_nvm_info *nvm = &hw->nvm;
189 if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
191 DEBUGOUT("nvm parameter(s) out of bounds\n");
192 ret_val = -E1000_ERR_NVM;
193 goto out;
197 ret_val = -E1000_ERR_NVM;
215 DEBUGOUT("Shadow RAM write EEWR timed out\n");
220 out:
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;
255 DEBUGOUT2("Read INVM Word 0x%02x = %x",
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;
331 *data = hw->subsystem_vendor_id;
334 *data = hw->device_id;
337 *data = hw->vendor_id;
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 /
364 s32 status = -E1000_ERR_INVM_VALUE_NOT_FOUND;
369 /* Read iNVM memory */
375 /* Read version number */
377 record = &buffer[invm_blocks - i];
378 next_record = &buffer[invm_blocks - i + 1];
418 invm_ver->invm_major = (nvm_version & E1000_INVM_MAJOR_MASK)
420 invm_ver->invm_minor = nvm_version & E1000_INVM_MINOR_MASK;
422 /* Read Image Type */
424 record = &buffer[invm_blocks - i];
425 next_record = &buffer[invm_blocks - i + 1];
429 invm_ver->invm_img_type = 0;
437 invm_ver->invm_img_type =
447 * e1000_validate_nvm_checksum_i210 - Validate EEPROM checksum
460 if (hw->nvm.ops.acquire(hw) == E1000_SUCCESS) {
463 * Replace the read function with semaphore grabbing with
467 read_op_ptr = hw->nvm.ops.read;
468 hw->nvm.ops.read = e1000_read_nvm_eerd;
472 /* Revert original read operation. */
473 hw->nvm.ops.read = read_op_ptr;
475 hw->nvm.ops.release(hw);
485 * e1000_update_nvm_checksum_i210 - Update EEPROM checksum
501 * Read the first word from the EEPROM. If this times out or fails, do
503 * EEPROM read fails
507 DEBUGOUT("EEPROM read failed\n");
508 goto out;
511 if (hw->nvm.ops.acquire(hw) == E1000_SUCCESS) {
513 * Do not use hw->nvm.ops.write, hw->nvm.ops.read
521 hw->nvm.ops.release(hw);
522 DEBUGOUT("NVM Read Error while updating checksum.\n");
523 goto out;
527 checksum = (u16) NVM_SUM - checksum;
531 hw->nvm.ops.release(hw);
533 goto out;
536 hw->nvm.ops.release(hw);
542 out:
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) {
580 DEBUGOUT("Flash update time out\n");
581 goto out;
591 DEBUGOUT("Flash update time out\n");
593 out:
598 * e1000_pool_flash_update_done_i210 - Pool FLUDONE status.
604 s32 ret_val = -E1000_ERR_NVM;
622 * e1000_init_nvm_params_i210 - Initialize i210 NVM function pointers
630 struct e1000_nvm_info *nvm = &hw->nvm;
635 nvm->ops.acquire = e1000_acquire_nvm_i210;
636 nvm->ops.release = e1000_release_nvm_i210;
637 nvm->ops.valid_led_default = e1000_valid_led_default_i210;
639 hw->nvm.type = e1000_nvm_flash_hw;
640 nvm->ops.read = e1000_read_nvm_srrd_i210;
641 nvm->ops.write = e1000_write_nvm_srwr_i210;
642 nvm->ops.validate = e1000_validate_nvm_checksum_i210;
643 nvm->ops.update = e1000_update_nvm_checksum_i210;
645 hw->nvm.type = e1000_nvm_invm;
646 nvm->ops.read = e1000_read_invm_i210;
647 nvm->ops.write = e1000_null_write_nvm;
648 nvm->ops.validate = e1000_null_ops_generic;
649 nvm->ops.update = e1000_null_ops_generic;
655 * e1000_init_function_pointers_i210 - Init func ptrs.
663 hw->nvm.ops.init_params = e1000_init_nvm_params_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);
682 DEBUGOUT("NVM Read Error\n");
683 goto out;
687 switch (hw->phy.media_type) {
697 out:
716 hw->phy.ops.acquire(hw);
742 ret_val = -E1000_ERR_PHY;
771 hw->phy.ops.release(hw);
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--;
805 * e1000_init_hw_i210 - Init hw for I210/I211
812 struct e1000_mac_info *mac = &hw->mac;
816 if ((hw->mac.type >= e1000_i210) &&
822 hw->phy.ops.get_cfg_done = e1000_get_cfg_done_i210;
825 mac->ops.id_led_init(hw);