[COMMON] lib: dss: rename exynos-snapshot to debug-snapshot
authorDonghyeok Choe <d7271.choe@samsung.com>
Sun, 13 May 2018 04:32:33 +0000 (13:32 +0900)
committerDonghyeok Choe <d7271.choe@samsung.com>
Tue, 15 May 2018 04:36:37 +0000 (13:36 +0900)
Change-Id: I196cfc11cd7d24d134bfbf89d5dec27c5450a22f
Signed-off-by: Donghyeok Choe <d7271.choe@samsung.com>
24 files changed:
arch/arm64/boot/dts/exynos/exynos9610-rmem.dtsi
arch/arm64/configs/erd9610_defconfig
arch/arm64/kernel/exynos-smc.S
drivers/clk/samsung/composite.c
drivers/regulator/s2mpu09-regulator.c
drivers/scsi/ufs/ufs-exynos-dbg.c
drivers/soc/samsung/Kconfig
drivers/soc/samsung/Makefile
drivers/soc/samsung/acpm/acpm.c
drivers/soc/samsung/acpm/acpm_ipc.c
drivers/soc/samsung/acpm/acpm_s2d.c
drivers/soc/samsung/cal-if/cal-if.c
drivers/soc/samsung/cal-if/pmucal_common.h
drivers/soc/samsung/cal-if/pmucal_local.c
drivers/soc/samsung/cal-if/pmucal_system.c
drivers/soc/samsung/debug/Kconfig [new file with mode: 0644]
drivers/soc/samsung/debug/Makefile [new file with mode: 0644]
drivers/watchdog/s3c2410_wdt.c
include/dt-bindings/soc/samsung/debug-snapshot-table.h [new file with mode: 0644]
include/dt-bindings/soc/samsung/exynos-ss-table.h [deleted file]
include/linux/debug-snapshot-helper.h [new file with mode: 0644]
include/linux/debug-snapshot-soc.h [new file with mode: 0644]
include/linux/debug-snapshot.h [new file with mode: 0644]
include/linux/exynos-ss.h [deleted file]

index 4f5220e9533d2bed9da111446bbdae47e178b954..31e1dc4ee2a2c1cae9fab1e58bb33ad9d8c77b39 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 #include "../../../../../include/generated/autoconf.h"
-#include <dt-bindings/soc/samsung/exynos-ss-table.h>
+#include <dt-bindings/soc/samsung/debug-snapshot-table.h>
 
 /memreserve/ 0xE0000000 0x1900000;
 / {
                        reg = <0x0 0xFD000000 0x80000>;
                };
 
-               exynos_ss {
-                       compatible = "exynos,exynos_ss";
-                       reg = <0x0 ESS_START_ADDR ESS_TOTAL_SIZE>;
+               debug_snapshot {
                        #address-cells = <2>;
                        #size-cells = <1>;
                        /* If this property exist, these are modified by bootloader. */
                        //bootloader;
 
                        header {
-                               compatible = "exynos_ss,header";
-                               reg = <0 ESS_HEADER_ADDR ESS_HEADER_SIZE>;
+                               compatible = "dbg_snapshot,header";
+                               reg = <0 DSS_HEADER_ADDR DSS_HEADER_SIZE>;
                        };
                        log_kernel {
-                               compatible = "exynos_ss,log_kernel";
-                               reg = <0 ESS_LOG_KERNEL_ADDR ESS_LOG_KERNEL_SIZE>;
+                               compatible = "dbg_snapshot,log_kernel";
+                               reg = <0 DSS_LOG_KERNEL_ADDR DSS_LOG_KERNEL_SIZE>;
                        };
                        log_platform {
-                               compatible = "exynos_ss,log_platform";
-                               reg = <0 ESS_LOG_PLATFORM_ADDR ESS_LOG_PLATFORM_SIZE>;
+                               compatible = "dbg_snapshot,log_platform";
+                               reg = <0 DSS_LOG_PLATFORM_ADDR DSS_LOG_PLATFORM_SIZE>;
                        };
                        log_sfr {
-                               compatible = "exynos_ss,log_sfr";
-                               reg = <0 ESS_LOG_SFR_ADDR ESS_LOG_SFR_SIZE>;
+                               compatible = "dbg_snapshot,log_sfr";
+                               reg = <0 DSS_LOG_SFR_ADDR DSS_LOG_SFR_SIZE>;
                        };
                        log_pstore {
-                               compatible = "exynos_ss,log_pstore";
-                               reg = <0 ESS_LOG_PSTORE_ADDR ESS_LOG_PSTORE_SIZE>;
+                               compatible = "dbg_snapshot,log_pstore";
+                               reg = <0 DSS_LOG_PSTORE_ADDR DSS_LOG_PSTORE_SIZE>;
                        };
                        log_kevents {
-                               compatible = "exynos_ss,log_kevents";
-                               reg = <0 ESS_LOG_KEVENTS_ADDR ESS_LOG_KEVENTS_SIZE>;
+                               compatible = "dbg_snapshot,log_kevents";
+                               reg = <0 DSS_LOG_KEVENTS_ADDR DSS_LOG_KEVENTS_SIZE>;
                        };
                };
 
index b535f51a3a90e76ec8ccf6b52a0ad71719e6fc11..b55616b74e8e8f0def7007e5a2ec639880b73207 100644 (file)
@@ -325,7 +325,7 @@ CONFIG_PWM_SAMSUNG=y
 # CONFIG_PHY_EXYNOS_DP_VIDEO is not set
 CONFIG_ANDROID=y
 CONFIG_ANDROID_BINDER_IPC=y
-# CONFIG_EXYNOS_SNAPSHOT is not set
+# CONFIG_DEBUG_SNAPSHOT is not set
 # CONFIG_EXYNOS_CONSOLE_DEBUGGER is not set
 CONFIG_EXT2_FS=y
 CONFIG_EXT3_FS=y
index 0a7a89315534b4a2a938a3b06113a4c41d410129..369a3a23bfd84cf6c9a8dccb8a4e84c93457f5d2 100755 (executable)
@@ -24,7 +24,7 @@
  */
 
 ENTRY(__exynos_smc)
-#ifdef CONFIG_EXYNOS_SNAPSHOT_LOGGING_SMC_CALL
+#ifdef CONFIG_DEBUG_SNAPSHOT_LOGGING_SMC_CALL
        stp     x29, x30, [sp, #-48]!
        mov     x29, sp
        stp     x0, x1, [sp, #16]
@@ -32,19 +32,19 @@ ENTRY(__exynos_smc)
        ldr     x3, =save_smc_id
        str     x0, [x3]
        mov     x3, #ESS_FLAG_IN
-       bl      exynos_ss_irq
+       bl      dbg_snapshot_irq
        ldp     x0, x1, [sp, #16]
        ldp     x2, x3, [sp, #32]
 #endif
        dsb     sy
        smc     #0
-#ifdef CONFIG_EXYNOS_SNAPSHOT_LOGGING_SMC_CALL
+#ifdef CONFIG_DEBUG_SNAPSHOT_LOGGING_SMC_CALL
        stp     x0, x1, [sp, #16]
        stp     x2, x3, [sp, #32]
        ldr     x3, =save_smc_id
        ldr     x0, [x3]
        mov     x3, #ESS_FLAG_OUT
-       bl      exynos_ss_irq
+       bl      dbg_snapshot_irq
        ldp     x0, x1, [sp, #16]
        ldp     x2, x3, [sp, #32]
        ldp     x29, x30, [sp], #48
index f6aa91b2ecd90b9d879ba571dbfab52528e9a5c2..37c093e0cf823b592a931a409555c7f6813661a5 100644 (file)
@@ -1375,17 +1375,17 @@ int cal_vclk_enable(struct clk_hw *hw)
        if (vclk->lock)
                spin_lock_irqsave(vclk->lock, flags);
 
-       exynos_ss_clk(hw, __func__, 1, ESS_FLAG_IN);
+       dbg_snapshot_clk(hw, __func__, 1, DSS_FLAG_IN);
        /* Call cal api to enable virtual clock */
        ret = cal_clk_enable(vclk->id);
        if (ret) {
                pr_err("[CAL]%s failed %d %d.\n", __func__, vclk->id, ret);
-               exynos_ss_clk(hw, __func__, 1, ESS_FLAG_ON);
+               dbg_snapshot_clk(hw, __func__, 1, DSS_FLAG_ON);
                if (vclk->lock)
                        spin_unlock_irqrestore(vclk->lock, flags);
                return -EAGAIN;
        }
-       exynos_ss_clk(hw, __func__, 1, ESS_FLAG_OUT);
+       dbg_snapshot_clk(hw, __func__, 1, DSS_FLAG_OUT);
 
        if (vclk->lock)
                spin_unlock_irqrestore(vclk->lock, flags);
@@ -1405,17 +1405,17 @@ void cal_vclk_disable(struct clk_hw *hw)
        if (vclk->lock)
                spin_lock_irqsave(vclk->lock, flags);
 
-       exynos_ss_clk(hw, __func__, 0, ESS_FLAG_IN);
+       dbg_snapshot_clk(hw, __func__, 0, DSS_FLAG_IN);
        /* Call cal api to disable virtual clock */
        ret = cal_clk_disable(vclk->id);
        if (ret) {
                pr_err("[CAL]%s failed %d %d.\n", __func__, vclk->id, ret);
-               exynos_ss_clk(hw, __func__, 0, ESS_FLAG_ON);
+               dbg_snapshot_clk(hw, __func__, 0, DSS_FLAG_ON);
                if (vclk->lock)
                        spin_unlock_irqrestore(vclk->lock, flags);
                return;
        }
-       exynos_ss_clk(hw, __func__, 0, ESS_FLAG_OUT);
+       dbg_snapshot_clk(hw, __func__, 0, DSS_FLAG_OUT);
 
        if (vclk->lock)
                spin_unlock_irqrestore(vclk->lock, flags);
@@ -1441,10 +1441,10 @@ unsigned long cal_vclk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
        struct samsung_vclk *vclk = to_vclk(hw);
        unsigned long ret = 0;
 
-       exynos_ss_clk(hw, __func__, 0, ESS_FLAG_IN);
+       dbg_snapshot_clk(hw, __func__, 0, DSS_FLAG_IN);
        /* Call cal api to recalculate rate */
        ret = cal_clk_getrate(vclk->id);
-       exynos_ss_clk(hw, __func__, ret, ESS_FLAG_OUT);
+       dbg_snapshot_clk(hw, __func__, ret, DSS_FLAG_OUT);
 
        return ret;
 }
@@ -1455,14 +1455,14 @@ unsigned long cal_vclk_gate_recalc_rate(struct clk_hw *hw, unsigned long parent_
        struct clk_hw *parent;
        unsigned long ret = 0;
 
-       exynos_ss_clk(hw, __func__, 0, ESS_FLAG_IN);
+       dbg_snapshot_clk(hw, __func__, 0, DSS_FLAG_IN);
        parent = clk_hw_get_parent(hw);
        if (parent) {
                vclk = to_vclk(parent);
                /* call cal api to recalculate rate */
                ret = cal_clk_getrate(vclk->id);
        }
-       exynos_ss_clk(hw, __func__, ret, ESS_FLAG_OUT);
+       dbg_snapshot_clk(hw, __func__, ret, DSS_FLAG_OUT);
 
        return ret;
 }
@@ -1483,18 +1483,18 @@ int cal_vclk_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long prate
        if (vclk->lock)
                spin_lock_irqsave(vclk->lock, flags);
 
-       exynos_ss_clk(hw, __func__, rate, ESS_FLAG_IN);
+       dbg_snapshot_clk(hw, __func__, rate, DSS_FLAG_IN);
        /* Call cal api to set rate of clock */
        ret = cal_clk_setrate(vclk->id, rate);
        if (ret) {
                pr_err("[CAL]%s failed %d %lu %d.\n", __func__,
                        vclk->id, rate, ret);
-               exynos_ss_clk(hw, __func__, rate, ESS_FLAG_ON);
+               dbg_snapshot_clk(hw, __func__, rate, DSS_FLAG_ON);
                if (vclk->lock)
                        spin_unlock_irqrestore(vclk->lock, flags);
                return -EAGAIN;
        }
-       exynos_ss_clk(hw, __func__, rate, ESS_FLAG_OUT);
+       dbg_snapshot_clk(hw, __func__, rate, DSS_FLAG_OUT);
 
        if (vclk->lock)
                spin_unlock_irqrestore(vclk->lock, flags);
@@ -1532,18 +1532,18 @@ int cal_vclk_dfs_set_rate(struct clk_hw *hw, unsigned long rate, unsigned long p
        if (vclk->lock)
                spin_lock_irqsave(vclk->lock, flags);
 
-       exynos_ss_clk(hw, __func__, rate, ESS_FLAG_IN);
+       dbg_snapshot_clk(hw, __func__, rate, DSS_FLAG_IN);
        /* Call cal api to set rate of clock */
        ret = cal_dfs_set_rate(vclk->id, rate);
        if (ret) {
                pr_err("[CAL]%s failed %d %lu %d.\n", __func__,
                        vclk->id, rate, ret);
-               exynos_ss_clk(hw, __func__, rate, ESS_FLAG_ON);
+               dbg_snapshot_clk(hw, __func__, rate, DSS_FLAG_ON);
                if (vclk->lock)
                        spin_unlock_irqrestore(vclk->lock, flags);
                return -EAGAIN;
        }
-       exynos_ss_clk(hw, __func__, rate, ESS_FLAG_OUT);
+       dbg_snapshot_clk(hw, __func__, rate, DSS_FLAG_OUT);
 
        if (vclk->lock)
                spin_unlock_irqrestore(vclk->lock, flags);
@@ -1603,14 +1603,14 @@ int cal_vclk_qactive_enable(struct clk_hw *hw)
        if (vclk->lock)
                spin_lock_irqsave(vclk->lock, flags);
 
-       exynos_ss_clk(hw, __func__, 1, ESS_FLAG_IN);
+       dbg_snapshot_clk(hw, __func__, 1, DSS_FLAG_IN);
 
        reg = readl(vclk->addr);
        reg &= ~(vclk->mask);
        reg |= vclk->val;
        writel(reg, vclk->addr);
 
-       exynos_ss_clk(hw, __func__, 1, ESS_FLAG_OUT);
+       dbg_snapshot_clk(hw, __func__, 1, DSS_FLAG_OUT);
 
        if (vclk->lock)
                spin_unlock_irqrestore(vclk->lock, flags);
@@ -1633,13 +1633,13 @@ void cal_vclk_qactive_disable(struct clk_hw *hw)
        if (vclk->lock)
                spin_lock_irqsave(vclk->lock, flags);
 
-       exynos_ss_clk(hw, __func__, 0, ESS_FLAG_IN);
+       dbg_snapshot_clk(hw, __func__, 0, DSS_FLAG_IN);
 
        reg = readl(vclk->addr);
        reg &= ~(vclk->mask);
        writel(reg, vclk->addr);
 
-       exynos_ss_clk(hw, __func__, 0, ESS_FLAG_OUT);
+       dbg_snapshot_clk(hw, __func__, 0, DSS_FLAG_OUT);
 
        if (vclk->lock)
                spin_unlock_irqrestore(vclk->lock, flags);
index 3afee5bc3d4a0672245817141a77b052e71638fe..e296f33269cfae5decaf0ecb0f5a24a125f77a66 100644 (file)
@@ -27,7 +27,7 @@
 #include <linux/mfd/samsung/s2mpu09-regulator.h>
 #include <linux/io.h>
 #include <linux/mutex.h>
-#include <linux/exynos-ss.h>
+#include <linux/debug-snapshot.h>
 #include <linux/debugfs.h>
 
 static struct s2mpu09_info *static_info;
index 3423377a0666db8a03fc3afc9516ad5a65c4ef99..1d7de9973abcc2275bce1196ad2e3c79411c14c5 100644 (file)
@@ -1166,9 +1166,9 @@ int exynos_ufs_init_dbg(struct ufs_hba *hba)
                exynos_clki->freq = 0;
                list_add_tail(&exynos_clki->list, &ufs->debug.misc.clk_list_head);
        }
-#ifdef CONFIG_EXYNOS_SNAPSHOT
-       hba->secure_log.paddr = exynos_ss_get_spare_paddr(0);
-       hba->secure_log.vaddr = (u32 *)exynos_ss_get_spare_vaddr(0);
+#ifdef CONFIG_DEBUG_SNAPSHOT
+       hba->secure_log.paddr = dbg_snapshot_get_spare_paddr(0);
+       hba->secure_log.vaddr = (u32 *)dbg_snapshot_get_spare_vaddr(0);
 #endif
 
        return 0;
index 4c511cd1b97744cf0301753de8516b5f2c1d7863..8dd63ca5b10765aa804506856688c29af43dffad 100644 (file)
@@ -79,4 +79,6 @@ config EXYNOS_PM_DOMAINS
        bool "Exynos PM domains" if COMPILE_TEST
        depends on PM_GENERIC_DOMAINS || COMPILE_TEST
 
+source "drivers/soc/samsung/debug/Kconfig"
+
 endif
index 2ba80403a3bfcc69ed40abb62ca655aa8e879ec7..e1da2cf146c96e665865f25aab788bdd0ed3c675 100644 (file)
@@ -22,3 +22,6 @@ obj-$(CONFIG_EXYNOS_CHIPID)   += exynos-chipid.o
 obj-$(CONFIG_EXYNOS_ACPM)       += acpm/
 
 obj-$(CONFIG_EXYNOS_RGT)        += exynos-rgt.o
+
+# DEBUG
+obj-$(CONFIG_EXYNOS_DEBUG)      += debug/
index c24607883982c9979c571458fc994289cfb21730..1c56884b71ce608db327490280c3d23ef5150e92 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/debugfs.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
-#include <linux/exynos-ss.h>
+#include <linux/debug-snapshot.h>
 #include <linux/soc/samsung/exynos-soc.h>
 #include <linux/sched/clock.h>
 
index 19026c93b5fd71d041f13f6f2431088170d89a83..85399028f734c1a8dfe0a06a58319eb56ee7dd66 100644 (file)
@@ -19,7 +19,7 @@
 #include <linux/list.h>
 #include <linux/wait.h>
 #include <linux/slab.h>
-#include <linux/exynos-ss.h>
+#include <linux/debug-snapshot.h>
 #include <linux/sched/clock.h>
 
 #include "acpm.h"
@@ -85,7 +85,7 @@ void acpm_get_inform(void)
 
 void acpm_ramdump(void)
 {
-#ifdef CONFIG_EXYNOS_SNAPSHOT_ACPM
+#ifdef CONFIG_DEBUG_SNAPSHOT_ACPM
        if (acpm_debug->dump_size)
                memcpy(acpm_debug->dump_dram_base, acpm_debug->dump_base, acpm_debug->dump_size);
 #endif
@@ -217,16 +217,16 @@ void acpm_log_print(void)
                                reg_id = get_reg_id(val >> 12);
 
                        if (reg_id == NO_SS_RANGE)
-                               exynos_ss_regulator(time, "outSc", val >> 12, (val >> 4) & 0xFF, (val >> 4) & 0xFF, val & 0xF);
+                               dbg_snapshot_regulator(time, "outSc", val >> 12, (val >> 4) & 0xFF, (val >> 4) & 0xFF, val & 0xF);
                        else if (reg_id == NO_SET_REGMAP)
-                               exynos_ss_regulator(time, "noMap", val >> 12, (val >> 4) & 0xFF, (val >> 4) & 0xFF, val & 0xF);
+                               dbg_snapshot_regulator(time, "noMap", val >> 12, (val >> 4) & 0xFF, (val >> 4) & 0xFF, val & 0xF);
                        else
-                               exynos_ss_regulator(time, regulator_ss[reg_id].name, val >> 12,
+                               dbg_snapshot_regulator(time, regulator_ss[reg_id].name, val >> 12,
                                                get_reg_voltage(regulator_ss[reg_id], (val >> 4) & 0xFF),
                                                (val >> 4) & 0xFF,
                                                val & 0xF);
                }
-               exynos_ss_acpm(time, str, val);
+               dbg_snapshot_acpm(time, str, val);
 
                if (acpm_debug->debug_log_level == 1 || !log_level)
                        pr_info("[ACPM_FW] : %llu id:%u, %s, %x\n", time, id, str, val);
@@ -742,9 +742,9 @@ static void log_buffer_init(struct device *dev, struct device_node *node)
        if (prop)
                acpm_debug->period = be32_to_cpup(prop);
 
-#ifdef CONFIG_EXYNOS_SNAPSHOT_ACPM
+#ifdef CONFIG_DEBUG_SNAPSHOT_ACPM
        acpm_debug->dump_dram_base = kzalloc(acpm_debug->dump_size, GFP_KERNEL);
-       exynos_ss_printk("[ACPM] acpm framework SRAM dump to dram base: 0x%x\n",
+       dbg_snapshot_printk("[ACPM] acpm framework SRAM dump to dram base: 0x%x\n",
                        virt_to_phys(acpm_debug->dump_dram_base));
 #endif
        pr_info("[ACPM] acpm framework SRAM dump to dram base: 0x%llx\n",
index 8ba497f4714abc5322f89c7e648216d2e0a057dd..a27d78cc0f6682d9b4a6937209978ca1ed8dc39a 100644 (file)
@@ -17,7 +17,7 @@
 #include <soc/samsung/acpm_ipc_ctrl.h>
 #include <linux/debugfs.h>
 #include <linux/slab.h>
-#include <linux/exynos-ss.h>
+#include <linux/debug-snapshot.h>
 
 
 #define EXYNOS_S2D_DBG_PREFIX  "EXYNOS-S2D-DBG: "
@@ -46,7 +46,7 @@ static int exynos_acpm_s2d_update_en(void)
        config.cmd = cmd;
        config.response = true;
        config.indirection = false;
-       config.cmd[1] = exynos_ss_get_item_paddr("log_s2d");
+       config.cmd[1] = dbg_snapshot_get_item_paddr("log_s2d");
        config.cmd[2] = s2d_en;
 
        before = sched_clock();
index 4cfcfad87e2bdf7afcbd0a9122a4ff5fcaadaa18..8560a1889f6f7623425143231eb2cb92d1b40bbb 100644 (file)
@@ -1,5 +1,5 @@
 #include <linux/module.h>
-#include <linux/exynos-ss.h>
+#include <linux/debug-snapshot.h>
 #include <soc/samsung/ect_parser.h>
 #include <soc/samsung/cal-if.h>
 
index f16edd62101088b3ae23075e7af7716ce8ed7b0b..88c060a61a21e1edc55467629abf7f61c783187c 100644 (file)
@@ -7,7 +7,7 @@
 #include <linux/types.h>
 #include <linux/kernel.h>
 #include <linux/sizes.h>
-#include <linux/exynos-ss.h>
+#include <linux/debug-snapshot.h>
 #include <linux/delay.h>
 #endif
 
index 1defe3eb78a5774625ac694be9c14666bfc9989b..fa693611261c8f907092121b06476e3559343fee 100644 (file)
@@ -17,7 +17,7 @@ int pmucal_local_enable(unsigned int pd_id)
 {
        int ret;
 
-       exynos_ss_pmu(pd_id, __func__, ESS_FLAG_IN);
+       dbg_snapshot_pmu(pd_id, __func__, DSS_FLAG_IN);
 
        if (pd_id >= pmucal_pd_list_size) {
                pr_err("%s pd index(%d) is out of supported range (0~%d).\n",
@@ -56,7 +56,7 @@ int pmucal_local_enable(unsigned int pd_id)
                return ret;
        }
 
-       exynos_ss_pmu(pd_id, __func__, ESS_FLAG_OUT);
+       dbg_snapshot_pmu(pd_id, __func__, DSS_FLAG_OUT);
 
        return 0;
 }
@@ -73,7 +73,7 @@ int pmucal_local_disable(unsigned int pd_id)
 {
        int ret, i;
 
-       exynos_ss_pmu(pd_id, __func__, ESS_FLAG_IN);
+       dbg_snapshot_pmu(pd_id, __func__, DSS_FLAG_IN);
 
        if (pd_id >= pmucal_pd_list_size) {
                pr_err("%s pd index(%d) is out of supported range (0~%d).\n",
@@ -114,7 +114,7 @@ int pmucal_local_disable(unsigned int pd_id)
                return ret;
        }
 
-       exynos_ss_pmu(pd_id, __func__, ESS_FLAG_OUT);
+       dbg_snapshot_pmu(pd_id, __func__, DSS_FLAG_OUT);
 
        return 0;
 }
@@ -132,7 +132,7 @@ int pmucal_local_is_enabled(unsigned int pd_id)
 {
        int i;
 
-       exynos_ss_pmu(pd_id, __func__, ESS_FLAG_IN);
+       dbg_snapshot_pmu(pd_id, __func__, DSS_FLAG_IN);
 
        if (pd_id >= pmucal_pd_list_size) {
                pr_err("%s pd index(%d) is out of supported range (0~%d).\n",
@@ -155,7 +155,7 @@ int pmucal_local_is_enabled(unsigned int pd_id)
                        break;
        }
 
-       exynos_ss_pmu(pd_id, __func__, ESS_FLAG_OUT);
+       dbg_snapshot_pmu(pd_id, __func__, DSS_FLAG_OUT);
 
        if (i == pmucal_pd_list[pd_id].num_status)
                return 1;
index 89a2634a41d129c871472ada5e9612b3e6855f8c..01f2e11e3beb61ba661f5f70a5ffc5a4f7d0b4de 100644 (file)
@@ -19,7 +19,7 @@ int pmucal_system_enter(int mode)
        int ret;
 
        if (mode != SYS_SICD)
-               exynos_ss_pmu(mode, __func__, ESS_FLAG_IN);
+               dbg_snapshot_pmu(mode, __func__, DSS_FLAG_IN);
 
        if (mode >= NUM_SYS_POWERDOWN) {
                pr_err("%s %s: mode index(%d) is out of supported range (0~%d).\n",
@@ -47,7 +47,7 @@ int pmucal_system_enter(int mode)
        }
 
        if (mode != SYS_SICD)
-               exynos_ss_pmu(mode, __func__, ESS_FLAG_OUT);
+               dbg_snapshot_pmu(mode, __func__, DSS_FLAG_OUT);
 
        return 0;
 }
@@ -65,7 +65,7 @@ int pmucal_system_exit(int mode)
        int ret;
 
        if (mode != SYS_SICD)
-               exynos_ss_pmu(mode, __func__, ESS_FLAG_IN);
+               dbg_snapshot_pmu(mode, __func__, DSS_FLAG_IN);
 
        if (mode >= NUM_SYS_POWERDOWN) {
                pr_err("%s %s: mode index(%d) is out of supported range (0~%d).\n",
@@ -96,7 +96,7 @@ int pmucal_system_exit(int mode)
        }
 
        if (mode != SYS_SICD)
-               exynos_ss_pmu(mode, __func__, ESS_FLAG_OUT);
+               dbg_snapshot_pmu(mode, __func__, DSS_FLAG_OUT);
 
        return 0;
 }
@@ -114,7 +114,7 @@ int pmucal_system_earlywakeup(int mode)
        int ret;
 
        if (mode != SYS_SICD)
-               exynos_ss_pmu(mode, __func__, ESS_FLAG_IN);
+               dbg_snapshot_pmu(mode, __func__, DSS_FLAG_IN);
 
        if (mode >= NUM_SYS_POWERDOWN) {
                pr_err("%s %s: mode index(%d) is out of supported range (0~%d).\n",
@@ -148,7 +148,7 @@ int pmucal_system_earlywakeup(int mode)
 #endif
 
        if (mode != SYS_SICD)
-               exynos_ss_pmu(mode, __func__, ESS_FLAG_OUT);
+               dbg_snapshot_pmu(mode, __func__, DSS_FLAG_OUT);
 
        return 0;
 }
diff --git a/drivers/soc/samsung/debug/Kconfig b/drivers/soc/samsung/debug/Kconfig
new file mode 100644 (file)
index 0000000..6125d5a
--- /dev/null
@@ -0,0 +1,4 @@
+menuconfig EXYNOS_DEBUG
+        bool "Exynos Debug Features"
+        default y
+        depends on ARCH_EXYNOS
diff --git a/drivers/soc/samsung/debug/Makefile b/drivers/soc/samsung/debug/Makefile
new file mode 100644 (file)
index 0000000..9e2531f
--- /dev/null
@@ -0,0 +1,15 @@
+#
+#  Makefile for Exynos-Debug
+#
+
+obj-$(CONFIG_EXYNOS_CORESIGHT)         += exynos-coresight.o
+ifeq ($(CONFIG_SOC_EXYNOS9810),y)
+obj-$(CONFIG_EXYNOS_ITMON)             += exynos9810-itmon.o
+endif
+ifeq ($(CONFIG_SOC_EXYNOS9820),y)
+obj-$(CONFIG_EXYNOS_ITMON)             += exynos9820-itmon.o
+endif
+ifeq ($(CONFIG_DEBUG_SNAPSHOT),y)
+obj-$(CONFIG_ARCH_EXYNOS)              += exynos-helper.o
+endif
+obj-$(CONFIG_EXYNOS_CORESIGHT_ETM)     += exynos-coresight-etm.o
index 5bae3c9d3d73d40ab3758d5a7daf4c7fc7e1d7f6..b327c423357f9ae794653e4fcdaba455b0b39972 100644 (file)
@@ -910,7 +910,7 @@ static int s3c2410wdt_multistage_wdt_start(void)
        return 0;
 }
 
-#ifdef CONFIG_EXYNOS_SNAPSHOT_WATCHDOG_RESET
+#ifdef CONFIG_DEBUG_SNAPSHOT_WATCHDOG_RESET
 
 static struct wdt_panic_block {
        struct notifier_block nb_panic_block;
@@ -928,7 +928,7 @@ static int s3c2410wdt_panic_handler(struct notifier_block *nb,
                return -ENODEV;
 
        /* We assumed that num_online_cpus() > 1 status is abnormal */
-       if (exynos_ss_get_hardlockup() || num_online_cpus() > 1) {
+       if (dbg_snapshot_get_hardlockup() || num_online_cpus() > 1) {
 
                pr_emerg("%s: watchdog reset is started on panic after 5secs\n", __func__);
 
@@ -1387,7 +1387,7 @@ static int s3c2410wdt_probe(struct platform_device *pdev)
        wtcon = readl(wdt->reg_base + S3C2410_WTCON);
        if (cluster_index == LITTLE_CLUSTER) {
                register_syscore_ops(&s3c2410wdt_syscore_ops);
-#ifdef CONFIG_EXYNOS_SNAPSHOT_WATCHDOG_RESET
+#ifdef CONFIG_DEBUG_SNAPSHOT_WATCHDOG_RESET
        /* register panic handler for watchdog reset */
                wdt_block.nb_panic_block.notifier_call = s3c2410wdt_panic_handler;
                wdt_block.wdt = wdt;
diff --git a/include/dt-bindings/soc/samsung/debug-snapshot-table.h b/include/dt-bindings/soc/samsung/debug-snapshot-table.h
new file mode 100644 (file)
index 0000000..26e65b4
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Exynos-SnapShot for Samsung's SoC's.
+ *
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef DEBUG_SNAPSHOT_TABLE_H
+#define DEBUG_SNAPSHOT_TABLE_H
+
+/************************************************************************
+ * This definition is default settings.
+ * We must use bootloader settings first.
+*************************************************************************/
+
+#define SZ_64K                         0x00010000
+#define SZ_1M                          0x00100000
+
+#define DSS_START_ADDR                 0xF9000000
+#define DSS_HEADER_SIZE                        SZ_64K
+#define DSS_LOG_KERNEL_SIZE            (2 * SZ_1M)
+#define DSS_LOG_PLATFORM_SIZE          (4 * SZ_1M)
+#define DSS_LOG_SFR_SIZE               (2 * SZ_1M)
+#define DSS_LOG_S2D_SIZE               (0)
+#define DSS_LOG_CACHEDUMP_SIZE         (0)
+#define DSS_LOG_ETM_SIZE               (0)
+#define DSS_LOG_PSTORE_SIZE            (2 * SZ_1M)
+#define DSS_LOG_KEVENTS_SIZE           (8 * SZ_1M)
+
+#define DSS_HEADER_OFFSET              0
+#define DSS_LOG_KERNEL_OFFSET          (DSS_HEADER_OFFSET + DSS_HEADER_SIZE)
+#define DSS_LOG_PLATFORM_OFFSET                (DSS_LOG_KERNEL_OFFSET + DSS_LOG_KERNEL_SIZE)
+#define DSS_LOG_SFR_OFFSET             (DSS_LOG_PLATFORM_OFFSET + DSS_LOG_PLATFORM_SIZE)
+#define DSS_LOG_S2D_OFFSET             (DSS_LOG_SFR_OFFSET + DSS_LOG_SFR_SIZE)
+#define DSS_LOG_CACHEDUMP_OFFSET       (DSS_LOG_S2D_OFFSET + DSS_LOG_S2D_SIZE)
+#define DSS_LOG_ETM_OFFSET             (DSS_LOG_CACHEDUMP_OFFSET + DSS_LOG_CACHEDUMP_SIZE)
+#define DSS_LOG_PSTORE_OFFSET          (DSS_LOG_ETM_OFFSET + DSS_LOG_ETM_SIZE)
+#define DSS_LOG_KEVENTS_OFFSET         (DSS_LOG_PSTORE_OFFSET + DSS_LOG_PSTORE_SIZE)
+
+#define DSS_HEADER_ADDR                        (DSS_START_ADDR + DSS_HEADER_OFFSET)
+#define DSS_LOG_KERNEL_ADDR            (DSS_START_ADDR + DSS_LOG_KERNEL_OFFSET)
+#define DSS_LOG_PLATFORM_ADDR          (DSS_START_ADDR + DSS_LOG_PLATFORM_OFFSET)
+#define DSS_LOG_SFR_ADDR               (DSS_START_ADDR + DSS_LOG_SFR_OFFSET)
+#define DSS_LOG_S2D_ADDR               (DSS_START_ADDR + DSS_LOG_S2D_OFFSET)
+#define DSS_LOG_CACHEDUMP_ADDR         (DSS_START_ADDR + DSS_LOG_CACHEDUMP_OFFSET)
+#define DSS_LOG_ETM_ADDR               (DSS_START_ADDR + DSS_LOG_ETM_OFFSET)
+#define DSS_LOG_PSTORE_ADDR            (DSS_START_ADDR + DSS_LOG_PSTORE_OFFSET)
+#define DSS_LOG_KEVENTS_ADDR           (DSS_START_ADDR + DSS_LOG_KEVENTS_OFFSET)
+
+#endif
diff --git a/include/dt-bindings/soc/samsung/exynos-ss-table.h b/include/dt-bindings/soc/samsung/exynos-ss-table.h
deleted file mode 100644 (file)
index caf39d1..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Exynos-SnapShot for Samsung's SoC's.
- *
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
- *             http://www.samsung.com
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#ifndef EXYNOS_SNAPSHOT_TABLE_H
-#define EXYNOS_SNAPSHOT_TABLE_H
-
-/************************************************************************
- * This definition is default settings.
- * We must use bootloader settings first.
-*************************************************************************/
-
-#define SZ_64K                         0x00010000
-#define SZ_1M                          0x00100000
-
-#define ESS_START_ADDR                 0xF9000000
-#define ESS_HEADER_SIZE                        SZ_64K
-#define ESS_LOG_KERNEL_SIZE            (2 * SZ_1M)
-#define ESS_LOG_PLATFORM_SIZE          (4 * SZ_1M)
-#define ESS_LOG_SFR_SIZE               (2 * SZ_1M)
-#define ESS_LOG_S2D_SIZE               (0)
-#define ESS_LOG_CACHEDUMP_SIZE         (0)
-#define ESS_LOG_ETM_SIZE               (0)
-#define ESS_LOG_PSTORE_SIZE            (2 * SZ_1M)
-#define ESS_LOG_KEVENTS_SIZE           (8 * SZ_1M)
-
-#define ESS_HEADER_OFFSET              0
-#define ESS_LOG_KERNEL_OFFSET          (ESS_HEADER_OFFSET + ESS_HEADER_SIZE)
-#define ESS_LOG_PLATFORM_OFFSET                (ESS_LOG_KERNEL_OFFSET + ESS_LOG_KERNEL_SIZE)
-#define ESS_LOG_SFR_OFFSET             (ESS_LOG_PLATFORM_OFFSET + ESS_LOG_PLATFORM_SIZE)
-#define ESS_LOG_S2D_OFFSET             (ESS_LOG_SFR_OFFSET + ESS_LOG_SFR_SIZE)
-#define ESS_LOG_CACHEDUMP_OFFSET       (ESS_LOG_S2D_OFFSET + ESS_LOG_S2D_SIZE)
-#define ESS_LOG_ETM_OFFSET             (ESS_LOG_CACHEDUMP_OFFSET + ESS_LOG_CACHEDUMP_SIZE)
-#define ESS_LOG_PSTORE_OFFSET          (ESS_LOG_ETM_OFFSET + ESS_LOG_ETM_SIZE)
-#define ESS_LOG_KEVENTS_OFFSET         (ESS_LOG_PSTORE_OFFSET + ESS_LOG_PSTORE_SIZE)
-
-#define ESS_HEADER_ADDR                        (ESS_START_ADDR + ESS_HEADER_OFFSET)
-#define ESS_LOG_KERNEL_ADDR            (ESS_START_ADDR + ESS_LOG_KERNEL_OFFSET)
-#define ESS_LOG_PLATFORM_ADDR          (ESS_START_ADDR + ESS_LOG_PLATFORM_OFFSET)
-#define ESS_LOG_SFR_ADDR               (ESS_START_ADDR + ESS_LOG_SFR_OFFSET)
-#define ESS_LOG_S2D_ADDR               (ESS_START_ADDR + ESS_LOG_S2D_OFFSET)
-#define ESS_LOG_CACHEDUMP_ADDR         (ESS_START_ADDR + ESS_LOG_CACHEDUMP_OFFSET)
-#define ESS_LOG_ETM_ADDR               (ESS_START_ADDR + ESS_LOG_ETM_OFFSET)
-#define ESS_LOG_PSTORE_ADDR            (ESS_START_ADDR + ESS_LOG_PSTORE_OFFSET)
-#define ESS_LOG_KEVENTS_ADDR           (ESS_START_ADDR + ESS_LOG_KEVENTS_OFFSET)
-
-/* Header size change 1MB for MB align. */
-#define ESS_TOTAL_SIZE                 (ESS_LOG_KERNEL_SIZE + ESS_LOG_PLATFORM_SIZE    \
-                                       +  ESS_LOG_SFR_SIZE + ESS_LOG_S2D_SIZE          \
-                                       +  ESS_LOG_CACHEDUMP_SIZE + ESS_LOG_ETM_SIZE    \
-                                       +  ESS_LOG_PSTORE_SIZE + ESS_LOG_KEVENTS_SIZE   \
-                                       + SZ_1M)
-#endif
diff --git a/include/linux/debug-snapshot-helper.h b/include/linux/debug-snapshot-helper.h
new file mode 100644 (file)
index 0000000..8a04ad8
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ *
+ * Debug-SnapShot: Debug Framework for Ramdump based debugging method
+ * The original code is Exynos-Snapshot for Exynos SoC
+ *
+ * Author: Hosung Kim <hosung0.kim@samsung.com>
+ * Author: Changki Kim <changki.kim@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef DEBUG_SNAPSHOT_HELPER_H
+#define DEBUG_SNAPSHOT_HELPER_H
+
+struct dbg_snapshot_helper_ops {
+       void (*soc_early_panic)(void *);
+
+       void (*soc_prepare_panic_entry)(void *);
+       void (*soc_prepare_panic_exit)(void *);
+
+       void (*soc_post_panic_entry)(void *);
+       void (*soc_post_panic_exit)(void *);
+
+       void (*soc_save_context_entry)(void *);
+       void (*soc_save_context_exit)(void *);
+
+       void (*soc_start_watchdog)(void *);
+       void (*soc_expire_watchdog)(void *);
+       void (*soc_stop_watchdog)(void *);
+       void (*soc_kick_watchdog)(void *);
+
+       int (*soc_is_power_cpu)(void *);
+       int (*soc_smc_call)(unsigned long, unsigned long, unsigned long, unsigned long);
+};
+
+extern void dbg_snapshot_register_soc_ops(struct dbg_snapshot_helper_ops *ops);
+extern bool dbg_snapshot_is_scratch(void);
+#endif
diff --git a/include/linux/debug-snapshot-soc.h b/include/linux/debug-snapshot-soc.h
new file mode 100644 (file)
index 0000000..0b1bd2b
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ *
+ * Debug-SnapShot: Debug Framework for Ramdump based debugging method
+ * The original code is Exynos-Snapshot for Exynos SoC
+ *
+ * Author: Hosung Kim <hosung0.kim@samsung.com>
+ * Author: Changki Kim <changki.kim@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#ifndef DEBUG_SNAPSHOT_SOC_H
+#define DEBUG_SNAPSHOT_SOC_H
+
+/* To Support Samsung SoC */
+#include <dt-bindings/soc/samsung/debug-snapshot-table.h>
+#ifdef CONFIG_DEBUG_SNAPSHOT_PMU
+#include <soc/samsung/cal-if.h>
+#endif
+
+/* SoC Dependent Header */
+#define DSS_REG_MCT_ADDR       (0)
+#define DSS_REG_MCT_SIZE       (0)
+#define DSS_REG_UART_ADDR      (0)
+#define DSS_REG_UART_SIZE      (0)
+
+struct dbg_snapshot_ops {
+        int (*pd_status)(unsigned int id);
+};
+
+extern struct dbg_snapshot_ops dss_ops;
+#endif
diff --git a/include/linux/debug-snapshot.h b/include/linux/debug-snapshot.h
new file mode 100644 (file)
index 0000000..468c408
--- /dev/null
@@ -0,0 +1,269 @@
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ *             http://www.samsung.com
+ *
+ * Exynos-SnapShot debugging framework for Exynos SoC
+ *
+ * Author: Hosung Kim <Hosung0.kim@samsung.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef DEBUG_SNAPSHOT_H
+#define DEBUG_SNAPSHOT_H
+
+#ifdef CONFIG_DEBUG_SNAPSHOT
+#include <asm/ptrace.h>
+#include <linux/bug.h>
+
+/* mandatory */
+extern void dbg_snapshot_task(int cpu, void *v_task);
+extern void dbg_snapshot_work(void *worker, void *v_task, void *fn, int en);
+extern void dbg_snapshot_cpuidle(char *modes, unsigned state, int diff, int en);
+extern void dbg_snapshot_suspend(void *fn, void *dev, int en);
+extern void dbg_snapshot_irq(int irq, void *fn, unsigned int val, int en);
+extern int dbg_snapshot_try_enable(const char *name, unsigned long long duration);
+extern int dbg_snapshot_set_enable(const char *name, int en);
+extern int dbg_snapshot_get_enable(const char *name);
+extern int dbg_snapshot_save_context(void *regs);
+extern int dbg_snapshot_save_reg(void *regs);
+extern void dbg_snapshot_save_system(void *unused);
+extern int dbg_snapshot_dump_panic(char *str, size_t len);
+extern int dbg_snapshot_early_panic(void);
+extern int dbg_snapshot_prepare_panic(void);
+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 unsigned int dbg_snapshot_get_item_size(char *);
+extern unsigned int dbg_snapshot_get_item_paddr(char *);
+extern unsigned long dbg_snapshot_get_item_vaddr(char *);
+extern bool dbg_snapshot_dumper_one(void *, char *, size_t, size_t *);
+extern void dbg_snapshot_panic_handler_safe(void);
+extern unsigned long dbg_snapshot_get_spare_vaddr(unsigned int offset);
+extern unsigned long dbg_snapshot_get_spare_paddr(unsigned int offset);
+extern unsigned long dbg_snapshot_get_last_pc(unsigned int cpu);
+extern unsigned long dbg_snapshot_get_last_pc_paddr(void);
+extern void dbg_snapshot_hook_hardlockup_entry(void *v_regs);
+extern void dbg_snapshot_hook_hardlockup_exit(void);
+extern void dbg_snapshot_dump_sfr(void);
+extern int dbg_snapshot_hook_pmsg(char *buffer, size_t count);
+extern void dbg_snapshot_save_log(int cpu, unsigned long where);
+
+/* option */
+#ifdef CONFIG_DEBUG_SNAPSHOT_ACPM
+extern void dbg_snapshot_acpm(unsigned long long timestamp, const char *log, unsigned int data);
+#else
+#define dbg_snapshot_acpm(a,b,c)         do { } while(0)
+#endif
+
+#ifdef CONFIG_DEBUG_SNAPSHOT_REGULATOR
+extern void dbg_snapshot_regulator(unsigned long long timestamp, char* f_name, unsigned int addr, unsigned int volt, unsigned int rvolt, int en);
+#else
+#define dbg_snapshot_regulator(a,b,c,d,e,f)         do { } while(0)
+#endif
+
+#ifdef CONFIG_DEBUG_SNAPSHOT_THERMAL
+extern void dbg_snapshot_thermal(void *data, unsigned int temp, char *name, unsigned int max_cooling);
+#else
+#define dbg_snapshot_thermal(a,b,c,d)  do { } while(0)
+#endif
+
+#ifndef CONFIG_DEBUG_SNAPSHOT_MINIMIZED_MODE
+extern void dbg_snapshot_clockevent(unsigned long long clc, int64_t delta, void *next_event);
+extern void dbg_snapshot_printk(const char *fmt, ...);
+extern void dbg_snapshot_printkl(size_t msg, size_t val);
+#else
+#define dbg_snapshot_clockevent(a,b,c) do { } while(0)
+#define dbg_snapshot_printk(...)               do { } while(0)
+#define dbg_snapshot_printkl(a,b)              do { } while(0)
+#endif
+
+#ifdef CONFIG_DEBUG_SNAPSHOT_IRQ_DISABLED
+extern void dbg_snapshot_irqs_disabled(unsigned long flags);
+#else
+#define dbg_snapshot_irqs_disabled(a)  do { } while(0)
+#endif
+
+#ifdef CONFIG_DEBUG_SNAPSHOT_HRTIMER
+extern void dbg_snapshot_hrtimer(void *timer, s64 *now, void *fn, int en);
+#else
+#define dbg_snapshot_hrtimer(a,b,c,d)  do { } while(0)
+#endif
+
+#ifdef CONFIG_DEBUG_SNAPSHOT_I2C
+struct i2c_adapter;
+struct i2c_msg;
+extern void dbg_snapshot_i2c(struct i2c_adapter *adap, struct i2c_msg *msgs, int num, int en);
+#else
+#define dbg_snapshot_i2c(a,b,c,d)              do { } while(0)
+#endif
+
+#ifdef CONFIG_DEBUG_SNAPSHOT_SPI
+struct spi_controller;
+struct spi_message;
+extern void dbg_snapshot_spi(struct spi_controller *ctlr, struct spi_message *cur_msg, int en);
+#else
+#define dbg_snapshot_spi(a,b,c)                do { } while(0)
+#endif
+
+#ifdef CONFIG_DEBUG_SNAPSHOT_REG
+extern void dbg_snapshot_reg(unsigned int read, size_t val, size_t reg, int en);
+#else
+#define dbg_snapshot_reg(a,b,c,d)              do { } while(0)
+#endif
+
+#ifdef CONFIG_DEBUG_SNAPSHOT_SPINLOCK
+extern void dbg_snapshot_spinlock(void *lock, int en);
+#else
+#define dbg_snapshot_spinlock(a,b)             do { } while(0)
+#endif
+
+#ifdef CONFIG_DEBUG_SNAPSHOT_CLK
+struct clk;
+extern void dbg_snapshot_clk(void *clock, const char *func_name, unsigned long arg, int mode);
+#else
+#define dbg_snapshot_clk(a,b,c,d)              do { } while(0)
+#endif
+
+#ifdef CONFIG_DEBUG_SNAPSHOT_PMU
+extern void dbg_snapshot_pmu(int id, const char *func_name, int mode);
+#else
+#define dbg_snapshot_pmu(a,b,c)                do { } while(0)
+#endif
+
+#ifdef CONFIG_DEBUG_SNAPSHOT_FREQ
+void dbg_snapshot_freq(int type, unsigned long old_freq, unsigned long target_freq, int en);
+#else
+#define dbg_snapshot_freq(a,b,c,d)             do { } while(0)
+#endif
+
+#ifdef CONFIG_DEBUG_SNAPSHOT_DM
+void dbg_snapshot_dm(int type, unsigned long min, unsigned long max, s32 wait_t, s32 t);
+#else
+#define dbg_snapshot_dm(a,b,c,d,e)             do { } while(0)
+#endif
+
+#ifdef CONFIG_DEBUG_SNAPSHOT_IRQ_EXIT
+extern void dbg_snapshot_irq_exit(unsigned int irq, unsigned long long start_time);
+#define dbg_snapshot_irq_exit_var(v)   do {    v = cpu_clock(raw_smp_processor_id());  \
+                                       } while(0)
+#else
+#define dbg_snapshot_irq_exit(a,b)             do { } while(0)
+#define dbg_snapshot_irq_exit_var(v)   do { v = 0; } while(0)
+#endif
+
+#ifdef CONFIG_DEBUG_SNAPSHOT_CRASH_KEY
+void dbg_snapshot_check_crash_key(unsigned int code, int value);
+#else
+#define dbg_snapshot_check_crash_key(a,b)      do { } while(0)
+#endif
+
+#else
+#define dbg_snapshot_acpm(a,b,c)               do { } while(0)
+#define dbg_snapshot_task(a,b)         do { } while(0)
+#define dbg_snapshot_work(a,b,c,d)             do { } while(0)
+#define dbg_snapshot_clockevent(a,b,c) do { } while(0)
+#define dbg_snapshot_cpuidle(a,b,c,d)  do { } while(0)
+#define dbg_snapshot_suspend(a,b,c)    do { } while(0)
+#define dbg_snapshot_regulator(a,b,c,d,e,f)    do { } while(0)
+#define dbg_snapshot_thermal(a,b,c,d)  do { } while(0)
+#define dbg_snapshot_irq(a,b,c,d)              do { } while(0)
+#define dbg_snapshot_irq_exit(a,b)             do { } while(0)
+#define dbg_snapshot_irqs_disabled(a)  do { } while(0)
+#define dbg_snapshot_spinlock(a,b)             do { } while(0)
+#define dbg_snapshot_clk(a,b,c,d)              do { } while(0)
+#define dbg_snapshot_pmu(a,b,c)                do { } while(0)
+#define dbg_snapshot_freq(a,b,c,d)             do { } while(0)
+#define dbg_snapshot_irq_exit_var(v)   do { v = 0; } while(0)
+#define dbg_snapshot_reg(a,b,c,d)              do { } while(0)
+#define dbg_snapshot_hrtimer(a,b,c,d)  do { } while(0)
+#define dbg_snapshot_i2c(a,b,c,d)              do { } while(0)
+#define dbg_snapshot_spi(a,b,c)                do { } while(0)
+#define dbg_snapshot_hook_pmsg(a,b)    do { } while(0)
+#define dbg_snapshot_printk(...)               do { } while(0)
+#define dbg_snapshot_printkl(a,b)              do { } while(0)
+#define dbg_snapshot_save_context(a)   do { } while(0)
+#define dbg_snapshot_try_enable(a,b)   do { } while(0)
+#define dbg_snapshot_set_enable(a,b)   do { } while(0)
+#define dbg_snapshot_get_enable(a)             do { } while(0)
+#define dbg_snapshot_save_reg(a)               do { } while(0)
+#define dbg_snapshot_save_system(a)    do { } while(0)
+#define dbg_snapshot_dump_panic(a,b)   do { } while(0)
+#define dbg_snapshot_dump_sfr()                do { } while(0)
+#define dbg_snapshot_early_panic(a)    do { } while(0)
+#define dbg_snapshot_prepare_panic()   do { } while(0)
+#define dbg_snapshot_post_panic()              do { } while(0)
+#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_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)
+#define dbg_snapshot_get_last_pc(a)    do { } while(0)
+#define dbg_snapshot_get_last_pc_paddr()       do { } while(0)
+#define dbg_snapshot_hook_hardlockup_entry(a) do { } while(0)
+#define dbg_snapshot_hook_hardlockup_exit() do { } while(0)
+
+static inline unsigned int dbg_snapshot_get_item_size(char *name)
+{
+       return 0;
+}
+static inline unsigned int dbg_snapshot_get_item_paddr(char *name)
+{
+       return 0;
+}
+static inline unsigned long dbg_snapshot_get_item_vaddr(char *name)
+{
+       return 0;
+}
+static inline bool dbg_snapshot_dumper_one(void *v_dumper,
+                               char *line, size_t size, size_t *len)
+{
+       return false;
+}
+#endif /* CONFIG_DEBUG_SNAPSHOT */
+
+extern void dbg_snapshot_soc_helper_init(void);
+static inline void dbg_snapshot_bug_func(void) {BUG();}
+static inline void dbg_snapshot_spin_func(void) {do {wfi();} while(1);}
+
+/**
+ * dsslog_flag - added log information supported.
+ * @DSS_FLAG_IN: Generally, marking into the function
+ * @DSS_FLAG_ON: Generally, marking the status not in, not out
+ * @DSS_FLAG_OUT: Generally, marking come out the function
+ * @DSS_FLAG_SOFTIRQ: Marking to pass the softirq function
+ * @DSS_FLAG_SOFTIRQ_HI_TASKLET: Marking to pass the tasklet function
+ * @DSS_FLAG_SOFTIRQ_TASKLET: Marking to pass the tasklet function
+ */
+enum dsslog_flag {
+       DSS_FLAG_IN = 1,
+       DSS_FLAG_ON = 2,
+       DSS_FLAG_OUT = 3,
+       DSS_FLAG_SOFTIRQ = 10000,
+       DSS_FLAG_SOFTIRQ_HI_TASKLET = 10100,
+       DSS_FLAG_SOFTIRQ_TASKLET = 10200,
+       DSS_FLAG_CALL_TIMER_FN = 20000
+};
+
+enum dsslog_freq_flag {
+       DSS_FLAG_LIT = 0,
+       DSS_FLAG_MID,
+       DSS_FLAG_BIG,
+       DSS_FLAG_INT,
+       DSS_FLAG_MIF,
+       DSS_FLAG_ISP,
+       DSS_FLAG_DISP,
+       DSS_FLAG_INTCAM,
+       DSS_FLAG_AUD,
+       DSS_FLAG_IVA,
+       DSS_FLAG_SCORE,
+       DSS_FLAG_FSYS0,
+       DSS_FLAG_MFC,
+       DSS_FLAG_NPU,
+       DSS_FLAG_END
+};
+#endif
diff --git a/include/linux/exynos-ss.h b/include/linux/exynos-ss.h
deleted file mode 100644 (file)
index eb4b68f..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Copyright (c) 2013 Samsung Electronics Co., Ltd.
- *             http://www.samsung.com
- *
- * Exynos-SnapShot debugging framework for Exynos SoC
- *
- * Author: Hosung Kim <Hosung0.kim@samsung.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef EXYNOS_SNAPSHOT_H
-#define EXYNOS_SNAPSHOT_H
-
-#ifdef CONFIG_EXYNOS_SNAPSHOT
-#include <asm/ptrace.h>
-#include "exynos-ss-soc.h"
-
-/* mandatory */
-extern void exynos_ss_task(int cpu, void *v_task);
-extern void exynos_ss_work(void *worker, void *work, void *fn, int en);
-extern void exynos_ss_cpuidle(char *modes, unsigned state, int diff, int en);
-extern void exynos_ss_suspend(void *fn, void *dev, int en);
-extern void exynos_ss_irq(int irq, void *fn, unsigned int val, int en);
-extern int exynos_ss_try_enable(const char *name, unsigned long long duration);
-extern int exynos_ss_set_enable(const char *name, int en);
-extern int exynos_ss_get_enable(const char *name);
-extern int exynos_ss_save_context(void *regs);
-extern int exynos_ss_save_reg(void *regs);
-extern int exynos_ss_dump_panic(char *str, size_t len);
-extern int exynos_ss_prepare_panic(void);
-extern int exynos_ss_post_panic(void);
-extern int exynos_ss_post_reboot(void);
-extern int exynos_ss_set_hardlockup(int);
-extern int exynos_ss_get_hardlockup(void);
-extern unsigned int exynos_ss_get_item_size(char *);
-extern unsigned int exynos_ss_get_item_paddr(char *);
-extern void exynos_ss_panic_handler_safe(struct pt_regs *regs);
-#ifdef CONFIG_EXYNOS_DRAMTEST
-extern int disable_mc_powerdn(void);
-#endif
-
-/* option */
-#ifdef CONFIG_EXYNOS_SNAPSHOT_ACPM
-extern void exynos_ss_acpm(unsigned long long timestamp, const char *log, unsigned int data);
-#else
-#define exynos_ss_acpm(a,b,c)         do { } while(0)
-#endif
-
-#ifdef CONFIG_EXYNOS_SNAPSHOT_REGULATOR
-extern void exynos_ss_regulator(unsigned long long timestamp, char* f_name, unsigned int addr, unsigned int volt, unsigned int rvolt, int en);
-#else
-#define exynos_ss_regulator(a,b,c,d,e,f)         do { } while(0)
-#endif
-
-#ifdef CONFIG_EXYNOS_SNAPSHOT_THERMAL
-extern void exynos_ss_thermal(void *data, unsigned int temp, char *name, unsigned int max_cooling);
-#else
-#define exynos_ss_thermal(a,b,c,d)     do { } while(0)
-#endif
-
-#ifdef CONFIG_EXYNOS_SNAPSHOT_MBOX
-extern void exynos_ss_mailbox(void *msg, int mode, char* f_name, void *volt);
-#else
-#define exynos_ss_mailbox(a,b,c,d)         do { } while(0)
-#endif
-
-#ifndef CONFIG_EXYNOS_SNAPSHOT_MINIMIZED_MODE
-extern void exynos_ss_clockevent(unsigned long long clc, int64_t delta, void *next_event);
-extern void exynos_ss_printk(const char *fmt, ...);
-extern void exynos_ss_printkl(size_t msg, size_t val);
-#else
-#define exynos_ss_clockevent(a,b,c)    do { } while(0)
-#define exynos_ss_printk(...)          do { } while(0)
-#define exynos_ss_printkl(a,b)         do { } while(0)
-#endif
-
-#ifdef CONFIG_EXYNOS_SNAPSHOT_IRQ_DISABLED
-extern void exynos_ss_irqs_disabled(unsigned long flags);
-#else
-#define exynos_ss_irqs_disabled(a)     do { } while(0);
-#endif
-
-#ifdef CONFIG_EXYNOS_SNAPSHOT_HRTIMER
-extern void exynos_ss_hrtimer(void *timer, s64 *now, void *fn, int en);
-#else
-#define exynos_ss_hrtimer(a,b,c,d)     do { } while(0);
-#endif
-
-#ifdef CONFIG_EXYNOS_SNAPSHOT_REG
-extern void exynos_ss_reg(unsigned int read, size_t val, size_t reg, int en);
-#else
-#define exynos_ss_reg(a,b,c,d)         do { } while(0);
-#endif
-
-#ifdef CONFIG_EXYNOS_SNAPSHOT_SPINLOCK
-extern void exynos_ss_spinlock(void *lock, int en);
-#else
-#define exynos_ss_spinlock(a,b)                do { } while(0);
-#endif
-
-#ifdef CONFIG_EXYNOS_SNAPSHOT_CLK
-struct clk;
-extern void exynos_ss_clk(void *clock, const char *func_name, unsigned long arg, int mode);
-#else
-#define exynos_ss_clk(a,b,c,d)         do { } while(0);
-#endif
-
-#ifdef CONFIG_EXYNOS_SNAPSHOT_PMU
-extern void exynos_ss_pmu(int id, const char *func_name, int mode);
-#else
-#define exynos_ss_pmu(a,b,c)            do { } while(0)
-#endif
-
-#ifdef CONFIG_EXYNOS_SNAPSHOT_FREQ
-void exynos_ss_freq(int type, unsigned long old_freq, unsigned long target_freq, int en);
-#else
-#define exynos_ss_freq(a,b,c,d)        do { } while(0);
-#endif
-
-#ifdef CONFIG_EXYNOS_SNAPSHOT_IRQ_EXIT
-extern void exynos_ss_irq_exit(unsigned int irq, unsigned long long start_time);
-#define exynos_ss_irq_exit_var(v)      do {    v = cpu_clock(raw_smp_processor_id());  \
-                                       } while(0)
-#else
-#define exynos_ss_irq_exit(a,b)                do { } while(0);
-#define exynos_ss_irq_exit_var(v)      do {    v = 0; } while(0);
-#endif
-
-#ifdef CONFIG_EXYNOS_SNAPSHOT_PSTORE
-extern int exynos_ss_hook_pmsg(char *buffer, size_t count);
-#else
-#define exynos_ss_hook_pmsg(a,b)       do { } while(0)
-#endif
-
-#ifdef CONFIG_EXYNOS_SNAPSHOT_CRASH_KEY
-void exynos_ss_check_crash_key(unsigned int code, int value);
-#else
-#define exynos_ss_check_crash_key(a,b) do { } while(0);
-#endif
-
-#ifdef CONFIG_EXYNOS_SNAPSHOT_SFRDUMP
-void exynos_ss_dump_sfr(void);
-#else
-#define exynos_ss_dump_sfr()           do { } while(0)
-#endif
-
-#else
-#define exynos_ss_acpm(a,b,c)          do { } while(0)
-#define exynos_ss_task(a,b)            do { } while(0)
-#define exynos_ss_work(a,b,c,d)                do { } while(0)
-#define exynos_ss_clockevent(a,b,c)    do { } while(0)
-#define exynos_ss_cpuidle(a,b,c,d)     do { } while(0)
-#define exynos_ss_suspend(a,b,c)       do { } while(0)
-#define exynos_ss_regulator(a,b,c,d,e,f)       do { } while(0)
-#define exynos_ss_thermal(a,b,c,d)     do { } while(0)
-#define exynos_ss_mailbox(a,b,c,d)     do { } while(0)
-#define exynos_ss_irq(a,b,c,d)         do { } while(0)
-#define exynos_ss_irq_exit(a,b)                do { } while(0)
-#define exynos_ss_irqs_disabled(a)     do { } while(0)
-#define exynos_ss_spinlock(a,b)                do { } while(0)
-#define exynos_ss_clk(a,b,c,d)         do { } while(0)
-#define exynos_ss_pmu(a,b,c)            do { } while(0)
-#define exynos_ss_freq(a,b,c,d)                do { } while(0)
-#define exynos_ss_irq_exit_var(v)      do { v = 0; } while(0)
-#define exynos_ss_reg(a,b,c,d)         do { } while(0)
-#define exynos_ss_hrtimer(a,b,c,d)     do { } while(0)
-#define exynos_ss_hook_pmsg(a,b)       do { } while(0)
-#define exynos_ss_printk(...)          do { } while(0)
-#define exynos_ss_printkl(a,b)         do { } while(0)
-#define exynos_ss_save_context(a)      do { } while(0)
-#define exynos_ss_try_enable(a,b)      do { } while(0)
-#define exynos_ss_set_enable(a,b)      do { } while(0)
-#define exynos_ss_get_enable(a)                do { } while(0)
-#define exynos_ss_dump_panic(a,b)      do { } while(0)
-#define exynos_ss_dump_sfr()           do { } while(0)
-#define exynos_ss_prepare_panic()      do { } while(0)
-#define exynos_ss_post_panic()         do { } while(0)
-#define exynos_ss_post_reboot()                do { } while(0)
-#define exynos_ss_set_hardlockup(a)    do { } while(0)
-#define exynos_ss_get_hardlockup()     do { } while(0)
-#define exynos_ss_get_item_size(a)     do { } while(0)
-#define exynos_ss_get_item_paddr(a)    do { } while(0)
-#define exynos_ss_check_crash_key(a,b) do { } while(0);
-#endif /* CONFIG_EXYNOS_SNAPSHOT */
-
-/**
- * esslog_flag - added log information supported.
- * @ESS_FLAG_IN: Generally, marking into the function
- * @ESS_FLAG_ON: Generally, marking the status not in, not out
- * @ESS_FLAG_OUT: Generally, marking come out the function
- * @ESS_FLAG_SOFTIRQ: Marking to pass the softirq function
- * @ESS_FLAG_SOFTIRQ_HI_TASKLET: Marking to pass the tasklet function
- * @ESS_FLAG_SOFTIRQ_TASKLET: Marking to pass the tasklet function
- */
-enum esslog_flag {
-       ESS_FLAG_IN = 1,
-       ESS_FLAG_ON = 2,
-       ESS_FLAG_OUT = 3,
-       ESS_FLAG_SOFTIRQ = 10000,
-       ESS_FLAG_SOFTIRQ_HI_TASKLET = 10100,
-       ESS_FLAG_SOFTIRQ_TASKLET = 10200,
-       ESS_FLAG_CALL_TIMER_FN = 20000
-};
-
-enum esslog_freq_flag {
-       ESS_FLAG_APL = 0,
-       ESS_FLAG_ATL,
-       ESS_FLAG_INT,
-       ESS_FLAG_MIF,
-       ESS_FLAG_ISP,
-       ESS_FLAG_DISP,
-};
-#endif