summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233/system-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <pamaury@rockbox.org>2011-06-30 17:31:40 +0000
committerAmaury Pouly <pamaury@rockbox.org>2011-06-30 17:31:40 +0000
commit617d1e9f6b7969aff5e45746b9c5e3cee9ce2c45 (patch)
treebf2015d298c2b6bc80189d09b73426380e08451f /firmware/target/arm/imx233/system-imx233.c
parent4a04c47a97517930b29f00b9d7f4d157cb69fa9b (diff)
downloadrockbox-617d1e9f6b7969aff5e45746b9c5e3cee9ce2c45.tar.gz
rockbox-617d1e9f6b7969aff5e45746b9c5e3cee9ce2c45.tar.bz2
rockbox-617d1e9f6b7969aff5e45746b9c5e3cee9ce2c45.zip
imx233/fuze+: ssp, dma, mmc now work properly, partially implement cpu frequency changing, implement panic waiting
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30104 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx233/system-imx233.c')
-rw-r--r--firmware/target/arm/imx233/system-imx233.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/firmware/target/arm/imx233/system-imx233.c b/firmware/target/arm/imx233/system-imx233.c
index 9c843c48c1..6114ecca08 100644
--- a/firmware/target/arm/imx233/system-imx233.c
+++ b/firmware/target/arm/imx233/system-imx233.c
@@ -31,6 +31,7 @@
#include "ssp-imx233.h"
#include "lcd.h"
#include "backlight-target.h"
+#include "button-target.h"
#define default_interrupt(name) \
extern __attribute__((weak, alias("UIRQ"))) void name(void)
@@ -104,7 +105,13 @@ void system_reboot(void)
void system_exception_wait(void)
{
- /* what is this supposed to do ? */
+ /* make sure lcd and backlight are on */
+ _backlight_on();
+ _backlight_set_brightness(100);
+ /* wait until button release (if a button is pressed) */
+ while(button_read_device());
+ /* then wait until next button press */
+ while(!button_read_device());
}
void imx233_enable_interrupt(int src, bool enable)
@@ -177,3 +184,23 @@ void udelay(unsigned us)
while(!imx233_us_elapsed(ref, us));
}
+#ifdef HAVE_ADJUSTABLE_CPU_FREQ
+void set_cpu_frequency(long frequency)
+{
+ switch(frequency)
+ {
+ case IMX233_CPUFREQ_454_MHz:
+ /* clk_h@clk_p/3 */
+ imx233_set_clock_divisor(CLK_AHB, 3);
+ /* clk_p@ref_cpu/1*18/19 */
+ imx233_set_fractional_divisor(CLK_CPU, 19);
+ imx233_set_clock_divisor(CLK_CPU, 1);
+ /* ref_cpu@480 MHz
+ * clk_p@454.74 MHz
+ * clk_h@151.58 MHz */
+ break;
+ default:
+ break;
+ }
+}
+#endif