From cfb073c452c0218a82e23fb5f5f89043719f2c07 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 3 Oct 2005 09:24:36 +0000 Subject: 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 --- firmware/export/system.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'firmware/export/system.h') 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) static inline void invalidate_icache(void) { asm volatile ("move.l #0x01000000,%d0\n" - "movec.l %d0,%cacr\n" + "movec.l %d0,%cacr\n" "move.l #0x80000000,%d0\n" - "movec.l %d0,%cacr"); + "movec.l %d0,%cacr"); } - -#define CPUFREQ_DEFAULT CPU_FREQ -#define CPUFREQ_NORMAL 47980800 -#define CPUFREQ_MAX 119952000 + +#define CPUFREQ_DEFAULT_MULT 1 +#define CPUFREQ_DEFAULT (CPUFREQ_DEFAULT_MULT * CPU_FREQ) +#define CPUFREQ_NORMAL_MULT 4 +#define CPUFREQ_NORMAL (CPUFREQ_NORMAL_MULT * CPU_FREQ) +#define CPUFREQ_MAX_MULT 11 +#define CPUFREQ_MAX (CPUFREQ_MAX_MULT * CPU_FREQ) #elif CONFIG_CPU == TCC730 -- cgit v1.2.3