TianoCore EDK2 master
Loading...
Searching...
No Matches
ScmiPrivate.h
Go to the documentation of this file.
1
12#ifndef SCMI_PRIVATE_H_
13#define SCMI_PRIVATE_H_
14
15// SCMI protocol IDs.
16typedef enum {
17 ScmiProtocolIdBase = 0x10,
18 ScmiProtocolIdPowerDomain = 0x11,
19 ScmiProtocolIdSystemPower = 0x12,
20 ScmiProtocolIdPerformance = 0x13,
21 ScmiProtocolIdClock = 0x14,
22 ScmiProtocolIdSensor = 0x15
23} SCMI_PROTOCOL_ID;
24
25// SCMI message types.
26typedef enum {
27 ScmiMessageTypeCommand = 0,
28 ScmiMessageTypeDelayedResponse = 2, // Skipping 1 is deliberate.
29 ScmiMessageTypeNotification = 3
30} SCMI_MESSAGE_TYPE;
31
32// SCMI response error codes.
33typedef enum {
34 ScmiSuccess = 0,
35 ScmiNotSupported = -1,
36 ScmiInvalidParameters = -2,
37 ScmiDenied = -3,
38 ScmiNotFound = -4,
39 ScmiOutOfRange = -5,
40 ScmiBusy = -6,
41 ScmiCommsError = -7,
42 ScmiGenericError = -8,
43 ScmiHardwareError = -9,
44 ScmiProtocolError = -10
45} SCMI_STATUS;
46
47// SCMI message IDs common to all protocols.
48typedef enum {
49 ScmiMessageIdProtocolVersion = 0x0,
50 ScmiMessageIdProtocolAttributes = 0x1,
51 ScmiMessageIdProtocolMessageAttributes = 0x2
52} SCMI_MESSAGE_ID;
53
54// Not defined in SCMI specification but will help to identify a message.
55typedef struct {
56 SCMI_PROTOCOL_ID ProtocolId;
57 UINT32 MessageId;
59
60#pragma pack(1)
61
62// Response to a SCMI command.
63typedef struct {
64 INT32 Status;
65 UINT32 ReturnValues[];
67
68// Message header. MsgId[7:0], MsgType[9:8], ProtocolId[17:10]
69#define MESSAGE_TYPE_SHIFT 8
70#define PROTOCOL_ID_SHIFT 10
71#define SCMI_MESSAGE_HEADER(MsgId, MsgType, ProtocolId) ( \
72 MsgType << MESSAGE_TYPE_SHIFT | \
73 ProtocolId << PROTOCOL_ID_SHIFT | \
74 MsgId \
75 )
76// SCMI message header.
77typedef struct {
78 UINT32 MessageHeader;
80
81#pragma pack()
82
93 OUT UINT32 **Payload
94 );
95
117 IN SCMI_COMMAND *Command,
118 IN OUT UINT32 *PayloadLength,
119 OUT UINT32 **ReturnValues OPTIONAL
120 );
121
134 IN SCMI_PROTOCOL_ID ProtocolId,
135 OUT UINT32 *Version
136 );
137
149 IN SCMI_PROTOCOL_ID ProtocolId,
150 OUT UINT32 **ReturnValues
151 );
152
165 IN SCMI_PROTOCOL_ID ProtocolId,
166 OUT UINT32 **ReturnValues
167 );
168
169#endif /* SCMI_PRIVATE_H_ */
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS ScmiGetProtocolVersion(IN SCMI_PROTOCOL_ID ProtocolId, OUT UINT32 *Version)
Definition: Scmi.c:190
EFI_STATUS ScmiGetProtocolMessageAttributes(IN SCMI_PROTOCOL_ID ProtocolId, OUT UINT32 **ReturnValues)
Definition: Scmi.c:244
EFI_STATUS ScmiCommandExecute(IN SCMI_COMMAND *Command, IN OUT UINT32 *PayloadLength, OUT UINT32 **ReturnValues OPTIONAL)
Definition: Scmi.c:76
EFI_STATUS ScmiCommandGetPayload(OUT UINT32 **Payload)
Definition: Scmi.c:31
EFI_STATUS ScmiGetProtocolAttributes(IN SCMI_PROTOCOL_ID ProtocolId, OUT UINT32 **ReturnValues)
Definition: Scmi.c:222
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29