ARM: T11x: set timer value for cpu power off
Bo Yan [Wed, 19 Sep 2012 22:26:02 +0000 (15:26 -0700)]
This is needed to shut off VDD_CPU in any power state transition
which will lead to CPU rail-off.

These timer settings are not optimal. PMIC datasheet should be
consulted to come up with optimal settings that meet PMIC
requirement and minimize latency when switching off CPU rail.

For cluster switch, a minimum value '2' is used since '0' or '1'
is not a valid option and system will stay in cluster 1 for
at least 'cpu_off_timer', so there is no need to repeat waiting.

Reviewed-on: http://git-master/r/133903

Change-Id: I825c0039150346650db63003ffbea9e72992caf6
Signed-off-by: Bo Yan <byan@nvidia.com>
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/143111
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>

Rebase-Id: R19e5bacc95e2190e818691c9b40eaa3221f8ef89

arch/arm/mach-tegra/board-dalmore-power.c
arch/arm/mach-tegra/board-pluto-power.c
arch/arm/mach-tegra/pm.c

index 2466dd2..d471092 100644 (file)
@@ -987,10 +987,10 @@ static struct platform_device dalmore_pda_power_device = {
 
 static struct tegra_suspend_platform_data dalmore_suspend_data = {
        .cpu_timer      = 2000,
-       .cpu_off_timer  = 0,
+       .cpu_off_timer  = 2000,
        .suspend_mode   = TEGRA_SUSPEND_LP0,
        .core_timer     = 0x7e7e,
-       .core_off_timer = 0,
+       .core_off_timer = 2000,
        .corereq_high   = true,
        .sysclkreq_high = true,
 };
index a378fe7..59c3261 100644 (file)
@@ -589,10 +589,10 @@ subsys_initcall_sync(pluto_fixed_regulator_init);
 
 static struct tegra_suspend_platform_data pluto_suspend_data = {
        .cpu_timer      = 2000,
-       .cpu_off_timer  = 0,
+       .cpu_off_timer  = 2000,
        .suspend_mode   = TEGRA_SUSPEND_LP0,
        .core_timer     = 0x7e7e,
-       .core_off_timer = 0,
+       .core_off_timer = 2000,
        .corereq_high   = false,
        .sysclkreq_high = true,
 };
index 3752aad..996566a 100644 (file)
@@ -612,11 +612,8 @@ unsigned int tegra_idle_lp2_last(unsigned int sleep_time, unsigned int flags)
         * are in LP2 state and irqs are disabled
         */
        if (flags & TEGRA_POWER_CLUSTER_MASK) {
-               if (is_idle_task(current))
-                       trace_cpu_cluster_rcuidle(POWER_CPU_CLUSTER_START);
-               else
-                       trace_cpu_cluster(POWER_CPU_CLUSTER_START);
-               set_power_timers(pdata->cpu_timer, 0,
+               trace_cpu_cluster(POWER_CPU_CLUSTER_START);
+               set_power_timers(pdata->cpu_timer, 2,
                        clk_get_rate_all_locked(tegra_pclk));
                if (flags & TEGRA_POWER_CLUSTER_G) {
                        /*