Tejas Patel | 354fe57 | 2018-12-14 00:55:37 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2019, Xilinx, Inc. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | /* Versal power management enums and defines */ |
| 8 | |
| 9 | #ifndef PM_DEFS_H |
| 10 | #define PM_DEFS_H |
| 11 | |
| 12 | #include "pm_node.h" |
| 13 | |
| 14 | /********************************************************************* |
| 15 | * Macro definitions |
| 16 | ********************************************************************/ |
| 17 | |
| 18 | /* Processor core device IDs */ |
| 19 | #define APU_DEVID(IDX) NODEID(XPM_NODECLASS_DEVICE, XPM_NODESUBCL_DEV_CORE, \ |
| 20 | XPM_NODETYPE_DEV_CORE_APU, (IDX)) |
| 21 | |
| 22 | #define XPM_DEVID_ACPU_0 APU_DEVID(XPM_NODEIDX_DEV_ACPU_0) |
| 23 | #define XPM_DEVID_ACPU_1 APU_DEVID(XPM_NODEIDX_DEV_ACPU_1) |
| 24 | |
Tejas Patel | 9d09ff9 | 2019-01-08 01:46:35 -0800 | [diff] [blame] | 25 | /* PM API ids */ |
| 26 | #define PM_GET_API_VERSION 1U |
Tejas Patel | 41f3e0b | 2019-01-08 01:46:37 -0800 | [diff] [blame] | 27 | #define PM_GET_DEVICE_STATUS 3U |
Tejas Patel | fe0e10a | 2019-12-08 23:29:44 -0800 | [diff] [blame] | 28 | #define PM_REQ_SUSPEND 6U |
| 29 | #define PM_SELF_SUSPEND 7U |
| 30 | #define PM_ABORT_SUSPEND 9U |
Tejas Patel | 41f3e0b | 2019-01-08 01:46:37 -0800 | [diff] [blame] | 31 | #define PM_REQUEST_DEVICE 13U |
| 32 | #define PM_RELEASE_DEVICE 14U |
| 33 | #define PM_SET_REQUIREMENT 15U |
Tejas Patel | 87c4f3a | 2019-01-08 01:46:38 -0800 | [diff] [blame^] | 34 | #define PM_RESET_ASSERT 17U |
| 35 | #define PM_RESET_GET_STATUS 18U |
Tejas Patel | 9d09ff9 | 2019-01-08 01:46:35 -0800 | [diff] [blame] | 36 | |
Tejas Patel | 354fe57 | 2018-12-14 00:55:37 -0800 | [diff] [blame] | 37 | /********************************************************************* |
| 38 | * Enum definitions |
| 39 | ********************************************************************/ |
| 40 | |
Tejas Patel | fe0e10a | 2019-12-08 23:29:44 -0800 | [diff] [blame] | 41 | enum pm_abort_reason { |
| 42 | ABORT_REASON_WKUP_EVENT = 100, |
| 43 | ABORT_REASON_PU_BUSY, |
| 44 | ABORT_REASON_NO_PWRDN, |
| 45 | ABORT_REASON_UNKNOWN, |
| 46 | }; |
| 47 | |
Tejas Patel | 354fe57 | 2018-12-14 00:55:37 -0800 | [diff] [blame] | 48 | /** |
Tejas Patel | 41f3e0b | 2019-01-08 01:46:37 -0800 | [diff] [blame] | 49 | * Subsystem IDs |
| 50 | */ |
| 51 | typedef enum { |
| 52 | XPM_SUBSYSID_PMC, |
| 53 | XPM_SUBSYSID_PSM, |
| 54 | XPM_SUBSYSID_APU, |
| 55 | XPM_SUBSYSID_RPU0_LOCK, |
| 56 | XPM_SUBSYSID_RPU0_0, |
| 57 | XPM_SUBSYSID_RPU0_1, |
| 58 | XPM_SUBSYSID_DDR0, |
| 59 | XPM_SUBSYSID_ME, |
| 60 | XPM_SUBSYSID_PL, |
| 61 | XPM_SUBSYSID_MAX, |
| 62 | } XPm_SubsystemId; |
| 63 | |
| 64 | /** |
Tejas Patel | 354fe57 | 2018-12-14 00:55:37 -0800 | [diff] [blame] | 65 | * @PM_RET_SUCCESS: success |
| 66 | * @PM_RET_ERROR_ARGS: illegal arguments provided (deprecated) |
| 67 | * @PM_RET_ERROR_NOTSUPPORTED: feature not supported (deprecated) |
| 68 | * @PM_RET_ERROR_INTERNAL: internal error |
| 69 | * @PM_RET_ERROR_CONFLICT: conflict |
| 70 | * @PM_RET_ERROR_ACCESS: access rights violation |
| 71 | * @PM_RET_ERROR_INVALID_NODE: invalid node |
| 72 | * @PM_RET_ERROR_DOUBLE_REQ: duplicate request for same node |
| 73 | * @PM_RET_ERROR_ABORT_SUSPEND: suspend procedure has been aborted |
| 74 | * @PM_RET_ERROR_TIMEOUT: timeout in communication with PMU |
| 75 | * @PM_RET_ERROR_NODE_USED: node is already in use |
| 76 | */ |
| 77 | enum pm_ret_status { |
| 78 | PM_RET_SUCCESS, |
| 79 | PM_RET_ERROR_ARGS = 1, |
| 80 | PM_RET_ERROR_NOTSUPPORTED = 4, |
| 81 | PM_RET_ERROR_INTERNAL = 2000, |
| 82 | PM_RET_ERROR_CONFLICT = 2001, |
| 83 | PM_RET_ERROR_ACCESS = 2002, |
| 84 | PM_RET_ERROR_INVALID_NODE = 2003, |
| 85 | PM_RET_ERROR_DOUBLE_REQ = 2004, |
| 86 | PM_RET_ERROR_ABORT_SUSPEND = 2005, |
| 87 | PM_RET_ERROR_TIMEOUT = 2006, |
| 88 | PM_RET_ERROR_NODE_USED = 2007 |
| 89 | }; |
| 90 | #endif /* PM_DEFS_H */ |