Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 56 | /********************************************************************* |
| 57 | * Enum definitions |
| 58 | ********************************************************************/ |
| 59 | |
| 60 | enum pm_api_id { |
| 61 | /* Miscellaneous API functions: */ |
| 62 | PM_GET_API_VERSION = 1, /* Do not change or move */ |
| 63 | PM_SET_CONFIGURATION, |
| 64 | PM_GET_NODE_STATUS, |
| 65 | PM_GET_OP_CHARACTERISTIC, |
| 66 | PM_REGISTER_NOTIFIER, |
| 67 | /* API for suspending of PUs: */ |
| 68 | PM_REQ_SUSPEND, |
| 69 | PM_SELF_SUSPEND, |
| 70 | PM_FORCE_POWERDOWN, |
| 71 | PM_ABORT_SUSPEND, |
| 72 | PM_REQ_WAKEUP, |
| 73 | PM_SET_WAKEUP_SOURCE, |
| 74 | PM_SYSTEM_SHUTDOWN, |
| 75 | /* API for managing PM slaves: */ |
| 76 | PM_REQ_NODE, |
| 77 | PM_RELEASE_NODE, |
| 78 | PM_SET_REQUIREMENT, |
| 79 | PM_SET_MAX_LATENCY, |
| 80 | /* Direct control API functions: */ |
| 81 | PM_RESET_ASSERT, |
| 82 | PM_RESET_GET_STATUS, |
| 83 | PM_MMIO_WRITE, |
| 84 | PM_MMIO_READ, |
| 85 | PM_API_MAX |
| 86 | }; |
| 87 | |
| 88 | enum pm_node_id { |
| 89 | NODE_UNKNOWN = 0, |
| 90 | NODE_APU, |
| 91 | NODE_APU_0, |
| 92 | NODE_APU_1, |
| 93 | NODE_APU_2, |
| 94 | NODE_APU_3, |
| 95 | NODE_RPU, |
| 96 | NODE_RPU_0, |
| 97 | NODE_RPU_1, |
| 98 | NODE_PL, |
| 99 | NODE_FPD, |
| 100 | NODE_OCM_BANK_0, |
| 101 | NODE_OCM_BANK_1, |
| 102 | NODE_OCM_BANK_2, |
| 103 | NODE_OCM_BANK_3, |
| 104 | NODE_TCM_0_A, |
| 105 | NODE_TCM_0_B, |
| 106 | NODE_TCM_1_A, |
| 107 | NODE_TCM_1_B, |
| 108 | NODE_L2, |
| 109 | NODE_GPU_PP_0, |
| 110 | NODE_GPU_PP_1, |
| 111 | NODE_USB_0, |
| 112 | NODE_USB_1, |
| 113 | NODE_TTC_0, |
| 114 | NODE_TTC_1, |
| 115 | NODE_TTC_2, |
| 116 | NODE_TTC_3, |
| 117 | NODE_SATA, |
| 118 | NODE_ETH_0, |
| 119 | NODE_ETH_1, |
| 120 | NODE_ETH_2, |
| 121 | NODE_ETH_3, |
| 122 | NODE_UART_0, |
| 123 | NODE_UART_1, |
| 124 | NODE_SPI_0, |
| 125 | NODE_SPI_1, |
| 126 | NODE_I2C_0, |
| 127 | NODE_I2C_1, |
| 128 | NODE_SD_0, |
| 129 | NODE_SD_1, |
| 130 | NODE_DP, |
| 131 | NODE_GDMA, |
| 132 | NODE_ADMA, |
| 133 | NODE_NAND, |
| 134 | NODE_QSPI, |
| 135 | NODE_GPIO, |
| 136 | NODE_CAN_0, |
| 137 | NODE_CAN_1, |
| 138 | NODE_AFI, |
| 139 | NODE_APLL, |
| 140 | NODE_VPLL, |
| 141 | NODE_DPLL, |
| 142 | NODE_RPLL, |
| 143 | NODE_IOPLL, |
| 144 | NODE_DDR, |
Mirela Simonovic | 0ff06ce | 2016-06-07 18:15:40 +0200 | [diff] [blame] | 145 | NODE_IPI_APU, |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 146 | }; |
| 147 | |
| 148 | enum pm_request_ack { |
| 149 | REQ_ACK_NO = 1, |
| 150 | REQ_ACK_BLOCKING, |
| 151 | REQ_ACK_NON_BLOCKING, |
| 152 | }; |
| 153 | |
| 154 | enum pm_abort_reason { |
| 155 | ABORT_REASON_WKUP_EVENT = 100, |
| 156 | ABORT_REASON_PU_BUSY, |
| 157 | ABORT_REASON_NO_PWRDN, |
| 158 | ABORT_REASON_UNKNOWN, |
| 159 | }; |
| 160 | |
| 161 | enum pm_suspend_reason { |
| 162 | SUSPEND_REASON_PU_REQ = 201, |
| 163 | SUSPEND_REASON_ALERT, |
| 164 | SUSPEND_REASON_SYS_SHUTDOWN, |
| 165 | }; |
| 166 | |
| 167 | enum pm_ram_state { |
| 168 | PM_RAM_STATE_OFF = 1, |
| 169 | PM_RAM_STATE_RETENTION, |
| 170 | PM_RAM_STATE_ON, |
| 171 | }; |
| 172 | |
| 173 | enum pm_opchar_type { |
| 174 | PM_OPCHAR_TYPE_POWER = 1, |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 175 | PM_OPCHAR_TYPE_TEMP, |
Anes Hadziahmetagic | 92aee01 | 2016-05-12 16:17:30 +0200 | [diff] [blame] | 176 | PM_OPCHAR_TYPE_LATENCY, |
Soren Brinkmann | 76fcae3 | 2016-03-06 20:16:27 -0800 | [diff] [blame] | 177 | }; |
| 178 | |
| 179 | /** |
| 180 | * @PM_RET_SUCCESS: success |
| 181 | * @PM_RET_ERROR_ARGS: illegal arguments provided |
| 182 | * @PM_RET_ERROR_ACCESS: access rights violation |
| 183 | * @PM_RET_ERROR_TIMEOUT: timeout in communication with PMU |
| 184 | * @PM_RET_ERROR_NOTSUPPORTED: feature not supported |
| 185 | * @PM_RET_ERROR_PROC: node is not a processor node |
| 186 | * @PM_RET_ERROR_API_ID: illegal API ID |
| 187 | * @PM_RET_ERROR_OTHER: other error |
| 188 | */ |
| 189 | enum pm_ret_status { |
| 190 | PM_RET_SUCCESS, |
| 191 | PM_RET_ERROR_ARGS, |
| 192 | PM_RET_ERROR_ACCESS, |
| 193 | PM_RET_ERROR_TIMEOUT, |
| 194 | PM_RET_ERROR_NOTSUPPORTED, |
| 195 | PM_RET_ERROR_PROC, |
| 196 | PM_RET_ERROR_API_ID, |
| 197 | PM_RET_ERROR_FAILURE, |
| 198 | PM_RET_ERROR_COMMUNIC, |
| 199 | PM_RET_ERROR_DOUBLEREQ, |
| 200 | PM_RET_ERROR_OTHER, |
| 201 | }; |
| 202 | |
| 203 | /** |
| 204 | * @PM_INITIAL_BOOT: boot is a fresh system startup |
| 205 | * @PM_RESUME: boot is a resume |
| 206 | * @PM_BOOT_ERROR: error, boot cause cannot be identified |
| 207 | */ |
| 208 | enum pm_boot_status { |
| 209 | PM_INITIAL_BOOT, |
| 210 | PM_RESUME, |
| 211 | PM_BOOT_ERROR, |
| 212 | }; |
| 213 | |
| 214 | #endif /* _PM_DEFS_H_ */ |