Lines Matching refs:hw
36 static void igb_raise_eec_clk(struct e1000_hw *hw, u32 *eecd) in igb_raise_eec_clk() argument
41 udelay(hw->nvm.delay_usec); in igb_raise_eec_clk()
51 static void igb_lower_eec_clk(struct e1000_hw *hw, u32 *eecd) in igb_lower_eec_clk() argument
56 udelay(hw->nvm.delay_usec); in igb_lower_eec_clk()
69 static void igb_shift_out_eec_bits(struct e1000_hw *hw, u16 data, u16 count) in igb_shift_out_eec_bits() argument
71 struct e1000_nvm_info *nvm = &hw->nvm; in igb_shift_out_eec_bits()
90 igb_raise_eec_clk(hw, &eecd); in igb_shift_out_eec_bits()
91 igb_lower_eec_clk(hw, &eecd); in igb_shift_out_eec_bits()
111 static u16 igb_shift_in_eec_bits(struct e1000_hw *hw, u16 count) in igb_shift_in_eec_bits() argument
124 igb_raise_eec_clk(hw, &eecd); in igb_shift_in_eec_bits()
132 igb_lower_eec_clk(hw, &eecd); in igb_shift_in_eec_bits()
146 static s32 igb_poll_eerd_eewr_done(struct e1000_hw *hw, int ee_reg) in igb_poll_eerd_eewr_done() argument
177 s32 igb_acquire_nvm(struct e1000_hw *hw) in igb_acquire_nvm() argument
211 static void igb_standby_nvm(struct e1000_hw *hw) in igb_standby_nvm() argument
213 struct e1000_nvm_info *nvm = &hw->nvm; in igb_standby_nvm()
235 static void e1000_stop_nvm(struct e1000_hw *hw) in e1000_stop_nvm() argument
240 if (hw->nvm.type == e1000_nvm_eeprom_spi) { in e1000_stop_nvm()
243 igb_lower_eec_clk(hw, &eecd); in e1000_stop_nvm()
253 void igb_release_nvm(struct e1000_hw *hw) in igb_release_nvm() argument
257 e1000_stop_nvm(hw); in igb_release_nvm()
270 static s32 igb_ready_nvm_eeprom(struct e1000_hw *hw) in igb_ready_nvm_eeprom() argument
272 struct e1000_nvm_info *nvm = &hw->nvm; in igb_ready_nvm_eeprom()
293 igb_shift_out_eec_bits(hw, NVM_RDSR_OPCODE_SPI, in igb_ready_nvm_eeprom()
294 hw->nvm.opcode_bits); in igb_ready_nvm_eeprom()
295 spi_stat_reg = (u8)igb_shift_in_eec_bits(hw, 8); in igb_ready_nvm_eeprom()
300 igb_standby_nvm(hw); in igb_ready_nvm_eeprom()
324 s32 igb_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) in igb_read_nvm_spi() argument
326 struct e1000_nvm_info *nvm = &hw->nvm; in igb_read_nvm_spi()
342 ret_val = nvm->ops.acquire(hw); in igb_read_nvm_spi()
346 ret_val = igb_ready_nvm_eeprom(hw); in igb_read_nvm_spi()
350 igb_standby_nvm(hw); in igb_read_nvm_spi()
356 igb_shift_out_eec_bits(hw, read_opcode, nvm->opcode_bits); in igb_read_nvm_spi()
357 igb_shift_out_eec_bits(hw, (u16)(offset*2), nvm->address_bits); in igb_read_nvm_spi()
364 word_in = igb_shift_in_eec_bits(hw, 16); in igb_read_nvm_spi()
369 nvm->ops.release(hw); in igb_read_nvm_spi()
384 s32 igb_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) in igb_read_nvm_eerd() argument
386 struct e1000_nvm_info *nvm = &hw->nvm; in igb_read_nvm_eerd()
405 ret_val = igb_poll_eerd_eewr_done(hw, E1000_NVM_POLL_READ); in igb_read_nvm_eerd()
429 s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) in igb_write_nvm_spi() argument
431 struct e1000_nvm_info *nvm = &hw->nvm; in igb_write_nvm_spi()
447 ret_val = nvm->ops.acquire(hw); in igb_write_nvm_spi()
451 ret_val = igb_ready_nvm_eeprom(hw); in igb_write_nvm_spi()
453 nvm->ops.release(hw); in igb_write_nvm_spi()
457 igb_standby_nvm(hw); in igb_write_nvm_spi()
460 igb_shift_out_eec_bits(hw, NVM_WREN_OPCODE_SPI, in igb_write_nvm_spi()
463 igb_standby_nvm(hw); in igb_write_nvm_spi()
472 igb_shift_out_eec_bits(hw, write_opcode, nvm->opcode_bits); in igb_write_nvm_spi()
473 igb_shift_out_eec_bits(hw, (u16)((offset + widx) * 2), in igb_write_nvm_spi()
481 igb_shift_out_eec_bits(hw, word_out, 16); in igb_write_nvm_spi()
485 igb_standby_nvm(hw); in igb_write_nvm_spi()
490 nvm->ops.release(hw); in igb_write_nvm_spi()
505 s32 igb_read_part_string(struct e1000_hw *hw, u8 *part_num, u32 part_num_size) in igb_read_part_string() argument
519 ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_0, 1, &nvm_data); in igb_read_part_string()
525 ret_val = hw->nvm.ops.read(hw, NVM_PBA_OFFSET_1, 1, &pointer); in igb_read_part_string()
570 ret_val = hw->nvm.ops.read(hw, pointer, 1, &length); in igb_read_part_string()
593 ret_val = hw->nvm.ops.read(hw, pointer + offset, 1, &nvm_data); in igb_read_part_string()
615 s32 igb_read_mac_addr(struct e1000_hw *hw) in igb_read_mac_addr() argument
625 hw->mac.perm_addr[i] = (u8)(rar_low >> (i*8)); in igb_read_mac_addr()
628 hw->mac.perm_addr[i+4] = (u8)(rar_high >> (i*8)); in igb_read_mac_addr()
631 hw->mac.addr[i] = hw->mac.perm_addr[i]; in igb_read_mac_addr()
643 s32 igb_validate_nvm_checksum(struct e1000_hw *hw) in igb_validate_nvm_checksum() argument
650 ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data); in igb_validate_nvm_checksum()
676 s32 igb_update_nvm_checksum(struct e1000_hw *hw) in igb_update_nvm_checksum() argument
683 ret_val = hw->nvm.ops.read(hw, i, 1, &nvm_data); in igb_update_nvm_checksum()
691 ret_val = hw->nvm.ops.write(hw, NVM_CHECKSUM_REG, 1, &checksum); in igb_update_nvm_checksum()
706 void igb_get_fw_version(struct e1000_hw *hw, struct e1000_fw_version *fw_vers) in igb_get_fw_version() argument
717 hw->nvm.ops.read(hw, NVM_ETRACK_HIWORD, 1, &etrack_test); in igb_get_fw_version()
718 switch (hw->mac.type) { in igb_get_fw_version()
720 igb_read_invm_version(hw, fw_vers); in igb_get_fw_version()
729 hw->nvm.ops.read(hw, NVM_VERSION, 1, &fw_version); in igb_get_fw_version()
739 if (!(igb_get_flash_presence_i210(hw))) { in igb_get_fw_version()
740 igb_read_invm_version(hw, fw_vers); in igb_get_fw_version()
746 hw->nvm.ops.read(hw, NVM_COMB_VER_PTR, 1, &comb_offset); in igb_get_fw_version()
750 hw->nvm.ops.read(hw, (NVM_COMB_VER_OFF + comb_offset in igb_get_fw_version()
752 hw->nvm.ops.read(hw, (NVM_COMB_VER_OFF + comb_offset), in igb_get_fw_version()
774 hw->nvm.ops.read(hw, NVM_VERSION, 1, &fw_version); in igb_get_fw_version()
796 hw->nvm.ops.read(hw, NVM_ETRACK_WORD, 1, &eeprom_verl); in igb_get_fw_version()
797 hw->nvm.ops.read(hw, (NVM_ETRACK_WORD + 1), 1, &eeprom_verh); in igb_get_fw_version()