summaryrefslogtreecommitdiffstats
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.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c
index 544371e5a4..240cb63b7c 100644
--- a/firmware/target/arm/as3525/system-as3525.c
+++ b/firmware/target/arm/as3525/system-as3525.c
@@ -23,6 +23,7 @@
#include "kernel.h"
#include "system.h"
#include "panic.h"
+#include "as3525-codec.h"
#define default_interrupt(name) \
extern __attribute__((weak,alias("UIRQ"))) void name (void)
@@ -123,6 +124,7 @@ void fiq_handler(void)
);
}
+#ifdef BOOTLOADER
static void sdram_delay(void)
{
int delay = 1024; /* arbitrary */
@@ -192,9 +194,11 @@ static void sdram_init(void)
MPMC_DYNAMIC_CONFIG_0 |= (1<<19); /* buffer enable */
}
+#endif
void system_init(void)
{
+#ifdef BOOTLOADER
#if 0 /* the GPIO clock is already enabled by the dualboot function */
CGU_PERI |= CGU_GPIO_CLOCK_ENABLE;
#endif
@@ -235,6 +239,7 @@ void system_init(void)
/* enable VIC */
CGU_PERI |= CGU_VIC_CLOCK_ENABLE;
VIC_INT_SELECT = 0; /* only IRQ, no FIQ */
+#endif
}
void system_reboot(void)
@@ -246,3 +251,15 @@ int system_memory_guard(int newmode)
(void)newmode;
return 0;
}
+
+void power_off(void)
+{
+ int system;
+ system = as3525_codec_read(0x20);
+ system &= ~1; /* clear bit 0 of system register */
+ as3525_codec_write(0x20, system);
+
+ /* TODO : turn off peripherals properly ? */
+
+ while(1);
+}