summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/edp.c
diff options
context:
space:
mode:
authorDiwakar Tundlam <dtundlam@nvidia.com>2013-04-11 17:28:54 -0700
committerSimone Willett <swillett@nvidia.com>2013-04-12 18:10:15 -0700
commit9ea2381b96a4e4ab152bec8da9bb6830cce00a40 (patch)
tree0f7717e0624a7550c9fd3d6ef37f6d079a569af4 /arch/arm/mach-tegra/edp.c
parentc0dabb7771ee208ff9033ca7b5ba46b39b2e8cd1 (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/arm/mach-tegra/edp.c')
-rw-r--r--arch/arm/mach-tegra/edp.c13
1 files changed, 11 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;