From 0887026ec149e8801c2ac14725d5151db836f8a8 Mon Sep 17 00:00:00 2001 From: Varun Wadekar Date: Wed, 27 Dec 2017 18:10:12 -0800 Subject: [PATCH] Tegra: default platform handler for the CPU_STANDBY state This patch adds a default implementation for the platform specific CPU standby power handler. Tegra SoCs can override this handler with their own implementations. Change-Id: I91e513842f194b1e2b1defa2d833bb4d9df5f06b Signed-off-by: Varun Wadekar --- plat/nvidia/tegra/common/tegra_pm.c | 11 +++++++++++ plat/nvidia/tegra/include/tegra_private.h | 1 + 2 files changed, 12 insertions(+) diff --git a/plat/nvidia/tegra/common/tegra_pm.c b/plat/nvidia/tegra/common/tegra_pm.c index 28052727..fbc0f116 100644 --- a/plat/nvidia/tegra/common/tegra_pm.c +++ b/plat/nvidia/tegra/common/tegra_pm.c @@ -41,6 +41,7 @@ uint8_t tegra_fake_system_suspend; * provide typical implementations that will be overridden by a SoC. */ #pragma weak tegra_soc_pwr_domain_suspend_pwrdown_early +#pragma weak tegra_soc_cpu_standby #pragma weak tegra_soc_pwr_domain_suspend #pragma weak tegra_soc_pwr_domain_on #pragma weak tegra_soc_pwr_domain_off @@ -55,6 +56,12 @@ int32_t tegra_soc_pwr_domain_suspend_pwrdown_early(const psci_power_state_t *tar return PSCI_E_NOT_SUPPORTED; } +int32_t tegra_soc_cpu_standby(plat_local_state_t cpu_state) +{ + (void)cpu_state; + return PSCI_E_SUCCESS; +} + int32_t tegra_soc_pwr_domain_suspend(const psci_power_state_t *target_state) { (void)target_state; @@ -141,6 +148,10 @@ void tegra_cpu_standby(plat_local_state_t cpu_state) { (void)cpu_state; + /* Tegra SoC specific handler */ + if (tegra_soc_cpu_standby(cpu_state) != PSCI_E_SUCCESS) + ERROR("%s failed\n", __func__); + /* * Enter standby state * dsb is good practice before using wfi to enter low power states diff --git a/plat/nvidia/tegra/include/tegra_private.h b/plat/nvidia/tegra/include/tegra_private.h index 68b46242..40aeaf85 100644 --- a/plat/nvidia/tegra/include/tegra_private.h +++ b/plat/nvidia/tegra/include/tegra_private.h @@ -97,6 +97,7 @@ extern uint8_t tegra_fake_system_suspend; void tegra_pm_system_suspend_entry(void); void tegra_pm_system_suspend_exit(void); int32_t tegra_system_suspended(void); +int32_t tegra_soc_cpu_standby(plat_local_state_t cpu_state); int32_t tegra_soc_pwr_domain_suspend(const psci_power_state_t *target_state); int32_t tegra_soc_pwr_domain_on(u_register_t mpidr); int32_t tegra_soc_pwr_domain_off(const psci_power_state_t *target_state); -- 2.30.2