diff options
author | Dave Chapman <dave@dchapman.com> | 2009-10-04 16:08:33 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2009-10-04 16:08:33 +0000 |
commit | ad0a0569ead50f8981bf8c8de6a938fd4559afbc (patch) | |
tree | e7d8d32f2d885ea7004c9d815a3c10370ac1530b /firmware | |
parent | fbf034fcff15bb972c94188d6f58b83fff4529d5 (diff) |
Another patch from FS#10633 by Michael Sparmann (with a couple of minor cosmetic tweaks by me) - cleanly unmount the flash when powering off or rebooting.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22920 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/arm/s5l8700/ipodnano2g/power-nano2g.c | 9 | ||||
-rw-r--r-- | firmware/target/arm/s5l8700/system-s5l8700.c | 21 |
2 files changed, 29 insertions, 1 deletions
diff --git a/firmware/target/arm/s5l8700/ipodnano2g/power-nano2g.c b/firmware/target/arm/s5l8700/ipodnano2g/power-nano2g.c index aa3367b941..fbd5157fb0 100644 --- a/firmware/target/arm/s5l8700/ipodnano2g/power-nano2g.c +++ b/firmware/target/arm/s5l8700/ipodnano2g/power-nano2g.c @@ -23,6 +23,10 @@ #include "inttypes.h" #include "s5l8700.h" #include "power.h" +#include "ftl-target.h" +#include <string.h> +#include "panic.h" + /* Power handling for S5L8700 based Meizu players @@ -32,7 +36,10 @@ void power_off(void) { - /* TODO */ + if (ftl_sync() != 0) panicf("Failed to unmount flash!"); + + /* TODO: Really power-off */ + panicf("Poweroff not implemented yet."); while(1); } diff --git a/firmware/target/arm/s5l8700/system-s5l8700.c b/firmware/target/arm/s5l8700/system-s5l8700.c index f04f2f92f2..070d3b9462 100644 --- a/firmware/target/arm/s5l8700/system-s5l8700.c +++ b/firmware/target/arm/s5l8700/system-s5l8700.c @@ -22,6 +22,9 @@ #include "kernel.h" #include "system.h" #include "panic.h" +#ifdef IPOD_NANO2G +#include "ftl-target.h" +#endif #define default_interrupt(name) \ extern __attribute__((weak,alias("UIRQ"))) void name (void) @@ -151,6 +154,24 @@ void system_init(void) void system_reboot(void) { +#ifdef IPODNANO2G + if (ftl_sync() != 0) panicf("Failed to unmount flash!"); + + /* Reset the SoC */ + asm volatile(" \ + msr CPSR_c, #0xd3 \ + mov r5, #0x110000 \ + add r5, r5, #0xff \ + add r6, r5, #0xa00 \ + mov r10, #0x3c800000 \ + str r6, [r10] \ + mov r6, #0xff0 \ + str r6, [r10,#4] \ + str r5, [r10]") + + /* Wait for reboot to kick in */ + while(1); +#endif } void system_exception_wait(void) |