|
@@ -4500,6 +4500,35 @@ void gsi_get_inst_ram_offset_and_size(unsigned long *base_offset,
|
|
|
}
|
|
|
EXPORT_SYMBOL(gsi_get_inst_ram_offset_and_size);
|
|
|
|
|
|
+/*
|
|
|
+ * Dumping the Debug registers for halt issue debugging.
|
|
|
+ */
|
|
|
+static void gsi_dump_halt_debug_reg(unsigned int chan_idx, unsigned int ee)
|
|
|
+{
|
|
|
+ struct gsihal_reg_ch_k_cntxt_0 ch_k_cntxt_0;
|
|
|
+
|
|
|
+ GSIERR("DEBUG_PC_FOR_DEBUG = 0x%x\n",
|
|
|
+ gsihal_read_reg(GSI_EE_n_GSI_DEBUG_PC_FOR_DEBUG));
|
|
|
+
|
|
|
+ GSIERR("GSI_DEBUG_BUSY_REG 0x%x\n",
|
|
|
+ gsihal_read_reg(GSI_EE_n_GSI_DEBUG_BUSY_REG));
|
|
|
+
|
|
|
+ GSIERR("GSI_EE_n_CNTXT_GLOB_IRQ_EN_OFFS = 0x%x\n",
|
|
|
+ gsihal_read_reg_n(GSI_EE_n_CNTXT_GLOB_IRQ_EN, gsi_ctx->per.ee));
|
|
|
+
|
|
|
+ GSIERR("GSI_EE_n_CNTXT_GLOB_IRQ_STTS_OFFS IRQ type = 0x%x\n",
|
|
|
+ gsihal_read_reg_n(GSI_EE_n_CNTXT_GLOB_IRQ_EN, gsi_ctx->per.ee));
|
|
|
+
|
|
|
+ GSIERR("GSI_EE_n_CNTXT_SCRATCH_0_OFFS = 0x%x\n",
|
|
|
+ gsihal_read_reg_n(GSI_EE_n_CNTXT_SCRATCH_0, gsi_ctx->per.ee));
|
|
|
+ if (gsi_ctx->per.ver >= GSI_VER_2_9)
|
|
|
+ GSIERR("GSI_EE_n_GSI_CH_k_SCRATCH_4 = 0x%x\n",
|
|
|
+ gsihal_read_reg_nk(GSI_EE_n_GSI_CH_k_SCRATCH_4, ee, chan_idx));
|
|
|
+
|
|
|
+ gsihal_read_reg_nk_fields(GSI_EE_n_GSI_CH_k_CNTXT_0, ee, chan_idx, &ch_k_cntxt_0);
|
|
|
+ GSIERR("Q6 channel [%d] state = %d\n", chan_idx, ch_k_cntxt_0.chstate);
|
|
|
+}
|
|
|
+
|
|
|
int gsi_halt_channel_ee(unsigned int chan_idx, unsigned int ee, int *code)
|
|
|
{
|
|
|
enum gsi_generic_ee_cmd_opcode op = GSI_GEN_EE_CMD_HALT_CHANNEL;
|
|
@@ -4552,8 +4581,17 @@ int gsi_halt_channel_ee(unsigned int chan_idx, unsigned int ee, int *code)
|
|
|
}
|
|
|
if (gsi_ctx->scratch.word0.s.generic_ee_cmd_return_code == 0) {
|
|
|
GSIERR("No response received\n");
|
|
|
- res = -GSI_STATUS_ERROR;
|
|
|
- goto free_lock;
|
|
|
+ gsi_dump_halt_debug_reg(chan_idx, ee);
|
|
|
+ usleep_range(GSI_RESET_WA_MIN_SLEEP, GSI_RESET_WA_MAX_SLEEP);
|
|
|
+ GSIERR("Reading after usleep scratch 0 reg\n");
|
|
|
+ gsi_ctx->scratch.word0.val = gsihal_read_reg_n(GSI_EE_n_CNTXT_SCRATCH_0,
|
|
|
+ gsi_ctx->per.ee);
|
|
|
+ if (gsi_ctx->scratch.word0.s.generic_ee_cmd_return_code == 0) {
|
|
|
+ GSIERR("No response received second attempt\n");
|
|
|
+ gsi_dump_halt_debug_reg(chan_idx, ee);
|
|
|
+ res = -GSI_STATUS_ERROR;
|
|
|
+ goto free_lock;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
res = GSI_STATUS_SUCCESS;
|