soc: samsung: exynos5433: Add support pm driver for EXYNOS5433
authorJonghwa Lee <jonghwa3.lee@samsung.com>
Wed, 17 Dec 2014 08:17:59 +0000 (17:17 +0900)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 14 Dec 2016 04:43:06 +0000 (13:43 +0900)
This patch adds EXYNOS5433 pm driver which supports EXNOS5433 dependent
procedures to enter suspend.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
[Replace cpu_suspend to arm_cpuidle_suspend as commit fb1de80 ("arm64: kernel: rename __cpu_suspend to keep it aligned with arm")]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
drivers/soc/samsung/Kconfig
drivers/soc/samsung/Makefile
drivers/soc/samsung/exynos5433-pm.c [new file with mode: 0644]

index 60a5bf5..1491c4a 100644 (file)
@@ -31,6 +31,14 @@ config EXYNOS_PM
          This option supports Exynos to enter suspend with doing some SoC
          specific requirements.
 
+config EXYNOS5433_PM
+       bool "Support Exynos5433 Power Management driver"
+       depends on EXYNOS_PM
+       select EXYNOS_EXTRA_PWR_MODES
+       help
+         Say Y here to support pm driver for Exynos5433.
+
+
 config EXYNOS_EXTRA_PWR_MODES
        bool
        help
index 817ce74..acaae9f 100644 (file)
@@ -1,3 +1,4 @@
 obj-$(CONFIG_EXYNOS_PMU)       += exynos-pmu.o
 obj-$(CONFIG_EXYNOS5433_PMU)   += exynos5433-pmu.o
 obj-$(CONFIG_EXYNOS_PM)                += exynos-pm.o
+obj-$(CONFIG_EXYNOS5433_PM)            += exynos5433-pm.o
diff --git a/drivers/soc/samsung/exynos5433-pm.c b/drivers/soc/samsung/exynos5433-pm.c
new file mode 100644 (file)
index 0000000..48ce168
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Exynos5433 suspend-to-ram support driver
+ *
+ * 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/of_address.h>
+#include <linux/soc/samsung/exynos-pm.h>
+#include <asm/io.h>
+#include <asm/cpuidle.h>
+#include <asm/suspend.h>
+
+void __iomem *sysram_ns_base;
+
+static int exynos5433_pm_suspend(void)
+{
+       __raw_writel(virt_to_phys(cpu_resume), sysram_ns_base + 0x8);
+       __raw_writel(EXYNOS_CHECK_SLEEP, sysram_ns_base + 0xC);
+
+       return arm_cpuidle_suspend(0);
+}
+
+static struct exynos_pm_ops exynos5433_pm_ops = {
+       .suspend = exynos5433_pm_suspend,
+};
+
+static int __init exynos5433_pm_init(void)
+{
+       struct device_node *of_node;
+
+       pr_info("Exynos suspend support initialize\n");
+
+       of_node = of_find_compatible_node(0, 0, "samsung,exynos5433-sysram-ns");
+       if (!of_node)
+               return -ENODEV;
+
+       sysram_ns_base = of_iomap(of_node, 0);
+       exynos_pm_init(&exynos5433_pm_ops);
+
+       return 0;
+}
+arch_initcall(exynos5433_pm_init);