summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/system-coldfire.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-03-17 23:47:38 +0000
committerJens Arnold <amiconn@rockbox.org>2008-03-17 23:47:38 +0000
commited3ff1b0b5122e898f7310a9b5ed112a22e2828c (patch)
tree10838a643bc95d0792e4bda21ad14a343b374751 /firmware/target/coldfire/system-coldfire.c
parent4071826c813f8e06e93e22049aee07ffc95c3460 (diff)
downloadrockbox-ed3ff1b0b5122e898f7310a9b5ed112a22e2828c.tar.gz
rockbox-ed3ff1b0b5122e898f7310a9b5ed112a22e2828c.zip
Various coldfire fixes: (1) iAudio Bootloader: Check the status of main & remote power button vs. the respective hold switch, and shut down when on hold. On X5/M5 this check is not strictly necessary for the main unit, but left there to keep things uniform. (2) M3: Stop reading the ADC properly before leaving the bootloader, on RoLo, and on reboot, to make it work reliably after those transitions. (3) Disable all interrupt sources on system init to avoid premature ISR calls after enabling interrupts in general. (4) iAudios: Proper implementation of ide_powered(), avoiding nasty HDD clicks in the bootloader when powering down, e.g. because of Hold. (5) Slight optimisations.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16689 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/coldfire/system-coldfire.c')
-rw-r--r--firmware/target/coldfire/system-coldfire.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/firmware/target/coldfire/system-coldfire.c b/firmware/target/coldfire/system-coldfire.c
index 97e9d35aaa..60f7ab12ad 100644
--- a/firmware/target/coldfire/system-coldfire.c
+++ b/firmware/target/coldfire/system-coldfire.c
@@ -18,6 +18,7 @@
18 ****************************************************************************/ 18 ****************************************************************************/
19#include <stdio.h> 19#include <stdio.h>
20#include "config.h" 20#include "config.h"
21#include "adc.h"
21#include "system.h" 22#include "system.h"
22#include "lcd.h" 23#include "lcd.h"
23#include "font.h" 24#include "font.h"
@@ -254,6 +255,16 @@ void system_init(void)
254 what'll be the most useful for most things which the main thread 255 what'll be the most useful for most things which the main thread
255 will do. */ 256 will do. */
256 coldfire_set_macsr(EMAC_FRACTIONAL | EMAC_SATURATE); 257 coldfire_set_macsr(EMAC_FRACTIONAL | EMAC_SATURATE);
258
259 IMR = 0x3ffff;
260 INTPRI1 = 0;
261 INTPRI2 = 0;
262 INTPRI3 = 0;
263 INTPRI4 = 0;
264 INTPRI5 = 0;
265 INTPRI6 = 0;
266 INTPRI7 = 0;
267 INTPRI8 = 0;
257 268
258 /* Set INTBASE and SPURVEC */ 269 /* Set INTBASE and SPURVEC */
259 INTBASE = 64; 270 INTBASE = 64;
@@ -268,6 +279,7 @@ void system_init(void)
268 279
269void system_reboot (void) 280void system_reboot (void)
270{ 281{
282 adc_close();
271 set_cpu_frequency(0); 283 set_cpu_frequency(0);
272 284
273 asm(" move.w #0x2700,%sr"); 285 asm(" move.w #0x2700,%sr");