Home | History | Annotate | Download | only in ixgbe

Lines Matching defs:eeprom

77 	struct ixgbe_eeprom_info *eeprom = &hw->eeprom;
83 /* EEPROM */
84 eeprom->ops.init_params = ixgbe_init_eeprom_params_generic;
85 /* If EEPROM is valid (bit 8 = 1), use EERD otherwise use bit bang */
87 eeprom->ops.read = ixgbe_read_eerd_generic;
88 eeprom->ops.read_buffer = ixgbe_read_eerd_buffer_generic;
90 eeprom->ops.read = ixgbe_read_eeprom_bit_bang_generic;
91 eeprom->ops.read_buffer =
94 eeprom->ops.write = ixgbe_write_eeprom_generic;
95 eeprom->ops.write_buffer = ixgbe_write_eeprom_buffer_bit_bang_generic;
96 eeprom->ops.validate_checksum =
98 eeprom->ops.update_checksum = ixgbe_update_eeprom_checksum_generic;
99 eeprom->ops.calc_checksum = ixgbe_calc_eeprom_checksum_generic;
255 * 10gig parts do not have a word in the EEPROM to determine the
642 * ixgbe_read_pba_string_generic - Reads part number string from EEPROM
644 * @pba_num: stores the part number string from the EEPROM
647 * Reads the part number string from the EEPROM.
665 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM0_PTR, &data);
671 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM1_PTR, &pba_ptr);
717 ret_val = hw->eeprom.ops.read(hw, pba_ptr, &length);
739 ret_val = hw->eeprom.ops.read(hw, pba_ptr + offset, &data);
753 * ixgbe_read_pba_num_generic - Reads part number from EEPROM
755 * @pba_num: stores the part number from the EEPROM
757 * Reads the part number from the EEPROM.
766 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM0_PTR, &data);
776 ret_val = hw->eeprom.ops.read(hw, IXGBE_PBANUM1_PTR, &data);
789 * @eeprom_buf: optional pointer to EEPROM image
790 * @eeprom_buf_size: size of EEPROM image in words
794 * Reads PBA from EEPROM image when eeprom_buf is not NULL.
795 * Reads PBA from physical EEPROM device when eeprom_buf is NULL.
809 ret_val = hw->eeprom.ops.read_buffer(hw, IXGBE_PBANUM0_PTR, 2,
836 ret_val = hw->eeprom.ops.read_buffer(hw, pba->word[1],
859 * @eeprom_buf: optional pointer to EEPROM image
860 * @eeprom_buf_size: size of EEPROM image in words
863 * Writes PBA to EEPROM image when eeprom_buf is not NULL.
864 * Writes PBA to physical EEPROM device when eeprom_buf is NULL.
876 ret_val = hw->eeprom.ops.write_buffer(hw, IXGBE_PBANUM0_PTR, 2,
894 ret_val = hw->eeprom.ops.write_buffer(hw, pba->word[1],
917 * @eeprom_buf: optional pointer to EEPROM image
918 * @eeprom_buf_size: size of EEPROM image in words
921 * Returns the size of the PBA block in words. Function operates on EEPROM
923 * EEPROM device.
936 ret_val = hw->eeprom.ops.read_buffer(hw, IXGBE_PBANUM0_PTR, 2,
951 ret_val = hw->eeprom.ops.read(hw, pba_word[1] + 0,
982 * in order for the MAC address to have been loaded from the EEPROM into RAR0
1100 /* Get MAC instance from EEPROM for configuring CS4227 */
1102 hw->eeprom.ops.read(hw, IXGBE_EEPROM_CTRL_4, &ee_ctrl_4);
1270 * ixgbe_init_eeprom_params_generic - Initialize EEPROM params
1273 * Initializes the EEPROM parameters ixgbe_eeprom_info within the
1274 * ixgbe_hw struct in order to set up EEPROM access.
1278 struct ixgbe_eeprom_info *eeprom = &hw->eeprom;
1284 if (eeprom->type == ixgbe_eeprom_uninitialized) {
1285 eeprom->type = ixgbe_eeprom_none;
1288 eeprom->semaphore_delay = 10;
1289 /* Clear EEPROM page size, it will be initialized as needed */
1290 eeprom->word_page_size = 0;
1293 * Check for EEPROM present first.
1298 eeprom->type = ixgbe_eeprom_spi;
1301 * SPI EEPROM is assumed here. This code would need to
1302 * change if a future EEPROM is not SPI.
1306 eeprom->word_size = 1 << (eeprom_size +
1311 eeprom->address_bits = 16;
1313 eeprom->address_bits = 8;
1314 DEBUGOUT3("Eeprom params: type = %d, size = %d, address bits: "
1315 "%d\n", eeprom->type, eeprom->word_size,
1316 eeprom->address_bits);
1323 * ixgbe_write_eeprom_buffer_bit_bang_generic - Write EEPROM using bit-bang
1325 * @offset: offset within the EEPROM to write
1327 * @data: 16 bit word(s) to write to EEPROM
1329 * Reads 16 bit word(s) from EEPROM through bit-bang method
1339 hw->eeprom.ops.init_params(hw);
1346 if (offset + words > hw->eeprom.word_size) {
1352 * The EEPROM page size cannot be queried from the chip. We do lazy
1355 if ((hw->eeprom.word_page_size == 0) &&
1379 * ixgbe_write_eeprom_buffer_bit_bang - Writes 16 bit word(s) to EEPROM
1381 * @offset: offset within the EEPROM to be written to
1383 * @data: 16 bit word(s) to be written to the EEPROM
1386 * EEPROM will most likely contain an invalid checksum.
1399 /* Prepare the EEPROM for writing */
1424 if ((hw->eeprom.address_bits == 8) &&
1432 hw->eeprom.address_bits);
1434 page_size = hw->eeprom.word_page_size;
1454 /* Done with writing - release the EEPROM */
1462 * ixgbe_write_eeprom_generic - Writes 16 bit value to EEPROM
1464 * @offset: offset within the EEPROM to be written to
1465 * @data: 16 bit word to be written to the EEPROM
1468 * EEPROM will most likely contain an invalid checksum.
1476 hw->eeprom.ops.init_params(hw);
1478 if (offset >= hw->eeprom.word_size) {
1490 * ixgbe_read_eeprom_buffer_bit_bang_generic - Read EEPROM using bit-bang
1492 * @offset: offset within the EEPROM to be read
1493 * @data: read 16 bit words(s) from EEPROM
1496 * Reads 16 bit word(s) from EEPROM through bit-bang method
1506 hw->eeprom.ops.init_params(hw);
1513 if (offset + words > hw->eeprom.word_size) {
1539 * ixgbe_read_eeprom_buffer_bit_bang - Read EEPROM using bit-bang
1541 * @offset: offset within the EEPROM to be read
1543 * @data: read 16 bit word(s) from EEPROM
1545 * Reads 16 bit word(s) from EEPROM through bit-bang method
1557 /* Prepare the EEPROM for reading */
1574 if ((hw->eeprom.address_bits == 8) &&
1582 hw->eeprom.address_bits);
1597 * ixgbe_read_eeprom_bit_bang_generic - Read EEPROM word using bit-bang
1599 * @offset: offset within the EEPROM to be read
1600 * @data: read 16 bit value from EEPROM
1602 * Reads 16 bit value from EEPROM through bit-bang method
1611 hw->eeprom.ops.init_params(hw);
1613 if (offset >= hw->eeprom.word_size) {
1625 * ixgbe_read_eerd_buffer_generic - Read EEPROM word(s) using EERD
1627 * @offset: offset of word in the EEPROM to read
1629 * @data: 16 bit word(s) from the EEPROM
1631 * Reads a 16 bit word(s) from the EEPROM using the EERD register.
1642 hw->eeprom.ops.init_params(hw);
1646 ERROR_REPORT1(IXGBE_ERROR_ARGUMENT, "Invalid EEPROM words");
1650 if (offset >= hw->eeprom.word_size) {
1652 ERROR_REPORT1(IXGBE_ERROR_ARGUMENT, "Invalid EEPROM offset");
1667 DEBUGOUT("Eeprom read timed out\n");
1676 * ixgbe_detect_eeprom_page_size_generic - Detect EEPROM page size
1678 * @offset: offset within the EEPROM to be used as a scratch pad
1680 * Discover EEPROM page size by writing marching data at given offset.
1696 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX;
1699 hw->eeprom.word_page_size = 0;
1709 * EEPROM address wraps around current page.
1711 hw->eeprom.word_page_size = IXGBE_EEPROM_PAGE_SIZE_MAX - data[0];
1713 DEBUGOUT1("Detected EEPROM page size = %d words.",
1714 hw->eeprom.word_page_size);
1720 * ixgbe_read_eerd_generic - Read EEPROM word using EERD
1722 * @offset: offset of word in the EEPROM to read
1723 * @data: word read from the EEPROM
1725 * Reads a 16 bit word from the EEPROM using the EERD register.
1733 * ixgbe_write_eewr_buffer_generic - Write EEPROM word(s) using EEWR
1735 * @offset: offset of word in the EEPROM to write
1737 * @data: word(s) write to the EEPROM
1739 * Write a 16 bit word(s) to the EEPROM using the EEWR register.
1750 hw->eeprom.ops.init_params(hw);
1754 ERROR_REPORT1(IXGBE_ERROR_ARGUMENT, "Invalid EEPROM words");
1758 if (offset >= hw->eeprom.word_size) {
1760 ERROR_REPORT1(IXGBE_ERROR_ARGUMENT, "Invalid EEPROM offset");
1771 DEBUGOUT("Eeprom write EEWR timed out\n");
1779 DEBUGOUT("Eeprom write EEWR timed out\n");
1789 * ixgbe_write_eewr_generic - Write EEPROM word using EEWR
1791 * @offset: offset of word in the EEPROM to write
1792 * @data: word write to the EEPROM
1794 * Write a 16 bit word to the EEPROM using the EEWR register.
1804 * @ee_reg: EEPROM flag for polling
1832 "EEPROM read/write done polling timed out");
1838 * ixgbe_acquire_eeprom - Acquire EEPROM using bit-bang
1841 * Prepares EEPROM for access using bit-bang method. This function should
1842 * be called before issuing a command to the EEPROM.
1859 /* Request EEPROM Access */
1874 DEBUGOUT("Could not acquire EEPROM grant\n");
1880 /* Setup EEPROM for Read/Write */
1896 * Sets the hardware semaphores so EEPROM access can occur for bit-bang method
1922 DEBUGOUT("Driver can't access the Eeprom - SMBI Semaphore "
1948 /* Set the SW EEPROM semaphore bit to request access */
1964 * Release semaphores and return error if SW EEPROM semaphore
1965 * was not granted because we don't have access to the EEPROM
1969 "SWESMBI Software EEPROM semaphore not granted.\n");
2003 * ixgbe_ready_eeprom - Polls for EEPROM ready
2016 * EEPROM will signal that the command has been completed by clearing
2036 DEBUGOUT("SPI EEPROM Status error\n");
2044 * ixgbe_standby_eeprom - Returns EEPROM to a "standby" state
2067 * ixgbe_shift_out_eeprom_bits - Shift data bits out to the EEPROM.
2069 * @data: data to send to the EEPROM
2084 * Mask is used to shift "count" bits of "data" out to the EEPROM
2091 * A "1" is shifted out to the EEPROM by setting bit "DI" to a
2093 * bit controls the clock input to the EEPROM). A "0" is
2094 * shifted out to the EEPROM by setting "DI" to "0" and then
2112 * EEPROM
2124 * ixgbe_shift_in_eeprom_bits - Shift data bits in from the EEPROM
2137 * In order to read a register from the EEPROM, we need to shift
2138 * 'count' bits in from the EEPROM. Bits are "shifted in" by raising
2139 * the clock input to the EEPROM (setting the SK bit), and then reading
2164 * ixgbe_raise_eeprom_clk - Raises the EEPROM's clock input.
2173 * Raise the clock input to the EEPROM
2183 * ixgbe_lower_eeprom_clk - Lowers the EEPROM's clock input.
2192 * Lower the clock input to the EEPROM (clearing the SK bit), then
2202 * ixgbe_release_eeprom - Release EEPROM, release semaphores
2221 /* Stop requesting EEPROM access */
2228 msec_delay(hw->eeprom.semaphore_delay);
2250 if (hw->eeprom.ops.read(hw, i, &word)) {
2251 DEBUGOUT("EEPROM read failed\n");
2259 if (hw->eeprom.ops.read(hw, i, &pointer)) {
2260 DEBUGOUT("EEPROM read failed\n");
2268 if (hw->eeprom.ops.read(hw, pointer, &length)) {
2269 DEBUGOUT("EEPROM read failed\n");
2277 if (hw->eeprom.ops.read(hw, j, &word)) {
2278 DEBUGOUT("EEPROM read failed\n");
2291 * ixgbe_validate_eeprom_checksum_generic - Validate EEPROM checksum
2295 * Performs checksum calculation and validates the EEPROM checksum. If the
2307 /* Read the first word from the EEPROM. If this times out or fails, do
2309 * EEPROM read fails
2311 status = hw->eeprom.ops.read(hw, 0, &checksum);
2313 DEBUGOUT("EEPROM read failed\n");
2317 status = hw->eeprom.ops.calc_checksum(hw);
2323 status = hw->eeprom.ops.read(hw, IXGBE_EEPROM_CHECKSUM, &read_checksum);
2325 DEBUGOUT("EEPROM read failed\n");
2329 /* Verify read checksum from EEPROM is the same as
2343 * ixgbe_update_eeprom_checksum_generic - Updates the EEPROM checksum
2353 /* Read the first word from the EEPROM. If this times out or fails, do
2355 * EEPROM read fails
2357 status = hw->eeprom.ops.read(hw, 0, &checksum);
2359 DEBUGOUT("EEPROM read failed\n");
2363 status = hw->eeprom.ops.calc_checksum(hw);
2369 status = hw->eeprom.ops.write(hw, IXGBE_EEPROM_CHECKSUM, checksum);
2510 * Otherwise, use the permanent address from the eeprom.
3310 * function (CSR, PHY0, PHY1, EEPROM, Flash)
3357 * function (CSR, PHY0, PHY1, EEPROM, Flash)
3571 * ixgbe_get_san_mac_addr_offset - Get SAN MAC address offset from the EEPROM
3575 * This function will read the EEPROM location for the SAN MAC address
3587 * First read the EEPROM pointer to see if the MAC addresses are
3590 ret_val = hw->eeprom.ops.read(hw, IXGBE_SAN_MAC_ADDR_PTR,
3594 "eeprom at offset %d failed",
3602 * ixgbe_get_san_mac_addr_generic - SAN MAC address retrieval from the EEPROM
3606 * Reads the SAN MAC address from the EEPROM, if it's available. This is
3620 * First read the EEPROM pointer to see if the MAC addresses are
3633 ret_val = hw->eeprom.ops.read(hw, san_mac_offset,
3637 "eeprom read at offset %d failed",
3649 * No addresses available in this EEPROM. It's not an
3658 * ixgbe_set_san_mac_addr_generic - Write the SAN MAC address to the EEPROM
3662 * Write a SAN MAC address to the EEPROM.
3686 hw->eeprom.ops.write(hw, san_mac_offset, san_mac_data);
4351 * the EEPROM
4356 * This function will read the EEPROM from the alternative SAN MAC address
4373 if (hw->eeprom.ops.read(hw, offset, &alt_san_mac_blk_offset))
4382 if (hw->eeprom.ops.read(hw, offset, &caps))
4389 if (hw->eeprom.ops.read(hw, offset, wwnn_prefix)) {
4391 "eeprom read at offset %d failed", offset);
4395 if (hw->eeprom.ops.read(hw, offset, wwpn_prefix))
4403 "eeprom read at offset %d failed", offset);
4408 * ixgbe_get_fcoe_boot_status_generic - Get FCOE boot status from EEPROM
4426 status = hw->eeprom.ops.read(hw, offset, &caps);
4434 status = hw->eeprom.ops.read(hw, IXGBE_ISCSI_FCOE_BLK_PTR, &offset);
4443 status = hw->eeprom.ops.read(hw, offset, &flags);
4507 * @device_caps: the EEPROM word with the extra device capabilities
4509 * This function will read the EEPROM location for the device capabilities,
4516 hw->eeprom.ops.read(hw, IXGBE_DEVICE_CAPS, device_caps);
4551 * @buffer: pointer to EEPROM
4552 * @length: size of EEPROM to calculate a checksum for
5126 /* Page 0 force a FW eeprom write which is slow so verify */
5145 * ixgbe_bypass_rd_eep_generic - Read the bypass FW eeprom address.
5148 * @addr: The bypass eeprom address to read.
5177 * ixgbe_get_orom_version - Return option ROM from EEPROM
5192 hw->eeprom.ops.read(hw, NVM_OROM_OFFSET, &offset);
5198 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_HI, &eeprom_cfg_blkh);
5199 hw->eeprom.ops.read(hw, offset + NVM_OROM_BLK_LOW, &eeprom_cfg_blkl);
5229 hw->eeprom.ops.read(hw, NVM_OEM_PROD_VER_PTR, &offset);
5236 hw->eeprom.ops.read(hw, offset, &mod_len);
5237 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_CAP_OFF, &cap);
5244 hw->eeprom
5245 hw->eeprom.ops.read(hw, offset + NVM_OEM_PROD_VER_OFF_H, &rel_num);
5259 * ixgbe_get_etk_id - Return Etrack ID from EEPROM
5270 if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_LOW, &etk_id_l))
5272 if (hw->eeprom.ops.read(hw, NVM_ETK_OFF_HI, &etk_id_h))