blob: 248c7151f8dba12069620f484d70cee1b983ee6c [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
Tejas Patel6b282252019-01-10 03:03:47 -080030#define PM_FORCE_POWERDOWN 8U
Tejas Patelfe0e10a2019-12-08 23:29:44 -080031#define PM_ABORT_SUSPEND 9U
Tejas Patel6b282252019-01-10 03:03:47 -080032#define PM_SYSTEM_SHUTDOWN 12U
Tejas Patel41f3e0b2019-01-08 01:46:37 -080033#define PM_REQUEST_DEVICE 13U
34#define PM_RELEASE_DEVICE 14U
35#define PM_SET_REQUIREMENT 15U
Tejas Patel87c4f3a2019-01-08 01:46:38 -080036#define PM_RESET_ASSERT 17U
37#define PM_RESET_GET_STATUS 18U
Tejas Patel20e92022019-01-08 01:46:39 -080038#define PM_PINCTRL_REQUEST 28U
39#define PM_PINCTRL_RELEASE 29U
40#define PM_PINCTRL_GET_FUNCTION 30U
41#define PM_PINCTRL_SET_FUNCTION 31U
42#define PM_PINCTRL_CONFIG_PARAM_GET 32U
43#define PM_PINCTRL_CONFIG_PARAM_SET 33U
Tejas Patel1f56fb12019-01-08 01:46:40 -080044#define PM_CLOCK_ENABLE 36U
45#define PM_CLOCK_DISABLE 37U
46#define PM_CLOCK_GETSTATE 38U
47#define PM_CLOCK_SETDIVIDER 39U
48#define PM_CLOCK_GETDIVIDER 40U
49#define PM_CLOCK_SETRATE 41U
50#define PM_CLOCK_GETRATE 42U
51#define PM_CLOCK_SETPARENT 43U
52#define PM_CLOCK_GETPARENT 44U
Tejas Patel023116d2019-01-08 01:46:41 -080053#define PM_PLL_SET_PARAMETER 48U
54#define PM_PLL_GET_PARAMETER 49U
55#define PM_PLL_SET_MODE 50U
56#define PM_PLL_GET_MODE 51U
Tejas Patel9d09ff92019-01-08 01:46:35 -080057
Tejas Patel354fe572018-12-14 00:55:37 -080058/*********************************************************************
59 * Enum definitions
60 ********************************************************************/
61
Tejas Patelfe0e10a2019-12-08 23:29:44 -080062enum pm_abort_reason {
63 ABORT_REASON_WKUP_EVENT = 100,
64 ABORT_REASON_PU_BUSY,
65 ABORT_REASON_NO_PWRDN,
66 ABORT_REASON_UNKNOWN,
67};
68
Tejas Patel354fe572018-12-14 00:55:37 -080069/**
Tejas Patel41f3e0b2019-01-08 01:46:37 -080070 * Subsystem IDs
71 */
72typedef enum {
73 XPM_SUBSYSID_PMC,
74 XPM_SUBSYSID_PSM,
75 XPM_SUBSYSID_APU,
76 XPM_SUBSYSID_RPU0_LOCK,
77 XPM_SUBSYSID_RPU0_0,
78 XPM_SUBSYSID_RPU0_1,
79 XPM_SUBSYSID_DDR0,
80 XPM_SUBSYSID_ME,
81 XPM_SUBSYSID_PL,
82 XPM_SUBSYSID_MAX,
83} XPm_SubsystemId;
84
85/**
Tejas Patel354fe572018-12-14 00:55:37 -080086 * @PM_RET_SUCCESS: success
87 * @PM_RET_ERROR_ARGS: illegal arguments provided (deprecated)
88 * @PM_RET_ERROR_NOTSUPPORTED: feature not supported (deprecated)
89 * @PM_RET_ERROR_INTERNAL: internal error
90 * @PM_RET_ERROR_CONFLICT: conflict
91 * @PM_RET_ERROR_ACCESS: access rights violation
92 * @PM_RET_ERROR_INVALID_NODE: invalid node
93 * @PM_RET_ERROR_DOUBLE_REQ: duplicate request for same node
94 * @PM_RET_ERROR_ABORT_SUSPEND: suspend procedure has been aborted
95 * @PM_RET_ERROR_TIMEOUT: timeout in communication with PMU
96 * @PM_RET_ERROR_NODE_USED: node is already in use
97 */
98enum pm_ret_status {
99 PM_RET_SUCCESS,
100 PM_RET_ERROR_ARGS = 1,
101 PM_RET_ERROR_NOTSUPPORTED = 4,
102 PM_RET_ERROR_INTERNAL = 2000,
103 PM_RET_ERROR_CONFLICT = 2001,
104 PM_RET_ERROR_ACCESS = 2002,
105 PM_RET_ERROR_INVALID_NODE = 2003,
106 PM_RET_ERROR_DOUBLE_REQ = 2004,
107 PM_RET_ERROR_ABORT_SUSPEND = 2005,
108 PM_RET_ERROR_TIMEOUT = 2006,
109 PM_RET_ERROR_NODE_USED = 2007
110};
111#endif /* PM_DEFS_H */