diff options
author | Sebastien Sabatier <s-sabatier1@ti.com> | 2012-03-28 17:14:57 +0200 |
---|---|---|
committer | Ziyann <jaraidaniel@gmail.com> | 2014-10-01 12:57:42 +0200 |
commit | dcd3ebeaa4390fba7bdee133ef9897d26a0a8ab8 (patch) | |
tree | 95b71d1ed41334eb818f1c25b726d98381393289 | |
parent | df05efdc59ac14fb4de1e4c7f366618e145ee951 (diff) | |
download | kernel_samsung_tuna-dcd3ebeaa4390fba7bdee133ef9897d26a0a8ab8.zip kernel_samsung_tuna-dcd3ebeaa4390fba7bdee133ef9897d26a0a8ab8.tar.gz kernel_samsung_tuna-dcd3ebeaa4390fba7bdee133ef9897d26a0a8ab8.tar.bz2 |
TI Thermal Governor: Updated the parameters for OMAP hot spot extrapolation
Due to a different OMAP die size between OMAP4460 and OMAP4470, the parameters
used to extrapolate the hot spot temperature from
the on-die sensor and the PCB sensor are different between 4460 and 4470.
When running thermal simulations, it appears that current parameters used on
OMAP4460 are not optimal.
This patch adds the capability to select the slope/const parameters according
to the OMAP44xx silicon revision and aligns these parameters with latest thermal
simulations (28th March 2012).
Change-Id: I828291504f6a23a1640c589af2d4913cf00f9745
Signed-off-by: Sebastien Sabatier <s-sabatier1@ti.com>
-rw-r--r-- | drivers/staging/thermal_framework/governor/omap_die_governor.c | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/drivers/staging/thermal_framework/governor/omap_die_governor.c b/drivers/staging/thermal_framework/governor/omap_die_governor.c index 21aeb5d..b0cd29f 100644 --- a/drivers/staging/thermal_framework/governor/omap_die_governor.c +++ b/drivers/staging/thermal_framework/governor/omap_die_governor.c @@ -23,6 +23,7 @@ #include <linux/suspend.h> #include <linux/thermal_framework.h> #include <plat/tmp102_temp_sensor.h> +#include <plat/cpu.h> /* CPU Zone information */ #define FATAL_ZONE 5 @@ -43,12 +44,16 @@ #define NORMAL_TEMP_MONITORING_RATE 1000 #define FAST_TEMP_MONITORING_RATE 250 -#define OMAP_GRADIENT_SLOPE 481 -#define OMAP_GRADIENT_CONST -12945 +#define OMAP_GRADIENT_SLOPE_4460 348 +#define OMAP_GRADIENT_CONST_4460 -9301 +#define OMAP_GRADIENT_SLOPE_4470 308 +#define OMAP_GRADIENT_CONST_4470 -7896 /* PCB sensor calculation constants */ -#define OMAP_GRADIENT_SLOPE_WITH_PCB 1370 -#define OMAP_GRADIENT_CONST_WITH_PCB -635 +#define OMAP_GRADIENT_SLOPE_W_PCB_4460 1142 +#define OMAP_GRADIENT_CONST_W_PCB_4460 -393 +#define OMAP_GRADIENT_SLOPE_W_PCB_4470 1063 +#define OMAP_GRADIENT_CONST_W_PCB_4470 -477 #define AVERAGE_NUMBER 20 struct omap_die_governor { @@ -66,6 +71,10 @@ struct omap_die_governor { int avg_cpu_sensor_temp; int avg_is_valid; struct delayed_work average_cpu_sensor_work; + int gradient_slope; + int gradient_const; + int gradient_slope_w_pcb; + int gradient_const_w_pcb; }; static struct thermal_dev *therm_fw; @@ -163,15 +172,16 @@ static signed int convert_omap_sensor_temp_to_hotspot_temp(int sensor_temp) absolute_delta = ( ((omap_gov->avg_cpu_sensor_temp - omap_gov->pcb_temp) * - OMAP_GRADIENT_SLOPE_WITH_PCB / 1000) + - OMAP_GRADIENT_CONST_WITH_PCB); + omap_gov->gradient_slope_w_pcb / 1000) + + omap_gov->gradient_const_w_pcb); /* Ensure that this formula never returns negative value */ if (absolute_delta < 0) absolute_delta = 0; } else { - absolute_delta = ((sensor_temp * OMAP_GRADIENT_SLOPE / 1000) + - OMAP_GRADIENT_CONST); + absolute_delta = ( + (sensor_temp * omap_gov->gradient_slope / 1000) + + omap_gov->gradient_const); } omap_gov->absolute_delta = absolute_delta; @@ -201,8 +211,8 @@ static signed hotspot_temp_to_sensor_temp(int hot_spot_temp) if (pcb_sensor && (omap_gov->avg_is_valid == 1)) return hot_spot_temp - omap_gov->absolute_delta; else - return ((hot_spot_temp - OMAP_GRADIENT_CONST) * 1000) / - (1000 + OMAP_GRADIENT_SLOPE); + return ((hot_spot_temp - omap_gov->gradient_const) * 1000) / + (1000 + omap_gov->gradient_slope); } /** @@ -668,6 +678,23 @@ static int __init omap_die_governor_init(void) pcb_sensor = NULL; + if (cpu_is_omap446x()) { + omap_gov->gradient_slope = OMAP_GRADIENT_SLOPE_4460; + omap_gov->gradient_const = OMAP_GRADIENT_CONST_4460; + omap_gov->gradient_slope_w_pcb = OMAP_GRADIENT_SLOPE_W_PCB_4460; + omap_gov->gradient_const_w_pcb = OMAP_GRADIENT_CONST_W_PCB_4460; + } else if (cpu_is_omap447x()) { + omap_gov->gradient_slope = OMAP_GRADIENT_SLOPE_4470; + omap_gov->gradient_const = OMAP_GRADIENT_CONST_4470; + omap_gov->gradient_slope_w_pcb = OMAP_GRADIENT_SLOPE_W_PCB_4470; + omap_gov->gradient_const_w_pcb = OMAP_GRADIENT_CONST_W_PCB_4470; + } else { + omap_gov->gradient_slope = 0; + omap_gov->gradient_const = 0; + omap_gov->gradient_slope_w_pcb = 0; + omap_gov->gradient_const_w_pcb = 0; + } + /* Init delayed work to average on-die temperature */ INIT_DELAYED_WORK(&omap_gov->average_cpu_sensor_work, average_cpu_sensor_delayed_work_fn); |