[ERD][NEUS7920-76] [COMMON] lib: dss: save some information to DSS header region
authorHosung Kim <hosung0.kim@samsung.com>
Mon, 20 Aug 2018 07:30:39 +0000 (16:30 +0900)
committerKim Gunho <gunho.kim@samsung.com>
Fri, 30 Aug 2019 07:58:56 +0000 (16:58 +0900)
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 <hosung0.kim@samsung.com>
lib/debug-snapshot-log.h
lib/debug-snapshot.c

index 9b3529e4200f1d65b96f0dc58de16cd73f68b35b..35fd4ac76ea76cad29e9c5f9736ab496bd4102cf 100644 (file)
 #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)
index 64feb0ac60fae1ff6ed13fe536dcf8ed90be264c..1cdf89c5a1a5a0225a76c9fe2776e5ded10cdf40 100644 (file)
@@ -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;
 }