blob: 9a8026f464efd3bcedbe7621fd771580dac64cc5 [file] [log] [blame]
Soren Brinkmann76fcae32016-03-06 20:16:27 -08001/*
Rajan Vaja83687612018-01-17 02:39:20 -08002 * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
Soren Brinkmann76fcae32016-03-06 20:16:27 -08003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Soren Brinkmann76fcae32016-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 */
Jolly Shahabee2a42018-02-07 15:37:01 -080020#define PM_VERSION_MAJOR 1
21#define PM_VERSION_MINOR 0
Soren Brinkmann76fcae32016-03-06 20:16:27 -080022
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 Drazic0bd9d0c2016-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 Brinkmann76fcae32016-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,
Filip Drazicca1e0af2017-03-16 16:56:53 +010065 PM_INIT_FINALIZE,
Nava kishore Manne68d460c2016-08-20 23:18:09 +053066 PM_FPGA_LOAD,
67 PM_FPGA_GET_STATUS,
Siva Durga Prasad Paladugu16427d12016-08-24 11:45:47 +053068 PM_GET_CHIPID,
Rajan Vaja670bec02018-01-18 22:54:07 -080069 PM_SECURE_RSA_AES,
70 PM_SECURE_SHA,
71 PM_SECURE_RSA,
Rajan Vaja83687612018-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,
Rajan Vaja5529a012018-01-17 02:39:23 -080078 PM_IOCTL,
Rajan Vaja35116132018-01-17 02:39:25 -080079 /* API to query information from firmware */
80 PM_QUERY_DATA,
81 /* Clock control API functions */
82 PM_CLOCK_ENABLE,
83 PM_CLOCK_DISABLE,
84 PM_CLOCK_GETSTATE,
85 PM_CLOCK_SETDIVIDER,
86 PM_CLOCK_GETDIVIDER,
87 PM_CLOCK_SETRATE,
88 PM_CLOCK_GETRATE,
89 PM_CLOCK_SETPARENT,
90 PM_CLOCK_GETPARENT,
Siva Durga Prasad Paladugua4ed4b22018-04-30 20:06:58 +053091 PM_SECURE_IMAGE,
Soren Brinkmann76fcae32016-03-06 20:16:27 -080092 PM_API_MAX
93};
94
95enum pm_node_id {
96 NODE_UNKNOWN = 0,
97 NODE_APU,
98 NODE_APU_0,
99 NODE_APU_1,
100 NODE_APU_2,
101 NODE_APU_3,
102 NODE_RPU,
103 NODE_RPU_0,
104 NODE_RPU_1,
Rajan Vaja670bec02018-01-18 22:54:07 -0800105 NODE_PLD,
Soren Brinkmann76fcae32016-03-06 20:16:27 -0800106 NODE_FPD,
107 NODE_OCM_BANK_0,
108 NODE_OCM_BANK_1,
109 NODE_OCM_BANK_2,
110 NODE_OCM_BANK_3,
111 NODE_TCM_0_A,
112 NODE_TCM_0_B,
113 NODE_TCM_1_A,
114 NODE_TCM_1_B,
115 NODE_L2,
116 NODE_GPU_PP_0,
117 NODE_GPU_PP_1,
118 NODE_USB_0,
119 NODE_USB_1,
120 NODE_TTC_0,
121 NODE_TTC_1,
122 NODE_TTC_2,
123 NODE_TTC_3,
124 NODE_SATA,
125 NODE_ETH_0,
126 NODE_ETH_1,
127 NODE_ETH_2,
128 NODE_ETH_3,
129 NODE_UART_0,
130 NODE_UART_1,
131 NODE_SPI_0,
132 NODE_SPI_1,
133 NODE_I2C_0,
134 NODE_I2C_1,
135 NODE_SD_0,
136 NODE_SD_1,
137 NODE_DP,
138 NODE_GDMA,
139 NODE_ADMA,
140 NODE_NAND,
141 NODE_QSPI,
142 NODE_GPIO,
143 NODE_CAN_0,
144 NODE_CAN_1,
Mirela Simonoviccd165822017-01-30 17:44:00 +0100145 NODE_EXTERN,
Soren Brinkmann76fcae32016-03-06 20:16:27 -0800146 NODE_APLL,
147 NODE_VPLL,
148 NODE_DPLL,
149 NODE_RPLL,
150 NODE_IOPLL,
151 NODE_DDR,
Mirela Simonovic0ff06ce2016-06-07 18:15:40 +0200152 NODE_IPI_APU,
Mirela Simonovic9b984be2016-06-17 16:17:23 +0200153 NODE_IPI_RPU_0,
Filip Drazic35e99e22016-07-26 12:07:05 +0200154 NODE_GPU,
155 NODE_PCIE,
156 NODE_PCAP,
157 NODE_RTC,
Rajan Vaja670bec02018-01-18 22:54:07 -0800158 NODE_LPD,
159 NODE_VCU,
160 NODE_IPI_RPU_1,
161 NODE_IPI_PL_0,
162 NODE_IPI_PL_1,
163 NODE_IPI_PL_2,
164 NODE_IPI_PL_3,
165 NODE_PL,
Rajan Vaja0ac2be12018-01-17 02:39:21 -0800166 NODE_GEM_TSU,
167 NODE_SWDT_0,
168 NODE_SWDT_1,
169 NODE_CSU,
170 NODE_PJTAG,
171 NODE_TRACE,
172 NODE_TESTSCAN,
173 NODE_PMU,
174 NODE_MAX,
Soren Brinkmann76fcae32016-03-06 20:16:27 -0800175};
176
177enum pm_request_ack {
178 REQ_ACK_NO = 1,
179 REQ_ACK_BLOCKING,
180 REQ_ACK_NON_BLOCKING,
181};
182
183enum pm_abort_reason {
184 ABORT_REASON_WKUP_EVENT = 100,
185 ABORT_REASON_PU_BUSY,
186 ABORT_REASON_NO_PWRDN,
187 ABORT_REASON_UNKNOWN,
188};
189
190enum pm_suspend_reason {
191 SUSPEND_REASON_PU_REQ = 201,
192 SUSPEND_REASON_ALERT,
193 SUSPEND_REASON_SYS_SHUTDOWN,
194};
195
196enum pm_ram_state {
197 PM_RAM_STATE_OFF = 1,
198 PM_RAM_STATE_RETENTION,
199 PM_RAM_STATE_ON,
200};
201
202enum pm_opchar_type {
203 PM_OPCHAR_TYPE_POWER = 1,
Soren Brinkmann76fcae32016-03-06 20:16:27 -0800204 PM_OPCHAR_TYPE_TEMP,
Anes Hadziahmetagic92aee012016-05-12 16:17:30 +0200205 PM_OPCHAR_TYPE_LATENCY,
Soren Brinkmann76fcae32016-03-06 20:16:27 -0800206};
207
208/**
209 * @PM_RET_SUCCESS: success
210 * @PM_RET_ERROR_ARGS: illegal arguments provided
211 * @PM_RET_ERROR_ACCESS: access rights violation
212 * @PM_RET_ERROR_TIMEOUT: timeout in communication with PMU
213 * @PM_RET_ERROR_NOTSUPPORTED: feature not supported
214 * @PM_RET_ERROR_PROC: node is not a processor node
215 * @PM_RET_ERROR_API_ID: illegal API ID
216 * @PM_RET_ERROR_OTHER: other error
217 */
218enum pm_ret_status {
219 PM_RET_SUCCESS,
220 PM_RET_ERROR_ARGS,
221 PM_RET_ERROR_ACCESS,
222 PM_RET_ERROR_TIMEOUT,
223 PM_RET_ERROR_NOTSUPPORTED,
224 PM_RET_ERROR_PROC,
225 PM_RET_ERROR_API_ID,
226 PM_RET_ERROR_FAILURE,
227 PM_RET_ERROR_COMMUNIC,
228 PM_RET_ERROR_DOUBLEREQ,
229 PM_RET_ERROR_OTHER,
230};
231
232/**
233 * @PM_INITIAL_BOOT: boot is a fresh system startup
234 * @PM_RESUME: boot is a resume
235 * @PM_BOOT_ERROR: error, boot cause cannot be identified
236 */
237enum pm_boot_status {
238 PM_INITIAL_BOOT,
239 PM_RESUME,
240 PM_BOOT_ERROR,
241};
242
Siva Durga Prasad Paladugu1f80d3f2018-04-30 15:56:10 +0530243/**
244 * @PMF_SHUTDOWN_TYPE_SHUTDOWN: shutdown
245 * @PMF_SHUTDOWN_TYPE_RESET: reset/reboot
246 * @PMF_SHUTDOWN_TYPE_SETSCOPE_ONLY: set the shutdown/reboot scope
247 */
Soren Brinkmann58fbb9b2016-09-02 09:50:54 -0700248enum pm_shutdown_type {
249 PMF_SHUTDOWN_TYPE_SHUTDOWN,
250 PMF_SHUTDOWN_TYPE_RESET,
Siva Durga Prasad Paladugu1f80d3f2018-04-30 15:56:10 +0530251 PMF_SHUTDOWN_TYPE_SETSCOPE_ONLY,
Soren Brinkmann58fbb9b2016-09-02 09:50:54 -0700252};
253
Siva Durga Prasad Paladugu1f80d3f2018-04-30 15:56:10 +0530254/**
255 * @PMF_SHUTDOWN_SUBTYPE_SUBSYSTEM: shutdown/reboot APU subsystem only
256 * @PMF_SHUTDOWN_SUBTYPE_PS_ONLY: shutdown/reboot entire PS (but not PL)
257 * @PMF_SHUTDOWN_SUBTYPE_SYSTEM: shutdown/reboot entire system
258 */
Soren Brinkmann58fbb9b2016-09-02 09:50:54 -0700259enum pm_shutdown_subtype {
260 PMF_SHUTDOWN_SUBTYPE_SUBSYSTEM,
261 PMF_SHUTDOWN_SUBTYPE_PS_ONLY,
262 PMF_SHUTDOWN_SUBTYPE_SYSTEM,
263};
264
Soren Brinkmann76fcae32016-03-06 20:16:27 -0800265#endif /* _PM_DEFS_H_ */