summaryrefslogtreecommitdiff
path: root/arch/arm/mach-exynos/firmware.c
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2013-03-21 18:48:45 +0100
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:43:23 +0900
commit2cca3eddf1bded86eaa43228f0b5672ecf1110be (patch)
tree05e3a6e39b5e3ab67a8bc2950e6f162f6fbc987f /arch/arm/mach-exynos/firmware.c
parentaa75091c073173c5b3eadd7fcae80af8556e0b68 (diff)
downloadlinux-3.10-2cca3eddf1bded86eaa43228f0b5672ecf1110be.tar.gz
linux-3.10-2cca3eddf1bded86eaa43228f0b5672ecf1110be.tar.bz2
linux-3.10-2cca3eddf1bded86eaa43228f0b5672ecf1110be.zip
ARM: EXYNOS: Add support for firmware-assisted suspend/resume
This patch adds firmware ops related to system suspend/resume that allows suspend/resume of systems with secure firmware. Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Diffstat (limited to 'arch/arm/mach-exynos/firmware.c')
-rw-r--r--arch/arm/mach-exynos/firmware.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos/firmware.c b/arch/arm/mach-exynos/firmware.c
index da5fb26ea04..3f98bf78c09 100644
--- a/arch/arm/mach-exynos/firmware.c
+++ b/arch/arm/mach-exynos/firmware.c
@@ -20,6 +20,8 @@
#include "smc.h"
+#define EXYNOS_SLEEP_MAGIC 0x00000BAD
+
static int exynos_do_idle(void)
{
exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
@@ -47,11 +49,37 @@ static int exynos_l2x0_init(void)
return 0;
}
+static int exynos_suspend(unsigned long resume_addr)
+{
+ writel(EXYNOS_SLEEP_MAGIC, S5P_VA_SYSRAM_NS + 0xC);
+ writel(resume_addr, S5P_VA_SYSRAM_NS + 0x8);
+ exynos_smc(SMC_CMD_SLEEP, 0, 0, 0);
+
+ return 0;
+}
+
+static int exynos_resume(void)
+{
+ writel(0, S5P_VA_SYSRAM_NS + 0xC);
+
+ return 0;
+}
+
+static int exynos_c15resume(u32 *regs)
+{
+ exynos_smc(SMC_CMD_C15RESUME, regs[0], regs[1], 0);
+
+ return 0;
+}
+
static const struct firmware_ops exynos_firmware_ops = {
.do_idle = exynos_do_idle,
.set_cpu_boot_addr = exynos_set_cpu_boot_addr,
.cpu_boot = exynos_cpu_boot,
.l2x0_init = exynos_l2x0_init,
+ .suspend = exynos_suspend,
+ .resume = exynos_resume,
+ .c15resume = exynos_c15resume,
};
void __init exynos_firmware_init(void)