Lines Matching +full:eeprom +full:- +full:data

1 // SPDX-License-Identifier: GPL-2.0
8 * igc_poll_eerd_eewr_done - Poll for EEPROM read/write completion
10 * @ee_reg: EEPROM flag for polling
12 * Polls the EEPROM status bit for either read or write completion based
17 s32 ret_val = -IGC_ERR_NVM; in igc_poll_eerd_eewr_done()
39 * igc_read_nvm_eerd - Reads EEPROM using EERD register
41 * @offset: offset of word in the EEPROM to read
43 * @data: word read from the EEPROM
45 * Reads a 16 bit word from the EEPROM using the EERD register.
47 s32 igc_read_nvm_eerd(struct igc_hw *hw, u16 offset, u16 words, u16 *data) in igc_read_nvm_eerd() argument
49 struct igc_nvm_info *nvm = &hw->nvm; in igc_read_nvm_eerd()
56 if (offset >= nvm->word_size || (words > (nvm->word_size - offset)) || in igc_read_nvm_eerd()
59 ret_val = -IGC_ERR_NVM; in igc_read_nvm_eerd()
72 data[i] = (rd32(IGC_EERD) >> IGC_NVM_RW_REG_DATA); in igc_read_nvm_eerd()
80 * igc_read_mac_addr - Read device MAC address
93 hw->mac.perm_addr[i] = (u8)(rar_low >> (i * 8)); in igc_read_mac_addr()
96 hw->mac.perm_addr[i + 4] = (u8)(rar_high >> (i * 8)); in igc_read_mac_addr()
99 hw->mac.addr[i] = hw->mac.perm_addr[i]; in igc_read_mac_addr()
105 * igc_validate_nvm_checksum - Validate EEPROM checksum
108 * Calculates the EEPROM checksum by reading/adding each word of the EEPROM
109 * and then verifies that the sum of the EEPROM is equal to 0xBABA.
118 ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data); in igc_validate_nvm_checksum()
128 ret_val = -IGC_ERR_NVM; in igc_validate_nvm_checksum()
137 * igc_update_nvm_checksum - Update EEPROM checksum
140 * Updates the EEPROM checksum by reading/adding each word of the EEPROM
141 * up to the checksum. Then calculates the EEPROM checksum and writes the
142 * value to the EEPROM.
151 ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data); in igc_update_nvm_checksum()
158 checksum = (u16)NVM_SUM - checksum; in igc_update_nvm_checksum()
159 ret_val = hw->nvm.ops.write(hw, NVM_CHECKSUM_REG, 1, &checksum); in igc_update_nvm_checksum()