imx233: implement core_sleep

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31443 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Amaury Pouly 2011-12-26 17:09:09 +00:00
parent 4e8320d2ec
commit 4fe6963e40
3 changed files with 13 additions and 1 deletions

View file

@ -98,6 +98,17 @@
#define HW_CLKCTRL_RESET_CHIP 0x2
#define HW_CLKCTRL_RESET_DIG 0x1
static inline void core_sleep(void)
{
__REG_SET(HW_CLKCTRL_CPU) = HW_CLKCTRL_CPU__INTERRUPT_WAIT;
asm volatile (
"mcr p15, 0, %0, c7, c0, 4 \n" /* Wait for interrupt */
"nop\n" /* Datasheet unclear: "The lr sent to handler points here after RTI"*/
: : "r"(0)
);
enable_irq();
}
enum imx233_clock_t
{
CLK_PIX, /* freq, div, frac, bypass, enable */

View file

@ -26,6 +26,7 @@
#include "panic.h"
#include "clock-target.h" /* CPUFREQ_* are defined here */
#include "clkctrl-imx233.h"
#include "power-imx233.h"
/* Digital control */

View file

@ -109,7 +109,7 @@ static inline void core_sleep(void)
}
#else
/* Skip this if special code is required and implemented */
#if !(defined(CPU_PP)) && CONFIG_CPU != RK27XX
#if !(defined(CPU_PP)) && CONFIG_CPU != RK27XX && CONFIG_CPU != IMX233
static inline void core_sleep(void)
{
/* TODO: core_sleep not implemented, battery life will be decreased */