blob: fcee7c4af13340d568282f75abfe3c6c6479a555 [file] [log] [blame]
John Powell7454e822022-04-07 15:43:35 -05001/*
2 * Copyright (c) 2022, 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 N1SDP_PS_RUN_STATE_ID 0 /* Valid for CPUs and Clusters */
12#define N1SDP_PS_RETENTION_STATE_ID 1 /* Valid for only CPUs */
13#define N1SDP_PS_OFF_STATE_ID 2 /* Valid for CPUs and Clusters */
14
15/* Suspend depth definitions for each power state */
16#define N1SDP_PS_RUN_DEPTH 0
17#define N1SDP_PS_RETENTION_DEPTH 1
18#define N1SDP_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 {N1SDP_PS_RETENTION_DEPTH, N1SDP_PS_RETENTION_STATE_ID, PSTATE_TYPE_STANDBY},
23 {N1SDP_PS_OFF_DEPTH, N1SDP_PS_OFF_STATE_ID, PSTATE_TYPE_POWERDOWN},
24 {0}
25};
26
27/* The state property array with details of idle state possible for the cluster */
28static const plat_state_prop_t cluster_state_prop[] = {
29 {N1SDP_PS_OFF_DEPTH, N1SDP_PS_OFF_STATE_ID, PSTATE_TYPE_POWERDOWN},
30 {0}
31};
32
33const plat_state_prop_t *plat_get_state_prop(unsigned int level)
34{
35 switch (level) {
36 case MPIDR_AFFLVL0:
37 return core_state_prop;
38 case MPIDR_AFFLVL1:
39 return cluster_state_prop;
40 default:
41 return NULL;
42 }
43}