summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Giacomelli <giac2000@hotmail.com>2016-03-27 22:46:53 +0200
committerMichael Giacomelli <giac2000@hotmail.com>2016-03-27 23:14:51 +0200
commit7be692e80612ce180d1dc4c796f6ee0586ec565a (patch)
treefdbadbf92805cebb557b080daba8e9b10b7264ee
parent775b21ebc45051b51851ee5ed6597c221ed9cede (diff)
downloadrockbox-7be692e80612ce180d1dc4c796f6ee0586ec565a.zip
rockbox-7be692e80612ce180d1dc4c796f6ee0586ec565a.tar.gz
rockbox-7be692e80612ce180d1dc4c796f6ee0586ec565a.tar.bz2
rockbox-7be692e80612ce180d1dc4c796f6ee0586ec565a.tar.xz
Enable voltage scaling on AMSv2.
Voltage is reduced when the CPU is unboosted, resulting in a large reduction in power consumption. In analogy with the AMSv1 voltage scaling code (currently disabled due to problems with SD cards), I have defined a config file option to enable/disable it. Change-Id: Ia89c31ec06dd012354b4d53435e7b5b36243b206
-rw-r--r--firmware/export/config/sansaclipplus.h3
-rw-r--r--firmware/export/config/sansaclipv2.h3
-rw-r--r--firmware/export/config/sansaclipzip.h3
-rw-r--r--firmware/export/config/sansafuzev2.h3
-rw-r--r--firmware/target/arm/as3525/system-as3525.c4
5 files changed, 14 insertions, 2 deletions
diff --git a/firmware/export/config/sansaclipplus.h b/firmware/export/config/sansaclipplus.h
index 6b84faa..faa2225 100644
--- a/firmware/export/config/sansaclipplus.h
+++ b/firmware/export/config/sansaclipplus.h
@@ -198,6 +198,9 @@
/* Define this if you have adjustable CPU frequency */
#define HAVE_ADJUSTABLE_CPU_FREQ
+/*define this to enable CPU voltage scaling on AMS devices*/
+#define HAVE_ADJUSTABLE_CPU_VOLTAGE
+
#define BOOTFILE_EXT "sansa"
#define BOOTFILE "rockbox." BOOTFILE_EXT
#define BOOTDIR "/.rockbox"
diff --git a/firmware/export/config/sansaclipv2.h b/firmware/export/config/sansaclipv2.h
index 5f6d195..301cfc8 100644
--- a/firmware/export/config/sansaclipv2.h
+++ b/firmware/export/config/sansaclipv2.h
@@ -194,6 +194,9 @@
/* Define this if you have adjustable CPU frequency */
#define HAVE_ADJUSTABLE_CPU_FREQ
+/*define this to enable CPU voltage scaling on AMS devices*/
+#define HAVE_ADJUSTABLE_CPU_VOLTAGE
+
#define BOOTFILE_EXT "sansa"
#define BOOTFILE "rockbox." BOOTFILE_EXT
#define BOOTDIR "/.rockbox"
diff --git a/firmware/export/config/sansaclipzip.h b/firmware/export/config/sansaclipzip.h
index b028dad..ea1c571 100644
--- a/firmware/export/config/sansaclipzip.h
+++ b/firmware/export/config/sansaclipzip.h
@@ -197,6 +197,9 @@
/* Define this if you have adjustable CPU frequency */
#define HAVE_ADJUSTABLE_CPU_FREQ
+/*define this to enable CPU voltage scaling on AMS devices*/
+#define HAVE_ADJUSTABLE_CPU_VOLTAGE
+
#define BOOTFILE_EXT "sansa"
#define BOOTFILE "rockbox." BOOTFILE_EXT
#define BOOTDIR "/.rockbox"
diff --git a/firmware/export/config/sansafuzev2.h b/firmware/export/config/sansafuzev2.h
index 3b4fb22..523a331 100644
--- a/firmware/export/config/sansafuzev2.h
+++ b/firmware/export/config/sansafuzev2.h
@@ -210,6 +210,9 @@
/* Define this if you have adjustable CPU frequency */
#define HAVE_ADJUSTABLE_CPU_FREQ
+/*define this to enable CPU voltage scaling on AMS devices*/
+#define HAVE_ADJUSTABLE_CPU_VOLTAGE
+
#define BOOTFILE_EXT "sansa"
#define BOOTFILE "rockbox." BOOTFILE_EXT
#define BOOTDIR "/.rockbox"
diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c
index 22aa90a..edd80f4 100644
--- a/firmware/target/arm/as3525/system-as3525.c
+++ b/firmware/target/arm/as3525/system-as3525.c
@@ -460,7 +460,7 @@ void set_cpu_frequency(long frequency)
{
if(frequency == CPUFREQ_MAX)
{
-#if 0
+#ifdef HAVE_ADJUSTABLE_CPU_VOLTAGE
/* Set CVDD1 power supply */
ascodec_write_pmu(0x17, 1, 0x80 | 47);
/* dely for voltage rising */
@@ -481,7 +481,7 @@ void set_cpu_frequency(long frequency)
cpu_frequency = CPUFREQ_NORMAL;
/* Set CVDD1 power supply */
-#if 0
+#ifdef HAVE_ADJUSTABLE_CPU_VOLTAGE
#ifdef SANSA_CLIPZIP
ascodec_write_pmu(0x17, 1, 0x80 | 19);
#else