summaryrefslogtreecommitdiff
path: root/firmware/system.c
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-04-07 12:16:27 +0000
committerDave Chapman <dave@dchapman.com>2006-04-07 12:16:27 +0000
commit8204cd76a77d2ea06729661c04d439d3af5b75e4 (patch)
treed4a6f07b15d6f819148cce121640f73f945c24ec /firmware/system.c
parent24bb9d4ceb33a8844e4bd8395617439ef8ab60e2 (diff)
iPod: Enable dynamic CPU frequency changing on the 4G (both greyscale and colour) and the first generation mini
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9548 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/system.c')
-rw-r--r--firmware/system.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/firmware/system.c b/firmware/system.c
index efa0a06190..c957ad98b5 100644
--- a/firmware/system.c
+++ b/firmware/system.c
@@ -1224,11 +1224,27 @@ void set_cpu_frequency(long frequency)
/* Clock frequency = (24/8)*postmult */
outl(0xaa020000 | 8 | (postmult << 8), 0x60006034);
+
/* Wait for PLL relock? */
udelay(2000);
/* Select PLL as clock source? */
outl((inl(0x60006020) & 0x0fffff0f) | 0x20000070, 0x60006020);
+
+#if defined(IPOD_COLOR) || defined(IPOD_4G) || defined(IPOD_MINI)
+ /* We don't know why the timer interrupt gets disabled on the PP5020
+ based ipods, but without the following line, the 4Gs will freeze
+ when CPU frequency changing is enabled.
+
+ Note also that a simple "CPU_INT_EN = TIMER1_MASK;" (as used
+ elsewhere to enable interrupts) doesn't work, we need "|=".
+
+ It's not needed on the PP5021 and PP5022 ipods.
+ */
+
+ /* unmask interrupt source */
+ CPU_INT_EN |= TIMER1_MASK;
+#endif
}
#elif !defined(BOOTLOADER)
void ipod_set_cpu_frequency(void)