summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Wenger <domonoky@googlemail.com>2009-04-07 16:14:01 +0000
committerDominik Wenger <domonoky@googlemail.com>2009-04-07 16:14:01 +0000
commitf5c5983c73167aab8dde6360237322e2ba529cb5 (patch)
tree7979084b23ea9313e4a11e230d757ce8f5e1178a
parent2f973487dc6da51a691a08dd07d9defdee06d2a4 (diff)
downloadrockbox-f5c5983c73167aab8dde6360237322e2ba529cb5.tar.gz
rockbox-f5c5983c73167aab8dde6360237322e2ba529cb5.tar.bz2
rockbox-f5c5983c73167aab8dde6360237322e2ba529cb5.zip
commit FS#10092 (cleanup AMS system init) by Rafaël Carré.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20640 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--bootloader/sansa_as3525.c2
-rw-r--r--firmware/target/arm/as3525/system-as3525.c15
2 files changed, 12 insertions, 5 deletions
diff --git a/bootloader/sansa_as3525.c b/bootloader/sansa_as3525.c
index 4537c4b43f..02f040aaa3 100644
--- a/bootloader/sansa_as3525.c
+++ b/bootloader/sansa_as3525.c
@@ -29,7 +29,6 @@
#include "lcd.h"
#include "backlight-target.h"
#include "button-target.h"
-#include "ascodec-target.h"
#include "common.h"
#include "storage.h"
#include "disk.h"
@@ -53,7 +52,6 @@ void main(void)
lcd_init();
show_logo();
- ascodec_init(); /* Required for backlight on e200v2 */
_backlight_on();
button_init_device();
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c
index 7af38ff9d1..a5f34d9b80 100644
--- a/firmware/target/arm/as3525/system-as3525.c
+++ b/firmware/target/arm/as3525/system-as3525.c
@@ -27,6 +27,7 @@
#include "dma-target.h"
#include "clock-target.h"
#include "fmradio_i2c.h"
+#include "button-target.h"
#define default_interrupt(name) \
extern __attribute__((weak,alias("UIRQ"))) void name (void)
@@ -217,8 +218,14 @@ static void sdram_init(void)
void system_init(void)
{
+ unsigned int reset_loops = 640;
+
+ CCU_SRC = 0x1fffff0
+ & ~(1<<18); /* FIXME */
+ while(reset_loops--)
+ CCU_SRL = CCU_SRL_MAGIC_NUMBER;
+ CCU_SRC = CCU_SRL = 0;
-#ifdef BOOTLOADER /* TODO: makes this work in the main build */
CGU_PROC = 0; /* fclk 24 MHz */
CGU_PERI &= ~0x7f; /* pclk 24 MHz */
@@ -248,6 +255,7 @@ void system_init(void)
"mcr p15, 0, r0, c1, c0 \n"
: : : "r0" );
+#ifdef BOOTLOADER
sdram_init();
#endif /* BOOTLOADER */
@@ -262,10 +270,11 @@ void system_init(void)
dma_init();
+ ascodec_init();
+
#ifndef BOOTLOADER
/* Disable fast hardware power-off, to use power button normally
* We don't need the power button in the bootloader. */
- ascodec_init();
ascodec_write(AS3514_CVDD_DCDC3, ascodec_read(AS3514_CVDD_DCDC3) & (1<<2));
#ifdef CONFIG_TUNER
@@ -289,7 +298,7 @@ void system_reboot(void)
void system_exception_wait(void)
{
- while (1);
+ while(!button_read_device());
}
int system_memory_guard(int newmode)