Skip to contentSkip to conversation

OMAP3 sleep code clean-up

PATCH In review Jean Pihet 7 participants 28 messages Nov 18, 2010 – Nov 22, 2010

Subsystems (4)
lore
Share & tools
lore

Jean Pihet

author
#0 lore raw

Vishwanath BS <[email protected]>, Jean Pihet <[email protected]>:

[PATCH 1/2]: OMAP3 PM: move omap3 sleep to ddr

For historical reasons the OMAP3 sleep code is run from SRAM. This code can run from DDR which provides better performance and leaves the SRAM available for other uses.

Tested on ZOOM3, OMAP3EVM, Beagleboard, n900
with full RET and OFF modes.

[PATCH 2/2] OMAP3: clean up ASM idle code

Clean up of the ASM code:
- reworked and simplified the execution paths, for better readability and to avoid duplication of code,
- reworked the comments for better readability,
- reworked the code formating and alignment,
- added comments for the i443 errata workarounds,
- replaced the cache flush code by a call to the kernel common code for ARMv7 (v7_flush_kern_cache_all), which is better maintained and so more mature,
- clean up of non used symbols.

Tested on Zoom3, OMAP3EVM, Beagleboard, n900
with full RET and OFF mode.

author
#1 lore raw

PATCH 1/2 OMAP3 PM: move omap3 sleep to ddr

From: Vishwanath BS <[email protected]>

For historical reasons the OMAP3 sleep code is run from SRAM. This code can run from DDR which provides better performance and leaves the SRAM available for other uses.

Tested on ZOOM3, OMAP3EVM, Beagleboard, n900
with full RET and OFF modes.

Changed the commit comments.

Cc Jean Pihet <[email protected]>
---
 arch/arm/mach-omap2/pm34xx.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/pm34xx.c +1 -8
index 75c0cd1..035ca47 100644
@@ -65,8 +65,6 @@ struct power_state {
 
 static LIST_HEAD(pwrst_list);
 
-static void (*_omap_sram_idle)(u32 *addr, int save_state);
-
 static int (*_omap_save_secure_sram)(u32 *addr);
 
 static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
@@ -346,9 +344,6 @@ void omap_sram_idle(void)
 	int core_prev_state, per_prev_state;
 	u32 sdrc_pwr = 0;
 
-	if (!_omap_sram_idle)
-		return;
-
 	pwrdm_clear_all_prev_pwrst(mpu_pwrdm);
 	pwrdm_clear_all_prev_pwrst(neon_pwrdm);
 	pwrdm_clear_all_prev_pwrst(core_pwrdm);
@@ -422,7 +417,7 @@ void omap_sram_idle(void)
 	 * get saved. The restore path then reads from this
 	 * location and restores them back.
 	 */
-	_omap_sram_idle(omap3_arm_context, save_state);
+	omap34xx_cpu_suspend(omap3_arm_context, save_state);
 	cpu_init();
 
 	/* Restore normal SDRC POWER settings */
@@ -972,8 +967,6 @@ static int __init clkdms_setup(struct clockdomain *clkdm, void *unused)
 
 void omap_push_sram_idle(void)
 {
-	_omap_sram_idle = omap_sram_push(omap34xx_cpu_suspend,
-					omap34xx_cpu_suspend_sz);
 	if (omap_type() != OMAP2_DEVICE_TYPE_GP)
 		_omap_save_secure_sram = omap_sram_push(save_secure_ram_context,
 				save_secure_ram_context_sz);
Signature · 1 line
1.7.2.3
#2 lore raw

RE: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Quoted 8 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Jean Pihet
Sent: Thursday, November 18, 2010 8:52 AM
To: [email protected]
Cc: Vishwanath BS; Kevin Hillman; Jean Pihet
Subject: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Quoted 8 lines

From: Vishwanath BS <[email protected]>

For historical reasons the OMAP3 sleep code is run from SRAM. This code can run from DDR which provides better performance and leaves the SRAM available for other uses.

Tested on ZOOM3, OMAP3EVM, Beagleboard, n900
with full RET and OFF modes.

Sorry, But I disagree with this patch.

There is a silicon errata which cannot be handled with this - RTA disable
- errata i608

You need to disable RTA while coming out of OFF - we cannot handle this on

GP devices if this is not done.

Quoted 61 lines

Changed the commit comments.

Cc Jean Pihet <[email protected]>
---
 arch/arm/mach-omap2/pm34xx.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/pm34xx.c +1 -8
index 75c0cd1..035ca47 100644
@@ -65,8 +65,6 @@ struct power_state {
 
 static LIST_HEAD(pwrst_list);
 
-static void (*_omap_sram_idle)(u32 *addr, int save_state);
-
 static int (*_omap_save_secure_sram)(u32 *addr);
 
 static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
@@ -346,9 +344,6 @@ void omap_sram_idle(void)
 	int core_prev_state, per_prev_state;
 	u32 sdrc_pwr = 0;
 
-	if (!_omap_sram_idle)
-		return;
-
 	pwrdm_clear_all_prev_pwrst(mpu_pwrdm);
 	pwrdm_clear_all_prev_pwrst(neon_pwrdm);
 	pwrdm_clear_all_prev_pwrst(core_pwrdm);
@@ -422,7 +417,7 @@ void omap_sram_idle(void)
 	 * get saved. The restore path then reads from this
 	 * location and restores them back.
 	 */
-	_omap_sram_idle(omap3_arm_context, save_state);
+	omap34xx_cpu_suspend(omap3_arm_context, save_state);
 	cpu_init();
 
 	/* Restore normal SDRC POWER settings */
@@ -972,8 +967,6 @@ static int __init clkdms_setup(struct clockdomain
 *clkdm, void *unused)
 
 void omap_push_sram_idle(void)
 {
-	_omap_sram_idle = omap_sram_push(omap34xx_cpu_suspend,
-					omap34xx_cpu_suspend_sz);
 	if (omap_type() != OMAP2_DEVICE_TYPE_GP)
 		_omap_save_secure_sram =

omap_sram_push(save_secure_ram_context,
save_secure_ram_context_sz);
--
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

NIshant,

Quoted 17 lines · Nishanth Menon
Quoted 8 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Jean Pihet
Sent: Thursday, November 18, 2010 8:52 AM
To: [email protected]
Cc: Vishwanath BS; Kevin Hillman; Jean Pihet
Subject: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Quoted 8 lines

From: Vishwanath BS <[email protected]>

For historical reasons the OMAP3 sleep code is run from SRAM. This code can run from DDR which provides better performance and leaves the SRAM available for other uses.

Tested on ZOOM3, OMAP3EVM, Beagleboard, n900
with full RET and OFF modes.

Quoted 8 lines

Sorry, But I disagree with this patch.

There is a silicon errata which cannot be handled with this - RTA disable
- errata i608

You need to disable RTA while coming out of OFF - we cannot handle this on

GP devices if this is not done.

When you come out of Core off, SRAM contents are anyway lost. So you have to run from DDR after ROM Code completes. This behavior has not changed with this patch. I fail to understand your concern here.

Vishwa

Quoted 58 lines
Quoted 58 lines

Changed the commit comments.

Cc Jean Pihet <[email protected]>

---
 arch/arm/mach-omap2/pm34xx.c |    9 +--------

 1 files changed, 1 insertions(+), 8 deletions(-)
arch/arm/mach-omap2/pm34xx.c +1 -8
index 75c0cd1..035ca47 100644
@@ -65,8 +65,6 @@ struct power_state {
 
  static LIST_HEAD(pwrst_list);
 
-static void (*_omap_sram_idle)(u32 *addr, int save_state);
-
  static int (*_omap_save_secure_sram)(u32 *addr);
 
  static struct powerdomain *mpu_pwrdm, *neon_pwrdm;
@@ -346,9 +344,6 @@ void omap_sram_idle(void)
       int core_prev_state, per_prev_state;
       u32 sdrc_pwr = 0;
 
-     if (!_omap_sram_idle)
-             return;
-
       pwrdm_clear_all_prev_pwrst(mpu_pwrdm);
       pwrdm_clear_all_prev_pwrst(neon_pwrdm);
       pwrdm_clear_all_prev_pwrst(core_pwrdm);
@@ -422,7 +417,7 @@ void omap_sram_idle(void)
        * get saved. The restore path then reads from this
        * location and restores them back.
        */
-     _omap_sram_idle(omap3_arm_context, save_state);
+     omap34xx_cpu_suspend(omap3_arm_context, save_state);
       cpu_init();
 
       /* Restore normal SDRC POWER settings */
@@ -972,8 +967,6 @@ static int __init clkdms_setup(struct clockdomain
 *clkdm, void *unused)
 
  void omap_push_sram_idle(void)
  {
-     _omap_sram_idle = omap_sram_push(omap34xx_cpu_suspend,
-                                     omap34xx_cpu_suspend_sz);
       if (omap_type() != OMAP2_DEVICE_TYPE_GP)

              _omap_save_secure_sram = omap_sram_push(save_secure_ram_context, save_secure_ram_context_sz); --
1.7.2.3

Quoted 5 lines
Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

RE: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Quoted 5 lines

-----Original Message-----
From: Sripathy, Vishwanath [mailto:[email protected]]
Sent: Thursday, November 18, 2010 9:09 AM
To: Nishanth Menon
Cc: Jean Pihet; [email protected]; Kevin Hillman; Jean

Pihet-XID

Quoted 19 lines

Subject: Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

NIshant,

Quoted 14 lines · Nishanth Menon
Quoted 14 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Jean Pihet
Sent: Thursday, November 18, 2010 8:52 AM
To: [email protected]
Cc: Vishwanath BS; Kevin Hillman; Jean Pihet
Subject: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

From: Vishwanath BS <[email protected]>

For historical reasons the OMAP3 sleep code is run from SRAM. This code can run from DDR which provides better performance and leaves the SRAM available for other uses.

Quoted 10 lines
Quoted 6 lines
Quoted 2 lines

Tested on ZOOM3, OMAP3EVM, Beagleboard, n900
with full RET and OFF modes.

Sorry, But I disagree with this patch.

There is a silicon errata which cannot be handled with this - RTA

disable

Quoted 3 lines

- errata i608

You need to disable RTA while coming out of OFF - we cannot handle

this

Quoted 6 lines

on

Quoted 2 lines

GP devices if this is not done.

When you come out of Core off, SRAM contents are anyway lost. So you have to run from DDR after ROM Code completes. This behavior has not changed with this patch. I fail to understand your concern here.

I could potentially be mistaken. Let me do one thing - I will post out the

patches that I have to the list and we can see how this all works together.

Regards,
Nishanth Menon

author
#5 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Hi Nishant,

Quoted 38 lines · Nishanth Menon
Quoted 5 lines

-----Original Message-----
From: Sripathy, Vishwanath [mailto:[email protected]]
Sent: Thursday, November 18, 2010 9:09 AM
To: Nishanth Menon
Cc: Jean Pihet; [email protected]; Kevin Hillman; Jean

Pihet-XID

Quoted 19 lines

Subject: Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

NIshant,

Quoted 14 lines · Nishanth Menon
Quoted 14 lines

-----Original Message-----
From: [email protected] [mailto:linux-omap- [email protected]] On Behalf Of Jean Pihet
Sent: Thursday, November 18, 2010 8:52 AM
To: [email protected]
Cc: Vishwanath BS; Kevin Hillman; Jean Pihet
Subject: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

From: Vishwanath BS <[email protected]>

For historical reasons the OMAP3 sleep code is run from SRAM. This code can run from DDR which provides better performance and leaves the SRAM available for other uses.

Quoted 10 lines
Quoted 6 lines
Quoted 2 lines

Tested on ZOOM3, OMAP3EVM, Beagleboard, n900
with full RET and OFF modes.

Sorry, But I disagree with this patch.

There is a silicon errata which cannot be handled with this - RTA

disable

Quoted 3 lines

- errata i608

You need to disable RTA while coming out of OFF - we cannot handle

this

Quoted 2 lines

on

Quoted 1 line
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

GP devices if this is not done.

When you come out of Core off, SRAM contents are anyway lost. So you have to run from DDR after ROM Code completes. This behavior has not changed with this patch. I fail to understand your concern here.

I could potentially be mistaken. Let me do one thing - I will post out the

patches that I have to the list and we can see how this all works together

Ok, fine.
I did not find any 36xx specific workaround for the errata i608 issue. Is there one already available?

Thanks,
Jean

Quoted 4 lines

Regards,
Nishanth Menon

#6 lore raw

RE: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Quoted 3 lines

-----Original Message-----
From: Jean Pihet [mailto:[email protected]]
Sent: Thursday, November 18, 2010 9:15 AM

[...]

Quoted 18 lines
Quoted 18 lines
Quoted 11 lines
Quoted 7 lines
Quoted 3 lines

Tested on ZOOM3, OMAP3EVM, Beagleboard, n900
with full RET and OFF modes.

Sorry, But I disagree with this patch.

There is a silicon errata which cannot be handled with this - RTA

disable

Quoted 3 lines

- errata i608

You need to disable RTA while coming out of OFF - we cannot handle

this

Quoted 6 lines

on

Quoted 2 lines

GP devices if this is not done.

When you come out of Core off, SRAM contents are anyway lost. So you have to run from DDR after ROM Code completes. This behavior has not changed with this patch. I fail to understand your concern here.

Quoted 8 lines
Quoted 1 line

I could potentially be mistaken. Let me do one thing - I will post out

the

Quoted 3 lines

patches that I have to the list and we can see how this all works together

Ok, fine.
I did not find any 36xx specific workaround for the errata i608 issue. Is there one already available?

Yes, I have a series of patches addressing that as well.. hoping to test On EMU/HS devices prior to posting - GP devices (3430/3630) tested. Regards,
Nishanth Menon

#7 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

In reply to Nishanth Menon
Quoted 9 lines · Nishanth Menon
Quoted 8 lines

From: Vishwanath BS <[email protected]>

For historical reasons the OMAP3 sleep code is run from SRAM. This code can run from DDR which provides better performance and leaves the SRAM available for other uses.

Tested on ZOOM3, OMAP3EVM, Beagleboard, n900
with full RET and OFF modes.

Quoted 7 lines

Sorry, But I disagree with this patch.

There is a silicon errata which cannot be handled with this - RTA disable
- errata i608

You need to disable RTA while coming out of OFF - we cannot handle this on GP devices if this is not done.

You need to provide some more details here as to exactly why this patch prevents the ability to do this workaround.

As Vishwa pointed out, when returning from OFF mode, current code already starts in DDR since SRAM is lost. The current code also already can jump back into SRAM for certain errata/fixup (c.f. es3_sdrc_fix in current code.)

Kevin

#8 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Kevin Hilman had written, on 11/18/2010 09:52 AM, the following:

Quoted 18 lines
Quoted 8 lines · Nishanth Menon
Quoted 8 lines

From: Vishwanath BS <[email protected]>

For historical reasons the OMAP3 sleep code is run from SRAM. This code can run from DDR which provides better performance and leaves the SRAM available for other uses.

Tested on ZOOM3, OMAP3EVM, Beagleboard, n900
with full RET and OFF modes.

Quoted 7 lines

Sorry, But I disagree with this patch.

There is a silicon errata which cannot be handled with this - RTA disable
- errata i608

You need to disable RTA while coming out of OFF - we cannot handle this on GP devices if this is not done.

Quoted 7 lines

You need to provide some more details here as to exactly why this patch prevents the ability to do this workaround.

As Vishwa pointed out, when returning from OFF mode, current code already starts in DDR since SRAM is lost. The current code also already can jump back into SRAM for certain errata/fixup (c.f. es3_sdrc_fix in current code.)

scratchpad_contents.public_restore_ptr -> this is the restore pointer that is invoked when we get out of OFF mode.

	-> on 3430 and 3630, I agree it in SDRAM, for es3_sdrc_fix, it 

relocates the required code to sram as it cannot be run in ddr. - so I believe no issues there.

But after wfi in wait_sdrc_ok as part of the code executing in SRAM today omap34xx_cpu_suspend -> we are waiting for DPLL3 lock prior to accessing DDR -> how do we execute that logic in SDRAM?

Signature · 2 lines
Regards,
Nishanth Menon
maintainer
#9 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Quoted 4 lines · Nishanth Menon

But after wfi in wait_sdrc_ok as part of the code executing in SRAM today omap34xx_cpu_suspend -> we are waiting for DPLL3 lock prior to accessing DDR -> how do we execute that logic in SDRAM?

I too am a bit concerned how this will all keep working. For light testing it may be running OK if it happens to run from cache..

Also, moving the code out of SRAM will limit the options for what we may need to do with DDR or L3.

Retention is something to consider, are there issues with that?

Regards,

Tony

maintainer
#10 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Quoted 8 lines · Tony Lindgren
Quoted 4 lines · Nishanth Menon

But after wfi in wait_sdrc_ok as part of the code executing in SRAM today omap34xx_cpu_suspend -> we are waiting for DPLL3 lock prior to accessing DDR -> how do we execute that logic in SDRAM?

I too am a bit concerned how this will all keep working. For light testing it may be running OK if it happens to run from cache..

This in the retention case, in off-idle those should be powered down..

Tony

author
#11 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

In reply to Tony Lindgren
Quoted 7 lines · Tony Lindgren
Quoted 4 lines · Nishanth Menon

But after wfi in wait_sdrc_ok as part of the code executing in SRAM today omap34xx_cpu_suspend -> we are waiting for DPLL3 lock prior to accessing DDR -> how do we execute that logic in SDRAM?

I too am a bit concerned how this will all keep working. For light testing it may be running OK if it happens to run from cache..

As Vishwa pointed out, when going out of OFF mode the SRAM and the caches are lost.
That means the low power mode _has to_ rely on SDRAM at wake-up.

About the DPLL lock:
1) wait_sdrc_ok is only called when back from the non-OFF modes,
2) I checked that when running wait_sdrc_ok the CORE is already out of idle and the DPLL is already locked. Note: l-o code has no support for the voltages OFF and the external clocks OFF.

What to conclude from 1) and 2)? In my test setup ot looks like wait_sdrc_ok is of no use, but I agree this a premature conclusion.

Quoted 2 lines

Also, moving the code out of SRAM will limit the options for what we may need to do with DDR or L3.

What are the options? All the executable code runs from DDR anyway.

Quoted 1 line

Retention is something to consider, are there issues with that?

No issue so far. See the points 1) and 2) here above.

Quoted 5 lines

Regards,

Tony

Jean

maintainer
#12 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Quoted 10 lines · Jean Pihet

On Thu, Nov 18, 2010 at 6:52 PM, Tony Lindgren <[email protected]> wrote:

About the DPLL lock:
1) wait_sdrc_ok is only called when back from the non-OFF modes,
2) I checked that when running wait_sdrc_ok the CORE is already out of idle and the DPLL is already locked. Note: l-o code has no support for the voltages OFF and the external clocks OFF.

What to conclude from 1) and 2)? In my test setup ot looks like wait_sdrc_ok is of no use, but I agree this a premature conclusion.

Yeah we should figure out in which cases wait_sdrc_ok is needed.

BTW, are you sure you're hitting core idle in your tests?

Regards,

Tony

author
#13 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Quoted 9 lines · Tony Lindgren
Quoted 8 lines · Jean Pihet

On Thu, Nov 18, 2010 at 6:52 PM, Tony Lindgren <[email protected]> wrote:

About the DPLL lock:
1) wait_sdrc_ok is only called when back from the non-OFF modes,
2) I checked that when running wait_sdrc_ok the CORE is already out of idle and the DPLL is already locked. Note: l-o code has no support for the voltages OFF and the external clocks OFF.

Quoted 6 lines
Quoted 2 lines

What to conclude from 1) and 2)? In my test setup ot looks like wait_sdrc_ok is of no use, but I agree this a premature conclusion.

Yeah we should figure out in which cases wait_sdrc_ok is needed.

BTW, are you sure you're hitting core idle in your tests?

Yes it is OK from the console messages and the counters values in /debug/pm_debug/count.

Let me confirm asap with the PRCM registers dump.

Quoted 5 lines

Regards,

Tony

Thanks,
Jean

Quoted 1 line
author
#14 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

HI Tony,

Quoted 13 lines · Jean Pihet
Quoted 12 lines · Tony Lindgren
Quoted 10 lines · Jean Pihet

On Thu, Nov 18, 2010 at 6:52 PM, Tony Lindgren <[email protected]> wrote:

About the DPLL lock:
1) wait_sdrc_ok is only called when back from the non-OFF modes,
2) I checked that when running wait_sdrc_ok the CORE is already out of idle and the DPLL is already locked. Note: l-o code has no support for the voltages OFF and the external clocks OFF.

What to conclude from 1) and 2)? In my test setup ot looks like wait_sdrc_ok is of no use, but I agree this a premature conclusion.

Quoted 7 lines
Quoted 3 lines

Yeah we should figure out in which cases wait_sdrc_ok is needed.

BTW, are you sure you're hitting core idle in your tests?

Yes it is OK from the console messages and the counters values in /debug/pm_debug/count.

Let me confirm asap with the PRCM registers dump.

Here is what I experimented:
1) added a cache flush (v7_flush_kern_cache_all) just before WFI, in all cases,
2) checked the real state entered in low power mode from the console messages, the output of /debug/pm_debug/count and PRCM registers dump

2) is OK, which means that the RET and OFF modes are correctly hit.

Can I conclude from 1) that the wake-up code is not running from the cache in RETention?

Thanks,
Jean

Quoted 12 lines
Quoted 6 lines

Regards,

Tony

Thanks,
Jean

Quoted 1 line
maintainer
#15 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Quoted 29 lines · Jean Pihet

HI Tony,

Quoted 13 lines · Jean Pihet
Quoted 12 lines · Tony Lindgren
Quoted 10 lines · Jean Pihet

On Thu, Nov 18, 2010 at 6:52 PM, Tony Lindgren <[email protected]> wrote:

About the DPLL lock:
1) wait_sdrc_ok is only called when back from the non-OFF modes,
2) I checked that when running wait_sdrc_ok the CORE is already out of idle and the DPLL is already locked. Note: l-o code has no support for the voltages OFF and the external clocks OFF.

What to conclude from 1) and 2)? In my test setup ot looks like wait_sdrc_ok is of no use, but I agree this a premature conclusion.

Quoted 7 lines
Quoted 3 lines

Yeah we should figure out in which cases wait_sdrc_ok is needed.

BTW, are you sure you're hitting core idle in your tests?

Yes it is OK from the console messages and the counters values in /debug/pm_debug/count.

Let me confirm asap with the PRCM registers dump.

Here is what I experimented:
1) added a cache flush (v7_flush_kern_cache_all) just before WFI, in all cases,
2) checked the real state entered in low power mode from the console messages, the output of /debug/pm_debug/count and PRCM registers dump

Quoted 4 lines

2) is OK, which means that the RET and OFF modes are correctly hit.

Can I conclude from 1) that the wake-up code is not running from the cache in RETention?

Sounds pretty safe to me then, thanks for testing. Now we just have to find out in which cases wait_sdrc_ok is needed..

Tony

#16 lore raw

RE: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

In reply to Jean Pihet
Quoted 31 lines

-----Original Message-----
From: Jean Pihet [mailto:[email protected]]
Sent: Friday, November 19, 2010 9:37 AM

Quoted 13 lines · Jean Pihet
Quoted 12 lines · Tony Lindgren
Quoted 10 lines · Jean Pihet

On Thu, Nov 18, 2010 at 6:52 PM, Tony Lindgren <[email protected]> wrote:

About the DPLL lock:
1) wait_sdrc_ok is only called when back from the non-OFF modes,
2) I checked that when running wait_sdrc_ok the CORE is already out of idle and the DPLL is already locked. Note: l-o code has no support for the voltages OFF and the external clocks OFF.

What to conclude from 1) and 2)? In my test setup ot looks like wait_sdrc_ok is of no use, but I agree this a premature conclusion.

Quoted 7 lines
Quoted 3 lines

Yeah we should figure out in which cases wait_sdrc_ok is needed.

BTW, are you sure you're hitting core idle in your tests?

Yes it is OK from the console messages and the counters values in /debug/pm_debug/count.

Let me confirm asap with the PRCM registers dump.

Here is what I experimented:
1) added a cache flush (v7_flush_kern_cache_all) just before WFI, in all >cases,
2) checked the real state entered in low power mode from the console messages, the output of /debug/pm_debug/count and PRCM registers dump

Quoted 4 lines

2) is OK, which means that the RET and OFF modes are correctly hit.

Can I conclude from 1) that the wake-up code is not running from the cache in RETention?

[Derrick, David]

To add some context to the wait_sdrc_ok function and why it was added:

wait_sdrc_ok was added because the DLL takes 500 L3 clock cycles to lock. So you do not want to go back to DDR before DLL is locked. Also, we found some times DLL never locked so we introduced the DLL kick procedure to force it to lock.

Regards,
David

author
#17 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Quoted 36 lines · David
Quoted 31 lines

-----Original Message-----
From: Jean Pihet [mailto:[email protected]]
Sent: Friday, November 19, 2010 9:37 AM

Quoted 13 lines · Jean Pihet
Quoted 12 lines · Tony Lindgren
Quoted 10 lines · Jean Pihet

On Thu, Nov 18, 2010 at 6:52 PM, Tony Lindgren <[email protected]> wrote:

About the DPLL lock:
1) wait_sdrc_ok is only called when back from the non-OFF modes,
2) I checked that when running wait_sdrc_ok the CORE is already out of idle and the DPLL is already locked. Note: l-o code has no support for the voltages OFF and the external clocks OFF.

What to conclude from 1) and 2)? In my test setup ot looks like wait_sdrc_ok is of no use, but I agree this a premature conclusion.

Quoted 7 lines
Quoted 3 lines

Yeah we should figure out in which cases wait_sdrc_ok is needed.

BTW, are you sure you're hitting core idle in your tests?

Yes it is OK from the console messages and the counters values in /debug/pm_debug/count.

Let me confirm asap with the PRCM registers dump.

Here is what I experimented:
1) added a cache flush (v7_flush_kern_cache_all) just before WFI, in all >cases,
2) checked the real state entered in low power mode from the console messages, the output of /debug/pm_debug/count and PRCM registers dump

Quoted 4 lines

2) is OK, which means that the RET and OFF modes are correctly hit.

Can I conclude from 1) that the wake-up code is not running from the cache in RETention?

Quoted 8 lines

[Derrick, David]

To add some context to the wait_sdrc_ok function and why it was added:

wait_sdrc_ok was added because the DLL takes 500 L3 clock cycles to lock. So you do not want to go back to DDR before DLL is locked. Also, we found some times DLL never locked so we introduced the DLL kick procedure to force it to lock.

Ok thanks for the details.
Does that mean that it is unsafe to run the sleep code (in sleep34xx.S) from DDR?

Quoted 5 lines

Regards,
David

Regards,
Jean

#18 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

In reply to Derrick, David
Quoted 36 lines · David
Quoted 31 lines

-----Original Message-----
From: Jean Pihet [mailto:[email protected]]
Sent: Friday, November 19, 2010 9:37 AM

Quoted 13 lines · Jean Pihet
Quoted 12 lines · Tony Lindgren
Quoted 10 lines · Jean Pihet

On Thu, Nov 18, 2010 at 6:52 PM, Tony Lindgren <[email protected]> wrote:

About the DPLL lock:
1) wait_sdrc_ok is only called when back from the non-OFF modes,
2) I checked that when running wait_sdrc_ok the CORE is already out of idle and the DPLL is already locked. Note: l-o code has no support for the voltages OFF and the external clocks OFF.

What to conclude from 1) and 2)? In my test setup ot looks like wait_sdrc_ok is of no use, but I agree this a premature conclusion.

Quoted 7 lines
Quoted 3 lines

Yeah we should figure out in which cases wait_sdrc_ok is needed.

BTW, are you sure you're hitting core idle in your tests?

Yes it is OK from the console messages and the counters values in /debug/pm_debug/count.

Let me confirm asap with the PRCM registers dump.

Here is what I experimented:
1) added a cache flush (v7_flush_kern_cache_all) just before WFI, in all >cases,
2) checked the real state entered in low power mode from the console messages, the output of /debug/pm_debug/count and PRCM registers dump

Quoted 4 lines

2) is OK, which means that the RET and OFF modes are correctly hit.

Can I conclude from 1) that the wake-up code is not running from the cache in RETention?

Quoted 9 lines

[Derrick, David]

To add some context to the wait_sdrc_ok function and why it was added:

wait_sdrc_ok was added because the DLL takes 500 L3 clock cycles to lock. So you do not want to go back to DDR before DLL is locked. Also, we found some times DLL never locked so we introduced the DLL kick procedure to force it to lock.

The root cause for the DLL not locking has been found though and a workaround implemented. So it should work now :) That still leaves the 500 L3 cycle delay though.

Cheers,

Peter.

#19 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Quoted 41 lines · "Peter 'p2' De Schrijver" <[email protected]> writes:
Quoted 40 lines · David
Quoted 31 lines

-----Original Message-----
From: Jean Pihet [mailto:[email protected]]
Sent: Friday, November 19, 2010 9:37 AM

Quoted 13 lines · Jean Pihet
Quoted 12 lines · Tony Lindgren
Quoted 10 lines · Jean Pihet

On Thu, Nov 18, 2010 at 6:52 PM, Tony Lindgren <[email protected]> wrote:

About the DPLL lock:
1) wait_sdrc_ok is only called when back from the non-OFF modes,
2) I checked that when running wait_sdrc_ok the CORE is already out of idle and the DPLL is already locked. Note: l-o code has no support for the voltages OFF and the external clocks OFF.

What to conclude from 1) and 2)? In my test setup ot looks like wait_sdrc_ok is of no use, but I agree this a premature conclusion.

Quoted 7 lines
Quoted 3 lines

Yeah we should figure out in which cases wait_sdrc_ok is needed.

BTW, are you sure you're hitting core idle in your tests?

Yes it is OK from the console messages and the counters values in /debug/pm_debug/count.

Let me confirm asap with the PRCM registers dump.

Here is what I experimented:
1) added a cache flush (v7_flush_kern_cache_all) just before WFI, in all >cases,
2) checked the real state entered in low power mode from the console messages, the output of /debug/pm_debug/count and PRCM registers dump

Quoted 4 lines

2) is OK, which means that the RET and OFF modes are correctly hit.

Can I conclude from 1) that the wake-up code is not running from the cache in RETention?

[Derrick, David]

To add some context to the wait_sdrc_ok function and why it was added:

Quoted 8 lines
Quoted 5 lines

wait_sdrc_ok was added because the DLL takes 500 L3 clock cycles to lock. So you do not want to go back to DDR before DLL is locked. Also, we found some times DLL never locked so we introduced the DLL kick procedure to force it to lock.

The root cause for the DLL not locking has been found though and a workaround implemented. So it should work now :)

Is the workaround for this reflected in Nishanth's series?

Kevin

Quoted 6 lines

That still leaves the
500 L3 cycle delay though.

Cheers,

Peter.

author
#20 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Quoted 49 lines · Kevin Hilman
Quoted 47 lines · "Peter 'p2' De Schrijver" <[email protected]> writes:
Quoted 45 lines · David
Quoted 31 lines

-----Original Message-----
From: Jean Pihet [mailto:[email protected]]
Sent: Friday, November 19, 2010 9:37 AM

Quoted 13 lines · Jean Pihet
Quoted 12 lines · Tony Lindgren
Quoted 10 lines · Jean Pihet

On Thu, Nov 18, 2010 at 6:52 PM, Tony Lindgren <[email protected]> wrote:

About the DPLL lock:
1) wait_sdrc_ok is only called when back from the non-OFF modes,
2) I checked that when running wait_sdrc_ok the CORE is already out of idle and the DPLL is already locked. Note: l-o code has no support for the voltages OFF and the external clocks OFF.

What to conclude from 1) and 2)? In my test setup ot looks like wait_sdrc_ok is of no use, but I agree this a premature conclusion.

Quoted 7 lines
Quoted 3 lines

Yeah we should figure out in which cases wait_sdrc_ok is needed.

BTW, are you sure you're hitting core idle in your tests?

Yes it is OK from the console messages and the counters values in /debug/pm_debug/count.

Let me confirm asap with the PRCM registers dump.

Here is what I experimented:
1) added a cache flush (v7_flush_kern_cache_all) just before WFI, in all >cases,
2) checked the real state entered in low power mode from the console messages, the output of /debug/pm_debug/count and PRCM registers dump

Quoted 4 lines

2) is OK, which means that the RET and OFF modes are correctly hit.

Can I conclude from 1) that the wake-up code is not running from the cache in RETention?

[Derrick, David]

To add some context to the wait_sdrc_ok function and why it was added:

wait_sdrc_ok was added because the DLL takes 500 L3 clock cycles to lock. So you do not want to go back to DDR before DLL is locked. Also, we found some times DLL never locked so we introduced the DLL kick procedure to force it to lock.

Quoted 4 lines
Quoted 2 lines

The root cause for the DLL not locking has been found though and a workaround implemented. So it should work now :)

Is the workaround for this reflected in Nishanth's series?

Yes the patch is '[PATCH 02/13] OMAP3: PM: Errata i581 suppport: dll kick strategy'

Quoted 10 lines

Kevin

Quoted 6 lines

That still leaves the
500 L3 cycle delay though.

Cheers,

Peter.

#21 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

In reply to Kevin Hilman
Quoted 49 lines · ext Kevin Hilman
Quoted 47 lines · "Peter 'p2' De Schrijver" <[email protected]> writes:
Quoted 45 lines · David
Quoted 31 lines

-----Original Message-----
From: Jean Pihet [mailto:[email protected]]
Sent: Friday, November 19, 2010 9:37 AM

Quoted 13 lines · Jean Pihet
Quoted 12 lines · Tony Lindgren
Quoted 10 lines · Jean Pihet

On Thu, Nov 18, 2010 at 6:52 PM, Tony Lindgren <[email protected]> wrote:

About the DPLL lock:
1) wait_sdrc_ok is only called when back from the non-OFF modes,
2) I checked that when running wait_sdrc_ok the CORE is already out of idle and the DPLL is already locked. Note: l-o code has no support for the voltages OFF and the external clocks OFF.

What to conclude from 1) and 2)? In my test setup ot looks like wait_sdrc_ok is of no use, but I agree this a premature conclusion.

Quoted 7 lines
Quoted 3 lines

Yeah we should figure out in which cases wait_sdrc_ok is needed.

BTW, are you sure you're hitting core idle in your tests?

Yes it is OK from the console messages and the counters values in /debug/pm_debug/count.

Let me confirm asap with the PRCM registers dump.

Here is what I experimented:
1) added a cache flush (v7_flush_kern_cache_all) just before WFI, in all >cases,
2) checked the real state entered in low power mode from the console messages, the output of /debug/pm_debug/count and PRCM registers dump

Quoted 4 lines

2) is OK, which means that the RET and OFF modes are correctly hit.

Can I conclude from 1) that the wake-up code is not running from the cache in RETention?

[Derrick, David]

To add some context to the wait_sdrc_ok function and why it was added:

wait_sdrc_ok was added because the DLL takes 500 L3 clock cycles to lock. So you do not want to go back to DDR before DLL is locked. Also, we found some times DLL never locked so we introduced the DLL kick procedure to force it to lock.

Quoted 4 lines
Quoted 2 lines

The root cause for the DLL not locking has been found though and a workaround implemented. So it should work now :)

Is the workaround for this reflected in Nishanth's series?

No. It seems not. The workaround needs VDD2 voltage scaling which seems to be missing now from l-o ?

Cheers,

Peter.

#22 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Peter 'p2' De Schrijver had written, on 11/22/2010 10:22 AM, the following:
[...]

Quoted 6 lines
Quoted 3 lines
Quoted 2 lines

The root cause for the DLL not locking has been found though and a workaround implemented. So it should work now :)

Is the workaround for this reflected in Nishanth's series?

No. It seems not. The workaround needs VDD2 voltage scaling which seems to be missing now from l-o ?

yep, that is correct - we dont have dvfs/OPP/voltage scaling in kernel.org as of today - until we have those, it might not be possible to push the "real workaround". the mentioned patch is, as documented, support for the voltage workaround.

Signature · 2 lines
Regards,
Nishanth Menon
#23 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Quoted 6 lines · Nishanth Menon

Peter 'p2' De Schrijver had written, on 11/22/2010 10:22 AM, the following:
[...]

Quoted 4 lines
Quoted 3 lines
Quoted 2 lines

The root cause for the DLL not locking has been found though and a workaround implemented. So it should work now :)

Is the workaround for this reflected in Nishanth's series?

Quoted 7 lines
Quoted 2 lines

No. It seems not. The workaround needs VDD2 voltage scaling which seems to be missing now from l-o ?

yep, that is correct - we dont have dvfs/OPP/voltage scaling in kernel.org as of today - until we have those, it might not be possible to push the "real workaround". the mentioned patch is, as documented, support for the voltage workaround.

It would be worth noting other known issues that are not worked around in this series due to external dependencies.

Also, is the current SR/voltage series as proposed capable of handling the workaround for this fix?

Kevin

#24 lore raw

Re: [PATCH 1/2] OMAP3 PM: move omap3 sleep to ddr

Kevin Hilman had written, on 11/22/2010 12:23 PM, the following:

Quoted 9 lines
Quoted 7 lines · Nishanth Menon

Peter 'p2' De Schrijver had written, on 11/22/2010 10:22 AM, the following:
[...]

Quoted 5 lines
Quoted 3 lines
Quoted 2 lines

The root cause for the DLL not locking has been found though and a workaround implemented. So it should work now :)

Is the workaround for this reflected in Nishanth's series?

No. It seems not. The workaround needs VDD2 voltage scaling which seems to be missing now from l-o ?

Quoted 7 lines
Quoted 4 lines

yep, that is correct - we dont have dvfs/OPP/voltage scaling in kernel.org as of today - until we have those, it might not be possible to push the "real workaround". the mentioned patch is, as documented, support for the voltage workaround.

It would be worth noting other known issues that are not worked around in this series due to external dependencies.

I believe I have done that
http://marc.info/?l=linux-omap&m=129013172525234&w=2
"IMPORTANT: this is not a complete workaround implementation as recommended by the silicon errata. this is a support logic for detecting lockups and attempting to recover where possible and is known to provide stability in multiple platforms.
"

Quoted 3 lines

Also, is the current SR/voltage series as proposed capable of handling the workaround for this fix?

I believe a new series is due sometime- we should see if the required changes are part of that series.

Regards,
Nishanth Menon

author
#25 lore raw

PATCH 2/2 OMAP3: clean up ASM idle code

In reply to Jean Pihet

From: Vishwanath BS <[email protected]>

Clean up of the ASM code:
- reworked and simplified the execution paths, for better readability and to avoid duplication of code,
- reworked the comments for better readability,
- reworked the code formating and alignment,
- added comments for the i443 errata workarounds,
- replaced the cache flush code by a call to the kernel common code for ARMv7 (v7_flush_kern_cache_all), which is better maintained and so more mature,
- clean up of non used symbols.

Tested on Zoom3, OMAP3EVM, Beagleboard, n900
with full RET and OFF mode.

Heavily reworked from Vishwa's original patch.

---
 arch/arm/mach-omap2/control.h   |    2 +
 arch/arm/mach-omap2/pm.h        |    6 +-
 arch/arm/mach-omap2/pm34xx.c    |    4 +-
 arch/arm/mach-omap2/sleep34xx.S |  354 +++++++++++++++------------------------
 4 files changed, 143 insertions(+), 223 deletions(-)
arch/arm/mach-omap2/control.h +2 -0
index b6c6b7c..78f7f19 100644
@@ -270,6 +270,8 @@
 #define OMAP343X_SCRATCHPAD_ROM		(OMAP343X_CTRL_BASE + 0x860)
 #define OMAP343X_SCRATCHPAD		(OMAP343X_CTRL_BASE + 0x910)
 #define OMAP343X_SCRATCHPAD_ROM_OFFSET	0x19C
+#define OMAP343X_SCRATCHPAD_REGADDR(reg)	OMAP2_L4_IO_ADDRESS(\
+						OMAP343X_SCRATCHPAD + reg)
 
 /* AM35XX_CONTROL_IPSS_CLK_CTRL bits */
 #define AM35XX_USBOTG_VBUSP_CLK_SHIFT   0
arch/arm/mach-omap2/pm.h +2 -4
index 0d75bfd..9ff051d 100644
@@ -75,14 +75,12 @@ extern void omap24xx_idle_loop_suspend(void);
 
 extern void omap24xx_cpu_suspend(u32 dll_ctrl, void __iomem *sdrc_dlla_ctrl,
 					void __iomem *sdrc_power);
-extern void omap34xx_cpu_suspend(u32 *addr, int save_state);
+
+extern void omap34xx_save_cpu_context_wfi(u32 *addr, int save_state);
 extern void save_secure_ram_context(u32 *addr);
 extern void omap3_save_scratchpad_contents(void);
 
 extern unsigned int omap24xx_idle_loop_suspend_sz;
-extern unsigned int omap34xx_suspend_sz;
 extern unsigned int save_secure_ram_context_sz;
 extern unsigned int omap24xx_cpu_suspend_sz;
-extern unsigned int omap34xx_cpu_suspend_sz;
-
 #endif
arch/arm/mach-omap2/pm34xx.c +2 -2
index 035ca47..18ad1ed 100644
@@ -404,7 +404,7 @@ void omap_sram_idle(void)
 	/*
 	* On EMU/HS devices ROM code restores a SRDC value
 	* from scratchpad which has automatic self refresh on timeout
-	* of AUTO_CNT = 1 enabled. This takes care of errata 1.142.
+	* of AUTO_CNT = 1 enabled. This takes care of errata ID i443.
 	* Hence store/restore the SDRC_POWER register here.
 	*/
 	if (omap_rev() >= OMAP3430_REV_ES3_0 &&
@@ -417,7 +417,7 @@ void omap_sram_idle(void)
 	 * get saved. The restore path then reads from this
 	 * location and restores them back.
 	 */
-	omap34xx_cpu_suspend(omap3_arm_context, save_state);
+	omap34xx_save_cpu_context_wfi(omap3_arm_context, save_state);
 	cpu_init();
 
 	/* Restore normal SDRC POWER settings */
arch/arm/mach-omap2/sleep34xx.S +137 -217

467 lines not on this page · raw message

Signature · 1 line
1.7.2.3
maintainer
#26 lore raw

Re: [PATCH 2/2] OMAP3: clean up ASM idle code

Quoted 12 lines · Jean Pihet

From: Vishwanath BS <[email protected]>

Clean up of the ASM code:
- reworked and simplified the execution paths, for better readability and to avoid duplication of code,
- reworked the comments for better readability,
- reworked the code formating and alignment,
- added comments for the i443 errata workarounds,
- replaced the cache flush code by a call to the kernel common code for ARMv7 (v7_flush_kern_cache_all), which is better maintained and so more mature,
- clean up of non used symbols.

This should be broken into several patches.

The first patch should be to use v7_flush_kern_cache_all instead of the buggy older copy of that in sleep34xx.S.

After that, any readability and formatting patches should contain no functional changes.

Regards,

Tony

author
#27 lore raw

Re: [PATCH 2/2] OMAP3: clean up ASM idle code

Quoted 14 lines · Tony Lindgren
Quoted 12 lines · Jean Pihet

From: Vishwanath BS <[email protected]>

Clean up of the ASM code:
- reworked and simplified the execution paths, for better readability and to avoid duplication of code,
- reworked the comments for better readability,
- reworked the code formating and alignment,
- added comments for the i443 errata workarounds,
- replaced the cache flush code by a call to the kernel common code for ARMv7 (v7_flush_kern_cache_all), which is better maintained and so more mature,
- clean up of non used symbols.

Quoted 4 lines

This should be broken into several patches.

The first patch should be to use v7_flush_kern_cache_all instead of the buggy older copy of that in sleep34xx.S.

Agree

Quoted 3 lines

After that, any readability and formatting patches should contain no functional changes.

Will rework and repost once something goes out of the on-going discussions.

Quoted 5 lines

Regards,

Tony

Thanks,
Jean
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html