ARM: tegra: power: Add Tegra3 cpu idle parameters
Alex Frid [Sat, 1 Oct 2011 04:27:37 +0000 (21:27 -0700)]
Add Tegra3 cpu idle parameters: lp2_0_in_idle and lp_n_in_idle
to independently control LP2 mode for boot and secondary cpus.

Change-Id: I7e526b9bd78a9d5c3235307bbc89f5fb507bec2b
Reviewed-on: http://git-master/r/55630
Reviewed-by: Aleksandr Frid <afrid@nvidia.com>
Tested-by: Aleksandr Frid <afrid@nvidia.com>
Reviewed-by: Scott Williams <scwilliams@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

Rebase-Id: Rc6a468b2e9e065c344b2386366d5a47d77ddf037

arch/arm/mach-tegra/cpuidle-t3.c

index 928ba90..99bf2f9 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/tick.h>
 #include <linux/cpu_pm.h>
 #include <linux/clk.h>
+#include <linux/moduleparam.h>
 
 #include <asm/cacheflush.h>
 #include <asm/hardware/gic.h>
@@ -68,6 +69,12 @@ static s64 tegra_cpu_wake_by_time[4] = {
        LLONG_MAX, LLONG_MAX, LLONG_MAX, LLONG_MAX };
 #endif
 
+static bool lp2_0_in_idle = true;
+module_param(lp2_0_in_idle, bool, 0644);
+
+static bool lp2_n_in_idle = true;
+module_param(lp2_n_in_idle, bool, 0644);
+
 static struct clk *cpu_clk_for_dvfs;
 static struct clk *twd_clk;
 
@@ -118,6 +125,9 @@ bool tegra3_lp2_is_allowed(struct cpuidle_device *dev,
        if (!tegra_all_cpus_booted)
                return false;
 
+       if ((!lp2_0_in_idle && !dev->cpu) || (!lp2_n_in_idle && dev->cpu))
+               return false;
+
        /* On A01, LP2 on slave CPU's cause ranhdom CPU hangs.
         * Refer to Bug 804085.
         */