From 35100c31016b4afbbc1e6885a424ca5db15a42ed Mon Sep 17 00:00:00 2001 From: Keunyoung Park Date: Thu, 5 Apr 2018 11:11:16 +0900 Subject: [PATCH] [COMMON] soc: samsung: add codes for Security Dump Manager Change-Id: I9863edba61b8f35c0407f809ab03abab9ea61d63 Signed-off-by: Keunyoung Park --- arch/arm64/kernel/smp.c | 2 ++ drivers/soc/samsung/Makefile | 3 +++ drivers/soc/samsung/exynos-sdm.c | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 drivers/soc/samsung/exynos-sdm.c diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 20705f5090e2..6a8dc4d33f2e 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -58,6 +58,7 @@ #include #include #include +#include #define CREATE_TRACE_POINTS #include @@ -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(); diff --git a/drivers/soc/samsung/Makefile b/drivers/soc/samsung/Makefile index ee2ec4119f43..570793aacb30 100644 --- a/drivers/soc/samsung/Makefile +++ b/drivers/soc/samsung/Makefile @@ -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 index 000000000000..a020953f510a --- /dev/null +++ b/drivers/soc/samsung/exynos-sdm.c @@ -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 +#include + +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; +} -- 2.20.1