blob: 22a531bf8313b449d279eddbc7914c23542e9483 [file] [log] [blame]
Anson Huangd2b90552018-07-12 10:52:55 +08001/*
2 * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <arch.h>
8#include <arch_helpers.h>
9#include <debug.h>
10#include <plat_imx8.h>
11#include <sci/sci.h>
12#include <stdbool.h>
13
14void __dead2 imx_system_off(void)
15{
16 sc_pm_set_sys_power_mode(ipc_handle, SC_PM_PW_MODE_OFF);
17 wfi();
18 ERROR("power off failed.\n");
19 panic();
20}
21
Anson Huang0da07d22018-07-12 11:04:15 +080022void __dead2 imx_system_reset(void)
23{
24 sc_pm_reset(ipc_handle, SC_PM_RESET_TYPE_BOARD);
25 wfi();
26 ERROR("system reset failed.\n");
27 panic();
28}
Anson Huangd2b90552018-07-12 10:52:55 +080029
Anson Huang10cd8172018-07-12 14:17:19 +080030int imx_validate_power_state(unsigned int power_state,
31 psci_power_state_t *req_state)
32{
33 /* TODO */
34 return PSCI_E_INVALID_PARAMS;
35}
36
37void imx_get_sys_suspend_power_state(psci_power_state_t *req_state)
38{
39 unsigned int i;
40
41 /* CPU & cluster off, system in retention */
42 for (i = MPIDR_AFFLVL0; i < PLAT_MAX_PWR_LVL; i++)
43 req_state->pwr_domain_state[i] = PLAT_MAX_OFF_STATE;
44 req_state->pwr_domain_state[PLAT_MAX_PWR_LVL] = PLAT_MAX_RET_STATE;
45}
46