diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-11-05 11:34:57 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-11-05 11:34:57 +0000 |
commit | 747be871ba63c265743c138bc7157688aa8335c3 (patch) | |
tree | d9c3a4241fefe574e5747452257ad43122cb45b3 /firmware | |
parent | 72f98786a0b73722d2688c7509a1acc528b727af (diff) | |
download | rockbox-747be871ba63c265743c138bc7157688aa8335c3.tar.gz rockbox-747be871ba63c265743c138bc7157688aa8335c3.zip |
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
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/system.c | 12 |
1 files 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 */ | |||
451 | 451 | ||
452 | /* set cpu frequency to 11mhz (to prevent overheating) */ | 452 | /* set cpu frequency to 11mhz (to prevent overheating) */ |
453 | DCR = (DCR & ~0x01ff) | 1; | 453 | DCR = (DCR & ~0x01ff) | 1; |
454 | PLLCR = 0x00000000; | 454 | PLLCR = 0x10800000; |
455 | 455 | ||
456 | while (1) | 456 | while (1) |
457 | { | 457 | { |
458 | /* check for the ON button (and !hold) */ | 458 | /* check for the ON button (and !hold) */ |
459 | if ((GPIO1_READ & 0x22) == 0) | 459 | if ((GPIO1_READ & 0x22) == 0) |
460 | system_reboot(); | 460 | SYPCR = 0xc0; |
461 | /* Start watchdog timer with 512 cycles timeout. Don't service it. */ | ||
462 | |||
463 | /* We need a reset method that works in all cases. Calling system_reboot() | ||
464 | doesn't work when we're called from the debug interrupt, because then | ||
465 | the CPU is in emulator mode and the only ways leaving it are exexcuting | ||
466 | an rte instruction or performing a reset. Even disabling the breakpoint | ||
467 | logic and performing special rte magic doesn't make system_reboot() | ||
468 | reliable. The system restarts, but boot often fails with ata error -42. */ | ||
461 | } | 469 | } |
462 | } | 470 | } |
463 | 471 | ||