From c196da2ceeddfc03a42e6a620aa08e3f583c8f0d Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Sun, 5 Sep 2010 15:34:34 +0000 Subject: FS#11597 : decrease FCLK frequency when unboosted FCLK is unused because we use fastbus clocking: CPU clock = PCLK Base PCLK off PLLA and use the lowest frqeuency for FCLK (24MHz source, maximum divider) Save a bit of power, adjust Clipv1/e200v2/Fuzev1 current usage accordingly Note: the power saving (in mA) is a bit less on e200v2/Fuzev1 than on Clipv1 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28000 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/system-as3525.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'firmware/target/arm/as3525/system-as3525.c') diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c index 50ce697656..01534abb3c 100644 --- a/firmware/target/arm/as3525/system-as3525.c +++ b/firmware/target/arm/as3525/system-as3525.c @@ -262,11 +262,7 @@ void system_init(void) #endif AS3525_PCLK_SEL); -#if CONFIG_CPU == AS3525 - cpu_frequency = CPUFREQ_DEFAULT; /* fastbus */ -#else - cpu_frequency = CPUFREQ_MAX; -#endif + set_cpu_frequency(CPUFREQ_DEFAULT); #if 0 /* the GPIO clock is already enabled by the dualboot function */ CGU_PERI |= CGU_GPIO_CLOCK_ENABLE; @@ -367,16 +363,14 @@ void set_cpu_frequency(long frequency) while(adc_read(ADC_CVDD) < 470); /* 470 * .0025 = 1.175V */ #endif /* HAVE_ADJUSTABLE_CPU_VOLTAGE */ + CGU_PROC = ((AS3525_FCLK_POSTDIV << 4) | + (AS3525_FCLK_PREDIV << 2) | + AS3525_FCLK_SEL); + asm volatile( "mrc p15, 0, r0, c1, c0 \n" - -#ifdef ASYNCHRONOUS_BUS - "orr r0, r0, #3<<30 \n" /* asynchronous bus clocking */ -#else "bic r0, r0, #3<<30 \n" /* clear bus bits */ "orr r0, r0, #1<<30 \n" /* synchronous bus clocking */ -#endif - "mcr p15, 0, r0, c1, c0 \n" : : : "r0" ); @@ -390,6 +384,8 @@ void set_cpu_frequency(long frequency) "mcr p15, 0, r0, c1, c0 \n" : : : "r0" ); + /* FCLK is unused so put it to the lowest freq we can */ + CGU_PROC = ((0xf << 4) | (0x3 << 2) | AS3525_CLK_MAIN); #ifdef HAVE_ADJUSTABLE_CPU_VOLTAGE /* Decreasing frequency so reduce voltage after change */ -- cgit v1.2.3