1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dave Chapman 2009-10-04 16:08:33 +00:00
parent fbf034fcff
commit ad0a0569ea
2 changed files with 29 additions and 1 deletions

View file

@ -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);
}

View file

@ -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)