blob: ddce1525b66744f820419c06d4a2386a4aa2284c [file] [log] [blame]
Soren Brinkmannc8284402016-03-06 20:16:27 -08001/*
2 * Copyright (c) 2013-2015, ARM Limited and Contributors. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * Redistributions of source code must retain the above copyright notice, this
8 * list of conditions and the following disclaimer.
9 *
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 *
14 * Neither the name of ARM nor the names of its contributors may be used
15 * to endorse or promote products derived from this software without specific
16 * prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31/* ZynqMP power management enums and defines */
32
33#ifndef _PM_DEFS_H_
34#define _PM_DEFS_H_
35
36/*********************************************************************
37 * Macro definitions
38 ********************************************************************/
39
40/*
41 * Version number is a 32bit value, like:
42 * (PM_VERSION_MAJOR << 16) | PM_VERSION_MINOR
43 */
44#define PM_VERSION_MAJOR 0
45#define PM_VERSION_MINOR 2
46
47#define PM_VERSION ((PM_VERSION_MAJOR << 16) | PM_VERSION_MINOR)
48
49/* Capabilities for RAM */
50#define PM_CAP_ACCESS 0x1U
51#define PM_CAP_CONTEXT 0x2U
52
53#define MAX_LATENCY (~0U)
54#define MAX_QOS 100U
55
Filip Drazic95fd9902016-07-20 17:17:39 +020056/* State arguments of the self suspend */
57#define PM_STATE_CPU_IDLE 0x0U
58#define PM_STATE_SUSPEND_TO_RAM 0xFU
59
Soren Brinkmannc8284402016-03-06 20:16:27 -080060/*********************************************************************
61 * Enum definitions
62 ********************************************************************/
63
64enum pm_api_id {
65 /* Miscellaneous API functions: */
66 PM_GET_API_VERSION = 1, /* Do not change or move */
67 PM_SET_CONFIGURATION,
68 PM_GET_NODE_STATUS,
69 PM_GET_OP_CHARACTERISTIC,
70 PM_REGISTER_NOTIFIER,
71 /* API for suspending of PUs: */
72 PM_REQ_SUSPEND,
73 PM_SELF_SUSPEND,
74 PM_FORCE_POWERDOWN,
75 PM_ABORT_SUSPEND,
76 PM_REQ_WAKEUP,
77 PM_SET_WAKEUP_SOURCE,
78 PM_SYSTEM_SHUTDOWN,
79 /* API for managing PM slaves: */
80 PM_REQ_NODE,
81 PM_RELEASE_NODE,
82 PM_SET_REQUIREMENT,
83 PM_SET_MAX_LATENCY,
84 /* Direct control API functions: */
85 PM_RESET_ASSERT,
86 PM_RESET_GET_STATUS,
87 PM_MMIO_WRITE,
88 PM_MMIO_READ,
Nava kishore Mannef7d4bfc2016-08-20 23:11:11 +053089 PM_INIT,
Soren Brinkmannc8284402016-03-06 20:16:27 -080090 PM_API_MAX
91};
92
93enum pm_node_id {
94 NODE_UNKNOWN = 0,
95 NODE_APU,
96 NODE_APU_0,
97 NODE_APU_1,
98 NODE_APU_2,
99 NODE_APU_3,
100 NODE_RPU,
101 NODE_RPU_0,
102 NODE_RPU_1,
103 NODE_PL,
104 NODE_FPD,
105 NODE_OCM_BANK_0,
106 NODE_OCM_BANK_1,
107 NODE_OCM_BANK_2,
108 NODE_OCM_BANK_3,
109 NODE_TCM_0_A,
110 NODE_TCM_0_B,
111 NODE_TCM_1_A,
112 NODE_TCM_1_B,
113 NODE_L2,
114 NODE_GPU_PP_0,
115 NODE_GPU_PP_1,
116 NODE_USB_0,
117 NODE_USB_1,
118 NODE_TTC_0,
119 NODE_TTC_1,
120 NODE_TTC_2,
121 NODE_TTC_3,
122 NODE_SATA,
123 NODE_ETH_0,
124 NODE_ETH_1,
125 NODE_ETH_2,
126 NODE_ETH_3,
127 NODE_UART_0,
128 NODE_UART_1,
129 NODE_SPI_0,
130 NODE_SPI_1,
131 NODE_I2C_0,
132 NODE_I2C_1,
133 NODE_SD_0,
134 NODE_SD_1,
135 NODE_DP,
136 NODE_GDMA,
137 NODE_ADMA,
138 NODE_NAND,
139 NODE_QSPI,
140 NODE_GPIO,
141 NODE_CAN_0,
142 NODE_CAN_1,
143 NODE_AFI,
144 NODE_APLL,
145 NODE_VPLL,
146 NODE_DPLL,
147 NODE_RPLL,
148 NODE_IOPLL,
149 NODE_DDR,
Mirela Simonovic2ba68952016-06-07 18:15:40 +0200150 NODE_IPI_APU,
Mirela Simonovic2c239f72016-06-17 16:17:23 +0200151 NODE_IPI_RPU_0,
Filip Drazic6aa4c532016-07-26 12:07:05 +0200152 NODE_GPU,
153 NODE_PCIE,
154 NODE_PCAP,
155 NODE_RTC,
Filip Drazicb516b7d2016-07-26 12:11:33 +0200156 NODE_MAX
Soren Brinkmannc8284402016-03-06 20:16:27 -0800157};
158
159enum pm_request_ack {
160 REQ_ACK_NO = 1,
161 REQ_ACK_BLOCKING,
162 REQ_ACK_NON_BLOCKING,
163};
164
165enum pm_abort_reason {
166 ABORT_REASON_WKUP_EVENT = 100,
167 ABORT_REASON_PU_BUSY,
168 ABORT_REASON_NO_PWRDN,
169 ABORT_REASON_UNKNOWN,
170};
171
172enum pm_suspend_reason {
173 SUSPEND_REASON_PU_REQ = 201,
174 SUSPEND_REASON_ALERT,
175 SUSPEND_REASON_SYS_SHUTDOWN,
176};
177
178enum pm_ram_state {
179 PM_RAM_STATE_OFF = 1,
180 PM_RAM_STATE_RETENTION,
181 PM_RAM_STATE_ON,
182};
183
184enum pm_opchar_type {
185 PM_OPCHAR_TYPE_POWER = 1,
Soren Brinkmannc8284402016-03-06 20:16:27 -0800186 PM_OPCHAR_TYPE_TEMP,
Anes Hadziahmetagic493541d2016-05-12 16:17:30 +0200187 PM_OPCHAR_TYPE_LATENCY,
Soren Brinkmannc8284402016-03-06 20:16:27 -0800188};
189
190/**
191 * @PM_RET_SUCCESS: success
192 * @PM_RET_ERROR_ARGS: illegal arguments provided
193 * @PM_RET_ERROR_ACCESS: access rights violation
194 * @PM_RET_ERROR_TIMEOUT: timeout in communication with PMU
195 * @PM_RET_ERROR_NOTSUPPORTED: feature not supported
196 * @PM_RET_ERROR_PROC: node is not a processor node
197 * @PM_RET_ERROR_API_ID: illegal API ID
198 * @PM_RET_ERROR_OTHER: other error
199 */
200enum pm_ret_status {
201 PM_RET_SUCCESS,
202 PM_RET_ERROR_ARGS,
203 PM_RET_ERROR_ACCESS,
204 PM_RET_ERROR_TIMEOUT,
205 PM_RET_ERROR_NOTSUPPORTED,
206 PM_RET_ERROR_PROC,
207 PM_RET_ERROR_API_ID,
208 PM_RET_ERROR_FAILURE,
209 PM_RET_ERROR_COMMUNIC,
210 PM_RET_ERROR_DOUBLEREQ,
211 PM_RET_ERROR_OTHER,
212};
213
214/**
215 * @PM_INITIAL_BOOT: boot is a fresh system startup
216 * @PM_RESUME: boot is a resume
217 * @PM_BOOT_ERROR: error, boot cause cannot be identified
218 */
219enum pm_boot_status {
220 PM_INITIAL_BOOT,
221 PM_RESUME,
222 PM_BOOT_ERROR,
223};
224
225#endif /* _PM_DEFS_H_ */