[COMMON] soc: samsung: add codes for Security Dump Manager
authorKeunyoung Park <keun0.park@samsung.com>
Thu, 5 Apr 2018 02:11:16 +0000 (11:11 +0900)
committerJunho Choi <junhosj.choi@samsung.com>
Thu, 24 May 2018 00:02:15 +0000 (09:02 +0900)
Change-Id: I9863edba61b8f35c0407f809ab03abab9ea61d63
Signed-off-by: Keunyoung Park <keun0.park@samsung.com>
arch/arm64/kernel/smp.c
drivers/soc/samsung/Makefile
drivers/soc/samsung/exynos-sdm.c [new file with mode: 0644]

index 20705f5090e2bd43721091a95fff0b7e45d37ce4..6a8dc4d33f2eada8c6fa4bb3a1462ff323f1e14d 100644 (file)
@@ -58,6 +58,7 @@
 #include <asm/tlbflush.h>
 #include <asm/ptrace.h>
 #include <asm/virt.h>
+#include <soc/samsung/exynos-sdm.h>
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/ipi.h>
@@ -841,6 +842,7 @@ static void ipi_cpu_stop(unsigned int cpu, struct pt_regs *regs)
        local_irq_disable();
 
        dbg_snapshot_save_context(regs);
+       exynos_sdm_flush_secdram();
 
        while (1)
                cpu_relax();
index ee2ec4119f43af8bcd42a31c17b5b19b8cabd8c4..570793aacb30eb561d19dbfae2bd403577b5eda4 100644 (file)
@@ -51,3 +51,6 @@ obj-$(CONFIG_EXYNOS_SECURE_LOG)       += exynos-seclog.o
 
 # HDCP
 obj-$(CONFIG_EXYNOS_HDCP2)  += exynos-hdcp/
+
+# SDM
+obj-$(CONFIG_EXYNOS_SDM) += exynos-sdm.o
diff --git a/drivers/soc/samsung/exynos-sdm.c b/drivers/soc/samsung/exynos-sdm.c
new file mode 100644 (file)
index 0000000..a020953
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ *           http://www.samsung.com/
+ *
+ * EXYNOS - Security Dump Manager support
+ *
+ * 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.
+ */
+
+#include <linux/smc.h>
+#include <linux/printk.h>
+
+int exynos_sdm_dump_secure_region(void)
+{
+       int ret;
+
+       ret = exynos_smc(SMC_CMD_DUMP_SECURE_REGION, 0, 0, 0);
+       pr_info("%s: 0x%x\n", __func__, ret);
+
+       return ret;
+}
+
+int exynos_sdm_flush_secdram(void)
+{
+       int ret;
+
+       ret = exynos_smc(SMC_CMD_FLUSH_SECDRAM, 0, 0, 0);
+
+       return ret;
+}