summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/system-coldfire.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/coldfire/system-coldfire.c')
-rw-r--r--firmware/target/coldfire/system-coldfire.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/firmware/target/coldfire/system-coldfire.c b/firmware/target/coldfire/system-coldfire.c
index e04255746f..c4651a3c80 100644
--- a/firmware/target/coldfire/system-coldfire.c
+++ b/firmware/target/coldfire/system-coldfire.c
@@ -177,16 +177,11 @@ static void system_display_exception_info(unsigned long format,
177 lcd_puts(0, 1, str); 177 lcd_puts(0, 1, str);
178 lcd_update(); 178 lcd_update();
179 179
180 /* set cpu frequency to 11mhz (to prevent overheating) */ 180 system_exception_wait();
181 DCR = (DCR & ~0x01ff) | 1;
182 PLLCR = EXCP_PLLCR;
183 181
184 while (1) 182 /* Start watchdog timer with 512 cycles timeout. Don't service it. */
185 { 183 SYPCR = 0xc0;
186 if ((EXCP_BUTTON_GPIO_READ & EXCP_BUTTON_MASK) == EXCP_BUTTON_VALUE) 184 while (1);
187 SYPCR = 0xc0;
188 /* Start watchdog timer with 512 cycles timeout. Don't service it. */
189 }
190 185
191 /* We need a reset method that works in all cases. Calling system_reboot() 186 /* We need a reset method that works in all cases. Calling system_reboot()
192 doesn't work when we're called from the debug interrupt, because then 187 doesn't work when we're called from the debug interrupt, because then
@@ -294,6 +289,14 @@ void system_reboot (void)
294 asm(" jmp (%a0)"); 289 asm(" jmp (%a0)");
295} 290}
296 291
292void system_exception_wait(void)
293{
294 /* set cpu frequency to 11mhz (to prevent overheating) */
295 DCR = (DCR & ~0x01ff) | 1;
296 PLLCR = EXCP_PLLCR;
297 while ((EXCP_BUTTON_GPIO_READ & EXCP_BUTTON_MASK) != EXCP_BUTTON_VALUE);
298}
299
297/* Utilise the breakpoint hardware to catch invalid memory accesses. */ 300/* Utilise the breakpoint hardware to catch invalid memory accesses. */
298int system_memory_guard(int newmode) 301int system_memory_guard(int newmode)
299{ 302{