disp: msm: sde: save register write logs in dump

Changes are made to add register write logs to memory dump.
This can be extracted from crash dumps and used for analysis.

Change-Id: If46aaa4ae68f83c79d4b51cbe5dfd22340aa991d
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
This commit is contained in:
Yashwanth
2021-01-18 14:45:51 +05:30
committed by Dhaval Patel
vanhempi bb66bea78f
commit 43d147f299
5 muutettua tiedostoa jossa 154 lisäystä ja 1 poistoa

Näytä tiedosto

@@ -234,6 +234,7 @@ struct sde_dbg_regbuf {
/**
* struct sde_dbg_base - global sde debug base structure
* @evtlog: event log instance
* @reglog: reg log instance
* @reg_base_list: list of register dumping regions
* @dev: device pointer
* @mutex: mutex to serialize access to serialze dumps, debugfs access
@@ -253,12 +254,14 @@ struct sde_dbg_regbuf {
* @dump_secure: dump entries excluding few as it is in secure-session
* @regbuf: buffer data to track the register dumping in hw recovery
* @cur_evt_index: index used for tracking event logs dump in hw recovery
* @cur_reglog_index: index used for tracking register logs dump in hw recovery
* @dbgbus_dump_idx: index used for tracking dbg-bus dump in hw recovery
* @vbif_dbgbus_dump_idx: index for tracking vbif dumps in hw recovery
* @hw_ownership: indicates if the VM owns the HW resources
*/
static struct sde_dbg_base {
struct sde_dbg_evtlog *evtlog;
struct sde_dbg_reglog *reglog;
struct list_head reg_base_list;
struct device *dev;
struct mutex mutex;
@@ -283,6 +286,7 @@ static struct sde_dbg_base {
struct sde_dbg_regbuf regbuf;
u32 cur_evt_index;
u32 cur_reglog_index;
enum sde_dbg_dump_context dump_mode;
bool hw_ownership;
} sde_dbg_base;
@@ -293,6 +297,9 @@ static DEFINE_MUTEX(sde_dbg_dsi_mutex);
/* sde_dbg_base_evtlog - global pointer to main sde event log for macro use */
struct sde_dbg_evtlog *sde_dbg_base_evtlog;
/* sde_dbg_base_reglog - global pointer to main sde reg log for macro use */
struct sde_dbg_reglog *sde_dbg_base_reglog;
static void _sde_debug_bus_xbar_dump(u32 wr_addr, u32 block_id, u32 test_id, u32 val)
{
SDE_DBG_LOG_DEBUGBUS("xbar", wr_addr, block_id, test_id, val);
@@ -2206,6 +2213,12 @@ int sde_dbg_init(struct device *dev)
sde_dbg_base_evtlog = sde_dbg_base.evtlog;
sde_dbg_base.reglog = sde_reglog_init();
if (IS_ERR_OR_NULL(sde_dbg_base.reglog))
return PTR_ERR(sde_dbg_base.reglog);
sde_dbg_base_reglog = sde_dbg_base.reglog;
INIT_WORK(&sde_dbg_base.dump_work, _sde_dump_work);
sde_dbg_base.work_panic = false;
sde_dbg_base.panic_on_err = DEFAULT_PANIC;
@@ -2265,6 +2278,8 @@ void sde_dbg_destroy(void)
sde_dbg_base_evtlog = NULL;
sde_evtlog_destroy(sde_dbg_base.evtlog);
sde_dbg_base.evtlog = NULL;
sde_reglog_destroy(sde_dbg_base.reglog);
sde_dbg_base.reglog = NULL;
sde_dbg_reg_base_destroy();
sde_dbg_dsi_ctrl_destroy();
mutex_destroy(&sde_dbg_base.mutex);