diff options
author | Diwakar Tundlam <dtundlam@nvidia.com> | 2013-04-11 17:28:54 -0700 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2013-04-12 18:10:15 -0700 |
commit | 9ea2381b96a4e4ab152bec8da9bb6830cce00a40 (patch) | |
tree | 0f7717e0624a7550c9fd3d6ef37f6d079a569af4 /arch | |
parent | c0dabb7771ee208ff9033ca7b5ba46b39b2e8cd1 (diff) |
ARM: tegra: build edp table with volt-temp constraints
Some chips must be constrained to run at a reduced maximum voltage
above certain temperature threshold. Added code for this constraint be
configured on a per SKU basis.
Bug 1270003
Bug 1270570
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Change-Id: Ic2e6f9406712d276ab9af92f89e98bd92972a5f6
Signed-off-by: Diwakar Tundlam <dtundlam@nvidia.com>
Reviewed-on: http://git-master/r/218723
(cherry-picked from commit 7619194041fe5d4bcb9d8f8faa25130d41d289ae)
Reviewed-on: http://git-master/r/218818
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/edp.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-tegra/include/mach/edp.h | 6 |
2 files changed, 17 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/edp.c b/arch/arm/mach-tegra/edp.c index e6165709a3ef..3e0957c98ee8 100644 --- a/arch/arm/mach-tegra/edp.c +++ b/arch/arm/mach-tegra/edp.c @@ -374,6 +374,7 @@ static struct tegra_edp_cpu_leakage_params leakage_params[] = { { 15618709, -4576116, 158401, -1538, }, }, }, + .volt_temp_cap = { 70, 1240 }, }, { .cpu_speedo_id = 1, /* A01P+ CPU */ @@ -406,6 +407,7 @@ static struct tegra_edp_cpu_leakage_params leakage_params[] = { }, }, .safety_cap = { 1810500, 1810500, 1606500, 1606500 }, + .volt_temp_cap = { 70, 1240 }, }, { .cpu_speedo_id = 2, /* A01P+ fast CPU */ @@ -438,6 +440,7 @@ static struct tegra_edp_cpu_leakage_params leakage_params[] = { }, }, .safety_cap = { 1912500, 1912500, 1912500, 1912500 }, + .volt_temp_cap = { 70, 1240 }, }, }; @@ -467,7 +470,8 @@ static inline s64 edp_pow(s64 val, int pwr) * temp_C - always valid * power_mW - valid or -1 (infinite) */ -unsigned int edp_calculate_maxf(struct tegra_edp_cpu_leakage_params *params, +static unsigned int edp_calculate_maxf( + struct tegra_edp_cpu_leakage_params *params, int temp_C, int power_mW, int iddq_mA, int n_cores_idx) @@ -482,6 +486,11 @@ unsigned int edp_calculate_maxf(struct tegra_edp_cpu_leakage_params *params, freq_KHz = freq_voltage_lut[f].freq / 1000; voltage_mV = freq_voltage_lut[f].voltage_mV; + /* Constrain Volt-Temp. Eg. at Tj >= 70C, no VDD_CPU > 1.24V */ + if (temp_C >= params->volt_temp_cap.temperature && + voltage_mV > params->volt_temp_cap.voltage_limit_mV) + continue; + /* Calculate leakage current */ leakage_mA = 0; for (i = 0; i <= 3; i++) { @@ -573,7 +582,7 @@ unsigned int tegra_edp_find_maxf(int volt) } -int edp_find_speedo_idx(int cpu_speedo_id, unsigned int *cpu_speedo_idx) +static int edp_find_speedo_idx(int cpu_speedo_id, unsigned int *cpu_speedo_idx) { int i; diff --git a/arch/arm/mach-tegra/include/mach/edp.h b/arch/arm/mach-tegra/include/mach/edp.h index 02b1fbf41ba7..23c148e6c86f 100644 --- a/arch/arm/mach-tegra/include/mach/edp.h +++ b/arch/arm/mach-tegra/include/mach/edp.h @@ -44,12 +44,18 @@ struct tegra_system_edp_entry { unsigned int freq_limits[4]; }; +struct tegra_edp_voltage_temp_constraint { + int temperature; + unsigned int voltage_limit_mV; +}; + struct tegra_edp_cpu_leakage_params { int cpu_speedo_id; int dyn_consts_n[NR_CPUS]; /* pre-multiplied by 1,000,000 */ int leakage_consts_n[NR_CPUS]; /* pre-multiplied by 1,000,000 */ int leakage_consts_ijk[4][4][4]; /* pre-multiplied by 100,000 */ unsigned int safety_cap[4]; + struct tegra_edp_voltage_temp_constraint volt_temp_cap; }; struct tegra_edp_freq_voltage_table { |