blob: 17d3b39e4c6428586dd95ec5d71a197cb5386791 [file] [log] [blame]
Arunachalam Ganapathya5b17762020-04-27 14:33:00 +01001/*
2 * Copyright (c) 2020, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <platform.h>
8#include <psci.h>
9
10/* State IDs for local power states on SGI platforms. */
11#define TC0_PS_RUN_STATE_ID 0 /* Valid for CPUs and Clusters */
12#define TC0_PS_RETENTION_STATE_ID 1 /* Valid for only CPUs */
13#define TC0_PS_OFF_STATE_ID 2 /* Valid for CPUs and Clusters */
14
15/* Suspend depth definitions for each power state */
16#define TC0_PS_RUN_DEPTH 0
17#define TC0_PS_RETENTION_DEPTH 1
18#define TC0_PS_OFF_DEPTH 2
19
20/* The state property array with details of idle state possible for the core */
21static const plat_state_prop_t core_state_prop[] = {
22 {TC0_PS_RETENTION_DEPTH, TC0_PS_RETENTION_STATE_ID,
23 PSTATE_TYPE_STANDBY},
24 {TC0_PS_OFF_DEPTH, TC0_PS_OFF_STATE_ID, PSTATE_TYPE_POWERDOWN},
25 {0}
26};
27
28/* The state property array with details of idle state possible for the cluster */
29static const plat_state_prop_t cluster_state_prop[] = {
30 {TC0_PS_OFF_DEPTH, TC0_PS_OFF_STATE_ID, PSTATE_TYPE_POWERDOWN},
31 {0}
32};
33
34const plat_state_prop_t *plat_get_state_prop(unsigned int level)
35{
36 switch (level) {
37 case MPIDR_AFFLVL0:
38 return core_state_prop;
39 case MPIDR_AFFLVL1:
40 return cluster_state_prop;
41 default:
42 return NULL;
43 }
44}