From: Haavard Skinnemoen Date: Mon, 4 Dec 2006 11:01:36 +0000 (+0100) Subject: [AVR32] Put the chip in "stop" mode when halting the system X-Git-Tag: v2.6.20-rc1~146^2~13^2~4 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2eb5090ee531a50533ba9e739071c21f98a5a77;p=linux-2.6 [AVR32] Put the chip in "stop" mode when halting the system Make machine_halt() execute a sleep instruction to put the chip in "stop" mode when the system is halted. This switches off all clocks except the 32 kHz oscillator, which is needed for the RTC to keep ticking. Signed-off-by: Haavard Skinnemoen --- diff --git a/arch/avr32/kernel/process.c b/arch/avr32/kernel/process.c index 317dc50945..0b4325946a 100644 --- a/arch/avr32/kernel/process.c +++ b/arch/avr32/kernel/process.c @@ -38,6 +38,13 @@ void cpu_idle(void) void machine_halt(void) { + /* + * Enter Stop mode. The 32 kHz oscillator will keep running so + * the RTC will keep the time properly and the system will + * boot quickly. + */ + asm volatile("sleep 3\n\t" + "sub pc, -2"); } void machine_power_off(void)