Commit 859a6f6e authored by Dmitry Osipenko's avatar Dmitry Osipenko Committed by Thierry Reding

ARM: tegra: Add tegra_pm_park_secondary_cpu()

This function resembles tegra_cpu_die() of the hotplug code, but
this variant is more suitable to be used for CPU PM because it's made
specifically to be used by cpu_suspend(). In short this function puts
secondary CPU offline, it will be used by the new CPUIDLE driver.
Acked-by: default avatarPeter De Schrijver <pdeschrijver@nvidia.com>
Tested-by: default avatarPeter Geis <pgwipeout@gmail.com>
Tested-by: default avatarJasper Korten <jja2000@gmail.com>
Tested-by: default avatarDavid Heidelberg <david@ixit.cz>
Tested-by: default avatarNicolas Chauvet <kwizart@gmail.com>
Signed-off-by: default avatarDmitry Osipenko <digetx@gmail.com>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent df25e554
...@@ -436,4 +436,18 @@ void __init tegra_init_suspend(void) ...@@ -436,4 +436,18 @@ void __init tegra_init_suspend(void)
suspend_set_ops(&tegra_suspend_ops); suspend_set_ops(&tegra_suspend_ops);
} }
int tegra_pm_park_secondary_cpu(unsigned long cpu)
{
if (cpu > 0) {
tegra_disable_clean_inv_dcache(TEGRA_FLUSH_CACHE_LOUIS);
if (tegra_get_chip_id() == TEGRA20)
tegra20_hotplug_shutdown();
else
tegra30_hotplug_shutdown();
}
return -EINVAL;
}
#endif #endif
...@@ -31,8 +31,13 @@ extern void (*tegra_tear_down_cpu)(void); ...@@ -31,8 +31,13 @@ extern void (*tegra_tear_down_cpu)(void);
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
void tegra_init_suspend(void); void tegra_init_suspend(void);
int tegra_pm_park_secondary_cpu(unsigned long cpu);
#else #else
static inline void tegra_init_suspend(void) {} static inline void tegra_init_suspend(void) {}
static inline int tegra_pm_park_secondary_cpu(unsigned long cpu)
{
return -ENOTSUPP;
}
#endif #endif
#endif /* _MACH_TEGRA_PM_H_ */ #endif /* _MACH_TEGRA_PM_H_ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment