Lines Matching full:eeprom
130 * 10gig parts do not have a word in the EEPROM to determine the in ixgbe_setup_fc_generic()
484 * ixgbe_read_pba_string_generic - Reads part number string from EEPROM
486 * @pba_num: stores the part number string from the EEPROM
489 * Reads the part number string from the EEPROM.
505 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM0_PTR, &data); in ixgbe_read_pba_string_generic()
511 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM1_PTR, &pba_ptr); in ixgbe_read_pba_string_generic()
557 ret_val = hw->eeprom.ops.read(hw, pba_ptr, &length); in ixgbe_read_pba_string_generic()
579 ret_val = hw->eeprom.ops.read(hw, pba_ptr + offset, &data); in ixgbe_read_pba_string_generic()
599 * in order for the MAC address to have been loaded from the EEPROM into RAR0
694 /* Get MAC instance from EEPROM for configuring CS4227 */ in ixgbe_set_lan_id_multi_port_pcie()
696 hw->eeprom.ops.read(hw, IXGBE_EEPROM_CTRL_4, &ee_ctrl_4); in ixgbe_set_lan_id_multi_port_pcie()
840 * ixgbe_init_eeprom_params_generic - Initialize EEPROM params
843 * Initializes the EEPROM parameters ixgbe_eeprom_info within the
844 * ixgbe_hw struct in order to set up EEPROM access.
848 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_generic() local
852 if (eeprom->type == ixgbe_eeprom_uninitialized) { in ixgbe_init_eeprom_params_generic()
853 eeprom->type = ixgbe_eeprom_none; in ixgbe_init_eeprom_params_generic()
856 eeprom->semaphore_delay = 10; in ixgbe_init_eeprom_params_generic()
857 /* Clear EEPROM page size, it will be initialized as needed */ in ixgbe_init_eeprom_params_generic()
858 eeprom->word_page_size = 0; in ixgbe_init_eeprom_params_generic()
861 * Check for EEPROM present first. in ixgbe_init_eeprom_params_generic()
866 eeprom->type = ixgbe_eeprom_spi; in ixgbe_init_eeprom_params_generic()
869 * SPI EEPROM is assumed here. This code would need to in ixgbe_init_eeprom_params_generic()
870 * 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()
909 if (offset + words > hw->eeprom.word_size) in ixgbe_write_eeprom_buffer_bit_bang_generic()
913 * The EEPROM page size cannot be queried from the chip. We do lazy in ixgbe_write_eeprom_buffer_bit_bang_generic()
916 if ((hw->eeprom.word_page_size == 0) && in ixgbe_write_eeprom_buffer_bit_bang_generic()
939 * ixgbe_write_eeprom_buffer_bit_bang - Writes 16 bit word(s) to EEPROM
941 * @offset: offset within the EEPROM to be written to
943 * @data: 16 bit word(s) to be written to the EEPROM
946 * EEPROM will most likely contain an invalid checksum.
957 /* Prepare the EEPROM for writing */ in ixgbe_write_eeprom_buffer_bit_bang()
980 if ((hw->eeprom.address_bits == 8) && in ixgbe_write_eeprom_buffer_bit_bang()
988 hw->eeprom.address_bits); in ixgbe_write_eeprom_buffer_bit_bang()
990 page_size = hw->eeprom.word_page_size; in ixgbe_write_eeprom_buffer_bit_bang()
1010 /* Done with writing - release the EEPROM */ in ixgbe_write_eeprom_buffer_bit_bang()
1017 * ixgbe_write_eeprom_generic - Writes 16 bit value to EEPROM
1019 * @offset: offset within the EEPROM to be written to
1020 * @data: 16 bit word to be written to the EEPROM
1023 * EEPROM will most likely contain an invalid checksum.
1027 hw->eeprom.ops.init_params(hw); in ixgbe_write_eeprom_generic()
1029 if (offset >= hw->eeprom.word_size) in ixgbe_write_eeprom_generic()
1036 * ixgbe_read_eeprom_buffer_bit_bang_generic - Read EEPROM using bit-bang
1038 * @offset: offset within the EEPROM to be read
1040 * @data: read 16 bit words(s) from EEPROM
1042 * Reads 16 bit word(s) from EEPROM through bit-bang method
1050 hw->eeprom.ops.init_params(hw); in ixgbe_read_eeprom_buffer_bit_bang_generic()
1055 if (offset + words > hw->eeprom.word_size) in ixgbe_read_eeprom_buffer_bit_bang_generic()
1078 * ixgbe_read_eeprom_buffer_bit_bang - Read EEPROM using bit-bang
1080 * @offset: offset within the EEPROM to be read
1082 * @data: read 16 bit word(s) from EEPROM
1084 * Reads 16 bit word(s) from EEPROM through bit-bang method
1094 /* Prepare the EEPROM for reading */ in ixgbe_read_eeprom_buffer_bit_bang()
1109 if ((hw->eeprom.address_bits == 8) && in ixgbe_read_eeprom_buffer_bit_bang()
1117 hw->eeprom.address_bits); in ixgbe_read_eeprom_buffer_bit_bang()
1131 * ixgbe_read_eeprom_bit_bang_generic - Read EEPROM word using bit-bang
1133 * @offset: offset within the EEPROM to be read
1134 * @data: read 16 bit value from EEPROM
1136 * Reads 16 bit value from EEPROM through bit-bang method
1141 hw->eeprom.ops.init_params(hw); in ixgbe_read_eeprom_bit_bang_generic()
1143 if (offset >= hw->eeprom.word_size) in ixgbe_read_eeprom_bit_bang_generic()
1150 * ixgbe_read_eerd_buffer_generic - Read EEPROM word(s) using EERD
1152 * @offset: offset of word in the EEPROM to read
1154 * @data: 16 bit word(s) from the EEPROM
1156 * Reads a 16 bit word(s) from the EEPROM using the EERD register.
1165 hw->eeprom.ops.init_params(hw); in ixgbe_read_eerd_buffer_generic()
1170 if (offset >= hw->eeprom.word_size) in ixgbe_read_eerd_buffer_generic()
1184 hw_dbg(hw, "Eeprom read timed out\n"); in ixgbe_read_eerd_buffer_generic()
1193 * ixgbe_detect_eeprom_page_size_generic - Detect EEPROM page size
1195 * @offset: offset within the EEPROM to be used as a scratch pad
1197 * Discover EEPROM page size by writing marching data at given offset.
1211 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX; in ixgbe_detect_eeprom_page_size_generic()
1214 hw->eeprom.word_page_size = 0; in ixgbe_detect_eeprom_page_size_generic()
1224 * EEPROM address wraps around current page. in ixgbe_detect_eeprom_page_size_generic()
1226 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX - data[0]; in ixgbe_detect_eeprom_page_size_generic()
1228 hw_dbg(hw, "Detected EEPROM page size = %d words.\n", in ixgbe_detect_eeprom_page_size_generic()
1229 hw->eeprom.word_page_size); in ixgbe_detect_eeprom_page_size_generic()
1234 * ixgbe_read_eerd_generic - Read EEPROM word using EERD
1236 * @offset: offset of word in the EEPROM to read
1237 * @data: word read from the EEPROM
1239 * Reads a 16 bit word from the EEPROM using the EERD register.
1247 * ixgbe_write_eewr_buffer_generic - Write EEPROM word(s) using EEWR
1249 * @offset: offset of word in the EEPROM to write
1251 * @data: word(s) write to the EEPROM
1253 * Write a 16 bit word(s) to the EEPROM using the EEWR register.
1262 hw->eeprom.ops.init_params(hw); in ixgbe_write_eewr_buffer_generic()
1267 if (offset >= hw->eeprom.word_size) in ixgbe_write_eewr_buffer_generic()
1277 hw_dbg(hw, "Eeprom write EEWR timed out\n"); in ixgbe_write_eewr_buffer_generic()
1285 hw_dbg(hw, "Eeprom write EEWR timed out\n"); in ixgbe_write_eewr_buffer_generic()
1294 * ixgbe_write_eewr_generic - Write EEPROM word using EEWR
1296 * @offset: offset of word in the EEPROM to write
1297 * @data: word write to the EEPROM
1299 * Write a 16 bit word to the EEPROM using the EEWR register.
1309 * @ee_reg: EEPROM flag for polling
1334 * ixgbe_acquire_eeprom - Acquire EEPROM using bit-bang
1337 * Prepares EEPROM for access using bit-bang method. This function should
1338 * be called before issuing a command to the EEPROM.
1350 /* Request EEPROM Access */ in ixgbe_acquire_eeprom()
1365 hw_dbg(hw, "Could not acquire EEPROM grant\n"); in ixgbe_acquire_eeprom()
1371 /* Setup EEPROM for Read/Write */ in ixgbe_acquire_eeprom()
1384 * Sets the hardware semaphores so EEPROM access can occur for bit-bang method
1405 hw_dbg(hw, "Driver can't access the Eeprom - SMBI Semaphore not granted.\n"); in ixgbe_get_eeprom_semaphore()
1429 /* Set the SW EEPROM semaphore bit to request access */ in ixgbe_get_eeprom_semaphore()
1443 /* Release semaphores and return error if SW EEPROM semaphore in ixgbe_get_eeprom_semaphore()
1444 * was not granted because we don't have access to the EEPROM in ixgbe_get_eeprom_semaphore()
1447 hw_dbg(hw, "SWESMBI Software EEPROM semaphore not granted.\n"); in ixgbe_get_eeprom_semaphore()
1474 * ixgbe_ready_eeprom - Polls for EEPROM ready
1484 * EEPROM will signal that the command has been completed by clearing in ixgbe_ready_eeprom()
1504 hw_dbg(hw, "SPI EEPROM Status error\n"); in ixgbe_ready_eeprom()
1512 * ixgbe_standby_eeprom - Returns EEPROM to a "standby" state
1533 * ixgbe_shift_out_eeprom_bits - Shift data bits out to the EEPROM.
1535 * @data: data to send to the EEPROM
1548 * Mask is used to shift "count" bits of "data" out to the EEPROM in ixgbe_shift_out_eeprom_bits()
1555 * A "1" is shifted out to the EEPROM by setting bit "DI" to a in ixgbe_shift_out_eeprom_bits()
1557 * bit controls the clock input to the EEPROM). A "0" is in ixgbe_shift_out_eeprom_bits()
1558 * shifted out to the EEPROM by setting "DI" to "0" and then in ixgbe_shift_out_eeprom_bits()
1576 * EEPROM in ixgbe_shift_out_eeprom_bits()
1588 * ixgbe_shift_in_eeprom_bits - Shift data bits in from the EEPROM
1599 * In order to read a register from the EEPROM, we need to shift in ixgbe_shift_in_eeprom_bits()
1600 * 'count' bits in from the EEPROM. Bits are "shifted in" by raising in ixgbe_shift_in_eeprom_bits()
1601 * the clock input to the EEPROM (setting the SK bit), and then reading in ixgbe_shift_in_eeprom_bits()
1626 * ixgbe_raise_eeprom_clk - Raises the EEPROM's clock input.
1633 * Raise the clock input to the EEPROM in ixgbe_raise_eeprom_clk()
1643 * ixgbe_lower_eeprom_clk - Lowers the EEPROM's clock input.
1650 * Lower the clock input to the EEPROM (clearing the SK bit), then in ixgbe_lower_eeprom_clk()
1660 * ixgbe_release_eeprom - Release EEPROM, release semaphores
1677 /* Stop requesting EEPROM access */ in ixgbe_release_eeprom()
1687 usleep_range(hw->eeprom.semaphore_delay * 1000, in ixgbe_release_eeprom()
1688 hw->eeprom.semaphore_delay * 2000); in ixgbe_release_eeprom()
1706 if (hw->eeprom.ops.read(hw, i, &word)) { in ixgbe_calc_eeprom_checksum_generic()
1707 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_generic()
1715 if (hw->eeprom.ops.read(hw, i, &pointer)) { in ixgbe_calc_eeprom_checksum_generic()
1716 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_generic()
1724 if (hw->eeprom.ops.read(hw, pointer, &length)) { in ixgbe_calc_eeprom_checksum_generic()
1725 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_generic()
1733 if (hw->eeprom.ops.read(hw, j, &word)) { in ixgbe_calc_eeprom_checksum_generic()
1734 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_calc_eeprom_checksum_generic()
1747 * ixgbe_validate_eeprom_checksum_generic - Validate EEPROM checksum
1751 * Performs checksum calculation and validates the EEPROM checksum. If the
1762 * Read the first word from the EEPROM. If this times out or fails, do in ixgbe_validate_eeprom_checksum_generic()
1764 * EEPROM read fails in ixgbe_validate_eeprom_checksum_generic()
1766 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_validate_eeprom_checksum_generic()
1768 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_validate_eeprom_checksum_generic()
1772 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_validate_eeprom_checksum_generic()
1778 status = hw->eeprom.ops.read(hw, IXGBE_EEPROM_CHECKSUM, &read_checksum); in ixgbe_validate_eeprom_checksum_generic()
1780 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_validate_eeprom_checksum_generic()
1784 /* Verify read checksum from EEPROM is the same as in ixgbe_validate_eeprom_checksum_generic()
1798 * ixgbe_update_eeprom_checksum_generic - Updates the EEPROM checksum
1807 * Read the first word from the EEPROM. If this times out or fails, do in ixgbe_update_eeprom_checksum_generic()
1809 * EEPROM read fails in ixgbe_update_eeprom_checksum_generic()
1811 status = hw->eeprom.ops.read(hw, 0, &checksum); in ixgbe_update_eeprom_checksum_generic()
1813 hw_dbg(hw, "EEPROM read failed\n"); in ixgbe_update_eeprom_checksum_generic()
1817 status = hw->eeprom.ops.calc_checksum(hw); in ixgbe_update_eeprom_checksum_generic()
1823 status = hw->eeprom.ops.write(hw, IXGBE_EEPROM_CHECKSUM, checksum); in ixgbe_update_eeprom_checksum_generic()
1940 * Otherwise, use the permanent address from the eeprom. in ixgbe_init_rx_addrs_generic()
2586 * function (CSR, PHY0, PHY1, EEPROM, Flash)
2631 * function (CSR, PHY0, PHY1, EEPROM, Flash)
2828 * ixgbe_get_san_mac_addr_offset - Get SAN MAC address offset from the EEPROM
2832 * This function will read the EEPROM location for the SAN MAC address
2842 * First read the EEPROM pointer to see if the MAC addresses are in ixgbe_get_san_mac_addr_offset()
2845 ret_val = hw->eeprom.ops.read(hw, IXGBE_SAN_MAC_ADDR_PTR, in ixgbe_get_san_mac_addr_offset()
2848 hw_err(hw, "eeprom read at offset %d failed\n", in ixgbe_get_san_mac_addr_offset()
2855 * ixgbe_get_san_mac_addr_generic - SAN MAC address retrieval from the EEPROM
2859 * Reads the SAN MAC address from the EEPROM, if it's available. This is
2871 * First read the EEPROM pointer to see if the MAC addresses are in ixgbe_get_san_mac_addr_generic()
2885 ret_val = hw->eeprom.ops.read(hw, san_mac_offset, in ixgbe_get_san_mac_addr_generic()
2888 hw_err(hw, "eeprom read at offset %d failed\n", in ixgbe_get_san_mac_addr_generic()
2899 /* No addresses available in this EEPROM. It's not necessarily an in ixgbe_get_san_mac_addr_generic()
3388 * the EEPROM
3393 * This function will read the EEPROM from the alternative SAN MAC address
3408 if (hw->eeprom.ops.read(hw, offset, &alt_san_mac_blk_offset)) in ixgbe_get_wwn_prefix_generic()
3417 if (hw->eeprom.ops.read(hw, offset, &caps)) in ixgbe_get_wwn_prefix_generic()
3424 if (hw->eeprom.ops.read(hw, offset, wwnn_prefix)) in ixgbe_get_wwn_prefix_generic()
3425 hw_err(hw, "eeprom read at offset %d failed\n", offset); in ixgbe_get_wwn_prefix_generic()
3428 if (hw->eeprom.ops.read(hw, offset, wwpn_prefix)) in ixgbe_get_wwn_prefix_generic()
3434 hw_err(hw, "eeprom read at offset %d failed\n", offset); in ixgbe_get_wwn_prefix_generic()
3489 * @device_caps: the EEPROM word with the extra device capabilities
3491 * This function will read the EEPROM location for the device capabilities,
3496 hw->eeprom.ops.read(hw, IXGBE_DEVICE_CAPS, device_caps); in ixgbe_get_device_caps_generic()
3569 * @buffer: pointer to EEPROM
3570 * @length: size of EEPROM to calculate a checksum for
3881 status = hw->eeprom.ops.read(hw, IXGBE_ETS_CFG, ets_offset); in ixgbe_get_ets_data()
3888 status = hw->eeprom.ops.read(hw, *ets_offset, ets_cfg); in ixgbe_get_ets_data()
3930 status = hw->eeprom.ops.read(hw, (ets_offset + 1 + i), in ixgbe_get_thermal_sensor_data_generic()
3992 if (hw->eeprom.ops.read(hw, ets_offset + 1 + i, &ets_sensor)) { in ixgbe_init_thermal_sensor_thresh_generic()
3993 hw_err(hw, "eeprom read at offset %d failed\n", in ixgbe_init_thermal_sensor_thresh_generic()
4019 * ixgbe_get_orom_version - Return option ROM from EEPROM
4034 hw->eeprom.ops.read(hw, NVM_OROM_OFFSET, &offset); in ixgbe_get_orom_version()
4040 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_HI, &eeprom_cfg_blkh); in ixgbe_get_orom_version()
4041 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_LOW, &eeprom_cfg_blkl); in ixgbe_get_orom_version()
4057 * 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()