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 <changki.kim@samsung.com>
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 *);
#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)
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)
__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);
/* 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;
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 */