Lines Matching full:eeprom

71 	struct ixgbe_eeprom_info *eeprom = &hw->eeprom;
77 /* EEPROM */
78 eeprom->ops.init_params = ixgbe_init_eeprom_params_generic;
79 /* If EEPROM is valid (bit 8 = 1), use EERD otherwise use bit bang */
81 eeprom->ops.read = ixgbe_read_eerd_generic;
82 eeprom->ops.read_buffer = ixgbe_read_eerd_buffer_generic;
84 eeprom->ops.read = ixgbe_read_eeprom_bit_bang_generic;
85 eeprom->ops.read_buffer =
88 eeprom->ops.write = ixgbe_write_eeprom_generic;
89 eeprom->ops.write_buffer = ixgbe_write_eeprom_buffer_bit_bang_generic;
90 eeprom->ops.validate_checksum =
92 eeprom->ops.update_checksum = ixgbe_update_eeprom_checksum_generic;
93 eeprom->ops.calc_checksum = ixgbe_calc_eeprom_checksum_generic;
254 * 10gig parts do not have a word in the EEPROM to determine the
636 * ixgbe_read_pba_string_generic - Reads part number string from EEPROM
638 * @pba_num: stores the part number string from the EEPROM
641 * Reads the part number string from the EEPROM.
659 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM0_PTR, &data);
665 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM1_PTR, &pba_ptr);
711 ret_val = hw->eeprom.ops.read(hw, pba_ptr, &length);
717 if (length == 0xFFFF || length == 0 || length > hw->eeprom.word_size) {
733 ret_val = hw->eeprom.ops.read(hw, pba_ptr + offset, &data);
747 * ixgbe_read_pba_num_generic - Reads part number from EEPROM
749 * @pba_num: stores the part number from the EEPROM
751 * Reads the part number from the EEPROM.
760 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM0_PTR, &data);
770 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM1_PTR, &data);
783 * @eeprom_buf: optional pointer to EEPROM image
784 * @eeprom_buf_size: size of EEPROM image in words
788 * Reads PBA from EEPROM image when eeprom_buf is not NULL.
789 * Reads PBA from physical EEPROM device when eeprom_buf is NULL.
803 ret_val = hw->eeprom.ops.read_buffer(hw, IXGBE_PBANUM0_PTR, 2,
830 ret_val = hw->eeprom.ops.read_buffer(hw, pba->word[1],
853 * @eeprom_buf: optional pointer to EEPROM image
854 * @eeprom_buf_size: size of EEPROM image in words
857 * Writes PBA to EEPROM image when eeprom_buf is not NULL.
858 * Writes PBA to physical EEPROM device when eeprom_buf is NULL.
870 ret_val = hw->eeprom.ops.write_buffer(hw, IXGBE_PBANUM0_PTR, 2,
888 ret_val = hw->eeprom.ops.write_buffer(hw, pba->word[1],
911 * @eeprom_buf: optional pointer to EEPROM image
912 * @eeprom_buf_size: size of EEPROM image in words
915 * Returns the size of the PBA block in words. Function operates on EEPROM
917 * EEPROM device.
930 ret_val = hw->eeprom.ops.read_buffer(hw, IXGBE_PBANUM0_PTR, 2,
945 ret_val = hw->eeprom.ops.read(hw, pba_word[1] + 0,
976 * in order for the MAC address to have been loaded from the EEPROM into RAR0
1094 /* Get MAC instance from EEPROM for configuring CS4227 */
1096 hw->eeprom.ops.read(hw, IXGBE_EEPROM_CTRL_4, &ee_ctrl_4);
1244 * ixgbe_init_eeprom_params_generic - Initialize EEPROM params
1247 * Initializes the EEPROM parameters ixgbe_eeprom_info within the
1248 * ixgbe_hw struct in order to set up EEPROM access.
1252 struct ixgbe_eeprom_info *eeprom = &hw->eeprom;
1258 if (eeprom->type == ixgbe_eeprom_uninitialized) {
1259 eeprom->type = ixgbe_eeprom_none;
1262 eeprom->semaphore_delay = 10;
1263 /* Clear EEPROM page size, it will be initialized as needed */
1264 eeprom->word_page_size = 0;
1267 * Check for EEPROM present first.
1272 eeprom->type = ixgbe_eeprom_spi;
1275 * SPI EEPROM is assumed here. This code would need to
1276 * change if a future EEPROM is not SPI.
1280 eeprom->word_size = 1 << (eeprom_size +
1285 eeprom->address_bits = 16;
1287 eeprom->address_bits = 8;
1288 DEBUGOUT3("Eeprom params: type = %d, size = %d, address bits: "
1289 "%d\n", eeprom->type, eeprom->word_size,
1290 eeprom->address_bits);
1297 * ixgbe_write_eeprom_buffer_bit_bang_generic - Write EEPROM using bit-bang
1299 * @offset: offset within the EEPROM to write
1301 * @data: 16 bit word(s) to write to EEPROM
1303 * Reads 16 bit word(s) from EEPROM through bit-bang method
1313 hw->eeprom.ops.init_params(hw);
1320 if (offset + words > hw->eeprom.word_size) {
1326 * The EEPROM page size cannot be queried from the chip. We do lazy
1329 if ((hw->eeprom.word_page_size == 0) &&
1353 * ixgbe_write_eeprom_buffer_bit_bang - Writes 16 bit word(s) to EEPROM
1355 * @offset: offset within the EEPROM to be written to
1357 * @data: 16 bit word(s) to be written to the EEPROM
1360 * EEPROM will most likely contain an invalid checksum.
1373 /* Prepare the EEPROM for writing */
1398 if ((hw->eeprom.address_bits == 8) &&
1406 hw->eeprom.address_bits);
1408 page_size = hw->eeprom.word_page_size;
1428 /* Done with writing - release the EEPROM */
1436 * ixgbe_write_eeprom_generic - Writes 16 bit value to EEPROM
1438 * @offset: offset within the EEPROM to be written to
1439 * @data: 16 bit word to be written to the EEPROM
1442 * EEPROM will most likely contain an invalid checksum.
1450 hw->eeprom.ops.init_params(hw);
1452 if (offset >= hw->eeprom.word_size) {
1464 * ixgbe_read_eeprom_buffer_bit_bang_generic - Read EEPROM using bit-bang
1466 * @offset: offset within the EEPROM to be read
1467 * @data: read 16 bit words(s) from EEPROM
1470 * Reads 16 bit word(s) from EEPROM through bit-bang method
1480 hw->eeprom.ops.init_params(hw);
1487 if (offset + words > hw->eeprom.word_size) {
1513 * ixgbe_read_eeprom_buffer_bit_bang - Read EEPROM using bit-bang
1515 * @offset: offset within the EEPROM to be read
1517 * @data: read 16 bit word(s) from EEPROM
1519 * Reads 16 bit word(s) from EEPROM through bit-bang method
1531 /* Prepare the EEPROM for reading */
1548 if ((hw->eeprom.address_bits == 8) &&
1556 hw->eeprom.address_bits);
1571 * ixgbe_read_eeprom_bit_bang_generic - Read EEPROM word using bit-bang
1573 * @offset: offset within the EEPROM to be read
1574 * @data: read 16 bit value from EEPROM
1576 * Reads 16 bit value from EEPROM through bit-bang method
1585 hw->eeprom.ops.init_params(hw);
1587 if (offset >= hw->eeprom.word_size) {
1599 * ixgbe_read_eerd_buffer_generic - Read EEPROM word(s) using EERD
1601 * @offset: offset of word in the EEPROM to read
1603 * @data: 16 bit word(s) from the EEPROM
1605 * Reads a 16 bit word(s) from the EEPROM using the EERD register.
1616 hw->eeprom.ops.init_params(hw);
1620 ERROR_REPORT1(IXGBE_ERROR_ARGUMENT, "Invalid EEPROM words");
1624 if (offset >= hw->eeprom.word_size) {
1626 ERROR_REPORT1(IXGBE_ERROR_ARGUMENT, "Invalid EEPROM offset");
1641 DEBUGOUT("Eeprom read timed out\n");
1650 * ixgbe_detect_eeprom_page_size_generic - Detect EEPROM page size
1652 * @offset: offset within the EEPROM to be used as a scratch pad
1654 * Discover EEPROM page size by writing marching data at given offset.
1670 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX;
1673 hw->eeprom.word_page_size = 0;
1683 * EEPROM address wraps around current page.
1685 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX - data[0];
1687 DEBUGOUT1("Detected EEPROM page size = %d words.",
1688 hw->eeprom.word_page_size);
1694 * ixgbe_read_eerd_generic - Read EEPROM word using EERD
1696 * @offset: offset of word in the EEPROM to read
1697 * @data: word read from the EEPROM
1699 * Reads a 16 bit word from the EEPROM using the EERD register.
1707 * ixgbe_write_eewr_buffer_generic - Write EEPROM word(s) using EEWR
1709 * @offset: offset of word in the EEPROM to write
1711 * @data: word(s) write to the EEPROM
1713 * Write a 16 bit word(s) to the EEPROM using the EEWR register.
1724 hw->eeprom.ops.init_params(hw);
1728 ERROR_REPORT1(IXGBE_ERROR_ARGUMENT, "Invalid EEPROM words");
1732 if (offset >= hw->eeprom.word_size) {
1734 ERROR_REPORT1(IXGBE_ERROR_ARGUMENT, "Invalid EEPROM offset");
1745 DEBUGOUT("Eeprom write EEWR timed out\n");
1753 DEBUGOUT("Eeprom write EEWR timed out\n");
1763 * ixgbe_write_eewr_generic - Write EEPROM word using EEWR
1765 * @offset: offset of word in the EEPROM to write
1766 * @data: word write to the EEPROM
1768 * Write a 16 bit word to the EEPROM using the EEWR register.
1778 * @ee_reg: EEPROM flag for polling
1806 "EEPROM read/write done polling timed out");
1812 * ixgbe_acquire_eeprom - Acquire EEPROM using bit-bang
1815 * Prepares EEPROM for access using bit-bang method. This function should
1816 * be called before issuing a command to the EEPROM.
1833 /* Request EEPROM Access */
1848 DEBUGOUT("Could not acquire EEPROM grant\n");
1854 /* Setup EEPROM for Read/Write */
1870 * Sets the hardware semaphores so EEPROM access can occur for bit-bang method
1897 DEBUGOUT("Driver can't access the Eeprom - SMBI Semaphore "
1923 /* Set the SW EEPROM semaphore bit to request access */
1939 * Release semaphores and return error if SW EEPROM semaphore
1940 * was not granted because we don't have access to the EEPROM
1944 "SWESMBI Software EEPROM semaphore not granted.\n");
1978 * ixgbe_ready_eeprom - Polls for EEPROM ready
1991 * EEPROM will signal that the command has been completed by clearing
2011 DEBUGOUT("SPI EEPROM Status error\n");
2019 * ixgbe_standby_eeprom - Returns EEPROM to a "standby" state
2042 * ixgbe_shift_out_eeprom_bits - Shift data bits out to the EEPROM.
2044 * @data: data to send to the EEPROM
2059 * Mask is used to shift "count" bits of "data" out to the EEPROM
2066 * A "1" is shifted out to the EEPROM by setting bit "DI" to a
2068 * bit controls the clock input to the EEPROM). A "0" is
2069 * shifted out to the EEPROM by setting "DI" to "0" and then
2087 * EEPROM
2099 * ixgbe_shift_in_eeprom_bits - Shift data bits in from the EEPROM
2112 * In order to read a register from the EEPROM, we need to shift
2113 * 'count' bits in from the EEPROM. Bits are "shifted in" by raising
2114 * the clock input to the EEPROM (setting the SK bit), and then reading
2139 * ixgbe_raise_eeprom_clk - Raises the EEPROM's clock input.
2148 * Raise the clock input to the EEPROM
2158 * ixgbe_lower_eeprom_clk - Lowers the EEPROM's clock input.
2167 * Lower the clock input to the EEPROM (clearing the SK bit), then
2177 * ixgbe_release_eeprom - Release EEPROM, release semaphores
2196 /* Stop requesting EEPROM access */
2203 msec_delay(hw->eeprom.semaphore_delay);
2225 if (hw->eeprom.ops.read(hw, i, &word)) {
2226 DEBUGOUT("EEPROM read failed\n");
2234 if (hw->eeprom.ops.read(hw, i, &pointer)) {
2235 DEBUGOUT("EEPROM read failed\n");
2243 if (hw->eeprom.ops.read(hw, pointer, &length)) {
2244 DEBUGOUT("EEPROM read failed\n");
2252 if (hw->eeprom.ops.read(hw, j, &word)) {
2253 DEBUGOUT("EEPROM read failed\n");
2266 * ixgbe_validate_eeprom_checksum_generic - Validate EEPROM checksum
2270 * Performs checksum calculation and validates the EEPROM checksum. If the
2282 /* Read the first word from the EEPROM. If this times out or fails, do
2284 * EEPROM read fails
2286 status = hw->eeprom.ops.read(hw, 0, &checksum);
2288 DEBUGOUT("EEPROM read failed\n");
2292 status = hw->eeprom.ops.calc_checksum(hw);
2298 status = hw->eeprom.ops.read(hw, IXGBE_EEPROM_CHECKSUM, &read_checksum);
2300 DEBUGOUT("EEPROM read failed\n");
2304 /* Verify read checksum from EEPROM is the same as
2318 * ixgbe_update_eeprom_checksum_generic - Updates the EEPROM checksum
2328 /* Read the first word from the EEPROM. If this times out or fails, do
2330 * EEPROM read fails
2332 status = hw->eeprom.ops.read(hw, 0, &checksum);
2334 DEBUGOUT("EEPROM read failed\n");
2338 status = hw->eeprom.ops.calc_checksum(hw);
2344 status = hw->eeprom.ops.write(hw, IXGBE_EEPROM_CHECKSUM, checksum);
2485 * Otherwise, use the permanent address from the eeprom.
3285 * function (CSR, PHY0, PHY1, EEPROM, Flash)
3332 * function (CSR, PHY0, PHY1, EEPROM, Flash)
3547 * ixgbe_get_san_mac_addr_offset - Get SAN MAC address offset from the EEPROM
3551 * This function will read the EEPROM location for the SAN MAC address
3563 * First read the EEPROM pointer to see if the MAC addresses are
3566 ret_val = hw->eeprom.ops.read(hw, IXGBE_SAN_MAC_ADDR_PTR,
3570 "eeprom at offset %d failed",
3578 * ixgbe_get_san_mac_addr_generic - SAN MAC address retrieval from the EEPROM
3582 * Reads the SAN MAC address from the EEPROM, if it's available. This is
3596 * First read the EEPROM pointer to see if the MAC addresses are
3609 ret_val = hw->eeprom.ops.read(hw, san_mac_offset,
3613 "eeprom read at offset %d failed",
3625 * No addresses available in this EEPROM. It's not an
3634 * ixgbe_set_san_mac_addr_generic - Write the SAN MAC address to the EEPROM
3638 * Write a SAN MAC address to the EEPROM.
3662 hw->eeprom.ops.write(hw, san_mac_offset, san_mac_data);
4346 * the EEPROM
4351 * This function will read the EEPROM from the alternative SAN MAC address
4368 if (hw->eeprom.ops.read(hw, offset, &alt_san_mac_blk_offset))
4377 if (hw->eeprom.ops.read(hw, offset, &caps))
4384 if (hw->eeprom.ops.read(hw, offset, wwnn_prefix)) {
4386 "eeprom read at offset %d failed", offset);
4390 if (hw->eeprom.ops.read(hw, offset, wwpn_prefix))
4398 "eeprom read at offset %d failed", offset);
4403 * ixgbe_get_fcoe_boot_status_generic - Get FCOE boot status from EEPROM
4421 status = hw->eeprom.ops.read(hw, offset, &caps);
4429 status = hw->eeprom.ops.read(hw, IXGBE_ISCSI_FCOE_BLK_PTR, &offset);
4438 status = hw->eeprom.ops.read(hw, offset, &flags);
4502 * @device_caps: the EEPROM word with the extra device capabilities
4504 * This function will read the EEPROM location for the device capabilities,
4511 hw->eeprom.ops.read(hw, IXGBE_DEVICE_CAPS, device_caps);
4546 * @buffer: pointer to EEPROM
4547 * @length: size of EEPROM to calculate a checksum for
4969 status = hw->eeprom.ops.read(hw, IXGBE_ETS_CFG, &ets_offset);
4978 status = hw->eeprom.ops.read(hw, ets_offset, &ets_cfg);
4993 status = hw->eeprom.ops.read(hw, (ets_offset + 1 + i),
5048 if (hw->eeprom.ops.read(hw, offset, &ets_offset))
5054 if (hw->eeprom.ops.read(hw, offset, &ets_cfg))
5066 if (hw->eeprom.ops.read(hw, offset, &ets_sensor)) {
5068 "eeprom read at offset %d failed",
5093 "eeprom read at offset %d failed", offset);
5293 /* Page 0 force a FW eeprom write which is slow so verify */
5312 * ixgbe_bypass_rd_eep_generic - Read the bypass FW eeprom addres.
5315 * @addr: The bypass eeprom address to read.
5344 * ixgbe_get_orom_version - Return option ROM from EEPROM
5359 hw->eeprom.ops.read(hw, NVM_OROM_OFFSET, &offset);
5365 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_HI, &eeprom_cfg_blkh);
5366 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_LOW, &eeprom_cfg_blkl);
5396 hw->eeprom.ops.read(hw, NVM_OEM_PROD_VER_PTR, &offset);
5403 hw->eeprom.ops.read(hw, offset, &mod_len);
5404 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_CAP_OFF, &cap);
5411 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_OFF_L, &prod_ver);
5412 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_OFF_H, &rel_num);
5426 * ixgbe_get_etk_id - Return Etrack ID from EEPROM
5437 if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_LOW, &etk_id_l))
5439 if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_HI, &etk_id_h))
5471 /* eeprom version is mac-type specific */
5474 /* version of eeprom section */
5484 /* version of eeprom section */
5497 /* version of eeprom section */