blob: 7bbfec858d46cc07fb80e9efc880379bce4b021b [file] [log] [blame]
Soren Brinkmann76fcae32016-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 Drazic0bd9d0c2016-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 Brinkmann76fcae32016-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,
89 PM_API_MAX
90};
91
92enum pm_node_id {
93 NODE_UNKNOWN = 0,
94 NODE_APU,
95 NODE_APU_0,
96 NODE_APU_1,
97 NODE_APU_2,
98 NODE_APU_3,
99 NODE_RPU,
100 NODE_RPU_0,
101 NODE_RPU_1,
102 NODE_PL,
103 NODE_FPD,
104 NODE_OCM_BANK_0,
105 NODE_OCM_BANK_1,
106 NODE_OCM_BANK_2,
107 NODE_OCM_BANK_3,
108 NODE_TCM_0_A,
109 NODE_TCM_0_B,
110 NODE_TCM_1_A,
111 NODE_TCM_1_B,
112 NODE_L2,
113 NODE_GPU_PP_0,
114 NODE_GPU_PP_1,
115 NODE_USB_0,
116 NODE_USB_1,
117 NODE_TTC_0,
118 NODE_TTC_1,
119 NODE_TTC_2,
120 NODE_TTC_3,
121 NODE_SATA,
122 NODE_ETH_0,
123 NODE_ETH_1,
124 NODE_ETH_2,
125 NODE_ETH_3,
126 NODE_UART_0,
127 NODE_UART_1,
128 NODE_SPI_0,
129 NODE_SPI_1,
130 NODE_I2C_0,
131 NODE_I2C_1,
132 NODE_SD_0,
133 NODE_SD_1,
134 NODE_DP,
135 NODE_GDMA,
136 NODE_ADMA,
137 NODE_NAND,
138 NODE_QSPI,
139 NODE_GPIO,
140 NODE_CAN_0,
141 NODE_CAN_1,
142 NODE_AFI,
143 NODE_APLL,
144 NODE_VPLL,
145 NODE_DPLL,
146 NODE_RPLL,
147 NODE_IOPLL,
148 NODE_DDR,
Mirela Simonovic0ff06ce2016-06-07 18:15:40 +0200149 NODE_IPI_APU,
Mirela Simonovic9b984be2016-06-17 16:17:23 +0200150 NODE_IPI_RPU_0,
Soren Brinkmann76fcae32016-03-06 20:16:27 -0800151};
152
153enum pm_request_ack {
154 REQ_ACK_NO = 1,
155 REQ_ACK_BLOCKING,
156 REQ_ACK_NON_BLOCKING,
157};
158
159enum pm_abort_reason {
160 ABORT_REASON_WKUP_EVENT = 100,
161 ABORT_REASON_PU_BUSY,
162 ABORT_REASON_NO_PWRDN,
163 ABORT_REASON_UNKNOWN,
164};
165
166enum pm_suspend_reason {
167 SUSPEND_REASON_PU_REQ = 201,
168 SUSPEND_REASON_ALERT,
169 SUSPEND_REASON_SYS_SHUTDOWN,
170};
171
172enum pm_ram_state {
173 PM_RAM_STATE_OFF = 1,
174 PM_RAM_STATE_RETENTION,
175 PM_RAM_STATE_ON,
176};
177
178enum pm_opchar_type {
179 PM_OPCHAR_TYPE_POWER = 1,
Soren Brinkmann76fcae32016-03-06 20:16:27 -0800180 PM_OPCHAR_TYPE_TEMP,
Anes Hadziahmetagic92aee012016-05-12 16:17:30 +0200181 PM_OPCHAR_TYPE_LATENCY,
Soren Brinkmann76fcae32016-03-06 20:16:27 -0800182};
183
184/**
185 * @PM_RET_SUCCESS: success
186 * @PM_RET_ERROR_ARGS: illegal arguments provided
187 * @PM_RET_ERROR_ACCESS: access rights violation
188 * @PM_RET_ERROR_TIMEOUT: timeout in communication with PMU
189 * @PM_RET_ERROR_NOTSUPPORTED: feature not supported
190 * @PM_RET_ERROR_PROC: node is not a processor node
191 * @PM_RET_ERROR_API_ID: illegal API ID
192 * @PM_RET_ERROR_OTHER: other error
193 */
194enum pm_ret_status {
195 PM_RET_SUCCESS,
196 PM_RET_ERROR_ARGS,
197 PM_RET_ERROR_ACCESS,
198 PM_RET_ERROR_TIMEOUT,
199 PM_RET_ERROR_NOTSUPPORTED,
200 PM_RET_ERROR_PROC,
201 PM_RET_ERROR_API_ID,
202 PM_RET_ERROR_FAILURE,
203 PM_RET_ERROR_COMMUNIC,
204 PM_RET_ERROR_DOUBLEREQ,
205 PM_RET_ERROR_OTHER,
206};
207
208/**
209 * @PM_INITIAL_BOOT: boot is a fresh system startup
210 * @PM_RESUME: boot is a resume
211 * @PM_BOOT_ERROR: error, boot cause cannot be identified
212 */
213enum pm_boot_status {
214 PM_INITIAL_BOOT,
215 PM_RESUME,
216 PM_BOOT_ERROR,
217};
218
219#endif /* _PM_DEFS_H_ */