summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2011-12-26 17:09:09 +0000
committerAmaury Pouly <pamaury@rockbox.org>2011-12-26 17:09:09 +0000
commit4fe6963e4044fd25e5c6b14dea31b0e0b60910c6 (patch)
tree16d8d6d36cd5d328af28a4452ce0d709386b0eec
parent4e8320d2ecc473d29da41f669b59c0ab463cb70a (diff)
downloadrockbox-4fe6963e4044fd25e5c6b14dea31b0e0b60910c6.tar.gz
rockbox-4fe6963e4044fd25e5c6b14dea31b0e0b60910c6.zip
imx233: implement core_sleep
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31443 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/imx233/clkctrl-imx233.h11
-rw-r--r--firmware/target/arm/imx233/system-target.h1
-rw-r--r--firmware/target/arm/thread-arm.c2
3 files changed, 13 insertions, 1 deletions
diff --git a/firmware/target/arm/imx233/clkctrl-imx233.h b/firmware/target/arm/imx233/clkctrl-imx233.h
index fc835c813a..8a52620f7e 100644
--- a/firmware/target/arm/imx233/clkctrl-imx233.h
+++ b/firmware/target/arm/imx233/clkctrl-imx233.h
@@ -98,6 +98,17 @@
98#define HW_CLKCTRL_RESET_CHIP 0x2 98#define HW_CLKCTRL_RESET_CHIP 0x2
99#define HW_CLKCTRL_RESET_DIG 0x1 99#define HW_CLKCTRL_RESET_DIG 0x1
100 100
101static inline void core_sleep(void)
102{
103 __REG_SET(HW_CLKCTRL_CPU) = HW_CLKCTRL_CPU__INTERRUPT_WAIT;
104 asm volatile (
105 "mcr p15, 0, %0, c7, c0, 4 \n" /* Wait for interrupt */
106 "nop\n" /* Datasheet unclear: "The lr sent to handler points here after RTI"*/
107 : : "r"(0)
108 );
109 enable_irq();
110}
111
101enum imx233_clock_t 112enum imx233_clock_t
102{ 113{
103 CLK_PIX, /* freq, div, frac, bypass, enable */ 114 CLK_PIX, /* freq, div, frac, bypass, enable */
diff --git a/firmware/target/arm/imx233/system-target.h b/firmware/target/arm/imx233/system-target.h
index 87063510ad..90a2966f2f 100644
--- a/firmware/target/arm/imx233/system-target.h
+++ b/firmware/target/arm/imx233/system-target.h
@@ -26,6 +26,7 @@
26#include "panic.h" 26#include "panic.h"
27 27
28#include "clock-target.h" /* CPUFREQ_* are defined here */ 28#include "clock-target.h" /* CPUFREQ_* are defined here */
29#include "clkctrl-imx233.h"
29#include "power-imx233.h" 30#include "power-imx233.h"
30 31
31/* Digital control */ 32/* Digital control */
diff --git a/firmware/target/arm/thread-arm.c b/firmware/target/arm/thread-arm.c
index 0b46ca2558..88dac2542a 100644
--- a/firmware/target/arm/thread-arm.c
+++ b/firmware/target/arm/thread-arm.c
@@ -109,7 +109,7 @@ static inline void core_sleep(void)
109} 109}
110#else 110#else
111/* Skip this if special code is required and implemented */ 111/* Skip this if special code is required and implemented */
112#if !(defined(CPU_PP)) && CONFIG_CPU != RK27XX 112#if !(defined(CPU_PP)) && CONFIG_CPU != RK27XX && CONFIG_CPU != IMX233
113static inline void core_sleep(void) 113static inline void core_sleep(void)
114{ 114{
115 /* TODO: core_sleep not implemented, battery life will be decreased */ 115 /* TODO: core_sleep not implemented, battery life will be decreased */