summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/as3525/system-as3525.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2008-11-09 06:17:21 +0000
committerRafaël Carré <rafael.carre@gmail.com>2008-11-09 06:17:21 +0000
commitaef27e1f0c69516bbcf13d7986e204502d708ec4 (patch)
tree127bc7a9a71e8856247a6ea52805c1666a92c26c /firmware/target/arm/as3525/system-as3525.c
parent308f21dc68ca1387c7003e9d185b717af7d575bf (diff)
downloadrockbox-aef27e1f0c69516bbcf13d7986e204502d708ec4.tar.gz
rockbox-aef27e1f0c69516bbcf13d7986e204502d708ec4.zip
Sansav2 Bootloader
Adds read-only SD driver, largely copied from ata-sd-pp.c Only tested on the embedded SD, on the Clip First steps to build a Normal firmware git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19045 a1c6a512-1295-4272-9138-f99709370657
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);
+}