blob: 7fe5d37d301d7f656378f7c196d7df8c1010a180 [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,
Nava kishore Manne33d39272016-08-20 23:11:11 +053089 PM_INIT,
Nava kishore Manne68d460c2016-08-20 23:18:09 +053090 PM_FPGA_LOAD,
91 PM_FPGA_GET_STATUS,
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,
105 NODE_PL,
106 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,
145 NODE_AFI,
146 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,
Filip Drazic4c0765a2016-07-26 12:11:33 +0200158 NODE_MAX
Soren Brinkmann76fcae32016-03-06 20:16:27 -0800159};
160
161enum pm_request_ack {
162 REQ_ACK_NO = 1,
163 REQ_ACK_BLOCKING,
164 REQ_ACK_NON_BLOCKING,
165};
166
167enum pm_abort_reason {
168 ABORT_REASON_WKUP_EVENT = 100,
169 ABORT_REASON_PU_BUSY,
170 ABORT_REASON_NO_PWRDN,
171 ABORT_REASON_UNKNOWN,
172};
173
174enum pm_suspend_reason {
175 SUSPEND_REASON_PU_REQ = 201,
176 SUSPEND_REASON_ALERT,
177 SUSPEND_REASON_SYS_SHUTDOWN,
178};
179
180enum pm_ram_state {
181 PM_RAM_STATE_OFF = 1,
182 PM_RAM_STATE_RETENTION,
183 PM_RAM_STATE_ON,
184};
185
186enum pm_opchar_type {
187 PM_OPCHAR_TYPE_POWER = 1,
Soren Brinkmann76fcae32016-03-06 20:16:27 -0800188 PM_OPCHAR_TYPE_TEMP,
Anes Hadziahmetagic92aee012016-05-12 16:17:30 +0200189 PM_OPCHAR_TYPE_LATENCY,
Soren Brinkmann76fcae32016-03-06 20:16:27 -0800190};
191
192/**
193 * @PM_RET_SUCCESS: success
194 * @PM_RET_ERROR_ARGS: illegal arguments provided
195 * @PM_RET_ERROR_ACCESS: access rights violation
196 * @PM_RET_ERROR_TIMEOUT: timeout in communication with PMU
197 * @PM_RET_ERROR_NOTSUPPORTED: feature not supported
198 * @PM_RET_ERROR_PROC: node is not a processor node
199 * @PM_RET_ERROR_API_ID: illegal API ID
200 * @PM_RET_ERROR_OTHER: other error
201 */
202enum pm_ret_status {
203 PM_RET_SUCCESS,
204 PM_RET_ERROR_ARGS,
205 PM_RET_ERROR_ACCESS,
206 PM_RET_ERROR_TIMEOUT,
207 PM_RET_ERROR_NOTSUPPORTED,
208 PM_RET_ERROR_PROC,
209 PM_RET_ERROR_API_ID,
210 PM_RET_ERROR_FAILURE,
211 PM_RET_ERROR_COMMUNIC,
212 PM_RET_ERROR_DOUBLEREQ,
213 PM_RET_ERROR_OTHER,
214};
215
216/**
217 * @PM_INITIAL_BOOT: boot is a fresh system startup
218 * @PM_RESUME: boot is a resume
219 * @PM_BOOT_ERROR: error, boot cause cannot be identified
220 */
221enum pm_boot_status {
222 PM_INITIAL_BOOT,
223 PM_RESUME,
224 PM_BOOT_ERROR,
225};
226
227#endif /* _PM_DEFS_H_ */