* [PATCH 06/11] mpu off state enabled
@ 2008-07-01 14:16 Rajendra Nayak
2008-07-02 12:19 ` Högander Jouni
0 siblings, 1 reply; 6+ messages in thread
From: Rajendra Nayak @ 2008-07-01 14:16 UTC (permalink / raw)
To: linux-omap
This patch updates the CPUidle code to handle MPU OFF related C states
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/mach-omap2/cpuidle34xx.c | 19 +++++++++++++++----
arch/arm/mach-omap2/cpuidle34xx.h | 5 +++++
2 files changed, 20 insertions(+), 4 deletions(-)
Index: linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.c
===================================================================
--- linux-omap-2.6.orig/arch/arm/mach-omap2/cpuidle34xx.c 2008-07-01 16:47:53.000000000 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.c 2008-07-01 16:55:39.112465404 +0530
@@ -82,8 +82,12 @@ static int omap3_enter_idle(struct cpuid
/* Program MPU to target state */
if (cx->mpu_state < PWRDM_POWER_ON) {
- if (neon_pwrst == PWRDM_POWER_ON)
- pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_RET);
+ if (neon_pwrst == PWRDM_POWER_ON) {
+ if (cx->mpu_state == PWRDM_POWER_RET)
+ pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_RET);
+ else if (cx->mpu_state == PWRDM_POWER_OFF)
+ pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_OFF);
+ }
pwrdm_set_next_pwrst(mpu_pd, cx->mpu_state);
}
@@ -99,9 +103,13 @@ static int omap3_enter_idle(struct cpuid
pwrdm_set_next_pwrst(core_pd, cx->core_state);
}
+ *(scratchpad_restore_addr) = restore_pointer_address;
+
/* Execute ARM wfi */
omap_sram_idle();
+ *(scratchpad_restore_addr) = 0x0;
+
/* Program MPU/NEON to ON */
if (cx->mpu_state < PWRDM_POWER_ON) {
if (neon_pwrst == PWRDM_POWER_ON)
@@ -211,7 +219,7 @@ void omap_init_power_states(void)
CPUIDLE_FLAG_BALANCED;
/* C3 . MPU OFF + Core active */
- omap3_power_states[3].valid = 0;
+ omap3_power_states[3].valid = 1;
omap3_power_states[3].type = OMAP3_STATE_C3;
omap3_power_states[3].sleep_latency = 1500;
omap3_power_states[3].wakeup_latency = 1800;
@@ -233,7 +241,7 @@ void omap_init_power_states(void)
CPUIDLE_FLAG_BALANCED | CPUIDLE_FLAG_CHECK_BM;
/* C5 . MPU OFF + Core CSWR */
- omap3_power_states[5].valid = 0;
+ omap3_power_states[5].valid = 1;
omap3_power_states[5].type = OMAP3_STATE_C5;
omap3_power_states[5].sleep_latency = 3000;
omap3_power_states[5].wakeup_latency = 8500;
@@ -270,6 +278,9 @@ int omap3_idle_init(void)
struct cpuidle_state *state;
struct cpuidle_device *dev;
+ clear_scratchpad_contents();
+ save_scratchpad_contents();
+
omap_init_power_states();
cpuidle_register_driver(&omap3_idle_driver);
Index: linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.h
===================================================================
--- linux-omap-2.6.orig/arch/arm/mach-omap2/cpuidle34xx.h 2008-07-01 16:25:16.000000000 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.h 2008-07-01 16:56:13.298377929 +0530
@@ -40,6 +40,11 @@ extern void per_gpio_clk_enable(void);
extern void per_gpio_clk_disable(void);
extern void omap_serial_enable_clocks(int enable);
extern int omap3_can_sleep();
+extern void clear_scratchpad_contents(void);
+extern void save_scratchpad_contents(void);
+extern u32 *scratchpad_restore_addr;
+extern u32 restore_pointer_address;
+
struct omap3_processor_cx {
u8 valid;
u8 type;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 06/11] mpu off state enabled
2008-07-01 14:16 Rajendra Nayak
@ 2008-07-02 12:19 ` Högander Jouni
2008-07-02 13:08 ` Rajendra Nayak
0 siblings, 1 reply; 6+ messages in thread
From: Högander Jouni @ 2008-07-02 12:19 UTC (permalink / raw)
To: ext Rajendra Nayak; +Cc: linux-omap
"ext Rajendra Nayak" <rnayak@ti.com> writes:
> This patch updates the CPUidle code to handle MPU OFF related C states
>
> Signed-off-by: Rajendra Nayak <rnayak@ti.com>
>
> ---
> arch/arm/mach-omap2/cpuidle34xx.c | 19 +++++++++++++++----
> arch/arm/mach-omap2/cpuidle34xx.h | 5 +++++
> 2 files changed, 20 insertions(+), 4 deletions(-)
>
> Index: linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.c
> ===================================================================
> --- linux-omap-2.6.orig/arch/arm/mach-omap2/cpuidle34xx.c 2008-07-01 16:47:53.000000000 +0530
> +++ linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.c 2008-07-01 16:55:39.112465404 +0530
> @@ -82,8 +82,12 @@ static int omap3_enter_idle(struct cpuid
>
> /* Program MPU to target state */
> if (cx->mpu_state < PWRDM_POWER_ON) {
> - if (neon_pwrst == PWRDM_POWER_ON)
> - pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_RET);
> + if (neon_pwrst == PWRDM_POWER_ON) {
> + if (cx->mpu_state == PWRDM_POWER_RET)
> + pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_RET);
> + else if (cx->mpu_state == PWRDM_POWER_OFF)
> + pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_OFF);
How about pwrdm_set_next_pwrst(neon_pd, cx->mpu_state)?
> + }
> pwrdm_set_next_pwrst(mpu_pd, cx->mpu_state);
> }
>
> @@ -99,9 +103,13 @@ static int omap3_enter_idle(struct cpuid
> pwrdm_set_next_pwrst(core_pd, cx->core_state);
> }
>
> + *(scratchpad_restore_addr) = restore_pointer_address;
> +
> /* Execute ARM wfi */
> omap_sram_idle();
>
> + *(scratchpad_restore_addr) = 0x0;
> +
> /* Program MPU/NEON to ON */
> if (cx->mpu_state < PWRDM_POWER_ON) {
> if (neon_pwrst == PWRDM_POWER_ON)
> @@ -211,7 +219,7 @@ void omap_init_power_states(void)
> CPUIDLE_FLAG_BALANCED;
>
> /* C3 . MPU OFF + Core active */
> - omap3_power_states[3].valid = 0;
> + omap3_power_states[3].valid = 1;
> omap3_power_states[3].type = OMAP3_STATE_C3;
> omap3_power_states[3].sleep_latency = 1500;
> omap3_power_states[3].wakeup_latency = 1800;
> @@ -233,7 +241,7 @@ void omap_init_power_states(void)
> CPUIDLE_FLAG_BALANCED | CPUIDLE_FLAG_CHECK_BM;
>
> /* C5 . MPU OFF + Core CSWR */
> - omap3_power_states[5].valid = 0;
> + omap3_power_states[5].valid = 1;
> omap3_power_states[5].type = OMAP3_STATE_C5;
> omap3_power_states[5].sleep_latency = 3000;
> omap3_power_states[5].wakeup_latency = 8500;
> @@ -270,6 +278,9 @@ int omap3_idle_init(void)
> struct cpuidle_state *state;
> struct cpuidle_device *dev;
>
> + clear_scratchpad_contents();
> + save_scratchpad_contents();
> +
> omap_init_power_states();
> cpuidle_register_driver(&omap3_idle_driver);
>
> Index: linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.h
> ===================================================================
> --- linux-omap-2.6.orig/arch/arm/mach-omap2/cpuidle34xx.h 2008-07-01 16:25:16.000000000 +0530
> +++ linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.h 2008-07-01 16:56:13.298377929 +0530
> @@ -40,6 +40,11 @@ extern void per_gpio_clk_enable(void);
> extern void per_gpio_clk_disable(void);
> extern void omap_serial_enable_clocks(int enable);
> extern int omap3_can_sleep();
> +extern void clear_scratchpad_contents(void);
> +extern void save_scratchpad_contents(void);
> +extern u32 *scratchpad_restore_addr;
> +extern u32 restore_pointer_address;
> +
> struct omap3_processor_cx {
> u8 valid;
> u8 type;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
--
Jouni Högander
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 06/11] mpu off state enabled
2008-07-02 12:19 ` Högander Jouni
@ 2008-07-02 13:08 ` Rajendra Nayak
0 siblings, 0 replies; 6+ messages in thread
From: Rajendra Nayak @ 2008-07-02 13:08 UTC (permalink / raw)
To: '"Högander" Jouni'; +Cc: linux-omap
> -----Original Message-----
> From: "Högander" Jouni [mailto:jouni.hogander@nokia.com]
> Sent: Wednesday, July 02, 2008 5:49 PM
> To: ext Rajendra Nayak
> Cc: linux-omap@vger.kernel.org
> Subject: Re: [PATCH 06/11] mpu off state enabled
>
> "ext Rajendra Nayak" <rnayak@ti.com> writes:
>
> > This patch updates the CPUidle code to handle MPU OFF
> related C states
> >
> > Signed-off-by: Rajendra Nayak <rnayak@ti.com>
> >
> > ---
> > arch/arm/mach-omap2/cpuidle34xx.c | 19 +++++++++++++++----
> > arch/arm/mach-omap2/cpuidle34xx.h | 5 +++++
> > 2 files changed, 20 insertions(+), 4 deletions(-)
> >
> > Index: linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.c
> > ===================================================================
> > --- linux-omap-2.6.orig/arch/arm/mach-omap2/cpuidle34xx.c
> 2008-07-01 16:47:53.000000000 +0530
> > +++ linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.c
> 2008-07-01 16:55:39.112465404 +0530
> > @@ -82,8 +82,12 @@ static int omap3_enter_idle(struct cpuid
> >
> > /* Program MPU to target state */
> > if (cx->mpu_state < PWRDM_POWER_ON) {
> > - if (neon_pwrst == PWRDM_POWER_ON)
> > - pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_RET);
> > + if (neon_pwrst == PWRDM_POWER_ON) {
> > + if (cx->mpu_state == PWRDM_POWER_RET)
> > + pwrdm_set_next_pwrst(neon_pd,
> PWRDM_POWER_RET);
> > + else if (cx->mpu_state == PWRDM_POWER_OFF)
> > + pwrdm_set_next_pwrst(neon_pd,
> PWRDM_POWER_OFF);
>
> How about pwrdm_set_next_pwrst(neon_pd, cx->mpu_state)?
Yes, I initially had it this way. Then thought calling a set_next for neon
and passing it the mpu_state might be confusing to read.
Can change it back and maybe put some comments anyway.
>
> > + }
> > pwrdm_set_next_pwrst(mpu_pd, cx->mpu_state);
> > }
> >
> > @@ -99,9 +103,13 @@ static int omap3_enter_idle(struct cpuid
> > pwrdm_set_next_pwrst(core_pd, cx->core_state);
> > }
> >
> > + *(scratchpad_restore_addr) = restore_pointer_address;
> > +
> > /* Execute ARM wfi */
> > omap_sram_idle();
> >
> > + *(scratchpad_restore_addr) = 0x0;
> > +
> > /* Program MPU/NEON to ON */
> > if (cx->mpu_state < PWRDM_POWER_ON) {
> > if (neon_pwrst == PWRDM_POWER_ON)
> > @@ -211,7 +219,7 @@ void omap_init_power_states(void)
> > CPUIDLE_FLAG_BALANCED;
> >
> > /* C3 . MPU OFF + Core active */
> > - omap3_power_states[3].valid = 0;
> > + omap3_power_states[3].valid = 1;
> > omap3_power_states[3].type = OMAP3_STATE_C3;
> > omap3_power_states[3].sleep_latency = 1500;
> > omap3_power_states[3].wakeup_latency = 1800;
> > @@ -233,7 +241,7 @@ void omap_init_power_states(void)
> > CPUIDLE_FLAG_BALANCED | CPUIDLE_FLAG_CHECK_BM;
> >
> > /* C5 . MPU OFF + Core CSWR */
> > - omap3_power_states[5].valid = 0;
> > + omap3_power_states[5].valid = 1;
> > omap3_power_states[5].type = OMAP3_STATE_C5;
> > omap3_power_states[5].sleep_latency = 3000;
> > omap3_power_states[5].wakeup_latency = 8500;
> > @@ -270,6 +278,9 @@ int omap3_idle_init(void)
> > struct cpuidle_state *state;
> > struct cpuidle_device *dev;
> >
> > + clear_scratchpad_contents();
> > + save_scratchpad_contents();
> > +
> > omap_init_power_states();
> > cpuidle_register_driver(&omap3_idle_driver);
> >
> > Index: linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.h
> > ===================================================================
> > --- linux-omap-2.6.orig/arch/arm/mach-omap2/cpuidle34xx.h
> 2008-07-01 16:25:16.000000000 +0530
> > +++ linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.h
> 2008-07-01 16:56:13.298377929 +0530
> > @@ -40,6 +40,11 @@ extern void per_gpio_clk_enable(void);
> > extern void per_gpio_clk_disable(void);
> > extern void omap_serial_enable_clocks(int enable);
> > extern int omap3_can_sleep();
> > +extern void clear_scratchpad_contents(void);
> > +extern void save_scratchpad_contents(void);
> > +extern u32 *scratchpad_restore_addr;
> > +extern u32 restore_pointer_address;
> > +
> > struct omap3_processor_cx {
> > u8 valid;
> > u8 type;
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe
> linux-omap" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
> >
>
> --
> Jouni Högander
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 06/11] mpu off state enabled
@ 2008-07-18 13:19 Rajendra Nayak
0 siblings, 0 replies; 6+ messages in thread
From: Rajendra Nayak @ 2008-07-18 13:19 UTC (permalink / raw)
To: linux-omap
This patch updates the CPUidle code to handle MPU OFF related C states
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/mach-omap2/cpuidle34xx.c | 19 +++++++++++++++----
arch/arm/mach-omap2/cpuidle34xx.h | 5 +++++
2 files changed, 20 insertions(+), 4 deletions(-)
Index: linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.c
===================================================================
--- linux-omap-2.6.orig/arch/arm/mach-omap2/cpuidle34xx.c 2008-07-01 16:47:53.000000000 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.c 2008-07-01 16:55:39.112465404 +0530
@@ -82,8 +82,12 @@ static int omap3_enter_idle(struct cpuid
/* Program MPU to target state */
if (cx->mpu_state < PWRDM_POWER_ON) {
- if (neon_pwrst == PWRDM_POWER_ON)
- pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_RET);
+ if (neon_pwrst == PWRDM_POWER_ON) {
+ if (cx->mpu_state == PWRDM_POWER_RET)
+ pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_RET);
+ else if (cx->mpu_state == PWRDM_POWER_OFF)
+ pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_OFF);
+ }
pwrdm_set_next_pwrst(mpu_pd, cx->mpu_state);
}
@@ -99,9 +103,13 @@ static int omap3_enter_idle(struct cpuid
pwrdm_set_next_pwrst(core_pd, cx->core_state);
}
+ *(scratchpad_restore_addr) = restore_pointer_address;
+
/* Execute ARM wfi */
omap_sram_idle();
+ *(scratchpad_restore_addr) = 0x0;
+
/* Program MPU/NEON to ON */
if (cx->mpu_state < PWRDM_POWER_ON) {
if (neon_pwrst == PWRDM_POWER_ON)
@@ -211,7 +219,7 @@ void omap_init_power_states(void)
CPUIDLE_FLAG_BALANCED;
/* C3 . MPU OFF + Core active */
- omap3_power_states[3].valid = 0;
+ omap3_power_states[3].valid = 1;
omap3_power_states[3].type = OMAP3_STATE_C3;
omap3_power_states[3].sleep_latency = 1500;
omap3_power_states[3].wakeup_latency = 1800;
@@ -233,7 +241,7 @@ void omap_init_power_states(void)
CPUIDLE_FLAG_BALANCED | CPUIDLE_FLAG_CHECK_BM;
/* C5 . MPU OFF + Core CSWR */
- omap3_power_states[5].valid = 0;
+ omap3_power_states[5].valid = 1;
omap3_power_states[5].type = OMAP3_STATE_C5;
omap3_power_states[5].sleep_latency = 3000;
omap3_power_states[5].wakeup_latency = 8500;
@@ -270,6 +278,9 @@ int omap3_idle_init(void)
struct cpuidle_state *state;
struct cpuidle_device *dev;
+ clear_scratchpad_contents();
+ save_scratchpad_contents();
+
omap_init_power_states();
cpuidle_register_driver(&omap3_idle_driver);
Index: linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.h
===================================================================
--- linux-omap-2.6.orig/arch/arm/mach-omap2/cpuidle34xx.h 2008-07-01 16:25:16.000000000 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.h 2008-07-01 16:56:13.298377929 +0530
@@ -40,6 +40,11 @@ extern void per_gpio_clk_enable(void);
extern void per_gpio_clk_disable(void);
extern void omap_serial_enable_clocks(int enable);
extern int omap3_can_sleep();
+extern void clear_scratchpad_contents(void);
+extern void save_scratchpad_contents(void);
+extern u32 *scratchpad_restore_addr;
+extern u32 restore_pointer_address;
+
struct omap3_processor_cx {
u8 valid;
u8 type;
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 06/11] mpu off state enabled
@ 2008-08-06 13:15 Rajendra Nayak
0 siblings, 0 replies; 6+ messages in thread
From: Rajendra Nayak @ 2008-08-06 13:15 UTC (permalink / raw)
To: linux-omap
This patch updates the CPUidle code to handle MPU OFF related C states
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/mach-omap2/cpuidle34xx.c | 19 +++++++++++++++----
arch/arm/mach-omap2/cpuidle34xx.h | 5 +++++
2 files changed, 20 insertions(+), 4 deletions(-)
Index: linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.c
===================================================================
--- linux-omap-2.6.orig/arch/arm/mach-omap2/cpuidle34xx.c 2008-08-06
18:09:48.000000000 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.c 2008-08-06
18:10:59.000000000 +0530
@@ -82,8 +82,12 @@ static int omap3_enter_idle(struct cpuid
/* Program MPU to target state */
if (cx->mpu_state < PWRDM_POWER_ON) {
- if (neon_pwrst == PWRDM_POWER_ON)
- pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_RET);
+ if (neon_pwrst == PWRDM_POWER_ON) {
+ if (cx->mpu_state == PWRDM_POWER_RET)
+ pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_RET);
+ else if (cx->mpu_state == PWRDM_POWER_OFF)
+ pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_OFF);
+ }
pwrdm_set_next_pwrst(mpu_pd, cx->mpu_state);
}
@@ -99,9 +103,13 @@ static int omap3_enter_idle(struct cpuid
pwrdm_set_next_pwrst(core_pd, cx->core_state);
}
+ *(scratchpad_restore_addr) = restore_pointer_address;
+
/* Execute ARM wfi */
omap_sram_idle();
+ *(scratchpad_restore_addr) = 0x0;
+
/* Program MPU/NEON to ON */
if (cx->mpu_state < PWRDM_POWER_ON) {
if (neon_pwrst == PWRDM_POWER_ON)
@@ -211,7 +219,7 @@ void omap_init_power_states(void)
CPUIDLE_FLAG_BALANCED;
/* C3 . MPU OFF + Core active */
- omap3_power_states[3].valid = 0;
+ omap3_power_states[3].valid = 1;
omap3_power_states[3].type = OMAP3_STATE_C3;
omap3_power_states[3].sleep_latency = 1500;
omap3_power_states[3].wakeup_latency = 1800;
@@ -233,7 +241,7 @@ void omap_init_power_states(void)
CPUIDLE_FLAG_BALANCED | CPUIDLE_FLAG_CHECK_BM;
/* C5 . MPU OFF + Core CSWR */
- omap3_power_states[5].valid = 0;
+ omap3_power_states[5].valid = 1;
omap3_power_states[5].type = OMAP3_STATE_C5;
omap3_power_states[5].sleep_latency = 3000;
omap3_power_states[5].wakeup_latency = 8500;
@@ -270,6 +278,9 @@ int omap3_idle_init(void)
struct cpuidle_state *state;
struct cpuidle_device *dev;
+ clear_scratchpad_contents();
+ save_scratchpad_contents();
+
omap_init_power_states();
cpuidle_register_driver(&omap3_idle_driver);
Index: linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.h
===================================================================
--- linux-omap-2.6.orig/arch/arm/mach-omap2/cpuidle34xx.h 2008-08-06
18:09:48.000000000 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.h 2008-08-06
18:10:59.000000000 +0530
@@ -40,6 +40,11 @@ extern void per_gpio_clk_enable(void);
extern void per_gpio_clk_disable(void);
extern void omap_serial_enable_clocks(int enable);
extern int omap3_can_sleep();
+extern void clear_scratchpad_contents(void);
+extern void save_scratchpad_contents(void);
+extern u32 *scratchpad_restore_addr;
+extern u32 restore_pointer_address;
+
struct omap3_processor_cx {
u8 valid;
u8 type;
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 06/11] mpu off state enabled
@ 2008-08-06 13:27 Rajendra Nayak
0 siblings, 0 replies; 6+ messages in thread
From: Rajendra Nayak @ 2008-08-06 13:27 UTC (permalink / raw)
To: linux-omap
This patch updates the CPUidle code to handle MPU OFF related C states
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
---
arch/arm/mach-omap2/cpuidle34xx.c | 19 +++++++++++++++----
arch/arm/mach-omap2/cpuidle34xx.h | 5 +++++
2 files changed, 20 insertions(+), 4 deletions(-)
Index: linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.c
===================================================================
--- linux-omap-2.6.orig/arch/arm/mach-omap2/cpuidle34xx.c 2008-08-06
18:09:48.000000000 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.c 2008-08-06
18:10:59.000000000 +0530
@@ -82,8 +82,12 @@ static int omap3_enter_idle(struct cpuid
/* Program MPU to target state */
if (cx->mpu_state < PWRDM_POWER_ON) {
- if (neon_pwrst == PWRDM_POWER_ON)
- pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_RET);
+ if (neon_pwrst == PWRDM_POWER_ON) {
+ if (cx->mpu_state == PWRDM_POWER_RET)
+ pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_RET);
+ else if (cx->mpu_state == PWRDM_POWER_OFF)
+ pwrdm_set_next_pwrst(neon_pd, PWRDM_POWER_OFF);
+ }
pwrdm_set_next_pwrst(mpu_pd, cx->mpu_state);
}
@@ -99,9 +103,13 @@ static int omap3_enter_idle(struct cpuid
pwrdm_set_next_pwrst(core_pd, cx->core_state);
}
+ *(scratchpad_restore_addr) = restore_pointer_address;
+
/* Execute ARM wfi */
omap_sram_idle();
+ *(scratchpad_restore_addr) = 0x0;
+
/* Program MPU/NEON to ON */
if (cx->mpu_state < PWRDM_POWER_ON) {
if (neon_pwrst == PWRDM_POWER_ON)
@@ -211,7 +219,7 @@ void omap_init_power_states(void)
CPUIDLE_FLAG_BALANCED;
/* C3 . MPU OFF + Core active */
- omap3_power_states[3].valid = 0;
+ omap3_power_states[3].valid = 1;
omap3_power_states[3].type = OMAP3_STATE_C3;
omap3_power_states[3].sleep_latency = 1500;
omap3_power_states[3].wakeup_latency = 1800;
@@ -233,7 +241,7 @@ void omap_init_power_states(void)
CPUIDLE_FLAG_BALANCED | CPUIDLE_FLAG_CHECK_BM;
/* C5 . MPU OFF + Core CSWR */
- omap3_power_states[5].valid = 0;
+ omap3_power_states[5].valid = 1;
omap3_power_states[5].type = OMAP3_STATE_C5;
omap3_power_states[5].sleep_latency = 3000;
omap3_power_states[5].wakeup_latency = 8500;
@@ -270,6 +278,9 @@ int omap3_idle_init(void)
struct cpuidle_state *state;
struct cpuidle_device *dev;
+ clear_scratchpad_contents();
+ save_scratchpad_contents();
+
omap_init_power_states();
cpuidle_register_driver(&omap3_idle_driver);
Index: linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.h
===================================================================
--- linux-omap-2.6.orig/arch/arm/mach-omap2/cpuidle34xx.h 2008-08-06
18:09:48.000000000 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/cpuidle34xx.h 2008-08-06
18:10:59.000000000 +0530
@@ -40,6 +40,11 @@ extern void per_gpio_clk_enable(void);
extern void per_gpio_clk_disable(void);
extern void omap_serial_enable_clocks(int enable);
extern int omap3_can_sleep();
+extern void clear_scratchpad_contents(void);
+extern void save_scratchpad_contents(void);
+extern u32 *scratchpad_restore_addr;
+extern u32 restore_pointer_address;
+
struct omap3_processor_cx {
u8 valid;
u8 type;
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-08-06 13:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-18 13:19 [PATCH 06/11] mpu off state enabled Rajendra Nayak
-- strict thread matches above, loose matches on Subject: below --
2008-08-06 13:27 Rajendra Nayak
2008-08-06 13:15 Rajendra Nayak
2008-07-01 14:16 Rajendra Nayak
2008-07-02 12:19 ` Högander Jouni
2008-07-02 13:08 ` Rajendra Nayak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox