ixgbe: add FW recovery mode check
Add FM NVM recovery mode check. Allow the software to detect this. Signed-off-by: Xiaoyun Li <xiaoyun.li@intel.com> Acked-by: Qi Zhang <qi.z.zhang@intel.com> Approved by: imp Obtained from: DPDK (5fb0a9acbb844b21691568c0014866e0e887bd19) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31621
This commit is contained in:
parent
994dd6328c
commit
b622bdb4eb
@ -1306,6 +1306,18 @@ void ixgbe_restore_mdd_vf(struct ixgbe_hw *hw, u32 vf)
|
||||
hw->mac.ops.restore_mdd_vf(hw, vf);
|
||||
}
|
||||
|
||||
/**
|
||||
* ixgbe_fw_recovery_mode - Check if in FW NVM recovery mode
|
||||
* @hw: pointer to hardware structure
|
||||
*
|
||||
**/
|
||||
bool ixgbe_fw_recovery_mode(struct ixgbe_hw *hw)
|
||||
{
|
||||
if (hw->mac.ops.fw_recovery_mode)
|
||||
return hw->mac.ops.fw_recovery_mode(hw);
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* ixgbe_enter_lplu - Transition to low power states
|
||||
* @hw: pointer to hardware structure
|
||||
|
@ -217,6 +217,7 @@ void ixgbe_disable_mdd(struct ixgbe_hw *hw);
|
||||
void ixgbe_enable_mdd(struct ixgbe_hw *hw);
|
||||
void ixgbe_mdd_event(struct ixgbe_hw *hw, u32 *vf_bitmap);
|
||||
void ixgbe_restore_mdd_vf(struct ixgbe_hw *hw, u32 vf);
|
||||
bool ixgbe_fw_recovery_mode(struct ixgbe_hw *hw);
|
||||
s32 ixgbe_enter_lplu(struct ixgbe_hw *hw);
|
||||
s32 ixgbe_handle_lasi(struct ixgbe_hw *hw);
|
||||
void ixgbe_set_rate_select_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed);
|
||||
|
@ -1080,6 +1080,9 @@ struct ixgbe_dmac_config {
|
||||
#define IXGBE_FWSM_MODE_MASK 0xE
|
||||
#define IXGBE_FWSM_TS_ENABLED 0x1
|
||||
#define IXGBE_FWSM_FW_MODE_PT 0x4
|
||||
#define IXGBE_FWSM_FW_NVM_RECOVERY_MODE (1 << 5)
|
||||
#define IXGBE_FWSM_EXT_ERR_IND_MASK 0x01F80000
|
||||
#define IXGBE_FWSM_FW_VAL_BIT (1 << 15)
|
||||
|
||||
/* ARC Subsystem registers */
|
||||
#define IXGBE_HICR 0x15F00
|
||||
@ -4010,6 +4013,7 @@ struct ixgbe_mac_operations {
|
||||
void (*enable_mdd)(struct ixgbe_hw *hw);
|
||||
void (*mdd_event)(struct ixgbe_hw *hw, u32 *vf_bitmap);
|
||||
void (*restore_mdd_vf)(struct ixgbe_hw *hw, u32 vf);
|
||||
bool (*fw_recovery_mode)(struct ixgbe_hw *hw);
|
||||
};
|
||||
|
||||
struct ixgbe_phy_operations {
|
||||
|
@ -83,6 +83,7 @@ s32 ixgbe_init_ops_X550(struct ixgbe_hw *hw)
|
||||
mac->ops.enable_mdd = ixgbe_enable_mdd_X550;
|
||||
mac->ops.mdd_event = ixgbe_mdd_event_X550;
|
||||
mac->ops.restore_mdd_vf = ixgbe_restore_mdd_vf_X550;
|
||||
mac->ops.fw_recovery_mode = ixgbe_fw_recovery_mode_X550;
|
||||
mac->ops.disable_rx = ixgbe_disable_rx_x550;
|
||||
/* Manageability interface */
|
||||
mac->ops.set_fw_drv_ver = ixgbe_set_fw_drv_ver_x550;
|
||||
@ -4676,3 +4677,18 @@ s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min,
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/**
|
||||
* ixgbe_fw_recovery_mode_X550 - Check FW NVM recovery mode
|
||||
* @hw: pointer t hardware structure
|
||||
*
|
||||
* Returns true if in FW NVM recovery mode.
|
||||
**/
|
||||
bool ixgbe_fw_recovery_mode_X550(struct ixgbe_hw *hw)
|
||||
{
|
||||
u32 fwsm;
|
||||
|
||||
fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM_BY_MAC(hw));
|
||||
|
||||
return !!(fwsm & IXGBE_FWSM_FW_NVM_RECOVERY_MODE);
|
||||
}
|
||||
|
@ -122,4 +122,5 @@ s32 ixgbe_reset_phy_t_X550em(struct ixgbe_hw *hw);
|
||||
s32 ixgbe_identify_sfp_module_X550em(struct ixgbe_hw *hw);
|
||||
s32 ixgbe_led_on_t_X550em(struct ixgbe_hw *hw, u32 led_idx);
|
||||
s32 ixgbe_led_off_t_X550em(struct ixgbe_hw *hw, u32 led_idx);
|
||||
bool ixgbe_fw_recovery_mode_X550(struct ixgbe_hw *hw);
|
||||
#endif /* _IXGBE_X550_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user