diff options
author | Jon Hunter <jonathanh@nvidia.com> | 2016-02-26 15:48:40 +0000 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2016-04-05 15:22:53 +0200 |
commit | 0a2d87e0473fc5eea3f8168f5a24a35e4cf3f29c (patch) | |
tree | e6bacbecb33dd2123fca41a991b17459edda6269 /arch/arm/mach-tegra/platsmp.c | |
parent | bc9af23d314f5c846e66e9425b31df2815ef1763 (diff) | |
download | blackbird-obmc-linux-0a2d87e0473fc5eea3f8168f5a24a35e4cf3f29c.tar.gz blackbird-obmc-linux-0a2d87e0473fc5eea3f8168f5a24a35e4cf3f29c.zip |
soc/tegra: pmc: Wait for powergate state to change
Currently, the function tegra_powergate_set() simply sets the desired
powergate state but does not wait for the state to change. In most cases
we should wait for the state to change before proceeding. Currently,
there is a case for Tegra114 and Tegra124 devices where we do not wait
when starting the secondary CPU as this is not necessary. However, this
is only done at boot time and so waiting here will only have a small
impact on boot time. Therefore, update tegra_powergate_set() to wait
when setting the powergate.
By adding this feature, we can also eliminate the polling loop from
tegra30_boot_secondary().
A function has been added for checking the status of the powergate and
so update the tegra_powergate_is_powered() to use this macro as well.
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/platsmp.c')
-rw-r--r-- | arch/arm/mach-tegra/platsmp.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/arch/arm/mach-tegra/platsmp.c b/arch/arm/mach-tegra/platsmp.c index f3f61dbbda97..75620ae73913 100644 --- a/arch/arm/mach-tegra/platsmp.c +++ b/arch/arm/mach-tegra/platsmp.c @@ -108,19 +108,9 @@ static int tegra30_boot_secondary(unsigned int cpu, struct task_struct *idle) * be un-gated by un-toggling the power gate register * manually. */ - if (!tegra_pmc_cpu_is_powered(cpu)) { - ret = tegra_pmc_cpu_power_on(cpu); - if (ret) - return ret; - - /* Wait for the power to come up. */ - timeout = jiffies + msecs_to_jiffies(100); - while (!tegra_pmc_cpu_is_powered(cpu)) { - if (time_after(jiffies, timeout)) - return -ETIMEDOUT; - udelay(10); - } - } + ret = tegra_pmc_cpu_power_on(cpu); + if (ret) + return ret; remove_clamps: /* CPU partition is powered. Enable the CPU clock. */ |