summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/cpu-tegra.c
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2011-02-05 01:11:13 -0800
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:42:20 -0800
commitefe7de861db97bea6a3964e7c7f4d0b13c07d1c9 (patch)
treee68181e8ba7702e47bd96a6b692c6198afa72a04 /arch/arm/mach-tegra/cpu-tegra.c
parentc0f1802a8e2b91a5185c10bb0bf62a14154456a0 (diff)
ARM: tegra: Add auto-hotplug support for Tegra3
Initial implementation of Tegra3 quad core CPU management. Add closed control loop on top of cpufreq DFS. Target frequency range is bounded by Fmax(Vnominal) for low power cluster - currently set to 456MHz, and Fmax(Vminimum) for high power cluster - currently set to 356MHz. When CPU frequency is scaled below the target range, slave high power CPUs are gradually brought down and eventually CPU is switched to the low power cluster. When CPU frequency is scaled above the target range, CPU is switched to the high power cluster and slave high power CPUs are gradually brought up. The auto hotplug support is disabled on boot. It can be explicitly enabled via sysfs interface. Original-Change-Id: Ie0e5cf1f334d9c53932db05950cfcf5addd271d7 Reviewed-on: http://git-master/r/18500 Reviewed-by: Aleksandr Frid <afrid@nvidia.com> Tested-by: Aleksandr Frid <afrid@nvidia.com> Reviewed-by: Jonathan Mayo <jmayo@nvidia.com> Reviewed-by: Scott Williams <scwilliams@nvidia.com> Original-Change-Id: I86152069aa2bed73e0148a4bcab897811e1a5827 Rebase-Id: R9cf5f5f8868c659db526cb49ddf276a79d93ef1a
Diffstat (limited to 'arch/arm/mach-tegra/cpu-tegra.c')
-rw-r--r--arch/arm/mach-tegra/cpu-tegra.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/cpu-tegra.c b/arch/arm/mach-tegra/cpu-tegra.c
index 3da60ac97072..ea6b7aaffa90 100644
--- a/arch/arm/mach-tegra/cpu-tegra.c
+++ b/arch/arm/mach-tegra/cpu-tegra.c
@@ -36,6 +36,7 @@
#include <mach/clk.h>
#include "clock.h"
+#include "pm.h"
static struct cpufreq_frequency_table *freq_table;
@@ -283,6 +284,10 @@ static int tegra_target(struct cpufreq_policy *policy,
ret = tegra_update_cpu_speed(new_speed);
out:
mutex_unlock(&tegra_cpu_lock);
+
+ if (ret == 0)
+ tegra_auto_hotplug_governor(new_speed);
+
return ret;
}
@@ -373,6 +378,8 @@ static struct cpufreq_driver tegra_cpufreq_driver = {
static int __init tegra_cpufreq_init(void)
{
+ int ret = 0;
+
struct tegra_cpufreq_table_data *table_data =
tegra_cpufreq_table_get();
BUG_ON(!table_data);
@@ -392,6 +399,10 @@ static int __init tegra_cpufreq_init(void)
throttle_lowest_index = table_data->throttle_lowest_index;
throttle_highest_index = table_data->throttle_highest_index;
#endif
+ ret = tegra_auto_hotplug_init();
+ if (ret)
+ return ret;
+
freq_table = table_data->freq_table;
return cpufreq_register_driver(&tegra_cpufreq_driver);
}
@@ -401,6 +412,7 @@ static void __exit tegra_cpufreq_exit(void)
#ifdef CONFIG_TEGRA_THERMAL_THROTTLE
destroy_workqueue(workqueue);
#endif
+ tegra_auto_hotplug_exit();
cpufreq_unregister_driver(&tegra_cpufreq_driver);
}