summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525
diff options
context:
space:
mode:
authorJack Halpin <jack.halpin@gmail.com>2010-01-12 23:56:59 +0000
committerJack Halpin <jack.halpin@gmail.com>2010-01-12 23:56:59 +0000
commitfefafebed6879d99af8fc5b885e79e8ee04e67a2 (patch)
treecc204b2f814add5fca5aa1bfc48e67102bd496fb /firmware/target/arm/as3525
parent980c7089e84a8e1e84b9ebade91cb2a00baf75ff (diff)
downloadrockbox-fefafebed6879d99af8fc5b885e79e8ee04e67a2.tar.gz
rockbox-fefafebed6879d99af8fc5b885e79e8ee04e67a2.zip
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
Diffstat (limited to 'firmware/target/arm/as3525')
-rw-r--r--firmware/target/arm/as3525/ata_sd_as3525.c11
-rw-r--r--firmware/target/arm/as3525/system-as3525.c4
2 files changed, 10 insertions, 5 deletions
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)
854 extern int buttonlight_is_on; 854 extern int buttonlight_is_on;
855#endif 855#endif
856 856
857#ifdef HAVE_HOTSWAP 857#if defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE)
858 static bool cpu_boosted = false; 858 static bool cpu_boosted = false;
859#endif 859#endif
860 860
@@ -880,23 +880,24 @@ void sd_enable(bool on)
880#endif /* HAVE_MULTIDRIVE */ 880#endif /* HAVE_MULTIDRIVE */
881 sd_enabled = true; 881 sd_enabled = true;
882 882
883#ifdef HAVE_HOTSWAP 883#if defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE)
884 if(card_detect_target()) /* If SD card present Boost cpu for voltage */ 884 if(card_detect_target()) /* If SD card present Boost cpu for voltage */
885 { 885 {
886 cpu_boosted = true; 886 cpu_boosted = true;
887 cpu_boost(true); 887 cpu_boost(true);
888 } 888 }
889#endif 889#endif /* defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE) */
890 } 890 }
891 else 891 else
892 { 892 {
893#ifdef HAVE_HOTSWAP 893#if defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE)
894 if(cpu_boosted) 894 if(cpu_boosted)
895 { 895 {
896 cpu_boost(false); 896 cpu_boost(false);
897 cpu_boosted = false; 897 cpu_boosted = false;
898 } 898 }
899#endif 899#endif /* defined(HAVE_HOTSWAP) && defined (HAVE_ADJUSTABLE_CPU_VOLTAGE) */
900
900 sd_enabled = false; 901 sd_enabled = false;
901 902
902#ifdef HAVE_MULTIDRIVE 903#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)
369{ 369{
370 if(frequency == CPUFREQ_MAX) 370 if(frequency == CPUFREQ_MAX)
371 { 371 {
372#ifdef HAVE_ADJUSTABLE_CPU_VOLTAGE
372 /* Increasing frequency so boost voltage before change */ 373 /* Increasing frequency so boost voltage before change */
373 ascodec_write(AS3514_CVDD_DCDC3, (AS314_CP_DCDC3_SETTING | CVDD_1_20)); 374 ascodec_write(AS3514_CVDD_DCDC3, (AS314_CP_DCDC3_SETTING | CVDD_1_20));
374 375
375 /* Some players run a bit low so use 1.175 volts instead of 1.20 */ 376 /* Some players run a bit low so use 1.175 volts instead of 1.20 */
376 /* Wait for voltage to be at least 1.175v before making fclk > 200 MHz */ 377 /* Wait for voltage to be at least 1.175v before making fclk > 200 MHz */
377 while(adc_read(ADC_CVDD) < 470); /* 470 * .0025 = 1.175V */ 378 while(adc_read(ADC_CVDD) < 470); /* 470 * .0025 = 1.175V */
379#endif /* HAVE_ADJUSTABLE_CPU_VOLTAGE */
378 380
379 asm volatile( 381 asm volatile(
380 "mrc p15, 0, r0, c1, c0 \n" 382 "mrc p15, 0, r0, c1, c0 \n"
@@ -399,8 +401,10 @@ void set_cpu_frequency(long frequency)
399 "mcr p15, 0, r0, c1, c0 \n" 401 "mcr p15, 0, r0, c1, c0 \n"
400 : : : "r0" ); 402 : : : "r0" );
401 403
404#ifdef HAVE_ADJUSTABLE_CPU_VOLTAGE
402 /* Decreasing frequency so reduce voltage after change */ 405 /* Decreasing frequency so reduce voltage after change */
403 ascodec_write(AS3514_CVDD_DCDC3, (AS314_CP_DCDC3_SETTING | CVDD_1_10)); 406 ascodec_write(AS3514_CVDD_DCDC3, (AS314_CP_DCDC3_SETTING | CVDD_1_10));
407#endif /* HAVE_ADJUSTABLE_CPU_VOLTAGE */
404 408
405 cpu_frequency = CPUFREQ_NORMAL; 409 cpu_frequency = CPUFREQ_NORMAL;
406 } 410 }