Lines Matching full:eeprom

134 	 * 10gig parts do not have a word in the EEPROM to determine the  in ixgbe_setup_fc_generic()
494 * ixgbe_read_pba_string_generic - Reads part number string from EEPROM
496 * @pba_num: stores the part number string from the EEPROM
499 * Reads the part number string from the EEPROM.
515 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM0_PTR, &data); in ixgbe_read_pba_string_generic()
521 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM1_PTR, &pba_ptr); in ixgbe_read_pba_string_generic()
567 ret_val = hw->eeprom.ops.read(hw, pba_ptr, &length); in ixgbe_read_pba_string_generic()
589 ret_val = hw->eeprom.ops.read(hw, pba_ptr + offset, &data); in ixgbe_read_pba_string_generic()
609 * in order for the MAC address to have been loaded from the EEPROM into RAR0
708 /* Get MAC instance from EEPROM for configuring CS4227 */ in ixgbe_set_lan_id_multi_port_pcie()
710 hw->eeprom.ops.read(hw, IXGBE_EEPROM_CTRL_4, &ee_ctrl_4); in ixgbe_set_lan_id_multi_port_pcie()
854 * ixgbe_init_eeprom_params_generic - Initialize EEPROM params
857 * Initializes the EEPROM parameters ixgbe_eeprom_info within the
858 * ixgbe_hw struct in order to set up EEPROM access.
862 struct ixgbe_eeprom_info *eeprom = &hw->eeprom; in ixgbe_init_eeprom_params_generic() local
866 if (eeprom->type == ixgbe_eeprom_uninitialized) { in ixgbe_init_eeprom_params_generic()
867 eeprom->type = ixgbe_eeprom_none; in ixgbe_init_eeprom_params_generic()
870 eeprom->semaphore_delay = 10; in ixgbe_init_eeprom_params_generic()
871 /* Clear EEPROM page size, it will be initialized as needed */ in ixgbe_init_eeprom_params_generic()
872 eeprom->word_page_size = 0; in ixgbe_init_eeprom_params_generic()
875 * Check for EEPROM present first. in ixgbe_init_eeprom_params_generic()
880 eeprom->type = ixgbe_eeprom_spi; in ixgbe_init_eeprom_params_generic()
883 * SPI EEPROM is assumed here. This code would need to in ixgbe_init_eeprom_params_generic()
884 * change if a future EEPROM is not SPI. in ixgbe_init_eeprom_params_generic()
887 eeprom->word_size = BIT(eeprom_size + in ixgbe_init_eeprom_params_generic()
892 eeprom->address_bits = 16; in ixgbe_init_eeprom_params_generic()
894 eeprom->address_bits = 8; in ixgbe_init_eeprom_params_generic()
895 hw_dbg(hw, "Eeprom params: type = %d, size = %d, address bits: %d\n", in ixgbe_init_eeprom_params_generic()
896 eeprom->type, eeprom->word_size, eeprom->address_bits); in ixgbe_init_eeprom_params_generic()
903 * ixgbe_write_eeprom_buffer_bit_bang_generic - Write EEPROM using bit-bang
905 * @offset: offset within the EEPROM to write
907 * @data: 16 bit word(s) to write to EEPROM
909 * Reads 16 bit word(s) from EEPROM through bit-bang method
917 hw->eeprom.ops.init_params(hw); in ixgbe_write_eeprom_buffer_bit_bang_generic()
919 if (words == 0 || (offset + words > hw->eeprom.word_size)) in ixgbe_write_eeprom_buffer_bit_bang_generic()
923 * The EEPROM page size cannot be queried from the chip. We do lazy in ixgbe_write_eeprom_buffer_bit_bang_generic()
926 if ((hw->eeprom.word_page_size == 0) && in ixgbe_write_eeprom_buffer_bit_bang_generic()
949 * ixgbe_write_eeprom_buffer_bit_bang - Writes 16 bit word(s) to EEPROM
951 * @offset: offset within the EEPROM to be written to
953 * @data: 16 bit word(s) to be written to the EEPROM
956 * EEPROM will most likely contain an invalid checksum.
967 /* Prepare the EEPROM for writing */ in ixgbe_write_eeprom_buffer_bit_bang()
990 if ((hw->eeprom.address_bits == 8) && in ixgbe_write_eeprom_buffer_bit_bang()
998 hw->eeprom.address_bits); in ixgbe_write_eeprom_buffer_bit_bang()
1000 page_size = hw->eeprom.word_page_size; in ixgbe_write_eeprom_buffer_bit_bang()
1020 /* Done with writing - release the EEPROM */ in ixgbe_write_eeprom_buffer_bit_bang()
1027 * ixgbe_write_eeprom_generic - Writes 16 bit value to EEPROM
1029 * @offset: offset within the EEPROM to be written to
1030 * @data: 16 bit word to be written to the EEPROM
1033 * EEPROM will most likely contain an invalid checksum.
1037 hw->eeprom.ops.init_params(hw); in ixgbe_write_eeprom_generic()
1039 if (offset >= hw->eeprom.word_size) in ixgbe_write_eeprom_generic()
1046 * ixgbe_read_eeprom_buffer_bit_bang_generic - Read EEPROM using bit-bang
1048 * @offset: offset within the EEPROM to be read
1050 * @data: read 16 bit words(s) from EEPROM
1052 * Reads 16 bit word(s) from EEPROM through bit-bang method
1060 hw->eeprom.ops.init_params(hw); in ixgbe_read_eeprom_buffer_bit_bang_generic()
1062 if (words == 0 || (offset + words > hw->eeprom.word_size)) in ixgbe_read_eeprom_buffer_bit_bang_generic()
1085 * ixgbe_read_eeprom_buffer_bit_bang - Read EEPROM using bit-bang
1087 * @offset: offset within the EEPROM to be read
1089 * @data: read 16 bit word(s) from EEPROM
1091 * Reads 16 bit word(s) from EEPROM through bit-bang method
1101 /* Prepare the EEPROM for reading */ in ixgbe_read_eeprom_buffer_bit_bang()
1116 if ((hw->eeprom.address_bits == 8) && in ixgbe_read_eeprom_buffer_bit_bang()
1124 hw->eeprom.address_bits); in ixgbe_read_eeprom_buffer_bit_bang()
1138 * ixgbe_read_eeprom_bit_bang_generic - Read EEPROM word using bit-bang
1140 * @offset: offset within the EEPROM to be read
1141 * @data: read 16 bit value from EEPROM
1143 * Reads 16 bit value from EEPROM through bit-bang method
1148 hw->eeprom.ops.init_params(hw); in ixgbe_read_eeprom_bit_bang_generic()
1150 if (offset >= hw->eeprom.word_size) in ixgbe_read_eeprom_bit_bang_generic()
1157 * ixgbe_read_eerd_buffer_generic - Read EEPROM word(s) using EERD
1159 * @offset: offset of word in the EEPROM to read
1161 * @data: 16 bit word(s) from the EEPROM
1163 * Reads a 16 bit word(s) from the EEPROM using the EERD register.
1172 hw->eeprom.ops.init_params(hw); in ixgbe_read_eerd_buffer_generic()
1174 if (words == 0 || offset >= hw->eeprom.word_size) in ixgbe_read_eerd_buffer_generic()
1188 hw_dbg(hw, "Eeprom read timed out\n"); in ixgbe_read_eerd_buffer_generic()
1197 * ixgbe_detect_eeprom_page_size_generic - Detect EEPROM page size
1199 * @offset: offset within the EEPROM to be used as a scratch pad
1201 * Discover EEPROM page size by writing marching data at given offset.
1215 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX; in ixgbe_detect_eeprom_page_size_generic()
1218 hw->eeprom.word_page_size = 0; in ixgbe_detect_eeprom_page_size_generic()
1228 * EEPROM address wraps around current page. in ixgbe_detect_eeprom_page_size_generic()
1230 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX - data[0]; in ixgbe_detect_eeprom_page_size_generic()
1232 hw_dbg(hw, "Detected EEPROM page size = %d words.\n", in ixgbe_detect_eeprom_page_size_generic()
1233 hw->eeprom.word_page_size); in ixgbe_detect_eeprom_page_size_generic()
1238 * ixgbe_read_eerd_generic - Read EEPROM word using EERD
1240 * @offset: offset of word in the EEPROM to read
1241 * @data: word read from the EEPROM
1243 * Reads a 16 bit word from the EEPROM using the EERD register.
1251 * ixgbe_write_eewr_buffer_generic - Write EEPROM word(s) using EEWR
1253 * @offset: offset of word in the EEPROM to write
1255 * @data: word(s) write to the EEPROM
1257 * Write a 16 bit word(s) to the EEPROM using the EEWR register.
1266 hw->eeprom.ops.init_params(hw); in ixgbe_write_eewr_buffer_generic()
1268 if (words == 0 || 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()
3409 * the EEPROM
3414 * This function will read the EEPROM from the alternative SAN MAC address
3429 if (hw->eeprom.ops.read(hw, offset, &alt_san_mac_blk_offset)) in ixgbe_get_wwn_prefix_generic()
3438 if (hw->eeprom.ops.read(hw, offset, &caps)) in ixgbe_get_wwn_prefix_generic()
3445 if (hw->eeprom.ops.read(hw, offset, wwnn_prefix)) in ixgbe_get_wwn_prefix_generic()
3446 hw_err(hw, "eeprom read at offset %d failed\n", offset); in ixgbe_get_wwn_prefix_generic()
3449 if (hw->eeprom.ops.read(hw, offset, wwpn_prefix)) in ixgbe_get_wwn_prefix_generic()
3455 hw_err(hw, "eeprom read at offset %d failed\n", offset); in ixgbe_get_wwn_prefix_generic()
3510 * @device_caps: the EEPROM word with the extra device capabilities
3512 * This function will read the EEPROM location for the device capabilities,
3517 hw->eeprom.ops.read(hw, IXGBE_DEVICE_CAPS, device_caps); in ixgbe_get_device_caps_generic()
3590 * @buffer: pointer to EEPROM
3591 * @length: size of EEPROM to calculate a checksum for
3901 status = hw->eeprom.ops.read(hw, IXGBE_ETS_CFG, ets_offset); in ixgbe_get_ets_data()
3908 status = hw->eeprom.ops.read(hw, *ets_offset, ets_cfg); in ixgbe_get_ets_data()
3950 status = hw->eeprom.ops.read(hw, (ets_offset + 1 + i), in ixgbe_get_thermal_sensor_data_generic()
4011 if (hw->eeprom.ops.read(hw, ets_offset + 1 + i, &ets_sensor)) { in ixgbe_init_thermal_sensor_thresh_generic()
4012 hw_err(hw, "eeprom read at offset %d failed\n", in ixgbe_init_thermal_sensor_thresh_generic()
4038 * ixgbe_get_orom_version - Return option ROM from EEPROM
4053 hw->eeprom.ops.read(hw, NVM_OROM_OFFSET, &offset); in ixgbe_get_orom_version()
4059 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_HI, &eeprom_cfg_blkh); in ixgbe_get_orom_version()
4060 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_LOW, &eeprom_cfg_blkl); in ixgbe_get_orom_version()
4076 * ixgbe_get_oem_prod_version - Etrack ID from EEPROM
4089 hw->eeprom.ops.read(hw, NVM_OEM_PROD_VER_PTR, &offset); in ixgbe_get_oem_prod_version()
4096 hw->eeprom.ops.read(hw, offset, &mod_len); in ixgbe_get_oem_prod_version()
4097 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_CAP_OFF, &cap); in ixgbe_get_oem_prod_version()
4104 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_OFF_L, &prod_ver); in ixgbe_get_oem_prod_version()
4105 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_OFF_H, &rel_num); in ixgbe_get_oem_prod_version()
4119 * ixgbe_get_etk_id - Return Etrack ID from EEPROM
4131 if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_LOW, &etk_id_l)) in ixgbe_get_etk_id()
4133 if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_HI, &etk_id_h)) in ixgbe_get_etk_id()