From aef27e1f0c69516bbcf13d7986e204502d708ec4 Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Sun, 9 Nov 2008 06:17:21 +0000 Subject: 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 --- firmware/target/arm/as3525/system-as3525.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'firmware/target/arm/as3525/system-as3525.c') 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); +} -- cgit v1.2.3