From 574667420ead5a8fa056b59b4ee7012ea46043da Mon Sep 17 00:00:00 2001 From: Changki Kim Date: Tue, 26 Mar 2019 20:20:46 +0900 Subject: [PATCH] [ERD][RAMEN9610-14963] [COMMON] lib: dss: Change debug level policy. debug level is related with ramdump. low: if error(like panic, wdtreset ..) happened, system does not enter fastboot mode. mid: system enters fastboot mode. debug level is determined in bootloader. Change-Id: I9186dc97ee7591ef2f4e888da488602141779ebf Signed-off-by: Changki Kim --- include/linux/debug-snapshot.h | 5 +---- lib/debug-snapshot-helper.c | 9 +-------- lib/debug-snapshot.c | 22 +++------------------- 3 files changed, 5 insertions(+), 31 deletions(-) diff --git a/include/linux/debug-snapshot.h b/include/linux/debug-snapshot.h index 0ee303467fa7..0acc2a59dd8f 100644 --- a/include/linux/debug-snapshot.h +++ b/include/linux/debug-snapshot.h @@ -39,9 +39,7 @@ extern int dbg_snapshot_post_panic(void); extern int dbg_snapshot_post_reboot(char *cmd); extern int dbg_snapshot_set_hardlockup(int); extern int dbg_snapshot_get_hardlockup(void); -extern int dbg_snapshot_set_debug_level(int); extern int dbg_snapshot_get_debug_level(void); -extern void dbg_snapshot_set_debug_level_reg(void); extern int dbg_snapshot_get_debug_level_reg(void); extern unsigned int dbg_snapshot_get_item_size(char *); extern unsigned int dbg_snapshot_get_item_paddr(char *); @@ -217,8 +215,8 @@ extern void dbg_snapshot_binder(struct trace_binder_transaction_base *base, #define dbg_snapshot_post_reboot(a) do { } while(0) #define dbg_snapshot_set_hardlockup(a) do { } while(0) #define dbg_snapshot_get_hardlockup() do { } while(0) -#define dbg_snapshot_set_debug_level(a) do { } while(0) #define dbg_snapshot_get_debug_level() do { } while(0) +#define dbg_snapshot_get_debug_level_reg() do { } while (0) #define dbg_snapshot_check_crash_key(a,b) do { } while(0) #define dbg_snapshot_dm(a,b,c,d,e) do { } while(0) #define dbg_snapshot_panic_handler_safe() do { } while(0) @@ -301,7 +299,6 @@ enum dsslog_freq_flag { DSS_FLAG_END }; -#define DSS_DEBUG_LEVEL_NONE (-1) #define DSS_DEBUG_LEVEL_PREFIX (0xDB9 << 16) #define DSS_DEBUG_LEVEL_LOW (0) #define DSS_DEBUG_LEVEL_MID (1) diff --git a/lib/debug-snapshot-helper.c b/lib/debug-snapshot-helper.c index 8a42d09092bf..7f464ee04c04 100644 --- a/lib/debug-snapshot-helper.c +++ b/lib/debug-snapshot-helper.c @@ -104,16 +104,9 @@ static void dbg_snapshot_report_reason(unsigned int val) __raw_writel(val, dbg_snapshot_get_base_vaddr() + DSS_OFFSET_EMERGENCY_REASON); } -void dbg_snapshot_set_debug_level_reg(void) -{ - if (dbg_snapshot_get_enable("header")) - __raw_writel(dss_desc.debug_level | DSS_DEBUG_LEVEL_PREFIX, - dbg_snapshot_get_base_vaddr() + DSS_OFFSET_DEBUG_LEVEL); -} - int dbg_snapshot_get_debug_level_reg(void) { - int ret = DSS_DEBUG_LEVEL_NONE; + int ret = DSS_DEBUG_LEVEL_MID; if (dbg_snapshot_get_enable("header")) { int val = __raw_readl(dbg_snapshot_get_base_vaddr() + DSS_OFFSET_DEBUG_LEVEL); diff --git a/lib/debug-snapshot.c b/lib/debug-snapshot.c index 201824b8581e..f38f4fa07302 100644 --- a/lib/debug-snapshot.c +++ b/lib/debug-snapshot.c @@ -83,21 +83,6 @@ struct dbg_snapshot_desc dss_desc; /* Variable for assigning virtual address base */ static size_t g_dbg_snapshot_vaddr_base = DSS_FIXED_VIRT_BASE; -int dbg_snapshot_set_debug_level(int level) -{ - if (level > -1 && level < ARRAY_SIZE(debug_level_val)) { - dss_desc.debug_level = level; - } else { -#if !IS_ENABLED(CONFIG_DEBUG_SNAPSHOT_USER_MODE) - dss_desc.debug_level = DSS_DEBUG_LEVEL_MID; -#else - dss_desc.debug_level = DSS_DEBUG_LEVEL_LOW; -#endif - } - dbg_snapshot_set_debug_level_reg(); - return 0; -} - int dbg_snapshot_get_debug_level(void) { return dss_desc.debug_level; @@ -748,14 +733,13 @@ static int __init dbg_snapshot_init_dt(void) static int __init dbg_snapshot_init_value(void) { - int val = dbg_snapshot_get_debug_level_reg(); - - dbg_snapshot_set_debug_level(val); + dss_desc.debug_level = dbg_snapshot_get_debug_level_reg(); pr_info("debug-snapshot: debug_level [%s]\n", debug_level_val[dss_desc.debug_level]); - dbg_snapshot_scratch_reg(DSS_SIGN_SCRATCH); + if (dss_desc.debug_level != DSS_DEBUG_LEVEL_LOW) + dbg_snapshot_scratch_reg(DSS_SIGN_SCRATCH); /* copy linux_banner, physical address of * kernel log / platform log / kevents to DSS header */ -- 2.20.1