blob: d78f2eee05a82f86c76cd548cd5a1dfaa0610a7b [file] [log] [blame]
John Powell7454e822022-04-07 15:43:35 -05001/*
Rohit Mathewb5154bc2024-02-15 11:32:56 +00002 * Copyright (c) 2022-2024, Arm Limited and Contributors. All rights reserved.
John Powell7454e822022-04-07 15:43:35 -05003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <platform.h>
8#include <psci.h>
9
Rohit Mathewb5154bc2024-02-15 11:32:56 +000010/* State IDs for local power states on N1SDP platform. */
John Powell7454e822022-04-07 15:43:35 -050011#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}