1
0
Fork 0
forked from len0rd/rockbox

Implement frequency scaling on iPod 3Gs - FS #5686

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10313 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Ankers 2006-07-24 22:49:06 +00:00
parent a91cb24dec
commit 943ff8dc67
2 changed files with 34 additions and 1 deletions

View file

@ -98,7 +98,7 @@
#define CONFIG_LED LED_VIRTUAL
/* Define this if you have adjustable CPU frequency */
//#define HAVE_ADJUSTABLE_CPU_FREQ
#define HAVE_ADJUSTABLE_CPU_FREQ
#define BOOTFILE_EXT "ipod"
#define BOOTFILE "rockbox." BOOTFILE_EXT

View file

@ -1307,7 +1307,38 @@ static void ipod_init_cache(void)
outl(0x3, 0xcf004024);
}
#endif
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
void set_cpu_frequency(long frequency)
{
unsigned long postmult;
if (frequency == CPUFREQ_NORMAL)
postmult = CPUFREQ_NORMAL_MULT;
else if (frequency == CPUFREQ_MAX)
postmult = CPUFREQ_MAX_MULT;
else
postmult = CPUFREQ_DEFAULT_MULT;
cpu_frequency = frequency;
outl(0x02, 0xcf005008);
outl(0x55, 0xcf00500c);
outl(0x6000, 0xcf005010);
/* Clock frequency = (24/8)*postmult */
outl(8, 0xcf005018);
outl(postmult, 0xcf00501c);
outl(0xe000, 0xcf005010);
/* Wait for PLL relock? */
udelay(2000);
/* Select PLL as clock source? */
outl(0xa8, 0xcf00500c);
}
#elif !defined(BOOTLOADER)
static void ipod_set_cpu_speed(void)
{
outl(0x02, 0xcf005008);
@ -1340,7 +1371,9 @@ void system_init(void)
outl(-1, 0xcf00101c);
outl(-1, 0xcf001028);
outl(-1, 0xcf001038);
#ifndef HAVE_ADJUSTABLE_CPU_FREQ
ipod_set_cpu_speed();
#endif
ipod_init_cache();
#endif
}