summaryrefslogtreecommitdiff
path: root/firmware/export
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-10-03 09:24:36 +0000
committerJens Arnold <amiconn@rockbox.org>2005-10-03 09:24:36 +0000
commitcfb073c452c0218a82e23fb5f5f89043719f2c07 (patch)
tree5aff8555b218e10037c086aaad3aaec1b4d677c8 /firmware/export
parent7190cf2ed9cfa854d81e7bf9c0e8a1ef71935c1f (diff)
downloadrockbox-cfb073c452c0218a82e23fb5f5f89043719f2c07.tar.gz
rockbox-cfb073c452c0218a82e23fb5f5f89043719f2c07.zip
Coldfire: New timer handling on CPU frequency change, adjusting the prescaler on the fly, for both tick and user timer. Precondition is that the higher frequencies are integer multiples of the base: now NORMAL is 45 MHz and MAX is 124 MHz. Removes the need for applications with longer timer periods (>= 10 ms) to boost the CPU all the time, e.g. the grayscale lib. Timer counts are now always based on the base frequency (CPU_FREQ). * Adjusted the RAM refresh timers to the new frequencies (all frequencies for H100) * All: Fixed the tick timer count being off by one.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7576 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export')
-rw-r--r--firmware/export/system.h15
-rw-r--r--firmware/export/timer.h3
2 files changed, 12 insertions, 6 deletions
diff --git a/firmware/export/system.h b/firmware/export/system.h
index 58e6570d3a..c2246e1e70 100644
--- a/firmware/export/system.h
+++ b/firmware/export/system.h
@@ -257,14 +257,17 @@ static inline unsigned long SWAB32(unsigned long value)
257static inline void invalidate_icache(void) 257static inline void invalidate_icache(void)
258{ 258{
259 asm volatile ("move.l #0x01000000,%d0\n" 259 asm volatile ("move.l #0x01000000,%d0\n"
260 "movec.l %d0,%cacr\n" 260 "movec.l %d0,%cacr\n"
261 "move.l #0x80000000,%d0\n" 261 "move.l #0x80000000,%d0\n"
262 "movec.l %d0,%cacr"); 262 "movec.l %d0,%cacr");
263} 263}
264 264
265#define CPUFREQ_DEFAULT CPU_FREQ 265#define CPUFREQ_DEFAULT_MULT 1
266#define CPUFREQ_NORMAL 47980800 266#define CPUFREQ_DEFAULT (CPUFREQ_DEFAULT_MULT * CPU_FREQ)
267#define CPUFREQ_MAX 119952000 267#define CPUFREQ_NORMAL_MULT 4
268#define CPUFREQ_NORMAL (CPUFREQ_NORMAL_MULT * CPU_FREQ)
269#define CPUFREQ_MAX_MULT 11
270#define CPUFREQ_MAX (CPUFREQ_MAX_MULT * CPU_FREQ)
268 271
269#elif CONFIG_CPU == TCC730 272#elif CONFIG_CPU == TCC730
270 273
diff --git a/firmware/export/timer.h b/firmware/export/timer.h
index 73936ca28c..afd60ac66c 100644
--- a/firmware/export/timer.h
+++ b/firmware/export/timer.h
@@ -28,6 +28,9 @@
28bool timer_register(int reg_prio, void (*unregister_callback)(void), 28bool timer_register(int reg_prio, void (*unregister_callback)(void),
29 long cycles, int int_prio, void (*timer_callback)(void)); 29 long cycles, int int_prio, void (*timer_callback)(void));
30bool timer_set_period(long cycles); 30bool timer_set_period(long cycles);
31#ifdef CPU_COLDFIRE
32void timers_adjust_prescale(int multiplier, bool enable_irq);
33#endif
31void timer_unregister(void); 34void timer_unregister(void);
32 35
33#endif /* !SIMULATOR */ 36#endif /* !SIMULATOR */