blob: d482cb75ae28e9a8403c58e5d8ab6dcc608fd433 [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 Patelfe0e10a2019-12-08 23:29:44 -080027#define PM_REQ_SUSPEND 6U
28#define PM_SELF_SUSPEND 7U
29#define PM_ABORT_SUSPEND 9U
Tejas Patel9d09ff92019-01-08 01:46:35 -080030
Tejas Patel354fe572018-12-14 00:55:37 -080031/*********************************************************************
32 * Enum definitions
33 ********************************************************************/
34
Tejas Patelfe0e10a2019-12-08 23:29:44 -080035enum pm_abort_reason {
36 ABORT_REASON_WKUP_EVENT = 100,
37 ABORT_REASON_PU_BUSY,
38 ABORT_REASON_NO_PWRDN,
39 ABORT_REASON_UNKNOWN,
40};
41
Tejas Patel354fe572018-12-14 00:55:37 -080042/**
43 * @PM_RET_SUCCESS: success
44 * @PM_RET_ERROR_ARGS: illegal arguments provided (deprecated)
45 * @PM_RET_ERROR_NOTSUPPORTED: feature not supported (deprecated)
46 * @PM_RET_ERROR_INTERNAL: internal error
47 * @PM_RET_ERROR_CONFLICT: conflict
48 * @PM_RET_ERROR_ACCESS: access rights violation
49 * @PM_RET_ERROR_INVALID_NODE: invalid node
50 * @PM_RET_ERROR_DOUBLE_REQ: duplicate request for same node
51 * @PM_RET_ERROR_ABORT_SUSPEND: suspend procedure has been aborted
52 * @PM_RET_ERROR_TIMEOUT: timeout in communication with PMU
53 * @PM_RET_ERROR_NODE_USED: node is already in use
54 */
55enum pm_ret_status {
56 PM_RET_SUCCESS,
57 PM_RET_ERROR_ARGS = 1,
58 PM_RET_ERROR_NOTSUPPORTED = 4,
59 PM_RET_ERROR_INTERNAL = 2000,
60 PM_RET_ERROR_CONFLICT = 2001,
61 PM_RET_ERROR_ACCESS = 2002,
62 PM_RET_ERROR_INVALID_NODE = 2003,
63 PM_RET_ERROR_DOUBLE_REQ = 2004,
64 PM_RET_ERROR_ABORT_SUSPEND = 2005,
65 PM_RET_ERROR_TIMEOUT = 2006,
66 PM_RET_ERROR_NODE_USED = 2007
67};
68#endif /* PM_DEFS_H */