Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc5470df authored by Shahar S Matityahu's avatar Shahar S Matityahu Committed by Kalle Valo
Browse files

iwlwifi: print fseq info upon fw assert



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: default avatarShahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 44f61b5c
Loading
Loading
Loading
Loading
+39 −0
Original line number Diff line number Diff line
@@ -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);
+2 −0
Original line number Diff line number Diff line
@@ -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__ */
+14 −1
Original line number Diff line number Diff line
@@ -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__ */
+2 −0
Original line number Diff line number Diff line
@@ -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,
+2 −1
Original line number Diff line number Diff line
@@ -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) |