summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/igc/igc_phy.c
diff options
context:
space:
mode:
authorSasha Neftin <sasha.neftin@intel.com>2020-12-20 11:16:49 +0200
committerTony Nguyen <anthony.l.nguyen@intel.com>2021-02-03 15:20:32 -0800
commit94f794d15a5ea902aabf148f17f5310a2f6ccd67 (patch)
treed6922127d9cd24af210a211dfba120747b205163 /drivers/net/ethernet/intel/igc/igc_phy.c
parent01bb6129c641030a40931c1a8c60ce4098c23dc9 (diff)
igc: Expose the gPHY firmware version
Extend reporting of NVM image version to include the gPHY (i225 PHY) firmware version. Signed-off-by: Sasha Neftin <sasha.neftin@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_phy.c')
-rw-r--r--drivers/net/ethernet/intel/igc/igc_phy.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/igc/igc_phy.c b/drivers/net/ethernet/intel/igc/igc_phy.c
index 8e1799508edc..83aeb5e7076f 100644
--- a/drivers/net/ethernet/intel/igc/igc_phy.c
+++ b/drivers/net/ethernet/intel/igc/igc_phy.c
@@ -791,3 +791,21 @@ s32 igc_read_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 *data)
return ret_val;
}
+
+/**
+ * igc_read_phy_fw_version - Read gPHY firmware version
+ * @hw: pointer to the HW structure
+ */
+u16 igc_read_phy_fw_version(struct igc_hw *hw)
+{
+ struct igc_phy_info *phy = &hw->phy;
+ u16 gphy_version = 0;
+ u16 ret_val;
+
+ /* NVM image version is reported as firmware version for i225 device */
+ ret_val = phy->ops.read_reg(hw, IGC_GPHY_VERSION, &gphy_version);
+ if (ret_val)
+ hw_dbg("igc_phy: read wrong gphy version\n");
+
+ return gphy_version;
+}