summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorQi Zhang <qi.z.zhang@intel.com>2019-03-25 13:44:43 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2019-03-29 17:25:31 +0100
commit741ab49577faa3a32baf0be9457df9157790ce89 (patch)
tree4d5c251fff80f589753f9cab8409bf0776b08688 /drivers
parentfcbf52eaaf2fae93bff26d1d48967b31c6fdfc81 (diff)
downloaddpdk-next-eventdev-741ab49577faa3a32baf0be9457df9157790ce89.zip
dpdk-next-eventdev-741ab49577faa3a32baf0be9457df9157790ce89.tar.gz
dpdk-next-eventdev-741ab49577faa3a32baf0be9457df9157790ce89.tar.xz
net/ice/base: add function to check FW recovery mode
Code added to check the FW recovery mode. This function will be used by the drivers during init to check whether the FW is in recovery mode or not. If FW is in recovery mode then the drivers need to run in a recovery mode where it can allow only limited operations. Link should be down, allow only certain AQ commands etc. Signed-off-by: Victor Raj <victor.raj@intel.com> Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com> Reviewed-by: Qiming Yang <qiming.yang@intel.com> Reviewed-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ice/base/ice_common.c15
-rw-r--r--drivers/net/ice/base/ice_common.h8
2 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
index c35a2f9..2ebf95e 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -3915,3 +3915,18 @@ ice_sched_query_elem(struct ice_hw *hw, u32 node_teid,
ice_debug(hw, ICE_DBG_SCHED, "query element failed\n");
return status;
}
+
+/**
+ * ice_is_fw_in_rec_mode
+ * @hw: pointer to the HW struct
+ *
+ * This function returns true if fw is in recovery mode
+ */
+bool ice_is_fw_in_rec_mode(struct ice_hw *hw)
+{
+ u32 reg;
+
+ /* check the current FW mode */
+ reg = rd32(hw, GL_MNG_FWSM);
+ return (reg & GL_MNG_FWSM_FW_MODES_M) > ICE_FW_MODE_DBG;
+}
diff --git a/drivers/net/ice/base/ice_common.h b/drivers/net/ice/base/ice_common.h
index cc7a777..9665f32 100644
--- a/drivers/net/ice/base/ice_common.h
+++ b/drivers/net/ice/base/ice_common.h
@@ -10,6 +10,13 @@
#include "ice_flex_pipe.h"
#include "ice_switch.h"
+enum ice_fw_modes {
+ ICE_FW_MODE_NORMAL,
+ ICE_FW_MODE_DBG,
+ ICE_FW_MODE_REC,
+ ICE_FW_MODE_DBG_REC
+};
+
enum ice_status ice_nvm_validate_checksum(struct ice_hw *hw);
void
@@ -188,4 +195,5 @@ ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,
enum ice_status
ice_sched_query_elem(struct ice_hw *hw, u32 node_teid,
struct ice_aqc_get_elem *buf);
+bool ice_is_fw_in_rec_mode(struct ice_hw *hw);
#endif /* _ICE_COMMON_H_ */