From bc1faedf1cbcc29b40d85a7d71d958c98641082b Mon Sep 17 00:00:00 2001 From: Hosung Kim Date: Mon, 20 Aug 2018 16:30:39 +0900 Subject: [PATCH] [ERD][NEUS7920-76] [COMMON] lib: dss: save some information to DSS header region DSS want to know some physical address in ramdump directly. - linux-banner is saved to 0x700 -- 0x8FF offset - kernel log address is saved to 0x900 offset - platform log address is saved to 0x904 offset - kernel event address is saved to 0x908 offset from DSS reserved region. Change-Id: I74f110249fbc3cecc32bcd2d22ba1cba65d9fbf9 Signed-off-by: Hosung Kim --- lib/debug-snapshot-log.h | 7 +++++++ lib/debug-snapshot.c | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/lib/debug-snapshot-log.h b/lib/debug-snapshot-log.h index 9b3529e4200f..35fd4ac76ea7 100644 --- a/lib/debug-snapshot-log.h +++ b/lib/debug-snapshot-log.h @@ -71,6 +71,13 @@ #define DSS_OFFSET_PANIC_STAT (0x500) #define DSS_OFFSET_CORE_LAST_PC (0x600) +/* S5P_VA_SS_BASE + 0x700 -- 0x8FF is reserved */ +#define DSS_OFFSET_LINUX_BANNER (0x700) + +#define DSS_OFFSET_KERNEL_LOG (0x900) +#define DSS_OFFSET_PLATFORM_LOG (0x904) +#define DSS_OFFSET_KERNEL_EVENT (0x908) + /* S5P_VA_SS_BASE + 0xC00 -- 0xFFF is reserved */ #define DSS_OFFSET_PANIC_STRING (0xC00) #define DSS_OFFSET_SPARE_BASE (DSS_HEADER_TOTAL_SZ) diff --git a/lib/debug-snapshot.c b/lib/debug-snapshot.c index 64feb0ac60fa..1cdf89c5a1a5 100644 --- a/lib/debug-snapshot.c +++ b/lib/debug-snapshot.c @@ -692,6 +692,7 @@ static int __init dbg_snapshot_init_dt(void) static int __init dbg_snapshot_init_value(void) { int val = dbg_snapshot_get_debug_level_reg(); + struct dbg_snapshot_item *item; dbg_snapshot_set_debug_level(val); @@ -700,6 +701,23 @@ static int __init dbg_snapshot_init_value(void) dbg_snapshot_scratch_reg(DSS_SIGN_SCRATCH); + /* copy linux_banner, physical address of + * kernel log / platform log / kevents to DSS header */ + strncpy(dbg_snapshot_get_base_vaddr() + DSS_OFFSET_LINUX_BANNER, + linux_banner, strlen(linux_banner)); + + item = &dss_items[dss_desc.log_kernel_num]; + __raw_writel(item->entry.paddr, + dbg_snapshot_get_base_vaddr() + DSS_OFFSET_KERNEL_LOG); + + item = &dss_items[dss_desc.log_platform_num]; + __raw_writel(item->entry.paddr, + dbg_snapshot_get_base_vaddr() + DSS_OFFSET_PLATFORM_LOG); + + item = &dss_items[dss_desc.kevents_num]; + __raw_writel(item->entry.paddr, + dbg_snapshot_get_base_vaddr() + DSS_OFFSET_KERNEL_EVENT); + return 0; } -- 2.20.1