i40e: add support for triggering EMPR
authorShannon Nelson <shannon.nelson@intel.com>
Sat, 16 Nov 2013 10:00:45 +0000 (10:00 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 6 Dec 2013 07:13:02 +0000 (23:13 -0800)
Allow debugfs to trigger a reset called EMPR.

Change-Id: I2f6600a8242759ec60c8198d03f70c2b774e0740
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_debugfs.c
drivers/net/ethernet/intel/i40e/i40e_main.c

index 8806cab28c6aaf8b6f917c3d765a5e7a494774b2..df685bc72ecae62658ecfb62216abc10a01adc26 100644 (file)
@@ -130,6 +130,7 @@ enum i40e_state_t {
        __I40E_PF_RESET_REQUESTED,
        __I40E_CORE_RESET_REQUESTED,
        __I40E_GLOBAL_RESET_REQUESTED,
+       __I40E_EMP_RESET_REQUESTED,
        __I40E_FILTER_OVERFLOW_PROMISC,
 };
 
index ef4cb1cf31f2d392a4ed4e1ae2e0059919423317..9c675b5f1466cfa0446eec8d65b5419c2276ab5e 100644 (file)
@@ -1472,6 +1472,10 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
                dev_info(&pf->pdev->dev, "forcing GlobR\n");
                i40e_do_reset(pf, (1 << __I40E_GLOBAL_RESET_REQUESTED));
 
+       } else if (strncmp(cmd_buf, "empr", 4) == 0) {
+               dev_info(&pf->pdev->dev, "forcing EMPR\n");
+               i40e_do_reset(pf, (1 << __I40E_EMP_RESET_REQUESTED));
+
        } else if (strncmp(cmd_buf, "read", 4) == 0) {
                u32 address;
                u32 value;
index d60673ebf139ff4772fda80164517290a32f859b..5d234a13abc55c059feea3fe798a2670c3bd6a0a 100644 (file)
@@ -4056,6 +4056,24 @@ void i40e_do_reset(struct i40e_pf *pf, u32 reset_flags)
                wr32(&pf->hw, I40E_GLGEN_RTRIG, val);
                i40e_flush(&pf->hw);
 
+       } else if (reset_flags & (1 << __I40E_EMP_RESET_REQUESTED)) {
+
+               /* Request a Firmware Reset
+                *
+                * Same as Global reset, plus restarting the
+                * embedded firmware engine.
+                */
+               /* enable EMP Reset */
+               val = rd32(&pf->hw, I40E_GLGEN_RSTENA_EMP);
+               val |= I40E_GLGEN_RSTENA_EMP_EMP_RST_ENA_MASK;
+               wr32(&pf->hw, I40E_GLGEN_RSTENA_EMP, val);
+
+               /* force the reset */
+               val = rd32(&pf->hw, I40E_GLGEN_RTRIG);
+               val |= I40E_GLGEN_RTRIG_EMPFWR_MASK;
+               wr32(&pf->hw, I40E_GLGEN_RTRIG, val);
+               i40e_flush(&pf->hw);
+
        } else if (reset_flags & (1 << __I40E_PF_RESET_REQUESTED)) {
 
                /* Request a PF Reset