From: Rajendra Nayak <rnayak@ti.com>
To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Cc: paul@pwsan.com, khilman@ti.com, b-cousson@ti.com,
santosh.shilimkar@ti.com, t-kristo@ti.com,
Rajendra Nayak <rnayak@ti.com>
Subject: [RFC 1/4] ARM: OMAP3: cpuidle: Remove unused MPU OSWR support code
Date: Fri, 20 Jul 2012 11:34:41 +0530 [thread overview]
Message-ID: <1342764284-8143-2-git-send-email-rnayak@ti.com> (raw)
In-Reply-To: <1342764284-8143-1-git-send-email-rnayak@ti.com>
We do not support MPU OSWR on OMAP3. Get rid of the complex/multiple
save_state handling in omap_sram_idle() and just use 2 save_state
definitions
save_state = 1, all logic and memory lost, MPU hits OFF
save_state = 0, nothing lost, MPU hits CSWR or shallower state
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/mach-omap2/pm34xx.c | 35 +++++++++--------------------------
arch/arm/mach-omap2/sleep34xx.S | 4 +---
2 files changed, 10 insertions(+), 29 deletions(-)
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 7c7b173..8d96b1f 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -256,19 +256,16 @@ static void omap34xx_save_context(u32 *save)
static int omap34xx_do_sram_idle(unsigned long save_state)
{
+ /*
+ * save_state = 1 indicates all logic and memory/cache lost
+ * save_state = 0 indicates nothing lost
+ */
omap34xx_cpu_suspend(save_state);
return 0;
}
void omap_sram_idle(void)
{
- /* Variable to tell what needs to be saved and restored
- * in omap_sram_idle*/
- /* save_state = 0 => Nothing to save and restored */
- /* save_state = 1 => Only L1 and logic lost */
- /* save_state = 2 => Only L2 lost */
- /* save_state = 3 => L1, L2 and logic lost */
- int save_state = 0;
int mpu_next_state = PWRDM_POWER_ON;
int per_next_state = PWRDM_POWER_ON;
int core_next_state = PWRDM_POWER_ON;
@@ -277,20 +274,6 @@ void omap_sram_idle(void)
u32 sdrc_pwr = 0;
mpu_next_state = pwrdm_read_next_pwrst(mpu_pwrdm);
- switch (mpu_next_state) {
- case PWRDM_POWER_ON:
- case PWRDM_POWER_RET:
- /* No need to save context */
- save_state = 0;
- break;
- case PWRDM_POWER_OFF:
- save_state = 3;
- break;
- default:
- /* Invalid state */
- pr_err("Invalid mpu state in sram_idle\n");
- return;
- }
/* NEON control */
if (pwrdm_read_pwrst(neon_pwrdm) == PWRDM_POWER_ON)
@@ -342,12 +325,12 @@ void omap_sram_idle(void)
* get saved. The rest is placed on the stack, and restored
* from there before resuming.
*/
- if (save_state)
+ if (mpu_next_state == PWRDM_POWER_OFF) {
omap34xx_save_context(omap3_arm_context);
- if (save_state == 1 || save_state == 3)
- cpu_suspend(save_state, omap34xx_do_sram_idle);
- else
- omap34xx_do_sram_idle(save_state);
+ cpu_suspend(1, omap34xx_do_sram_idle);
+ } else {
+ omap34xx_do_sram_idle(0);
+ }
/* Restore normal SDRC POWER settings */
if (cpu_is_omap3430() && omap_rev() >= OMAP3430_REV_ES3_0 &&
diff --git a/arch/arm/mach-omap2/sleep34xx.S b/arch/arm/mach-omap2/sleep34xx.S
index 1f62f23..a4d04a4 100644
--- a/arch/arm/mach-omap2/sleep34xx.S
+++ b/arch/arm/mach-omap2/sleep34xx.S
@@ -157,9 +157,7 @@ ENTRY(omap34xx_cpu_suspend)
/*
* r0 contains information about saving context:
* 0 - No context lost
- * 1 - Only L1 and logic lost
- * 2 - Only L2 lost (Even L1 is retained we clean it along with L2)
- * 3 - Both L1 and L2 lost and logic lost
+ * 1 - Both L1 and L2 lost and logic lost
*/
/*
--
1.7.1
next prev parent reply other threads:[~2012-07-20 6:05 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-20 6:04 [RFC 0/4] OMAP Cpuidle/Suspend Cleanups Rajendra Nayak
2012-07-20 6:04 ` Rajendra Nayak [this message]
2012-07-20 7:08 ` [RFC 1/4] ARM: OMAP3: cpuidle: Remove unused MPU OSWR support code Shilimkar, Santosh
2012-07-20 18:25 ` Paul Walmsley
2012-07-23 7:10 ` Rajendra Nayak
2012-07-20 6:04 ` [RFC 2/4] ARM: OMAP: PM: Get rid of Powerdomain book-keeping from cpuidle Rajendra Nayak
2012-07-20 7:25 ` Shilimkar, Santosh
2012-07-20 8:08 ` Rajendra Nayak
2012-07-20 8:51 ` Tero Kristo
2012-07-20 11:54 ` Shilimkar, Santosh
2012-07-25 22:43 ` Kevin Hilman
2012-07-26 11:43 ` Rajendra Nayak
2012-07-26 12:42 ` Rajendra Nayak
2012-07-26 17:44 ` Kevin Hilman
2012-07-26 18:27 ` Tero Kristo
2012-07-26 20:50 ` Paul Walmsley
2012-07-27 6:46 ` Rajendra Nayak
2012-07-27 7:43 ` Rajendra Nayak
2012-07-20 6:04 ` [RFC 3/4] ARM: OMAP: powerdomain: Add .power_on/.power_down hooks for powerdomains Rajendra Nayak
2012-07-20 7:26 ` Shilimkar, Santosh
2012-07-20 6:04 ` [RFC 4/4] ARM: OMAP3: PM: Use .power_on/.power_down to clean omap_sram_idle Rajendra Nayak
2012-07-20 7:30 ` Shilimkar, Santosh
2012-07-20 8:59 ` [RFC 0/4] OMAP Cpuidle/Suspend Cleanups Tero Kristo
2012-07-20 9:03 ` Rajendra Nayak
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=1342764284-8143-2-git-send-email-rnayak@ti.com \
--to=rnayak@ti.com \
--cc=b-cousson@ti.com \
--cc=khilman@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-omap@vger.kernel.org \
--cc=paul@pwsan.com \
--cc=santosh.shilimkar@ti.com \
--cc=t-kristo@ti.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 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).