blob: 1b8871f7f07faf4267bed00faf8bf81809f1dd47 [file] [log] [blame]
Tejas Patel354fe572018-12-14 00:55:37 -08001/*
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 Patel9d09ff92019-01-08 01:46:35 -080025/* PM API ids */
26#define PM_GET_API_VERSION 1U
Tejas Patel41f3e0b2019-01-08 01:46:37 -080027#define PM_GET_DEVICE_STATUS 3U
Tejas Patelfe0e10a2019-12-08 23:29:44 -080028#define PM_REQ_SUSPEND 6U
29#define PM_SELF_SUSPEND 7U
30#define PM_ABORT_SUSPEND 9U
Tejas Patel41f3e0b2019-01-08 01:46:37 -080031#define PM_REQUEST_DEVICE 13U
32#define PM_RELEASE_DEVICE 14U
33#define PM_SET_REQUIREMENT 15U
Tejas Patel87c4f3a2019-01-08 01:46:38 -080034#define PM_RESET_ASSERT 17U
35#define PM_RESET_GET_STATUS 18U
Tejas Patel9d09ff92019-01-08 01:46:35 -080036
Tejas Patel354fe572018-12-14 00:55:37 -080037/*********************************************************************
38 * Enum definitions
39 ********************************************************************/
40
Tejas Patelfe0e10a2019-12-08 23:29:44 -080041enum 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 Patel354fe572018-12-14 00:55:37 -080048/**
Tejas Patel41f3e0b2019-01-08 01:46:37 -080049 * Subsystem IDs
50 */
51typedef 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 Patel354fe572018-12-14 00:55:37 -080065 * @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 */
77enum 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 */