1 /*
2  * Arm SCP/MCP Software
3  * Copyright (c) 2015-2021, Arm Limited and Contributors. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  *
7  * Description:
8  *      System Control and Management Interface (SCMI) protocol independent
9  *      definitions.
10  */
11 
12 #ifndef INTERNAL_SCMI_H
13 #define INTERNAL_SCMI_H
14 
15 #include <stdint.h>
16 
17 /*!
18  * \defgroup GroupSCMI System Control & Management Interface (SCMI)
19  * \{
20  */
21 
22 /*!
23  * \brief Entity role.
24  */
25 enum scmi_role {
26     /*! Agent entity */
27     SCMI_ROLE_AGENT,
28 
29     /*! Platform entity */
30     SCMI_ROLE_PLATFORM
31 };
32 
33 /*!
34  * \brief Agent type
35  *
36  * \details The SCMI specification defines three specific agent types:
37  *          - a PSCI implementation on AP processors.
38  *          - a management agent.
39  *          - an OSPM.
40  *      The POWER_STATE_SET command targeting a power domain, including AP
41  *      cores, is processed only if issued by a PSCI agent. The processing of
42  *      the SYSTEM_POWER_STATE_SET command depends on the type of the agent that
43  *      issued it. The OTHER type is added here to cover the other type of
44  *      agents.
45  */
46 enum scmi_agent_type {
47     /*! PSCI agent */
48     SCMI_AGENT_TYPE_PSCI,
49 
50     /*! Management agent */
51     SCMI_AGENT_TYPE_MANAGEMENT,
52 
53     /*! OSPM agent */
54     SCMI_AGENT_TYPE_OSPM,
55 
56     /*! Other agent */
57     SCMI_AGENT_TYPE_OTHER,
58 
59     /*! Number of agent types */
60     SCMI_AGENT_TYPE_COUNT,
61 };
62 
63 /*!
64  * \brief Channel type.
65  *
66  * \details Defines the channel direction in terms of the requester to the
67  *      completer.
68  *
69  * \note The integer values of this enumeration are based on the requester of
70  *      communications in that configuration.
71  */
72 enum scmi_channel_type {
73     /*!< Agent-to-platform */
74     SCMI_CHANNEL_TYPE_A2P = SCMI_ROLE_AGENT,
75 
76     /*!< Platform-to-agent */
77     SCMI_CHANNEL_TYPE_P2A = SCMI_ROLE_PLATFORM
78 };
79 
80 
81 /*!
82  * \brief Generic platform-to-agent PROTOCOL_VERSION structure.
83  */
84 struct scmi_protocol_version_p2a {
85     int32_t status;
86     uint32_t version;
87 };
88 
89 /*!
90  * \brief Generic platform-to-agent PROTOCOL_ATTRIBUTES structure.
91  */
92 struct scmi_protocol_attributes_p2a {
93     int32_t status;
94     uint32_t attributes;
95 };
96 
97 /*!
98  * \brief Generic agent-to-platform PROTOCOL_MESSAGE_ATTRIBUTES structure.
99  */
100 struct scmi_protocol_message_attributes_a2p {
101     uint32_t message_id;
102 };
103 
104 /*!
105  * \brief Generic platform-to-agent PROTOCOL_MESSAGE_ATTRIBUTES structure.
106  */
107 struct scmi_protocol_message_attributes_p2a {
108     int32_t status;
109     uint32_t attributes;
110 };
111 
112 /*!
113  * \}
114  */
115 
116 #endif /* INTERNAL_SCMI_H */
117