[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)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:22:12 +0000 (20:22 +0300)
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 93f224eeb122ed35ccf44ebe759ad27f67239931..e9ffc6744e51e9d4d1dd9141276290055386407c 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>
@@ -803,6 +804,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;
+}