diff options
author | Alex Frid <afrid@nvidia.com> | 2011-02-05 01:11:13 -0800 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-04-26 15:51:17 -0700 |
commit | b8f1f17a13d1fce6316cb34efe03e481e56a9f69 (patch) | |
tree | 33145e1017d1e3cdc8be7f6f70f8493a9dc70856 /arch/arm/mach-tegra/cpu-tegra.c | |
parent | fce1d8b2baff254ac53dc732ca77894ba50d9481 (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>
Change-Id: I86152069aa2bed73e0148a4bcab897811e1a5827
Diffstat (limited to 'arch/arm/mach-tegra/cpu-tegra.c')
-rw-r--r-- | arch/arm/mach-tegra/cpu-tegra.c | 12 |
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 b99499ce0110..7c51b3e49efa 100644 --- a/arch/arm/mach-tegra/cpu-tegra.c +++ b/arch/arm/mach-tegra/cpu-tegra.c @@ -38,6 +38,7 @@ #include <mach/clk.h> #include "clock.h" +#include "power.h" static struct cpufreq_frequency_table *freq_table; @@ -284,6 +285,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; } @@ -372,6 +377,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); @@ -391,6 +398,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); } @@ -400,6 +411,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); } |