From: Varun Wadekar Date: Thu, 7 Jan 2016 22:04:21 +0000 (-0800) Subject: Tegra: PM: soc-specific system off handler X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=31a4957cd3c1674000c0cd66931878310701edb9;p=project%2Fbcm63xx%2Fatf.git Tegra: PM: soc-specific system off handler This patch introduces a power down handler which can be overriden by SoCs to customise the power down process. The current SoCs do not have a way of powering down the entire system as external PMIC chips are involved in the process. But future SoCs will have a way to power off the entire system without talking to an external PMIC. Change-Id: Ie7750714141a29cb0a1a616fafc531c4f11d0985 Signed-off-by: Varun Wadekar --- diff --git a/plat/nvidia/tegra/common/tegra_pm.c b/plat/nvidia/tegra/common/tegra_pm.c index 8b7a0590..42ab5f25 100644 --- a/plat/nvidia/tegra/common/tegra_pm.c +++ b/plat/nvidia/tegra/common/tegra_pm.c @@ -55,6 +55,7 @@ extern uint64_t tegra_sec_entry_point; #pragma weak tegra_soc_pwr_domain_off #pragma weak tegra_soc_pwr_domain_on_finish #pragma weak tegra_soc_prepare_system_reset +#pragma weak tegra_soc_prepare_system_off int tegra_soc_pwr_domain_suspend(const psci_power_state_t *target_state) { @@ -81,6 +82,12 @@ int tegra_soc_prepare_system_reset(void) return PSCI_E_SUCCESS; } +__dead2 void tegra_soc_prepare_system_off(void) +{ + ERROR("Tegra System Off: operation not handled.\n"); + panic(); +} + /******************************************************************************* * This handler is called by the PSCI implementation during the `SYSTEM_SUSPEND` * call to get the `power_state` parameter. This allows the platform to encode @@ -199,8 +206,9 @@ void tegra_pwr_domain_suspend_finish(const psci_power_state_t *target_state) ******************************************************************************/ __dead2 void tegra_system_off(void) { - ERROR("Tegra System Off: operation not handled.\n"); - panic(); + INFO("Powering down system...\n"); + + tegra_soc_prepare_system_off(); } /******************************************************************************* @@ -208,6 +216,8 @@ __dead2 void tegra_system_off(void) ******************************************************************************/ __dead2 void tegra_system_reset(void) { + INFO("Restarting system...\n"); + /* per-SoC system reset handler */ tegra_soc_prepare_system_reset();