Skip to content

Commit

Permalink
s5pv310: TMU: Fix levels for overclock kernels
Browse files Browse the repository at this point in the history
The TMU limiter was choosing frequencies two steps above the original design limits
due to L0 being 1.6 GHz instead of 1.2 GHz.  This fixes the limits.

Signed-off-by: Andrew Dodd <atd7@cornell.edu>
  • Loading branch information
Entropy512 committed Feb 16, 2012
1 parent e4e2387 commit 8081698
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions arch/arm/mach-s5pv310/tmu.c
Expand Up @@ -169,7 +169,7 @@ static int set_trip_temp = TEMP_TRIPPED_CELCIUS;
static int set_tq0_temp = TEMP_TQ0_CELCIUS;

static int set_sampling_rate;
static int set_cpu_level = 3;
static int set_cpu_level = 5;

static int __init tmu_test_param(char *str)
{
Expand Down Expand Up @@ -419,7 +419,7 @@ static void tmu_poll_testmode(void)

if (cur_temp >= set_thr_temp) { /* 85 */
tmu_info->ctz->data.tmu_flag = TMU_STATUS_THROTTLED;
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU, CPU_L2);
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU, CPU_L4);
cpufreq_limited_thr = 1;
if (tmu_tripped_cb(TMU_STATUS_THROTTLED) < 0)
pr_err("Error inform to battery driver !\n");
Expand All @@ -431,7 +431,7 @@ static void tmu_poll_testmode(void)

case TMU_STATUS_THROTTLED:
if (cur_temp >= set_thr_temp && !(cpufreq_limited_thr)) {
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU, CPU_L2);
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU, CPU_L4);
cpufreq_limited_thr = 1;
if (tmu_tripped_cb(TMU_STATUS_THROTTLED) < 0)
pr_err("Error inform to battery driver !\n");
Expand All @@ -451,12 +451,12 @@ static void tmu_poll_testmode(void)
tmu_info->ctz->data.tmu_flag = TMU_STATUS_WARNING;
s5pv310_cpufreq_upper_limit_free(DVFS_LOCK_ID_TMU);
cpufreq_limited_thr = 0;
if (set_cpu_level == 3)
if (set_cpu_level == 5)
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU,
CPU_L3); /* CPU_L3 */
CPU_L5); /* CPU_L5 */
else
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU,
CPU_L4); /* CPU_L4 */
CPU_L6); /* CPU_L6 */

cpufreq_limited_warn = 1;
if (tmu_tripped_cb(TMU_STATUS_WARNING) < 0)
Expand All @@ -471,12 +471,12 @@ static void tmu_poll_testmode(void)
if (cur_temp >= set_warn_temp && !(cpufreq_limited_warn)) { /* 100 */
s5pv310_cpufreq_upper_limit_free(DVFS_LOCK_ID_TMU);
cpufreq_limited_thr = 0;
if (set_cpu_level == 3)
if (set_cpu_level == 5)
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU,
CPU_L3); /* CPU_L3 */
CPU_L5); /* CPU_L5 */
else
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU,
CPU_L4); /* CPU_L4 */
CPU_L6); /* CPU_L6 */

cpufreq_limited_warn = 1;
if (tmu_tripped_cb(TMU_STATUS_WARNING) < 0)
Expand All @@ -491,7 +491,7 @@ static void tmu_poll_testmode(void)
s5pv310_cpufreq_upper_limit_free(DVFS_LOCK_ID_TMU);
cpufreq_limited_warn = 0;
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU,
CPU_L2); /* CPU_L2 */
CPU_L4); /* CPU_L2 */
cpufreq_limited_thr = 1;
if (tmu_tripped_cb(TMU_STATUS_THROTTLED) < 0)
pr_err("Error inform to battery driver !\n");
Expand Down Expand Up @@ -626,7 +626,7 @@ static void tmu_poll_timer(struct work_struct *work)
}
if (cur_temp >= TEMP_TROTTLED_CELCIUS) { /* 87 */
tmu_info->ctz->data.tmu_flag = TMU_STATUS_THROTTLED;
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU, CPU_L2);
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU, CPU_L4);
cpufreq_limited_thr = 1;
if (tmu_tripped_cb(TMU_STATUS_THROTTLED) < 0)
pr_err("Error inform to battery driver !\n");
Expand All @@ -639,7 +639,7 @@ static void tmu_poll_timer(struct work_struct *work)
case TMU_STATUS_THROTTLED:
if (cur_temp >= TEMP_TROTTLED_CELCIUS &&
!(cpufreq_limited_thr)) {
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU, CPU_L2);
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU, CPU_L4);
cpufreq_limited_thr = 1;
if (tmu_tripped_cb(TMU_STATUS_THROTTLED) < 0)
pr_err("Error inform to battery driver !\n");
Expand All @@ -658,7 +658,7 @@ static void tmu_poll_timer(struct work_struct *work)
tmu_info->ctz->data.tmu_flag = TMU_STATUS_WARNING;
s5pv310_cpufreq_upper_limit_free(DVFS_LOCK_ID_TMU);
cpufreq_limited_thr = 0;
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU, CPU_L4); /* CPU_L4 */
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU, CPU_L6); /* CPU_L6 */
cpufreq_limited_warn = 1;
if (tmu_tripped_cb(TMU_STATUS_WARNING) < 0)
pr_err("Error inform to battery driver !\n");
Expand All @@ -673,7 +673,7 @@ static void tmu_poll_timer(struct work_struct *work)
!(cpufreq_limited_warn)) { /* 103 */
s5pv310_cpufreq_upper_limit_free(DVFS_LOCK_ID_TMU);
cpufreq_limited_thr = 0;
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU, CPU_L4);
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU, CPU_L6);

cpufreq_limited_warn = 1;
if (tmu_tripped_cb(TMU_STATUS_WARNING) < 0)
Expand All @@ -685,7 +685,7 @@ static void tmu_poll_timer(struct work_struct *work)
tmu_info->ctz->data.tmu_flag = TMU_STATUS_THROTTLED;
s5pv310_cpufreq_upper_limit_free(DVFS_LOCK_ID_TMU);
cpufreq_limited_warn = 0;
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU, CPU_L2);
s5pv310_cpufreq_upper_limit(DVFS_LOCK_ID_TMU, CPU_L4);
cpufreq_limited_thr = 1;
if (tmu_tripped_cb(TMU_STATUS_THROTTLED) < 0)
pr_err("Error inform to battery driver !\n");
Expand Down

0 comments on commit 8081698

Please sign in to comment.