From 747be871ba63c265743c138bc7157688aa8335c3 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sat, 5 Nov 2005 11:34:57 +0000 Subject: System reboot from UIE() now works in all cases, even from a debug interrupt (memory guard). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7756 a1c6a512-1295-4272-9138-f99709370657 --- firmware/system.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/firmware/system.c b/firmware/system.c index 32ea3c0c03..d6b48247ea 100644 --- a/firmware/system.c +++ b/firmware/system.c @@ -451,13 +451,21 @@ void UIE (void) /* Unexpected Interrupt or Exception */ /* set cpu frequency to 11mhz (to prevent overheating) */ DCR = (DCR & ~0x01ff) | 1; - PLLCR = 0x00000000; + PLLCR = 0x10800000; while (1) { /* check for the ON button (and !hold) */ if ((GPIO1_READ & 0x22) == 0) - system_reboot(); + SYPCR = 0xc0; + /* Start watchdog timer with 512 cycles timeout. Don't service it. */ + + /* We need a reset method that works in all cases. Calling system_reboot() + doesn't work when we're called from the debug interrupt, because then + the CPU is in emulator mode and the only ways leaving it are exexcuting + an rte instruction or performing a reset. Even disabling the breakpoint + logic and performing special rte magic doesn't make system_reboot() + reliable. The system restarts, but boot often fails with ata error -42. */ } } -- cgit v1.2.3