Lines Matching full:eeprom

131 	 * 10gig parts do not have a word in the EEPROM to determine the  in ixgbe_setup_fc_generic()
485 * ixgbe_read_pba_string_generic - Reads part number string from EEPROM
487 * @pba_num: stores the part number string from the EEPROM
490 * Reads the part number string from the EEPROM.
506 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM0_PTR, &data); in ixgbe_read_pba_string_generic()
512 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM1_PTR, &pba_ptr); in ixgbe_read_pba_string_generic()
558 ret_val = hw->eeprom.ops.read(hw, pba_ptr, &length); in ixgbe_read_pba_string_generic()
580 ret_val = hw->eeprom.ops.read(hw, pba_ptr + offset, &data); in ixgbe_read_pba_string_generic()
600 * in order for the MAC address to have been loaded from the EEPROM into RAR0
695 /* Get MAC instance from EEPROM for configuring CS4227 */ in ixgbe_set_lan_id_multi_port_pcie()
697 hw->eeprom.ops.read(hw, IXGBE_EEPROM_CTRL_4, &ee_ctrl_4); in ixgbe_set_lan_id_multi_port_pcie()
841 * ixgbe_init_eeprom_params_generic - Initialize EEPROM params
844 * Initializes the EEPROM parameters ixgbe_eeprom_info within the
845 * ixgbe_hw struct in order to set up EEPROM access.
849 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_generic() local
853 if (eeprom->type == ixgbe_eeprom_uninitialized) { in ixgbe_init_eeprom_params_generic()
854 eeprom->type = ixgbe_eeprom_none; in ixgbe_init_eeprom_params_generic()
857 eeprom->semaphore_delay = 10; in ixgbe_init_eeprom_params_generic()
858 /* Clear EEPROM page size, it will be initialized as needed */ in ixgbe_init_eeprom_params_generic()
859 eeprom->word_page_size = 0; in ixgbe_init_eeprom_params_generic()
862 * Check for EEPROM present first. in ixgbe_init_eeprom_params_generic()
867 eeprom->type = ixgbe_eeprom_spi; in ixgbe_init_eeprom_params_generic()
870 * SPI EEPROM is assumed here. This code would need to in ixgbe_init_eeprom_params_generic()
871 * change if a future EEPROM is not SPI. in ixgbe_init_eeprom_params_generic()
875 eeprom->word_size = BIT(eeprom_size + in ixgbe_init_eeprom_params_generic()
880 eeprom->address_bits = 16; in ixgbe_init_eeprom_params_generic()
882 eeprom->address_bits = 8; in ixgbe_init_eeprom_params_generic()
883 hw_dbg(hw, "Eeprom params: type = %d, size = %d, address bits: %d\n", in ixgbe_init_eeprom_params_generic()
884 eeprom->type, eeprom->word_size, eeprom->address_bits); in ixgbe_init_eeprom_params_generic()
891 * ixgbe_write_eeprom_buffer_bit_bang_generic - Write EEPROM using bit-bang
893 * @offset: offset within the EEPROM to write
895 * @data: 16 bit word(s) to write to EEPROM
897 * Reads 16 bit word(s) from EEPROM through bit-bang method
905 hw->eeprom.ops.init_params(hw); in ixgbe_write_eeprom_buffer_bit_bang_generic()
910 if (offset + words > hw->eeprom.word_size) in ixgbe_write_eeprom_buffer_bit_bang_generic()
914 * The EEPROM page size cannot be queried from the chip. We do lazy in ixgbe_write_eeprom_buffer_bit_bang_generic()
917 if ((hw->eeprom.word_page_size == 0) && in ixgbe_write_eeprom_buffer_bit_bang_generic()
940 * ixgbe_write_eeprom_buffer_bit_bang - Writes 16 bit word(s) to EEPROM
942 * @offset: offset within the EEPROM to be written to
944 * @data: 16 bit word(s) to be written to the EEPROM
947 * EEPROM will most likely contain an invalid checksum.
958 /* Prepare the EEPROM for writing */ in ixgbe_write_eeprom_buffer_bit_bang()
981 if ((hw->eeprom.address_bits == 8) && in ixgbe_write_eeprom_buffer_bit_bang()
989 hw->eeprom.address_bits); in ixgbe_write_eeprom_buffer_bit_bang()
991 page_size = hw->eeprom.word_page_size; in ixgbe_write_eeprom_buffer_bit_bang()
1011 /* Done with writing - release the EEPROM */ in ixgbe_write_eeprom_buffer_bit_bang()
1018 * ixgbe_write_eeprom_generic - Writes 16 bit value to EEPROM
1020 * @offset: offset within the EEPROM to be written to
1021 * @data: 16 bit word to be written to the EEPROM
1024 * EEPROM will most likely contain an invalid checksum.
1028 hw->eeprom.ops.init_params(hw); in ixgbe_write_eeprom_generic()
1030 if (offset >= hw->eeprom.word_size) in ixgbe_write_eeprom_generic()
1037 * ixgbe_read_eeprom_buffer_bit_bang_generic - Read EEPROM using bit-bang
1039 * @offset: offset within the EEPROM to be read
1041 * @data: read 16 bit words(s) from EEPROM
1043 * Reads 16 bit word(s) from EEPROM through bit-bang method
1051 hw->eeprom.ops.init_params(hw); in ixgbe_read_eeprom_buffer_bit_bang_generic()
1056 if (offset + words > hw->eeprom.word_size) in ixgbe_read_eeprom_buffer_bit_bang_generic()
1079 * ixgbe_read_eeprom_buffer_bit_bang - Read EEPROM using bit-bang
1081 * @offset: offset within the EEPROM to be read
1083 * @data: read 16 bit word(s) from EEPROM
1085 * Reads 16 bit word(s) from EEPROM through bit-bang method
1095 /* Prepare the EEPROM for reading */ in ixgbe_read_eeprom_buffer_bit_bang()
1110 if ((hw->eeprom.address_bits == 8) && in ixgbe_read_eeprom_buffer_bit_bang()
1118 hw->eeprom.address_bits); in ixgbe_read_eeprom_buffer_bit_bang()
1132 * ixgbe_read_eeprom_bit_bang_generic - Read EEPROM word using bit-bang
1134 * @offset: offset within the EEPROM to be read
1135 * @data: read 16 bit value from EEPROM
1137 * Reads 16 bit value from EEPROM through bit-bang method
1142 hw->eeprom.ops.init_params(hw); in ixgbe_read_eeprom_bit_bang_generic()
1144 if (offset >= hw->eeprom.word_size) in ixgbe_read_eeprom_bit_bang_generic()
1151 * ixgbe_read_eerd_buffer_generic - Read EEPROM word(s) using EERD
1153 * @offset: offset of word in the EEPROM to read
1155 * @data: 16 bit word(s) from the EEPROM
1157 * Reads a 16 bit word(s) from the EEPROM using the EERD register.
1166 hw->eeprom.ops.init_params(hw); in ixgbe_read_eerd_buffer_generic()
1171 if (offset >= hw->eeprom.word_size) in ixgbe_read_eerd_buffer_generic()
1185 hw_dbg(hw, "Eeprom read timed out\n"); in ixgbe_read_eerd_buffer_generic()
1194 * ixgbe_detect_eeprom_page_size_generic - Detect EEPROM page size
1196 * @offset: offset within the EEPROM to be used as a scratch pad
1198 * Discover EEPROM page size by writing marching data at given offset.
1212 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX; in ixgbe_detect_eeprom_page_size_generic()
1215 hw->eeprom.word_page_size = 0; in ixgbe_detect_eeprom_page_size_generic()
1225 * EEPROM address wraps around current page. in ixgbe_detect_eeprom_page_size_generic()
1227 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX - data[0]; in ixgbe_detect_eeprom_page_size_generic()
1229 hw_dbg(hw, "Detected EEPROM page size = %d words.\n", in ixgbe_detect_eeprom_page_size_generic()
1230 hw->eeprom.word_page_size); in ixgbe_detect_eeprom_page_size_generic()
1235 * ixgbe_read_eerd_generic - Read EEPROM word using EERD
1237 * @offset: offset of word in the EEPROM to read
1238 * @data: word read from the EEPROM
1240 * Reads a 16 bit word from the EEPROM using the EERD register.
1248 * ixgbe_write_eewr_buffer_generic - Write EEPROM word(s) using EEWR
1250 * @offset: offset of word in the EEPROM to write
1252 * @data: word(s) write to the EEPROM
1254 * Write a 16 bit word(s) to the EEPROM using the EEWR register.
1263 hw->eeprom.ops.init_params(hw); in ixgbe_write_eewr_buffer_generic()
1268 if (offset >= hw->eeprom.word_size) in ixgbe_write_eewr_buffer_generic()
1278 hw_dbg(hw, "Eeprom write EEWR timed out\n"); in ixgbe_write_eewr_buffer_generic()
1286 hw_dbg(hw, "Eeprom write EEWR timed out\n"); in ixgbe_write_eewr_buffer_generic()
1295 * ixgbe_write_eewr_generic - Write EEPROM word using EEWR
1297 * @offset: offset of word in the EEPROM to write
1298 * @data: word write to the EEPROM
1300 * Write a 16 bit word to the EEPROM using the EEWR register.
1310 * @ee_reg: EEPROM flag for polling
1335 * ixgbe_acquire_eeprom - Acquire EEPROM using bit-bang
1338 * Prepares EEPROM for access using bit-bang method. This function should
1339 * be called before issuing a command to the EEPROM.
1351 /* Request EEPROM Access */ in ixgbe_acquire_eeprom()
1366 hw_dbg(hw, "Could not acquire EEPROM grant\n"); in ixgbe_acquire_eeprom()
1372 /* Setup EEPROM for Read/Write */ in ixgbe_acquire_eeprom()
1385 * Sets the hardware semaphores so EEPROM access can occur for bit-bang method
1406 hw_dbg(hw, "Driver can't access the Eeprom - SMBI Semaphore not granted.\n"); in ixgbe_get_eeprom_semaphore()
1430 /* Set the SW EEPROM semaphore bit to request access */ in ixgbe_get_eeprom_semaphore()
1444 /* Release semaphores and return error if SW EEPROM semaphore in ixgbe_get_eeprom_semaphore()
1445 * was not granted because we don't have access to the EEPROM in ixgbe_get_eeprom_semaphore()
1448 hw_dbg(hw, "SWESMBI Software EEPROM semaphore not granted.\n"); in ixgbe_get_eeprom_semaphore()
1475 * ixgbe_ready_eeprom - Polls for EEPROM ready
1485 * EEPROM will signal that the command has been completed by clearing in ixgbe_ready_eeprom()
1505 hw_dbg(hw, "SPI EEPROM Status error\n"); in ixgbe_ready_eeprom()
1513 * ixgbe_standby_eeprom - Returns EEPROM to a "standby" state
1534 * ixgbe_shift_out_eeprom_bits - Shift data bits out to the EEPROM.
1536 * @data: data to send to the EEPROM
1549 * Mask is used to shift "count" bits of "data" out to the EEPROM in ixgbe_shift_out_eeprom_bits()
1556 * A "1" is shifted out to the EEPROM by setting bit "DI" to a in ixgbe_shift_out_eeprom_bits()
1558 * bit controls the clock input to the EEPROM). A "0" is in ixgbe_shift_out_eeprom_bits()
1559 * shifted out to the EEPROM by setting "DI" to "0" and then in ixgbe_shift_out_eeprom_bits()
1577 * EEPROM in ixgbe_shift_out_eeprom_bits()
1589 * ixgbe_shift_in_eeprom_bits - Shift data bits in from the EEPROM
1600 * In order to read a register from the EEPROM, we need to shift in ixgbe_shift_in_eeprom_bits()
1601 * 'count' bits in from the EEPROM. Bits are "shifted in" by raising in ixgbe_shift_in_eeprom_bits()
1602 * the clock input to the EEPROM (setting the SK bit), and then reading in ixgbe_shift_in_eeprom_bits()
1627 * ixgbe_raise_eeprom_clk - Raises the EEPROM's clock input.
1634 * Raise the clock input to the EEPROM in ixgbe_raise_eeprom_clk()
1644 * ixgbe_lower_eeprom_clk - Lowers the EEPROM's clock input.
1651 * Lower the clock input to the EEPROM (clearing the SK bit), then in ixgbe_lower_eeprom_clk()
1661 * ixgbe_release_eeprom - Release EEPROM, release semaphores
1678 /* Stop requesting EEPROM access */ in ixgbe_release_eeprom()
1688 usleep_range(hw->eeprom.semaphore_delay * 1000, in ixgbe_release_eeprom()
1689 hw->eeprom.semaphore_delay * 2000); in ixgbe_release_eeprom()
1707 if (hw->eeprom.ops.read(hw, i, &word)) { in ixgbe_calc_eeprom_checksum_generic()
1708 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_generic()
1716 if (hw->eeprom.ops.read(hw, i, &pointer)) { in ixgbe_calc_eeprom_checksum_generic()
1717 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_generic()
1725 if (hw->eeprom.ops.read(hw, pointer, &length)) { in ixgbe_calc_eeprom_checksum_generic()
1726 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_generic()
1734 if (hw->eeprom.ops.read(hw, j, &word)) { in ixgbe_calc_eeprom_checksum_generic()
1735 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_generic()
1748 * ixgbe_validate_eeprom_checksum_generic - Validate EEPROM checksum
1752 * Performs checksum calculation and validates the EEPROM checksum. If the
1763 * Read the first word from the EEPROM. If this times out or fails, do in ixgbe_validate_eeprom_checksum_generic()
1765 * EEPROM read fails in ixgbe_validate_eeprom_checksum_generic()
1767 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_validate_eeprom_checksum_generic()
1769 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_validate_eeprom_checksum_generic()
1773 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_validate_eeprom_checksum_generic()
1779 status = hw->eeprom.ops.read(hw, IXGBE_EEPROM_CHECKSUM, &read_checksum); in ixgbe_validate_eeprom_checksum_generic()
1781 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_validate_eeprom_checksum_generic()
1785 /* Verify read checksum from EEPROM is the same as in ixgbe_validate_eeprom_checksum_generic()
1799 * ixgbe_update_eeprom_checksum_generic - Updates the EEPROM checksum
1808 * Read the first word from the EEPROM. If this times out or fails, do in ixgbe_update_eeprom_checksum_generic()
1810 * EEPROM read fails in ixgbe_update_eeprom_checksum_generic()
1812 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_update_eeprom_checksum_generic()
1814 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_update_eeprom_checksum_generic()
1818 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_update_eeprom_checksum_generic()
1824 status = hw->eeprom.ops.write(hw, IXGBE_EEPROM_CHECKSUM, checksum); in ixgbe_update_eeprom_checksum_generic()
1941 * Otherwise, use the permanent address from the eeprom. in ixgbe_init_rx_addrs_generic()
2587 * function (CSR, PHY0, PHY1, EEPROM, Flash)
2632 * function (CSR, PHY0, PHY1, EEPROM, Flash)
2829 * ixgbe_get_san_mac_addr_offset - Get SAN MAC address offset from the EEPROM
2833 * This function will read the EEPROM location for the SAN MAC address
2843 * First read the EEPROM pointer to see if the MAC addresses are in ixgbe_get_san_mac_addr_offset()
2846 ret_val = hw->eeprom.ops.read(hw, IXGBE_SAN_MAC_ADDR_PTR, in ixgbe_get_san_mac_addr_offset()
2849 hw_err(hw, "eeprom read at offset %d failed\n", in ixgbe_get_san_mac_addr_offset()
2856 * ixgbe_get_san_mac_addr_generic - SAN MAC address retrieval from the EEPROM
2860 * Reads the SAN MAC address from the EEPROM, if it's available. This is
2872 * First read the EEPROM pointer to see if the MAC addresses are in ixgbe_get_san_mac_addr_generic()
2886 ret_val = hw->eeprom.ops.read(hw, san_mac_offset, in ixgbe_get_san_mac_addr_generic()
2889 hw_err(hw, "eeprom read at offset %d failed\n", in ixgbe_get_san_mac_addr_generic()
2900 /* No addresses available in this EEPROM. It's not necessarily an in ixgbe_get_san_mac_addr_generic()
3389 * the EEPROM
3394 * This function will read the EEPROM from the alternative SAN MAC address
3409 if (hw->eeprom.ops.read(hw, offset, &alt_san_mac_blk_offset)) in ixgbe_get_wwn_prefix_generic()
3418 if (hw->eeprom.ops.read(hw, offset, &caps)) in ixgbe_get_wwn_prefix_generic()
3425 if (hw->eeprom.ops.read(hw, offset, wwnn_prefix)) in ixgbe_get_wwn_prefix_generic()
3426 hw_err(hw, "eeprom read at offset %d failed\n", offset); in ixgbe_get_wwn_prefix_generic()
3429 if (hw->eeprom.ops.read(hw, offset, wwpn_prefix)) in ixgbe_get_wwn_prefix_generic()
3435 hw_err(hw, "eeprom read at offset %d failed\n", offset); in ixgbe_get_wwn_prefix_generic()
3490 * @device_caps: the EEPROM word with the extra device capabilities
3492 * This function will read the EEPROM location for the device capabilities,
3497 hw->eeprom.ops.read(hw, IXGBE_DEVICE_CAPS, device_caps); in ixgbe_get_device_caps_generic()
3570 * @buffer: pointer to EEPROM
3571 * @length: size of EEPROM to calculate a checksum for
3880 status = hw->eeprom.ops.read(hw, IXGBE_ETS_CFG, ets_offset); in ixgbe_get_ets_data()
3887 status = hw->eeprom.ops.read(hw, *ets_offset, ets_cfg); in ixgbe_get_ets_data()
3929 status = hw->eeprom.ops.read(hw, (ets_offset + 1 + i), in ixgbe_get_thermal_sensor_data_generic()
3991 if (hw->eeprom.ops.read(hw, ets_offset + 1 + i, &ets_sensor)) { in ixgbe_init_thermal_sensor_thresh_generic()
3992 hw_err(hw, "eeprom read at offset %d failed\n", in ixgbe_init_thermal_sensor_thresh_generic()
4018 * ixgbe_get_orom_version - Return option ROM from EEPROM
4033 hw->eeprom.ops.read(hw, NVM_OROM_OFFSET, &offset); in ixgbe_get_orom_version()
4039 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_HI, &eeprom_cfg_blkh); in ixgbe_get_orom_version()
4040 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_LOW, &eeprom_cfg_blkl); in ixgbe_get_orom_version()
4056 * ixgbe_get_oem_prod_version - Etrack ID from EEPROM
4069 hw->eeprom.ops.read(hw, NVM_OEM_PROD_VER_PTR, &offset); in ixgbe_get_oem_prod_version()
4076 hw->eeprom.ops.read(hw, offset, &mod_len); in ixgbe_get_oem_prod_version()
4077 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_CAP_OFF, &cap); in ixgbe_get_oem_prod_version()
4084 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_OFF_L, &prod_ver); in ixgbe_get_oem_prod_version()
4085 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_OFF_H, &rel_num); in ixgbe_get_oem_prod_version()
4099 * ixgbe_get_etk_id - Return Etrack ID from EEPROM
4111 if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_LOW, &etk_id_l)) in ixgbe_get_etk_id()
4113 if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_HI, &etk_id_h)) in ixgbe_get_etk_id()