summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/clkctrl-imx233.h
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 /firmware/target/arm/imx233/clkctrl-imx233.h
parent4e8320d2ecc473d29da41f669b59c0ab463cb70a (diff)
downloadrockbox-4fe6963e4044fd25e5c6b14dea31b0e0b60910c6.tar.gz
rockbox-4fe6963e4044fd25e5c6b14dea31b0e0b60910c6.tar.bz2
rockbox-4fe6963e4044fd25e5c6b14dea31b0e0b60910c6.zip
imx233: implement core_sleep
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31443 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx233/clkctrl-imx233.h')
-rw-r--r--firmware/target/arm/imx233/clkctrl-imx233.h11
1 files changed, 11 insertions, 0 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 @@
#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 */