aboutsummaryrefslogtreecommitdiff
path: root/plat/nvidia/tegra/soc/t186/plat_sip_calls.c
diff options
context:
space:
mode:
authorVarun Wadekar <vwadekar@nvidia.com>2016-02-29 10:24:30 -0800
committerVarun Wadekar <vwadekar@nvidia.com>2017-03-20 09:15:40 -0700
commit7eaf040abb52511eb638fbd88209cb2d33653762 (patch)
tree55ddee0ea29da0df4bd61d8eb20ffbd64725c962 /plat/nvidia/tegra/soc/t186/plat_sip_calls.c
parent1f586a71377011c362eded70c39c1efb97950d9a (diff)
downloadarm-trusted-firmware-7eaf040abb52511eb638fbd88209cb2d33653762.tar.gz
Tegra186: implement quasi power off (SC8) state
This patch adds support for the SC8 system power off state. This state keeps the sensor subsystem powered ON while powering down the remaining parts of the SoC. The CPUs and DRAM are powered down as part of this state entry and perform a cold boot when exiting SC8. Change-Id: Iba65c661a7fe077a0d696f114bab3b4595e19a0d Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'plat/nvidia/tegra/soc/t186/plat_sip_calls.c')
-rw-r--r--plat/nvidia/tegra/soc/t186/plat_sip_calls.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/plat/nvidia/tegra/soc/t186/plat_sip_calls.c b/plat/nvidia/tegra/soc/t186/plat_sip_calls.c
index 8b340a19..fabab018 100644
--- a/plat/nvidia/tegra/soc/t186/plat_sip_calls.c
+++ b/plat/nvidia/tegra/soc/t186/plat_sip_calls.c
@@ -41,10 +41,13 @@
#include <t18x_ari.h>
#include <tegra_private.h>
+extern uint32_t tegra186_system_powerdn_state;
+
/*******************************************************************************
* Tegra186 SiP SMCs
******************************************************************************/
#define TEGRA_SIP_NEW_VIDEOMEM_REGION 0x82000003
+#define TEGRA_SIP_SYSTEM_SHUTDOWN_STATE 0x82FFFE01
#define TEGRA_SIP_MCE_CMD_ENTER_CSTATE 0x82FFFF00
#define TEGRA_SIP_MCE_CMD_UPDATE_CSTATE_INFO 0x82FFFF01
#define TEGRA_SIP_MCE_CMD_UPDATE_CROSSOVER_TIME 0x82FFFF02
@@ -133,6 +136,33 @@ int plat_sip_handler(uint32_t smc_fid,
return 0;
+ case TEGRA_SIP_SYSTEM_SHUTDOWN_STATE:
+
+ /* clean up the high bits */
+ x1 = (uint32_t)x1;
+
+ /*
+ * SC8 is a special Tegra186 system state where the CPUs and
+ * DRAM are powered down but the other subsystem is still
+ * alive.
+ */
+ if ((x1 == TEGRA_ARI_SYSTEM_SC8) ||
+ (x1 == TEGRA_ARI_MISC_CCPLEX_SHUTDOWN_POWER_OFF)) {
+
+ tegra186_system_powerdn_state = x1;
+ flush_dcache_range(
+ (uintptr_t)&tegra186_system_powerdn_state,
+ sizeof(tegra186_system_powerdn_state));
+
+ } else {
+
+ ERROR("%s: unhandled powerdn state (%d)\n", __func__,
+ (uint32_t)x1);
+ return -ENOTSUP;
+ }
+
+ return 0;
+
default:
break;
}