1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Dave Chapman 2006-04-07 12:16:27 +00:00
parent 24bb9d4ceb
commit 8204cd76a7
4 changed files with 19 additions and 3 deletions

View file

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

View file

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

View file

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

View file

@ -1224,11 +1224,27 @@ void set_cpu_frequency(long frequency)
/* Clock frequency = (24/8)*postmult */ /* Clock frequency = (24/8)*postmult */
outl(0xaa020000 | 8 | (postmult << 8), 0x60006034); outl(0xaa020000 | 8 | (postmult << 8), 0x60006034);
/* Wait for PLL relock? */ /* Wait for PLL relock? */
udelay(2000); udelay(2000);
/* Select PLL as clock source? */ /* Select PLL as clock source? */
outl((inl(0x60006020) & 0x0fffff0f) | 0x20000070, 0x60006020); 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) #elif !defined(BOOTLOADER)
void ipod_set_cpu_frequency(void) void ipod_set_cpu_frequency(void)