|
@@ -1003,15 +1003,16 @@ static s32 ixgbe_write_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 val)
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * ixgbe_read_i2c_eeprom_82598 - Reads 8 bit word over I2C interface.
|
|
|
+ * ixgbe_read_i2c_phy_82598 - Reads 8 bit word over I2C interface.
|
|
|
* @hw: pointer to hardware structure
|
|
|
- * @byte_offset: EEPROM byte offset to read
|
|
|
+ * @dev_addr: address to read from
|
|
|
+ * @byte_offset: byte offset to read from dev_addr
|
|
|
* @eeprom_data: value read
|
|
|
*
|
|
|
- * Performs 8 byte read operation to SFP module's EEPROM over I2C interface.
|
|
|
+ * Performs 8 byte read operation to SFP module's data over I2C interface.
|
|
|
**/
|
|
|
-static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,
|
|
|
- u8 *eeprom_data)
|
|
|
+static s32 ixgbe_read_i2c_phy_82598(struct ixgbe_hw *hw, u8 dev_addr,
|
|
|
+ u8 byte_offset, u8 *eeprom_data)
|
|
|
{
|
|
|
s32 status = 0;
|
|
|
u16 sfp_addr = 0;
|
|
@@ -1025,7 +1026,7 @@ static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,
|
|
|
* 0xC30D. These registers are used to talk to the SFP+
|
|
|
* module's EEPROM through the SDA/SCL (I2C) interface.
|
|
|
*/
|
|
|
- sfp_addr = (IXGBE_I2C_EEPROM_DEV_ADDR << 8) + byte_offset;
|
|
|
+ sfp_addr = (dev_addr << 8) + byte_offset;
|
|
|
sfp_addr = (sfp_addr | IXGBE_I2C_EEPROM_READ_MASK);
|
|
|
hw->phy.ops.write_reg(hw,
|
|
|
IXGBE_MDIO_PMA_PMD_SDA_SCL_ADDR,
|
|
@@ -1057,13 +1058,42 @@ static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,
|
|
|
*eeprom_data = (u8)(sfp_data >> 8);
|
|
|
} else {
|
|
|
status = IXGBE_ERR_PHY;
|
|
|
- goto out;
|
|
|
}
|
|
|
|
|
|
out:
|
|
|
return status;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * ixgbe_read_i2c_eeprom_82598 - Reads 8 bit word over I2C interface.
|
|
|
+ * @hw: pointer to hardware structure
|
|
|
+ * @byte_offset: EEPROM byte offset to read
|
|
|
+ * @eeprom_data: value read
|
|
|
+ *
|
|
|
+ * Performs 8 byte read operation to SFP module's EEPROM over I2C interface.
|
|
|
+ **/
|
|
|
+static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,
|
|
|
+ u8 *eeprom_data)
|
|
|
+{
|
|
|
+ return ixgbe_read_i2c_phy_82598(hw, IXGBE_I2C_EEPROM_DEV_ADDR,
|
|
|
+ byte_offset, eeprom_data);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * ixgbe_read_i2c_sff8472_82598 - Reads 8 bit word over I2C interface.
|
|
|
+ * @hw: pointer to hardware structure
|
|
|
+ * @byte_offset: byte offset at address 0xA2
|
|
|
+ * @eeprom_data: value read
|
|
|
+ *
|
|
|
+ * Performs 8 byte read operation to SFP module's SFF-8472 data over I2C
|
|
|
+ **/
|
|
|
+static s32 ixgbe_read_i2c_sff8472_82598(struct ixgbe_hw *hw, u8 byte_offset,
|
|
|
+ u8 *sff8472_data)
|
|
|
+{
|
|
|
+ return ixgbe_read_i2c_phy_82598(hw, IXGBE_I2C_EEPROM_DEV_ADDR2,
|
|
|
+ byte_offset, sff8472_data);
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* ixgbe_get_supported_physical_layer_82598 - Returns physical layer type
|
|
|
* @hw: pointer to hardware structure
|
|
@@ -1297,6 +1327,7 @@ static struct ixgbe_phy_operations phy_ops_82598 = {
|
|
|
.write_reg = &ixgbe_write_phy_reg_generic,
|
|
|
.setup_link = &ixgbe_setup_phy_link_generic,
|
|
|
.setup_link_speed = &ixgbe_setup_phy_link_speed_generic,
|
|
|
+ .read_i2c_sff8472 = &ixgbe_read_i2c_sff8472_82598,
|
|
|
.read_i2c_eeprom = &ixgbe_read_i2c_eeprom_82598,
|
|
|
.check_overtemp = &ixgbe_tn_check_overtemp,
|
|
|
};
|