From fefafebed6879d99af8fc5b885e79e8ee04e67a2 Mon Sep 17 00:00:00 2001 From: Jack Halpin Date: Tue, 12 Jan 2010 23:56:59 +0000 Subject: SansaAMS: Disable voltage scaling. Voltage scaling seems to be causing various problems mostly related to issues with the uSD cards. The increased runtime benefit only amounts to ~30 minutes as currently implemented so it seems prudent to disable it once again at this time. We still don't understand why the core voltage being lowered would impact the uSD card but in fact it does. The internal cards do not seem to have problems. I have simply #ifdef'd the voltage scaling code with HAVE_ADJUSTABLE_CPU_VOLTAGE so if you want to use voltage scaling simply define that and the voltage scaling code should run. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24217 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/as3525/ata_sd_as3525.c | 11 ++++++----- firmware/target/arm/as3525/system-as3525.c | 4 ++++ 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'firmware') diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c index 99bf668ec4..0afe735e53 100644 --- a/firmware/target/arm/as3525/ata_sd_as3525.c +++ b/firmware/target/arm/as3525/ata_sd_as3525.c @@ -854,7 +854,7 @@ void sd_enable(bool on) extern int buttonlight_is_on; #endif -#ifdef HAVE_HOTSWAP +#if defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE) static bool cpu_boosted = false; #endif @@ -880,23 +880,24 @@ void sd_enable(bool on) #endif /* HAVE_MULTIDRIVE */ sd_enabled = true; -#ifdef HAVE_HOTSWAP +#if defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE) if(card_detect_target()) /* If SD card present Boost cpu for voltage */ { cpu_boosted = true; cpu_boost(true); } -#endif +#endif /* defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE) */ } else { -#ifdef HAVE_HOTSWAP +#if defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE) if(cpu_boosted) { cpu_boost(false); cpu_boosted = false; } -#endif +#endif /* defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE) */ + sd_enabled = false; #ifdef HAVE_MULTIDRIVE diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c index 13b406a6b8..2e6b6d4085 100644 --- a/firmware/target/arm/as3525/system-as3525.c +++ b/firmware/target/arm/as3525/system-as3525.c @@ -369,12 +369,14 @@ void set_cpu_frequency(long frequency) { if(frequency == CPUFREQ_MAX) { +#ifdef HAVE_ADJUSTABLE_CPU_VOLTAGE /* Increasing frequency so boost voltage before change */ ascodec_write(AS3514_CVDD_DCDC3, (AS314_CP_DCDC3_SETTING | CVDD_1_20)); /* Some players run a bit low so use 1.175 volts instead of 1.20 */ /* Wait for voltage to be at least 1.175v before making fclk > 200 MHz */ while(adc_read(ADC_CVDD) < 470); /* 470 * .0025 = 1.175V */ +#endif /* HAVE_ADJUSTABLE_CPU_VOLTAGE */ asm volatile( "mrc p15, 0, r0, c1, c0 \n" @@ -399,8 +401,10 @@ void set_cpu_frequency(long frequency) "mcr p15, 0, r0, c1, c0 \n" : : : "r0" ); +#ifdef HAVE_ADJUSTABLE_CPU_VOLTAGE /* Decreasing frequency so reduce voltage after change */ ascodec_write(AS3514_CVDD_DCDC3, (AS314_CP_DCDC3_SETTING | CVDD_1_10)); +#endif /* HAVE_ADJUSTABLE_CPU_VOLTAGE */ cpu_frequency = CPUFREQ_NORMAL; } -- cgit v1.2.3