Commit 31a4957c authored by Varun Wadekar's avatar Varun Wadekar
Browse files

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: default avatarVarun Wadekar <vwadekar@nvidia.com>
parent d288ab24
...@@ -55,6 +55,7 @@ extern uint64_t tegra_sec_entry_point; ...@@ -55,6 +55,7 @@ extern uint64_t tegra_sec_entry_point;
#pragma weak tegra_soc_pwr_domain_off #pragma weak tegra_soc_pwr_domain_off
#pragma weak tegra_soc_pwr_domain_on_finish #pragma weak tegra_soc_pwr_domain_on_finish
#pragma weak tegra_soc_prepare_system_reset #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) int tegra_soc_pwr_domain_suspend(const psci_power_state_t *target_state)
{ {
...@@ -81,6 +82,12 @@ int tegra_soc_prepare_system_reset(void) ...@@ -81,6 +82,12 @@ int tegra_soc_prepare_system_reset(void)
return PSCI_E_SUCCESS; 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` * 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 * 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) ...@@ -199,8 +206,9 @@ void tegra_pwr_domain_suspend_finish(const psci_power_state_t *target_state)
******************************************************************************/ ******************************************************************************/
__dead2 void tegra_system_off(void) __dead2 void tegra_system_off(void)
{ {
ERROR("Tegra System Off: operation not handled.\n"); INFO("Powering down system...\n");
panic();
tegra_soc_prepare_system_off();
} }
/******************************************************************************* /*******************************************************************************
...@@ -208,6 +216,8 @@ __dead2 void tegra_system_off(void) ...@@ -208,6 +216,8 @@ __dead2 void tegra_system_off(void)
******************************************************************************/ ******************************************************************************/
__dead2 void tegra_system_reset(void) __dead2 void tegra_system_reset(void)
{ {
INFO("Restarting system...\n");
/* per-SoC system reset handler */ /* per-SoC system reset handler */
tegra_soc_prepare_system_reset(); tegra_soc_prepare_system_reset();
......
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