32 #include <linux/types.h>
33 #include <linux/if_ether.h>
39 static void igb_put_hw_semaphore_i210(
struct e1000_hw *
hw);
42 static s32 igb_pool_flash_update_done_i210(
struct e1000_hw *
hw);
82 u32 fwmask = mask << 16;
87 if (igb_get_hw_semaphore_i210(hw)) {
93 if (!(swfw_sync & fwmask))
99 igb_put_hw_semaphore_i210(hw);
105 hw_dbg(
"Driver can't access resource, SW_FW_SYNC timeout.\n");
113 igb_put_hw_semaphore_i210(hw);
137 igb_put_hw_semaphore_i210(hw);
154 for (i = 0; i < timeout; i++) {
168 hw_dbg(
"Driver can't access the NVM\n");
183 static void igb_put_hw_semaphore_i210(
struct e1000_hw *hw)
219 hw->
nvm.ops.release(hw);
260 status = igb_write_nvm_srwr(hw, offset, count,
262 hw->
nvm.ops.release(hw);
291 u32 attempts = 100000;
300 hw_dbg(
"nvm parameter(s) out of bounds\n");
305 for (i = 0; i < words; i++) {
312 for (k = 0; k < attempts; k++) {
322 hw_dbg(
"Shadow RAM write EEWR timed out\n");
351 hw_dbg(
"MAC Addr not found in iNVM\n");
376 hw_dbg(
"NVM word 0x%02x is not mapped.\n", offset);
397 u8 record_type, word_address;
411 if (word_address == (
u8)address) {
413 hw_dbg(
"Read INVM Word 0x%02x = %x",
421 hw_dbg(
"Requested word 0x%02x not found in OTP\n", address);
444 read_op_ptr = hw->
nvm.ops.read;
450 hw->
nvm.ops.read = read_op_ptr;
452 hw->
nvm.ops.release(hw);
482 hw_dbg(
"EEPROM read failed\n");
496 hw->
nvm.ops.release(hw);
497 hw_dbg(
"NVM Read Error while updating checksum.\n");
503 ret_val = igb_write_nvm_srwr(hw, NVM_CHECKSUM_REG, 1,
506 hw->
nvm.ops.release(hw);
507 hw_dbg(
"NVM Write Error while updating checksum.\n");
511 hw->
nvm.ops.release(hw);
531 ret_val = igb_pool_flash_update_done_i210(hw);
533 hw_dbg(
"Flash update time out\n");
540 ret_val = igb_pool_flash_update_done_i210(hw);
542 hw_dbg(
"Flash update complete\n");
544 hw_dbg(
"Flash update time out\n");
555 s32 igb_pool_flash_update_done_i210(
struct e1000_hw *hw)
586 hw_dbg(
"NVM Read Error\n");
591 switch (hw->
phy.media_type) {