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()
874 eeprom->word_size = BIT(eeprom_size + in ixgbe_init_eeprom_params_generic()
879 eeprom->address_bits = 16; in ixgbe_init_eeprom_params_generic()
881 eeprom->address_bits = 8; in ixgbe_init_eeprom_params_generic()
882 hw_dbg(hw, "Eeprom params: type = %d, size = %d, address bits: %d\n", in ixgbe_init_eeprom_params_generic()
883 eeprom->type, eeprom->word_size, eeprom->address_bits); in ixgbe_init_eeprom_params_generic()
890 * ixgbe_write_eeprom_buffer_bit_bang_generic - Write EEPROM using bit-bang
892 * @offset: offset within the EEPROM to write
894 * @data: 16 bit word(s) to write to EEPROM
896 * Reads 16 bit word(s) from EEPROM through bit-bang method
904 hw->eeprom.ops.init_params(hw); in ixgbe_write_eeprom_buffer_bit_bang_generic()
906 if (words == 0 || (offset + words > hw->eeprom.word_size)) in ixgbe_write_eeprom_buffer_bit_bang_generic()
910 * The EEPROM page size cannot be queried from the chip. We do lazy in ixgbe_write_eeprom_buffer_bit_bang_generic()
913 if ((hw->eeprom.word_page_size == 0) && in ixgbe_write_eeprom_buffer_bit_bang_generic()
936 * ixgbe_write_eeprom_buffer_bit_bang - Writes 16 bit word(s) to EEPROM
938 * @offset: offset within the EEPROM to be written to
940 * @data: 16 bit word(s) to be written to the EEPROM
943 * EEPROM will most likely contain an invalid checksum.
954 /* Prepare the EEPROM for writing */ in ixgbe_write_eeprom_buffer_bit_bang()
977 if ((hw->eeprom.address_bits == 8) && in ixgbe_write_eeprom_buffer_bit_bang()
985 hw->eeprom.address_bits); in ixgbe_write_eeprom_buffer_bit_bang()
987 page_size = hw->eeprom.word_page_size; in ixgbe_write_eeprom_buffer_bit_bang()
1007 /* Done with writing - release the EEPROM */ in ixgbe_write_eeprom_buffer_bit_bang()
1014 * ixgbe_write_eeprom_generic - Writes 16 bit value to EEPROM
1016 * @offset: offset within the EEPROM to be written to
1017 * @data: 16 bit word to be written to the EEPROM
1020 * EEPROM will most likely contain an invalid checksum.
1024 hw->eeprom.ops.init_params(hw); in ixgbe_write_eeprom_generic()
1026 if (offset >= hw->eeprom.word_size) in ixgbe_write_eeprom_generic()
1033 * ixgbe_read_eeprom_buffer_bit_bang_generic - Read EEPROM using bit-bang
1035 * @offset: offset within the EEPROM to be read
1037 * @data: read 16 bit words(s) from EEPROM
1039 * Reads 16 bit word(s) from EEPROM through bit-bang method
1047 hw->eeprom.ops.init_params(hw); in ixgbe_read_eeprom_buffer_bit_bang_generic()
1049 if (words == 0 || (offset + words > hw->eeprom.word_size)) in ixgbe_read_eeprom_buffer_bit_bang_generic()
1072 * ixgbe_read_eeprom_buffer_bit_bang - Read EEPROM using bit-bang
1074 * @offset: offset within the EEPROM to be read
1076 * @data: read 16 bit word(s) from EEPROM
1078 * Reads 16 bit word(s) from EEPROM through bit-bang method
1088 /* Prepare the EEPROM for reading */ in ixgbe_read_eeprom_buffer_bit_bang()
1103 if ((hw->eeprom.address_bits == 8) && in ixgbe_read_eeprom_buffer_bit_bang()
1111 hw->eeprom.address_bits); in ixgbe_read_eeprom_buffer_bit_bang()
1125 * ixgbe_read_eeprom_bit_bang_generic - Read EEPROM word using bit-bang
1127 * @offset: offset within the EEPROM to be read
1128 * @data: read 16 bit value from EEPROM
1130 * Reads 16 bit value from EEPROM through bit-bang method
1135 hw->eeprom.ops.init_params(hw); in ixgbe_read_eeprom_bit_bang_generic()
1137 if (offset >= hw->eeprom.word_size) in ixgbe_read_eeprom_bit_bang_generic()
1144 * ixgbe_read_eerd_buffer_generic - Read EEPROM word(s) using EERD
1146 * @offset: offset of word in the EEPROM to read
1148 * @data: 16 bit word(s) from the EEPROM
1150 * Reads a 16 bit word(s) from the EEPROM using the EERD register.
1159 hw->eeprom.ops.init_params(hw); in ixgbe_read_eerd_buffer_generic()
1161 if (words == 0 || offset >= hw->eeprom.word_size) in ixgbe_read_eerd_buffer_generic()
1175 hw_dbg(hw, "Eeprom read timed out\n"); in ixgbe_read_eerd_buffer_generic()
1184 * ixgbe_detect_eeprom_page_size_generic - Detect EEPROM page size
1186 * @offset: offset within the EEPROM to be used as a scratch pad
1188 * Discover EEPROM page size by writing marching data at given offset.
1202 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX; in ixgbe_detect_eeprom_page_size_generic()
1205 hw->eeprom.word_page_size = 0; in ixgbe_detect_eeprom_page_size_generic()
1215 * EEPROM address wraps around current page. in ixgbe_detect_eeprom_page_size_generic()
1217 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX - data[0]; in ixgbe_detect_eeprom_page_size_generic()
1219 hw_dbg(hw, "Detected EEPROM page size = %d words.\n", in ixgbe_detect_eeprom_page_size_generic()
1220 hw->eeprom.word_page_size); in ixgbe_detect_eeprom_page_size_generic()
1225 * ixgbe_read_eerd_generic - Read EEPROM word using EERD
1227 * @offset: offset of word in the EEPROM to read
1228 * @data: word read from the EEPROM
1230 * Reads a 16 bit word from the EEPROM using the EERD register.
1238 * ixgbe_write_eewr_buffer_generic - Write EEPROM word(s) using EEWR
1240 * @offset: offset of word in the EEPROM to write
1242 * @data: word(s) write to the EEPROM
1244 * Write a 16 bit word(s) to the EEPROM using the EEWR register.
1253 hw->eeprom.ops.init_params(hw); in ixgbe_write_eewr_buffer_generic()
1255 if (words == 0 || offset >= hw->eeprom.word_size) in ixgbe_write_eewr_buffer_generic()
1265 hw_dbg(hw, "Eeprom write EEWR timed out\n"); in ixgbe_write_eewr_buffer_generic()
1273 hw_dbg(hw, "Eeprom write EEWR timed out\n"); in ixgbe_write_eewr_buffer_generic()
1282 * ixgbe_write_eewr_generic - Write EEPROM word using EEWR
1284 * @offset: offset of word in the EEPROM to write
1285 * @data: word write to the EEPROM
1287 * Write a 16 bit word to the EEPROM using the EEWR register.
1297 * @ee_reg: EEPROM flag for polling
1322 * ixgbe_acquire_eeprom - Acquire EEPROM using bit-bang
1325 * Prepares EEPROM for access using bit-bang method. This function should
1326 * be called before issuing a command to the EEPROM.
1338 /* Request EEPROM Access */ in ixgbe_acquire_eeprom()
1353 hw_dbg(hw, "Could not acquire EEPROM grant\n"); in ixgbe_acquire_eeprom()
1359 /* Setup EEPROM for Read/Write */ in ixgbe_acquire_eeprom()
1372 * Sets the hardware semaphores so EEPROM access can occur for bit-bang method
1393 hw_dbg(hw, "Driver can't access the Eeprom - SMBI Semaphore not granted.\n"); in ixgbe_get_eeprom_semaphore()
1417 /* Set the SW EEPROM semaphore bit to request access */ in ixgbe_get_eeprom_semaphore()
1431 /* Release semaphores and return error if SW EEPROM semaphore in ixgbe_get_eeprom_semaphore()
1432 * was not granted because we don't have access to the EEPROM in ixgbe_get_eeprom_semaphore()
1435 hw_dbg(hw, "SWESMBI Software EEPROM semaphore not granted.\n"); in ixgbe_get_eeprom_semaphore()
1462 * ixgbe_ready_eeprom - Polls for EEPROM ready
1472 * EEPROM will signal that the command has been completed by clearing in ixgbe_ready_eeprom()
1492 hw_dbg(hw, "SPI EEPROM Status error\n"); in ixgbe_ready_eeprom()
1500 * ixgbe_standby_eeprom - Returns EEPROM to a "standby" state
1521 * ixgbe_shift_out_eeprom_bits - Shift data bits out to the EEPROM.
1523 * @data: data to send to the EEPROM
1536 * Mask is used to shift "count" bits of "data" out to the EEPROM in ixgbe_shift_out_eeprom_bits()
1543 * A "1" is shifted out to the EEPROM by setting bit "DI" to a in ixgbe_shift_out_eeprom_bits()
1545 * bit controls the clock input to the EEPROM). A "0" is in ixgbe_shift_out_eeprom_bits()
1546 * shifted out to the EEPROM by setting "DI" to "0" and then in ixgbe_shift_out_eeprom_bits()
1564 * EEPROM in ixgbe_shift_out_eeprom_bits()
1576 * ixgbe_shift_in_eeprom_bits - Shift data bits in from the EEPROM
1587 * In order to read a register from the EEPROM, we need to shift in ixgbe_shift_in_eeprom_bits()
1588 * 'count' bits in from the EEPROM. Bits are "shifted in" by raising in ixgbe_shift_in_eeprom_bits()
1589 * the clock input to the EEPROM (setting the SK bit), and then reading in ixgbe_shift_in_eeprom_bits()
1614 * ixgbe_raise_eeprom_clk - Raises the EEPROM's clock input.
1621 * Raise the clock input to the EEPROM in ixgbe_raise_eeprom_clk()
1631 * ixgbe_lower_eeprom_clk - Lowers the EEPROM's clock input.
1638 * Lower the clock input to the EEPROM (clearing the SK bit), then in ixgbe_lower_eeprom_clk()
1648 * ixgbe_release_eeprom - Release EEPROM, release semaphores
1665 /* Stop requesting EEPROM access */ in ixgbe_release_eeprom()
1675 usleep_range(hw->eeprom.semaphore_delay * 1000, in ixgbe_release_eeprom()
1676 hw->eeprom.semaphore_delay * 2000); in ixgbe_release_eeprom()
1694 if (hw->eeprom.ops.read(hw, i, &word)) { in ixgbe_calc_eeprom_checksum_generic()
1695 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_generic()
1703 if (hw->eeprom.ops.read(hw, i, &pointer)) { in ixgbe_calc_eeprom_checksum_generic()
1704 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_generic()
1712 if (hw->eeprom.ops.read(hw, pointer, &length)) { in ixgbe_calc_eeprom_checksum_generic()
1713 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_generic()
1721 if (hw->eeprom.ops.read(hw, j, &word)) { in ixgbe_calc_eeprom_checksum_generic()
1722 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_generic()
1735 * ixgbe_validate_eeprom_checksum_generic - Validate EEPROM checksum
1739 * Performs checksum calculation and validates the EEPROM checksum. If the
1750 * Read the first word from the EEPROM. If this times out or fails, do in ixgbe_validate_eeprom_checksum_generic()
1752 * EEPROM read fails in ixgbe_validate_eeprom_checksum_generic()
1754 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_validate_eeprom_checksum_generic()
1756 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_validate_eeprom_checksum_generic()
1760 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_validate_eeprom_checksum_generic()
1766 status = hw->eeprom.ops.read(hw, IXGBE_EEPROM_CHECKSUM, &read_checksum); in ixgbe_validate_eeprom_checksum_generic()
1768 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_validate_eeprom_checksum_generic()
1772 /* Verify read checksum from EEPROM is the same as in ixgbe_validate_eeprom_checksum_generic()
1786 * ixgbe_update_eeprom_checksum_generic - Updates the EEPROM checksum
1795 * Read the first word from the EEPROM. If this times out or fails, do in ixgbe_update_eeprom_checksum_generic()
1797 * EEPROM read fails in ixgbe_update_eeprom_checksum_generic()
1799 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_update_eeprom_checksum_generic()
1801 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_update_eeprom_checksum_generic()
1805 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_update_eeprom_checksum_generic()
1811 status = hw->eeprom.ops.write(hw, IXGBE_EEPROM_CHECKSUM, checksum); in ixgbe_update_eeprom_checksum_generic()
1928 * Otherwise, use the permanent address from the eeprom. in ixgbe_init_rx_addrs_generic()
2574 * function (CSR, PHY0, PHY1, EEPROM, Flash)
2619 * function (CSR, PHY0, PHY1, EEPROM, Flash)
2816 * ixgbe_get_san_mac_addr_offset - Get SAN MAC address offset from the EEPROM
2820 * This function will read the EEPROM location for the SAN MAC address
2830 * First read the EEPROM pointer to see if the MAC addresses are in ixgbe_get_san_mac_addr_offset()
2833 ret_val = hw->eeprom.ops.read(hw, IXGBE_SAN_MAC_ADDR_PTR, in ixgbe_get_san_mac_addr_offset()
2836 hw_err(hw, "eeprom read at offset %d failed\n", in ixgbe_get_san_mac_addr_offset()
2843 * ixgbe_get_san_mac_addr_generic - SAN MAC address retrieval from the EEPROM
2847 * Reads the SAN MAC address from the EEPROM, if it's available. This is
2859 * First read the EEPROM pointer to see if the MAC addresses are in ixgbe_get_san_mac_addr_generic()
2873 ret_val = hw->eeprom.ops.read(hw, san_mac_offset, in ixgbe_get_san_mac_addr_generic()
2876 hw_err(hw, "eeprom read at offset %d failed\n", in ixgbe_get_san_mac_addr_generic()
2887 /* No addresses available in this EEPROM. It's not necessarily an in ixgbe_get_san_mac_addr_generic()
3391 * the EEPROM
3396 * This function will read the EEPROM from the alternative SAN MAC address
3411 if (hw->eeprom.ops.read(hw, offset, &alt_san_mac_blk_offset)) in ixgbe_get_wwn_prefix_generic()
3420 if (hw->eeprom.ops.read(hw, offset, &caps)) in ixgbe_get_wwn_prefix_generic()
3427 if (hw->eeprom.ops.read(hw, offset, wwnn_prefix)) in ixgbe_get_wwn_prefix_generic()
3428 hw_err(hw, "eeprom read at offset %d failed\n", offset); in ixgbe_get_wwn_prefix_generic()
3431 if (hw->eeprom.ops.read(hw, offset, wwpn_prefix)) in ixgbe_get_wwn_prefix_generic()
3437 hw_err(hw, "eeprom read at offset %d failed\n", offset); in ixgbe_get_wwn_prefix_generic()
3492 * @device_caps: the EEPROM word with the extra device capabilities
3494 * This function will read the EEPROM location for the device capabilities,
3499 hw->eeprom.ops.read(hw, IXGBE_DEVICE_CAPS, device_caps); in ixgbe_get_device_caps_generic()
3572 * @buffer: pointer to EEPROM
3573 * @length: size of EEPROM to calculate a checksum for
3883 status = hw->eeprom.ops.read(hw, IXGBE_ETS_CFG, ets_offset); in ixgbe_get_ets_data()
3890 status = hw->eeprom.ops.read(hw, *ets_offset, ets_cfg); in ixgbe_get_ets_data()
3932 status = hw->eeprom.ops.read(hw, (ets_offset + 1 + i), in ixgbe_get_thermal_sensor_data_generic()
3993 if (hw->eeprom.ops.read(hw, ets_offset + 1 + i, &ets_sensor)) { in ixgbe_init_thermal_sensor_thresh_generic()
3994 hw_err(hw, "eeprom read at offset %d failed\n", in ixgbe_init_thermal_sensor_thresh_generic()
4020 * ixgbe_get_orom_version - Return option ROM from EEPROM
4035 hw->eeprom.ops.read(hw, NVM_OROM_OFFSET, &offset); in ixgbe_get_orom_version()
4041 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_HI, &eeprom_cfg_blkh); in ixgbe_get_orom_version()
4042 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_LOW, &eeprom_cfg_blkl); in ixgbe_get_orom_version()
4058 * ixgbe_get_oem_prod_version - Etrack ID from EEPROM
4071 hw->eeprom.ops.read(hw, NVM_OEM_PROD_VER_PTR, &offset); in ixgbe_get_oem_prod_version()
4078 hw->eeprom.ops.read(hw, offset, &mod_len); in ixgbe_get_oem_prod_version()
4079 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_CAP_OFF, &cap); in ixgbe_get_oem_prod_version()
4086 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_OFF_L, &prod_ver); in ixgbe_get_oem_prod_version()
4087 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_OFF_H, &rel_num); in ixgbe_get_oem_prod_version()
4101 * ixgbe_get_etk_id - Return Etrack ID from EEPROM
4113 if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_LOW, &etk_id_l)) in ixgbe_get_etk_id()
4115 if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_HI, &etk_id_h)) in ixgbe_get_etk_id()