iwlwifi: print fseq info upon fw assert
authorShahar S Matityahu <shahar.s.matityahu@intel.com>
Wed, 29 May 2019 13:39:52 +0000 (16:39 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Sat, 1 Jun 2019 05:04:48 +0000 (08:04 +0300)
Read fseq info from FW registers and print it upon fw assert.
The print is needed since the fseq version coming from the TLV might
not be the actual version that is used.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/intel/iwlwifi/fw/dbg.c
drivers/net/wireless/intel/iwlwifi/fw/dbg.h
drivers/net/wireless/intel/iwlwifi/iwl-prph.h
drivers/net/wireless/intel/iwlwifi/mvm/utils.c
drivers/net/wireless/intel/iwlwifi/pcie/trans.c

index 5f52e40a29032dd290991324a8f31f512c99fd16..33d7bc5500dbf00191bac4c27d632b1ec4960c71 100644 (file)
@@ -2747,3 +2747,42 @@ void iwl_fw_dbg_periodic_trig_handler(struct timer_list *t)
                          jiffies + msecs_to_jiffies(collect_interval));
        }
 }
+
+#define FSEQ_REG(x) { .addr = (x), .str = #x, }
+
+void iwl_fw_error_print_fseq_regs(struct iwl_fw_runtime *fwrt)
+{
+       struct iwl_trans *trans = fwrt->trans;
+       unsigned long flags;
+       int i;
+       struct {
+               u32 addr;
+               const char *str;
+       } fseq_regs[] = {
+               FSEQ_REG(FSEQ_ERROR_CODE),
+               FSEQ_REG(FSEQ_TOP_INIT_VERSION),
+               FSEQ_REG(FSEQ_CNVIO_INIT_VERSION),
+               FSEQ_REG(FSEQ_OTP_VERSION),
+               FSEQ_REG(FSEQ_TOP_CONTENT_VERSION),
+               FSEQ_REG(FSEQ_ALIVE_TOKEN),
+               FSEQ_REG(FSEQ_CNVI_ID),
+               FSEQ_REG(FSEQ_CNVR_ID),
+               FSEQ_REG(CNVI_AUX_MISC_CHIP),
+               FSEQ_REG(CNVR_AUX_MISC_CHIP),
+               FSEQ_REG(CNVR_SCU_SD_REGS_SD_REG_DIG_DCDC_VTRIM),
+               FSEQ_REG(CNVR_SCU_SD_REGS_SD_REG_ACTIVE_VDIG_MIRROR),
+       };
+
+       if (!iwl_trans_grab_nic_access(trans, &flags))
+               return;
+
+       IWL_ERR(fwrt, "Fseq Registers:\n");
+
+       for (i = 0; i < ARRAY_SIZE(fseq_regs); i++)
+               IWL_ERR(fwrt, "0x%08X | %s\n",
+                       iwl_read_prph_no_grab(trans, fseq_regs[i].addr),
+                       fseq_regs[i].str);
+
+       iwl_trans_release_nic_access(trans, &flags);
+}
+IWL_EXPORT_SYMBOL(iwl_fw_error_print_fseq_regs);
index 2a9e560a906bb6c287190f68cb91ee0981262e0d..fd0ad220e961f5d51f64419ceb23e4ffbc9cc7c9 100644 (file)
@@ -471,4 +471,6 @@ static inline void iwl_fw_error_collect(struct iwl_fw_runtime *fwrt)
 }
 
 void iwl_fw_dbg_periodic_trig_handler(struct timer_list *t);
+
+void iwl_fw_error_print_fseq_regs(struct iwl_fw_runtime *fwrt);
 #endif  /* __iwl_fw_dbg_h__ */
index 925f308764bf7a1597017d5c5d09f9694a81b825..8d930bfe0727579788985d8622e7a9ab3a6a5daf 100644 (file)
@@ -395,7 +395,11 @@ enum {
        WFPM_AUX_CTL_AUX_IF_MAC_OWNER_MSK       = 0x80000000,
 };
 
-#define AUX_MISC_REG                   0xA200B0
+#define CNVI_AUX_MISC_CHIP                             0xA200B0
+#define CNVR_AUX_MISC_CHIP                             0xA2B800
+#define CNVR_SCU_SD_REGS_SD_REG_DIG_DCDC_VTRIM         0xA29890
+#define CNVR_SCU_SD_REGS_SD_REG_ACTIVE_VDIG_MIRROR     0xA29938
+
 enum {
        HW_STEP_LOCATION_BITS = 24,
 };
@@ -447,4 +451,13 @@ enum {
 
 #define UREG_DOORBELL_TO_ISR6          0xA05C04
 #define UREG_DOORBELL_TO_ISR6_NMI_BIT  BIT(0)
+
+#define FSEQ_ERROR_CODE                        0xA340C8
+#define FSEQ_TOP_INIT_VERSION          0xA34038
+#define FSEQ_CNVIO_INIT_VERSION                0xA3403C
+#define FSEQ_OTP_VERSION               0xA340FC
+#define FSEQ_TOP_CONTENT_VERSION       0xA340F4
+#define FSEQ_ALIVE_TOKEN               0xA340F0
+#define FSEQ_CNVI_ID                   0xA3408C
+#define FSEQ_CNVR_ID                   0xA34090
 #endif                         /* __iwl_prph_h__ */
index b9914efc55c4b2f027db3954877645c4b7c27fb0..cc56ab88fb4394e31e6ca28635547198352727b7 100644 (file)
@@ -596,6 +596,8 @@ void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm)
                iwl_mvm_dump_lmac_error_log(mvm, 1);
 
        iwl_mvm_dump_umac_error_log(mvm);
+
+       iwl_fw_error_print_fseq_regs(&mvm->fwrt);
 }
 
 int iwl_mvm_reconfig_scd(struct iwl_mvm *mvm, int queue, int fifo, int sta_id,
index e9d1075d91dbceae056997ff04d02dd09d58d3e9..21da18af015567f3e2a8255ec9a2e23131571aa9 100644 (file)
@@ -3546,7 +3546,8 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
                        hw_step |= ENABLE_WFPM;
                        iwl_write_umac_prph_no_grab(trans, WFPM_CTRL_REG,
                                                    hw_step);
-                       hw_step = iwl_read_prph_no_grab(trans, AUX_MISC_REG);
+                       hw_step = iwl_read_prph_no_grab(trans,
+                                                       CNVI_AUX_MISC_CHIP);
                        hw_step = (hw_step >> HW_STEP_LOCATION_BITS) & 0xF;
                        if (hw_step == 0x3)
                                trans->hw_rev = (trans->hw_rev & 0xFFFFFFF3) |