From: nicolas.pitre@linaro.org (Nicolas Pitre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/4] ARM: vexpress/TC2: implement PM suspend method
Date: Wed, 17 Jul 2013 23:28:36 -0400 [thread overview]
Message-ID: <1374118116-16836-5-git-send-email-nicolas.pitre@linaro.org> (raw)
In-Reply-To: <1374118116-16836-1-git-send-email-nicolas.pitre@linaro.org>
From: Nicolas Pitre <nico@linaro.org>
Similar to power_down(), except that for a suspend, the firmware
mailbox address has to be set prior entering low power mode.
The residency argument is not used yet, so the last man always shuts
down the cluster for now.
Signed-off-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Pawel Moll <pawel.moll@arm.com>
---
arch/arm/mach-vexpress/tc2_pm.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-vexpress/tc2_pm.c b/arch/arm/mach-vexpress/tc2_pm.c
index 26dbe782fb..dfb55d45b6 100644
--- a/arch/arm/mach-vexpress/tc2_pm.c
+++ b/arch/arm/mach-vexpress/tc2_pm.c
@@ -84,7 +84,7 @@ static int tc2_pm_power_up(unsigned int cpu, unsigned int cluster)
return 0;
}
-static void tc2_pm_power_down(void)
+static void tc2_pm_down(u64 residency)
{
unsigned int mpidr, cpu, cluster;
bool last_man = false, skip_wfi = false;
@@ -198,6 +198,22 @@ static void tc2_pm_power_down(void)
/* Not dead at this point? Let our caller cope. */
}
+static void tc2_pm_power_down(void)
+{
+ tc2_pm_down(0);
+}
+
+static void tc2_pm_suspend(u64 residency)
+{
+ unsigned int mpidr, cpu, cluster;
+
+ mpidr = read_cpuid_mpidr();
+ cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0);
+ cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1);
+ ve_spc_set_resume_addr(cluster, cpu, virt_to_phys(mcpm_entry_point));
+ tc2_pm_down(residency);
+}
+
static void tc2_pm_powered_up(void)
{
unsigned int mpidr, cpu, cluster;
@@ -231,6 +247,7 @@ static void tc2_pm_powered_up(void)
static const struct mcpm_platform_ops tc2_pm_power_ops = {
.power_up = tc2_pm_power_up,
.power_down = tc2_pm_power_down,
+ .suspend = tc2_pm_suspend,
.powered_up = tc2_pm_powered_up,
};
--
1.8.1.2
prev parent reply other threads:[~2013-07-18 3:28 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-18 3:28 [PATCH 0/4] MCPM backends updates Nicolas Pitre
2013-07-18 3:28 ` [PATCH 1/4] ARM: vexpress/dcscb: fix cache disabling sequences Nicolas Pitre
2013-07-18 15:04 ` Dave Martin
2013-07-18 17:24 ` Nicolas Pitre
2013-07-18 18:03 ` Dave Martin
2013-07-18 18:59 ` Nicolas Pitre
2013-07-19 10:28 ` Dave Martin
2013-07-19 10:59 ` Lorenzo Pieralisi
2013-07-22 17:58 ` Nicolas Pitre
2013-07-23 10:43 ` Dave Martin
2013-07-23 12:28 ` Nicolas Pitre
2013-07-23 16:33 ` Lorenzo Pieralisi
2013-07-25 0:27 ` Nicolas Pitre
2013-07-25 12:04 ` Dave Martin
2013-07-26 14:58 ` Nicolas Pitre
2013-07-26 16:00 ` Dave Martin
2013-07-26 16:24 ` Lorenzo Pieralisi
2013-07-18 3:28 ` [PATCH 2/4] drivers/platform: vexpress: add Serial Power Controller (SPC) support Nicolas Pitre
2013-07-18 3:28 ` [PATCH 3/4] ARM: vexpress/TC2: basic PM support Nicolas Pitre
2013-07-18 3:28 ` Nicolas Pitre [this message]
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=1374118116-16836-5-git-send-email-nicolas.pitre@linaro.org \
--to=nicolas.pitre@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).