blob: 588d8b4e253b481611c335188f6e4ab8ce2433df [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
Antonio Nino Diaze0f90632018-12-14 00:18:21 +00007#include <stdbool.h>
8
Anson Huangd2b90552018-07-12 10:52:55 +08009#include <arch.h>
10#include <arch_helpers.h>
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000011#include <common/debug.h>
12
Anson Huangd2b90552018-07-12 10:52:55 +080013#include <plat_imx8.h>
14#include <sci/sci.h>
Anson Huangd2b90552018-07-12 10:52:55 +080015
16void __dead2 imx_system_off(void)
17{
18 sc_pm_set_sys_power_mode(ipc_handle, SC_PM_PW_MODE_OFF);
19 wfi();
20 ERROR("power off failed.\n");
21 panic();
22}
23
Anson Huang0da07d22018-07-12 11:04:15 +080024void __dead2 imx_system_reset(void)
25{
26 sc_pm_reset(ipc_handle, SC_PM_RESET_TYPE_BOARD);
27 wfi();
28 ERROR("system reset failed.\n");
29 panic();
30}
Anson Huangd2b90552018-07-12 10:52:55 +080031
Anson Huang10cd8172018-07-12 14:17:19 +080032int imx_validate_power_state(unsigned int power_state,
33 psci_power_state_t *req_state)
34{
35 /* TODO */
36 return PSCI_E_INVALID_PARAMS;
37}
38
39void imx_get_sys_suspend_power_state(psci_power_state_t *req_state)
40{
41 unsigned int i;
42
43 /* CPU & cluster off, system in retention */
44 for (i = MPIDR_AFFLVL0; i < PLAT_MAX_PWR_LVL; i++)
45 req_state->pwr_domain_state[i] = PLAT_MAX_OFF_STATE;
46 req_state->pwr_domain_state[PLAT_MAX_PWR_LVL] = PLAT_MAX_RET_STATE;
47}
48