summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/export/config-ipod3g.h2
-rw-r--r--firmware/system.c33
2 files changed, 34 insertions, 1 deletions
diff --git a/firmware/export/config-ipod3g.h b/firmware/export/config-ipod3g.h
index b3b5d14e85..d0d2d0664c 100644
--- a/firmware/export/config-ipod3g.h
+++ b/firmware/export/config-ipod3g.h
@@ -98,7 +98,7 @@
98#define CONFIG_LED LED_VIRTUAL 98#define CONFIG_LED LED_VIRTUAL
99 99
100/* Define this if you have adjustable CPU frequency */ 100/* Define this if you have adjustable CPU frequency */
101//#define HAVE_ADJUSTABLE_CPU_FREQ 101#define HAVE_ADJUSTABLE_CPU_FREQ
102 102
103#define BOOTFILE_EXT "ipod" 103#define BOOTFILE_EXT "ipod"
104#define BOOTFILE "rockbox." BOOTFILE_EXT 104#define BOOTFILE "rockbox." BOOTFILE_EXT
diff --git a/firmware/system.c b/firmware/system.c
index 846a4434f7..1874c0480e 100644
--- a/firmware/system.c
+++ b/firmware/system.c
@@ -1307,7 +1307,38 @@ static void ipod_init_cache(void)
1307 1307
1308 outl(0x3, 0xcf004024); 1308 outl(0x3, 0xcf004024);
1309} 1309}
1310#endif
1311
1312#ifdef HAVE_ADJUSTABLE_CPU_FREQ
1313void set_cpu_frequency(long frequency)
1314{
1315 unsigned long postmult;
1316
1317 if (frequency == CPUFREQ_NORMAL)
1318 postmult = CPUFREQ_NORMAL_MULT;
1319 else if (frequency == CPUFREQ_MAX)
1320 postmult = CPUFREQ_MAX_MULT;
1321 else
1322 postmult = CPUFREQ_DEFAULT_MULT;
1323 cpu_frequency = frequency;
1310 1324
1325 outl(0x02, 0xcf005008);
1326 outl(0x55, 0xcf00500c);
1327 outl(0x6000, 0xcf005010);
1328
1329 /* Clock frequency = (24/8)*postmult */
1330 outl(8, 0xcf005018);
1331 outl(postmult, 0xcf00501c);
1332
1333 outl(0xe000, 0xcf005010);
1334
1335 /* Wait for PLL relock? */
1336 udelay(2000);
1337
1338 /* Select PLL as clock source? */
1339 outl(0xa8, 0xcf00500c);
1340}
1341#elif !defined(BOOTLOADER)
1311static void ipod_set_cpu_speed(void) 1342static void ipod_set_cpu_speed(void)
1312{ 1343{
1313 outl(0x02, 0xcf005008); 1344 outl(0x02, 0xcf005008);
@@ -1340,7 +1371,9 @@ void system_init(void)
1340 outl(-1, 0xcf00101c); 1371 outl(-1, 0xcf00101c);
1341 outl(-1, 0xcf001028); 1372 outl(-1, 0xcf001028);
1342 outl(-1, 0xcf001038); 1373 outl(-1, 0xcf001038);
1374#ifndef HAVE_ADJUSTABLE_CPU_FREQ
1343 ipod_set_cpu_speed(); 1375 ipod_set_cpu_speed();
1376#endif
1344 ipod_init_cache(); 1377 ipod_init_cache();
1345#endif 1378#endif
1346} 1379}