blob: c9656e31fb7574ea77878805bc21feb76ae055df [file] [log] [blame]
Soren Brinkmannc8284402016-03-06 20:16:27 -08001/*
Rajan Vaja849ba7f2018-01-17 02:39:20 -08002 * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
Soren Brinkmannc8284402016-03-06 20:16:27 -08003 *
dp-arm82cb2c12017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Soren Brinkmannc8284402016-03-06 20:16:27 -08005 */
6
7/* ZynqMP power management enums and defines */
8
9#ifndef _PM_DEFS_H_
10#define _PM_DEFS_H_
11
12/*********************************************************************
13 * Macro definitions
14 ********************************************************************/
15
16/*
17 * Version number is a 32bit value, like:
18 * (PM_VERSION_MAJOR << 16) | PM_VERSION_MINOR
19 */
20#define PM_VERSION_MAJOR 0
21#define PM_VERSION_MINOR 2
22
23#define PM_VERSION ((PM_VERSION_MAJOR << 16) | PM_VERSION_MINOR)
24
25/* Capabilities for RAM */
26#define PM_CAP_ACCESS 0x1U
27#define PM_CAP_CONTEXT 0x2U
28
29#define MAX_LATENCY (~0U)
30#define MAX_QOS 100U
31
Filip Drazic95fd9902016-07-20 17:17:39 +020032/* State arguments of the self suspend */
33#define PM_STATE_CPU_IDLE 0x0U
34#define PM_STATE_SUSPEND_TO_RAM 0xFU
35
Soren Brinkmannc8284402016-03-06 20:16:27 -080036/*********************************************************************
37 * Enum definitions
38 ********************************************************************/
39
40enum pm_api_id {
41 /* Miscellaneous API functions: */
42 PM_GET_API_VERSION = 1, /* Do not change or move */
43 PM_SET_CONFIGURATION,
44 PM_GET_NODE_STATUS,
45 PM_GET_OP_CHARACTERISTIC,
46 PM_REGISTER_NOTIFIER,
47 /* API for suspending of PUs: */
48 PM_REQ_SUSPEND,
49 PM_SELF_SUSPEND,
50 PM_FORCE_POWERDOWN,
51 PM_ABORT_SUSPEND,
52 PM_REQ_WAKEUP,
53 PM_SET_WAKEUP_SOURCE,
54 PM_SYSTEM_SHUTDOWN,
55 /* API for managing PM slaves: */
56 PM_REQ_NODE,
57 PM_RELEASE_NODE,
58 PM_SET_REQUIREMENT,
59 PM_SET_MAX_LATENCY,
60 /* Direct control API functions: */
61 PM_RESET_ASSERT,
62 PM_RESET_GET_STATUS,
63 PM_MMIO_WRITE,
64 PM_MMIO_READ,
Nava kishore Mannef7d4bfc2016-08-20 23:11:11 +053065 PM_INIT,
Nava kishore Manne2ddc31d2016-08-20 23:18:09 +053066 PM_FPGA_LOAD,
67 PM_FPGA_GET_STATUS,
Siva Durga Prasad Paladugu3104f2e2016-08-24 11:45:47 +053068 PM_GET_CHIPID,
Rajan Vajaf61262a2018-01-18 22:54:07 -080069 PM_SECURE_RSA_AES,
70 PM_SECURE_SHA,
71 PM_SECURE_RSA,
Rajan Vaja849ba7f2018-01-17 02:39:20 -080072 PM_PINCTRL_REQUEST,
73 PM_PINCTRL_RELEASE,
74 PM_PINCTRL_GET_FUNCTION,
75 PM_PINCTRL_SET_FUNCTION,
76 PM_PINCTRL_CONFIG_PARAM_GET,
77 PM_PINCTRL_CONFIG_PARAM_SET,
Soren Brinkmannc8284402016-03-06 20:16:27 -080078 PM_API_MAX
79};
80
81enum pm_node_id {
82 NODE_UNKNOWN = 0,
83 NODE_APU,
84 NODE_APU_0,
85 NODE_APU_1,
86 NODE_APU_2,
87 NODE_APU_3,
88 NODE_RPU,
89 NODE_RPU_0,
90 NODE_RPU_1,
Rajan Vajaf61262a2018-01-18 22:54:07 -080091 NODE_PLD,
Soren Brinkmannc8284402016-03-06 20:16:27 -080092 NODE_FPD,
93 NODE_OCM_BANK_0,
94 NODE_OCM_BANK_1,
95 NODE_OCM_BANK_2,
96 NODE_OCM_BANK_3,
97 NODE_TCM_0_A,
98 NODE_TCM_0_B,
99 NODE_TCM_1_A,
100 NODE_TCM_1_B,
101 NODE_L2,
102 NODE_GPU_PP_0,
103 NODE_GPU_PP_1,
104 NODE_USB_0,
105 NODE_USB_1,
106 NODE_TTC_0,
107 NODE_TTC_1,
108 NODE_TTC_2,
109 NODE_TTC_3,
110 NODE_SATA,
111 NODE_ETH_0,
112 NODE_ETH_1,
113 NODE_ETH_2,
114 NODE_ETH_3,
115 NODE_UART_0,
116 NODE_UART_1,
117 NODE_SPI_0,
118 NODE_SPI_1,
119 NODE_I2C_0,
120 NODE_I2C_1,
121 NODE_SD_0,
122 NODE_SD_1,
123 NODE_DP,
124 NODE_GDMA,
125 NODE_ADMA,
126 NODE_NAND,
127 NODE_QSPI,
128 NODE_GPIO,
129 NODE_CAN_0,
130 NODE_CAN_1,
131 NODE_AFI,
132 NODE_APLL,
133 NODE_VPLL,
134 NODE_DPLL,
135 NODE_RPLL,
136 NODE_IOPLL,
137 NODE_DDR,
Mirela Simonovic2ba68952016-06-07 18:15:40 +0200138 NODE_IPI_APU,
Mirela Simonovic2c239f72016-06-17 16:17:23 +0200139 NODE_IPI_RPU_0,
Filip Drazic6aa4c532016-07-26 12:07:05 +0200140 NODE_GPU,
141 NODE_PCIE,
142 NODE_PCAP,
143 NODE_RTC,
Rajan Vajaf61262a2018-01-18 22:54:07 -0800144 NODE_LPD,
145 NODE_VCU,
146 NODE_IPI_RPU_1,
147 NODE_IPI_PL_0,
148 NODE_IPI_PL_1,
149 NODE_IPI_PL_2,
150 NODE_IPI_PL_3,
151 NODE_PL,
Rajan Vajae52e10a2018-01-17 02:39:21 -0800152 NODE_GEM_TSU,
153 NODE_SWDT_0,
154 NODE_SWDT_1,
155 NODE_CSU,
156 NODE_PJTAG,
157 NODE_TRACE,
158 NODE_TESTSCAN,
159 NODE_PMU,
160 NODE_MAX,
Soren Brinkmannc8284402016-03-06 20:16:27 -0800161};
162
163enum pm_request_ack {
164 REQ_ACK_NO = 1,
165 REQ_ACK_BLOCKING,
166 REQ_ACK_NON_BLOCKING,
167};
168
169enum pm_abort_reason {
170 ABORT_REASON_WKUP_EVENT = 100,
171 ABORT_REASON_PU_BUSY,
172 ABORT_REASON_NO_PWRDN,
173 ABORT_REASON_UNKNOWN,
174};
175
176enum pm_suspend_reason {
177 SUSPEND_REASON_PU_REQ = 201,
178 SUSPEND_REASON_ALERT,
179 SUSPEND_REASON_SYS_SHUTDOWN,
180};
181
182enum pm_ram_state {
183 PM_RAM_STATE_OFF = 1,
184 PM_RAM_STATE_RETENTION,
185 PM_RAM_STATE_ON,
186};
187
188enum pm_opchar_type {
189 PM_OPCHAR_TYPE_POWER = 1,
Soren Brinkmannc8284402016-03-06 20:16:27 -0800190 PM_OPCHAR_TYPE_TEMP,
Anes Hadziahmetagic493541d2016-05-12 16:17:30 +0200191 PM_OPCHAR_TYPE_LATENCY,
Soren Brinkmannc8284402016-03-06 20:16:27 -0800192};
193
194/**
195 * @PM_RET_SUCCESS: success
196 * @PM_RET_ERROR_ARGS: illegal arguments provided
197 * @PM_RET_ERROR_ACCESS: access rights violation
198 * @PM_RET_ERROR_TIMEOUT: timeout in communication with PMU
199 * @PM_RET_ERROR_NOTSUPPORTED: feature not supported
200 * @PM_RET_ERROR_PROC: node is not a processor node
201 * @PM_RET_ERROR_API_ID: illegal API ID
202 * @PM_RET_ERROR_OTHER: other error
203 */
204enum pm_ret_status {
205 PM_RET_SUCCESS,
206 PM_RET_ERROR_ARGS,
207 PM_RET_ERROR_ACCESS,
208 PM_RET_ERROR_TIMEOUT,
209 PM_RET_ERROR_NOTSUPPORTED,
210 PM_RET_ERROR_PROC,
211 PM_RET_ERROR_API_ID,
212 PM_RET_ERROR_FAILURE,
213 PM_RET_ERROR_COMMUNIC,
214 PM_RET_ERROR_DOUBLEREQ,
215 PM_RET_ERROR_OTHER,
216};
217
218/**
219 * @PM_INITIAL_BOOT: boot is a fresh system startup
220 * @PM_RESUME: boot is a resume
221 * @PM_BOOT_ERROR: error, boot cause cannot be identified
222 */
223enum pm_boot_status {
224 PM_INITIAL_BOOT,
225 PM_RESUME,
226 PM_BOOT_ERROR,
227};
228
Soren Brinkmann83531702016-09-02 09:50:54 -0700229enum pm_shutdown_type {
230 PMF_SHUTDOWN_TYPE_SHUTDOWN,
231 PMF_SHUTDOWN_TYPE_RESET,
232};
233
234enum pm_shutdown_subtype {
235 PMF_SHUTDOWN_SUBTYPE_SUBSYSTEM,
236 PMF_SHUTDOWN_SUBTYPE_PS_ONLY,
237 PMF_SHUTDOWN_SUBTYPE_SYSTEM,
238};
239
Soren Brinkmannc8284402016-03-06 20:16:27 -0800240#endif /* _PM_DEFS_H_ */