blob: 394818b74339a0a1724638b904a17ae7370c0b09 [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001/*
2 * Copyright (c) 2018, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <arch.h>
8#include <platform.h>
9#include <psci.h>
10#include <stddef.h>
11
12/*
13 * State IDs for local power states on the FVP.
14 */
15#define FVP_RUN_STATE_ID 0 /* Valid for CPUs and Clusters */
16#define FVP_RETENTION_STATE_ID 1 /* Valid for only CPUs */
17#define FVP_OFF_STATE_ID 2 /* Valid for CPUs and Clusters */
18
19/*
20 * Suspend depth definitions for each power state
21 */
22typedef enum {
23 FVP_RUN_DEPTH = 0,
24 FVP_RETENTION_DEPTH,
25 FVP_OFF_DEPTH,
26} suspend_depth_t;
27
28/* The state property array with details of idle state possible for the core */
29static const plat_state_prop_t core_state_prop[] = {
30 {FVP_RETENTION_DEPTH, FVP_RETENTION_STATE_ID, PSTATE_TYPE_STANDBY},
31 {FVP_OFF_DEPTH, FVP_OFF_STATE_ID, PSTATE_TYPE_POWERDOWN},
32 {0},
33};
34
35/* The state property array with details of idle state possible
36 for the cluster */
37static const plat_state_prop_t cluster_state_prop[] = {
38 {FVP_OFF_DEPTH, FVP_OFF_STATE_ID, PSTATE_TYPE_POWERDOWN},
39 {0},
40};
41
42/* The state property array with details of idle state possible
43 for the system level */
44static const plat_state_prop_t system_state_prop[] = {
45 {FVP_OFF_DEPTH, FVP_OFF_STATE_ID, PSTATE_TYPE_POWERDOWN},
46 {0},
47};
48
49const plat_state_prop_t *plat_get_state_prop(unsigned int level)
50{
51 switch (level) {
52 case MPIDR_AFFLVL0:
53 return core_state_prop;
54 case MPIDR_AFFLVL1:
55 return cluster_state_prop;
56 case MPIDR_AFFLVL2:
57 return system_state_prop;
58 default:
59 return NULL;
60 }
61}