summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/system-as3525.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525/system-as3525.c')
-rw-r--r--firmware/target/arm/as3525/system-as3525.c15
1 files changed, 12 insertions, 3 deletions
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 @@
27#include "dma-target.h" 27#include "dma-target.h"
28#include "clock-target.h" 28#include "clock-target.h"
29#include "fmradio_i2c.h" 29#include "fmradio_i2c.h"
30#include "button-target.h"
30 31
31#define default_interrupt(name) \ 32#define default_interrupt(name) \
32 extern __attribute__((weak,alias("UIRQ"))) void name (void) 33 extern __attribute__((weak,alias("UIRQ"))) void name (void)
@@ -217,8 +218,14 @@ static void sdram_init(void)
217 218
218void system_init(void) 219void system_init(void)
219{ 220{
221 unsigned int reset_loops = 640;
222
223 CCU_SRC = 0x1fffff0
224 & ~(1<<18); /* FIXME */
225 while(reset_loops--)
226 CCU_SRL = CCU_SRL_MAGIC_NUMBER;
227 CCU_SRC = CCU_SRL = 0;
220 228
221#ifdef BOOTLOADER /* TODO: makes this work in the main build */
222 CGU_PROC = 0; /* fclk 24 MHz */ 229 CGU_PROC = 0; /* fclk 24 MHz */
223 CGU_PERI &= ~0x7f; /* pclk 24 MHz */ 230 CGU_PERI &= ~0x7f; /* pclk 24 MHz */
224 231
@@ -248,6 +255,7 @@ void system_init(void)
248 "mcr p15, 0, r0, c1, c0 \n" 255 "mcr p15, 0, r0, c1, c0 \n"
249 : : : "r0" ); 256 : : : "r0" );
250 257
258#ifdef BOOTLOADER
251 sdram_init(); 259 sdram_init();
252#endif /* BOOTLOADER */ 260#endif /* BOOTLOADER */
253 261
@@ -262,10 +270,11 @@ void system_init(void)
262 270
263 dma_init(); 271 dma_init();
264 272
273 ascodec_init();
274
265#ifndef BOOTLOADER 275#ifndef BOOTLOADER
266 /* Disable fast hardware power-off, to use power button normally 276 /* Disable fast hardware power-off, to use power button normally
267 * We don't need the power button in the bootloader. */ 277 * We don't need the power button in the bootloader. */
268 ascodec_init();
269 ascodec_write(AS3514_CVDD_DCDC3, ascodec_read(AS3514_CVDD_DCDC3) & (1<<2)); 278 ascodec_write(AS3514_CVDD_DCDC3, ascodec_read(AS3514_CVDD_DCDC3) & (1<<2));
270 279
271#ifdef CONFIG_TUNER 280#ifdef CONFIG_TUNER
@@ -289,7 +298,7 @@ void system_reboot(void)
289 298
290void system_exception_wait(void) 299void system_exception_wait(void)
291{ 300{
292 while (1); 301 while(!button_read_device());
293} 302}
294 303
295int system_memory_guard(int newmode) 304int system_memory_guard(int newmode)