All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vikas Sajjan <vikas.sajjan@samsung.com>
To: linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org
Cc: kgene.kim@samsung.com, tomasz.figa@gmail.com, joshi@samsung.com,
	sajjan.linux@gmail.com, dianders@chromium.org, olof@lixom.net
Subject: [PATCH v2 3/3] ARM: exynos: Add PMU and S2R support for exynos5800 SoC
Date: Thu, 21 Aug 2014 18:52:37 +0545	[thread overview]
Message-ID: <1408626457-3422-4-git-send-email-vikas.sajjan@samsung.com> (raw)
In-Reply-To: <1408626457-3422-1-git-send-email-vikas.sajjan@samsung.com>

Adds PMU and S2R support for exynos5800 SoC.

Signed-off-by: Vikas Sajjan <vikas.sajjan@samsung.com>
---
 arch/arm/mach-exynos/pm.c       |    3 +++
 arch/arm/mach-exynos/pmu.c      |   22 ++++++++++++++++++++++
 arch/arm/mach-exynos/regs-pmu.h |    3 ++-
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index acdcf0b..41fc1c3 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -646,6 +646,9 @@ static struct of_device_id exynos_pmu_of_device_ids[] = {
 	}, {
 		.compatible = "samsung,exynos5420-pmu",
 		.data = &exynos5420_pm_data,
+	}, {
+		.compatible = "samsung,exynos5800-pmu",
+		.data = &exynos5420_pm_data,
 	},
 	{ /*sentinel*/ },
 };
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index f8ced42..c1cd31c 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -719,6 +719,19 @@ static void exynos5420_pmu_init(void)
 	pr_info("EXYNOS5420 PMU initialized\n");
 }
 
+static void exynos5800_pmu_init(void)
+{
+	unsigned int value;
+
+	exynos5420_pmu_init();
+
+	value = pmu_raw_readl(EXYNOS5420_LPI_MASK);
+	value |= EXYNOS5800_POWER_GATE_CTRL;
+	pmu_raw_writel(value, EXYNOS5420_LPI_MASK);
+
+	pr_info("EXYNOS5800 PMU initialized\n");
+}
+
 
 static const struct exynos_pmu_data exynos4210_pmu_data = {
 	.pmu_config	= exynos4210_pmu_config,
@@ -745,6 +758,12 @@ static struct exynos_pmu_data exynos5420_pmu_data = {
 	.powerdown_conf	= exynos5420_powerdown_conf,
 };
 
+static struct exynos_pmu_data exynos5800_pmu_data = {
+	.pmu_config	= exynos5420_pmu_config,
+	.pmu_init	= exynos5800_pmu_init,
+	.powerdown_conf	= exynos5420_powerdown_conf,
+};
+
 static const struct regmap_config pmu_regmap_config = {
 	.reg_bits = 32,
 	.val_bits = 32,
@@ -770,6 +789,9 @@ static const struct of_device_id exynos_pmu_of_device_ids[] = {
 	}, {
 		.compatible = "samsung,exynos5420-pmu",
 		.data = &exynos5420_pmu_data,
+	}, {
+		.compatible = "samsung,exynos5800-pmu",
+		.data = &exynos5800_pmu_data,
 	},
 	{ /*sentinel*/ },
 };
diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h
index 3a6a559..3a0140c 100644
--- a/arch/arm/mach-exynos/regs-pmu.h
+++ b/arch/arm/mach-exynos/regs-pmu.h
@@ -555,5 +555,6 @@ static inline unsigned int exynos_pmu_cpunr(unsigned int mpidr)
 					 | EXYNOS5420_KFC_USE_STANDBY_WFI1  \
 					 | EXYNOS5420_KFC_USE_STANDBY_WFI2  \
 					 | EXYNOS5420_KFC_USE_STANDBY_WFI3)
-
+/* for exynos5800 only */
+#define EXYNOS5800_POWER_GATE_CTRL                              (1 << 15)
 #endif /* __ASM_ARCH_REGS_PMU_H */
-- 
1.7.9.5

WARNING: multiple messages have this Message-ID (diff)
From: vikas.sajjan@samsung.com (Vikas Sajjan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 3/3] ARM: exynos: Add PMU and S2R support for exynos5800 SoC
Date: Thu, 21 Aug 2014 18:52:37 +0545	[thread overview]
Message-ID: <1408626457-3422-4-git-send-email-vikas.sajjan@samsung.com> (raw)
In-Reply-To: <1408626457-3422-1-git-send-email-vikas.sajjan@samsung.com>

Adds PMU and S2R support for exynos5800 SoC.

Signed-off-by: Vikas Sajjan <vikas.sajjan@samsung.com>
---
 arch/arm/mach-exynos/pm.c       |    3 +++
 arch/arm/mach-exynos/pmu.c      |   22 ++++++++++++++++++++++
 arch/arm/mach-exynos/regs-pmu.h |    3 ++-
 3 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index acdcf0b..41fc1c3 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -646,6 +646,9 @@ static struct of_device_id exynos_pmu_of_device_ids[] = {
 	}, {
 		.compatible = "samsung,exynos5420-pmu",
 		.data = &exynos5420_pm_data,
+	}, {
+		.compatible = "samsung,exynos5800-pmu",
+		.data = &exynos5420_pm_data,
 	},
 	{ /*sentinel*/ },
 };
diff --git a/arch/arm/mach-exynos/pmu.c b/arch/arm/mach-exynos/pmu.c
index f8ced42..c1cd31c 100644
--- a/arch/arm/mach-exynos/pmu.c
+++ b/arch/arm/mach-exynos/pmu.c
@@ -719,6 +719,19 @@ static void exynos5420_pmu_init(void)
 	pr_info("EXYNOS5420 PMU initialized\n");
 }
 
+static void exynos5800_pmu_init(void)
+{
+	unsigned int value;
+
+	exynos5420_pmu_init();
+
+	value = pmu_raw_readl(EXYNOS5420_LPI_MASK);
+	value |= EXYNOS5800_POWER_GATE_CTRL;
+	pmu_raw_writel(value, EXYNOS5420_LPI_MASK);
+
+	pr_info("EXYNOS5800 PMU initialized\n");
+}
+
 
 static const struct exynos_pmu_data exynos4210_pmu_data = {
 	.pmu_config	= exynos4210_pmu_config,
@@ -745,6 +758,12 @@ static struct exynos_pmu_data exynos5420_pmu_data = {
 	.powerdown_conf	= exynos5420_powerdown_conf,
 };
 
+static struct exynos_pmu_data exynos5800_pmu_data = {
+	.pmu_config	= exynos5420_pmu_config,
+	.pmu_init	= exynos5800_pmu_init,
+	.powerdown_conf	= exynos5420_powerdown_conf,
+};
+
 static const struct regmap_config pmu_regmap_config = {
 	.reg_bits = 32,
 	.val_bits = 32,
@@ -770,6 +789,9 @@ static const struct of_device_id exynos_pmu_of_device_ids[] = {
 	}, {
 		.compatible = "samsung,exynos5420-pmu",
 		.data = &exynos5420_pmu_data,
+	}, {
+		.compatible = "samsung,exynos5800-pmu",
+		.data = &exynos5800_pmu_data,
 	},
 	{ /*sentinel*/ },
 };
diff --git a/arch/arm/mach-exynos/regs-pmu.h b/arch/arm/mach-exynos/regs-pmu.h
index 3a6a559..3a0140c 100644
--- a/arch/arm/mach-exynos/regs-pmu.h
+++ b/arch/arm/mach-exynos/regs-pmu.h
@@ -555,5 +555,6 @@ static inline unsigned int exynos_pmu_cpunr(unsigned int mpidr)
 					 | EXYNOS5420_KFC_USE_STANDBY_WFI1  \
 					 | EXYNOS5420_KFC_USE_STANDBY_WFI2  \
 					 | EXYNOS5420_KFC_USE_STANDBY_WFI3)
-
+/* for exynos5800 only */
+#define EXYNOS5800_POWER_GATE_CTRL                              (1 << 15)
 #endif /* __ASM_ARCH_REGS_PMU_H */
-- 
1.7.9.5

  parent reply	other threads:[~2014-08-21 13:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-21 13:07 [PATCH v2 0/3] Adds PMU and S2R support for exynos5800 Vikas Sajjan
2014-08-21 13:07 ` Vikas Sajjan
2014-08-21 13:07 ` [PATCH v2 1/3] ARM: dts: Add pmu node for exynos5800 SoC Vikas Sajjan
2014-08-21 13:07   ` Vikas Sajjan
2014-08-21 13:07 ` [PATCH v2 2/3] ARM: exynos: Add exynos5800-pmu compatible entry Vikas Sajjan
2014-08-21 13:07   ` Vikas Sajjan
2014-08-21 13:07 ` Vikas Sajjan [this message]
2014-08-21 13:07   ` [PATCH v2 3/3] ARM: exynos: Add PMU and S2R support for exynos5800 SoC Vikas Sajjan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1408626457-3422-4-git-send-email-vikas.sajjan@samsung.com \
    --to=vikas.sajjan@samsung.com \
    --cc=dianders@chromium.org \
    --cc=joshi@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=sajjan.linux@gmail.com \
    --cc=tomasz.figa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.