AT91: Fix power-saving in idle-mode on 926T processors
According to Atmel, their 926T processors (AT91 post RM9200) requires 'Wait for Interrupt' mode be entered right after disabling the processor clock in order to minimise current consumption when idle, so do both provided we're not running on a 920T (an RM9200).
Furthermore, get rid of the #ifndef CONFIG_DEBUG_KERNEL, since arch_idle() can be turned off completely with the kernel parameter 'nohlt'.
---
KernelVersion: 2.6.35
arch/arm/mach-at91/include/mach/system.h | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
arch/arm/mach-at91/include/mach/system.h +3 -4
@@ -28,17 +28,16 @@static inline void arch_idle (void ) { -#ifndef CONFIG_DEBUG_KERNEL /* * Disable the processor clock. The processor will be automatically * re-enabled by an interrupt or by a reset. */ at91_sys_write (AT91_PMC_SCDR ,AT91_PMC_PCK ); -#else +#ifndef CONFIG_CPU_ARM920T /* * Set the processor (CP15) into 'Wait for Interrupt' mode. -* Unlike disabling the processor clock via the PMC (above) -* this allows the processor to be woken via JTAG. +* Post-RM9200 processors need this in conjunction with the above +* to save power when idle. */ cpu_do_idle ();#endif
Signature · 1 line
1.7.0.4
Quoted 10 lines · Anders Larsen
According to Atmel, their 926T processors (AT91 post RM9200) requires 'Wait for Interrupt' mode be entered right after disabling the processor clock in order to minimise current consumption when idle, so do both provided we're not running on a 920T (an RM9200).
Furthermore, get rid of the #ifndef
CONFIG_DEBUG_KERNEL, sincearch_idle()can be turned off completely with the kernel parameter 'nohlt'.Signed-off-by Anders Larsen <[email protected]>Cc Andrew Victor <[email protected]>
please rebase against this branch
git://github.com/at91linux/linux-2.6-at91.git branch for-rmk
Best Regards,
J.
Russell,
Le 08/10/2010 14:29, Jean-Christophe PLAGNIOL-VILLARD :
Quoted 6 lines · Anders Larsen
Quoted 5 lines
According to Atmel, their 926T processors (AT91 post RM9200) requires 'Wait for Interrupt' mode be entered right after disabling the processor clock in order to minimise current consumption when idle, so do both provided we're not running on a 920T (an RM9200).
Quoted 8 lines
Quoted 5 lines
Furthermore, get rid of the #ifndef
CONFIG_DEBUG_KERNEL, sincearch_idle()can be turned off completely with the kernel parameter 'nohlt'.Signed-off-by Anders Larsen <[email protected]>Cc Andrew Victor <[email protected]>please rebase against this branch
git://github.com/at91linux/linux-2.6-at91.gitbranch for-rmk
This patch seems already in your "master" branch
(5c189208b606a85b4e97109af70d59f10a42fdfd).
Do you want me to rebase this patch or do you mange merging with "AT91:
fix use of clock disable on idle for AT91x40 devices" (cb809b1a5ebffca8cf0314b788919989e8e4ab5f) ?
already in your "devel" and "devel-stable" branches?
Best regards,
Signature · 1 line
Nicolas Ferre
Quoted 10 lines · Anders Larsen
According to Atmel, their 926T processors (AT91 post RM9200) requires 'Wait for Interrupt' mode be entered right after disabling the processor clock in order to minimise current consumption when idle, so do both provided we're not running on a 920T (an RM9200).
Furthermore, get rid of the #ifndef
CONFIG_DEBUG_KERNEL, sincearch_idle()can be turned off completely with the kernel parameter 'nohlt'.Signed-off-by Anders Larsen <[email protected]>Cc Andrew Victor <[email protected]>
Is there a known interaction with this and the JTAG controller? I haven't had time to look closer into it yet, but with this applied I can no longer access an Altera FPGA on a chain shared with a 9G45 through Quartus.
Quoted 22 lines
+++
b/arch/arm/mach-at91/include/mach/system.harch/arm/mach-at91/include/mach/system.h +0
-1@@ -28,17 +28,16 @@ ?static inline void arch_idle(void) ?{ -#ifndef CONFIG_DEBUG_KERNEL ? ? ? ?/*
? ? ? ? * Disable the processor clock. ?The processor will be automatically ? ? ? ? * re-enabled by an interrupt or by a reset.
? ? ? ? */
? ? ? ?at91_sys_write(AT91_PMC_SCDR,AT91_PMC_PCK);arch/arm/mach-at91/include/mach/system.h +1
-1-#else +#ifndef CONFIG_CPU_ARM920T ? ? ? ?/*
? ? ? ? * Set the processor (CP15) into 'Wait for Interrupt' mode.
- ? ? ? ?* Unlike disabling the processor clock via the PMC (above)
- ? ? ? ?* ?this allows the processor to be woken via JTAG.
+ ? ? ? ?* Post-RM9200 processors need this in conjunction with the above
+ ? ? ? ?* to save power when idle.
? ? ? ? */
? ? ? ?cpu_do_idle();
?#endif
Signature · 1 line
Bye, Peter Korsgaard
Hej Peter,
Quoted 7 lines · Peter Korsgaard
Quoted 4 lines · Anders Larsen
According to Atmel, their 926T processors (AT91 post RM9200) requires 'Wait for Interrupt' mode be entered right after disabling the processor clock in order to minimise current consumption when idle, so do both provided we're not running on a 920T (an RM9200).
Is there a known interaction with this and the JTAG controller?
indeed there is - disabling the processor clock blocks JTAG debugging.
Quoted 3 lines
I haven't had time to look closer into it yet, but with this applied I can no longer access an Altera FPGA on a chain shared with a 9G45 through Quartus.
If you boot with the kernel parameter "nohlt", arch_idle() is not called, and JTAG should work again (but of course power consumption will be substantially higher).
This was noted by Uwe Kleine-K?nig in https://lkml.org/lkml/2010/5/5/342
Cheers
Anders
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Anders" == Anders Larsen <[email protected]> writes:
Hi,
Quoted 1 line
Quoted 1 line
Is there a known interaction with this and the JTAG controller?
Anders> indeed there is - disabling the processor clock blocks JTAG debugging.
Ok - And apparently it completely blocks the JTAG controller, so you cannot even put it in bypass mode and access other devices on the same JTAG chain.
Quoted 3 lines
Quoted 3 lines
I haven't had time to look closer into it yet, but with this applied I can no longer access an Altera FPGA on a chain shared with a 9G45 through Quartus.
Anders> If you boot with the kernel parameter "nohlt", arch_idle() is Anders> not called, and JTAG should work again (but of course power Anders> consumption will be substantially higher).
Anders> This was noted by Uwe Kleine-K?nig in
Anders> https://lkml.org/lkml/2010/5/5/342
Thanks.
Signature · 1 line
Bye, Peter Korsgaard
Quoted 11 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Anders" == Anders Larsen <[email protected]> writes:
Hi,
Quoted 1 line
Quoted 1 line
Is there a known interaction with this and the JTAG controller?
Anders> indeed there is - disabling the processor clock blocks JTAG debugging.
Ok - And apparently it completely blocks the JTAG controller, so you cannot even put it in bypass mode and access other devices on the same JTAG chain.
This is a quite usual violation of ieee-1949.1-2001 (i.e. the jtag standard (don't know if there is a newer version?)). I really wonder why it's so hard to get this right. There is the availability of "compiliance-enable patterns" that allow to say: "My device is only jtaggable if this input is 1." Why not power the jtag block with such an input? Software doesn't need (and actually must not) have the ability to disable the jtag clock. Moreover this way the chip doesn't need any current to keep jtag on and still a developer needing jtag doesn't need to change any source code, but only needs a jumper on his devboard.
It could be so easy when all people knew what they do.
sigh
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |