TianoCore EDK2 master
Loading...
Searching...
No Matches
ArmScmiPerformanceProtocol.h
Go to the documentation of this file.
1
12#ifndef ARM_SCMI_PERFORMANCE_PROTOCOL_H_
13#define ARM_SCMI_PERFORMANCE_PROTOCOL_H_
14
15#include <Protocol/ArmScmi.h>
16
18#define PERFORMANCE_PROTOCOL_VERSION_V1 0x10000
19#define PERFORMANCE_PROTOCOL_VERSION_V2 0x20000
20#define PERFORMANCE_PROTOCOL_VERSION_V3 0x30000
21
22#define ARM_SCMI_PERFORMANCE_PROTOCOL_GUID { \
23 0x9b8ba84, 0x3dd3, 0x49a6, {0xa0, 0x5a, 0x31, 0x34, 0xa5, 0xf0, 0x7b, 0xad} \
24 }
25
26extern EFI_GUID gArmScmiPerformanceProtocolGuid;
27
29
30#pragma pack(1)
31
32#define POWER_IN_MW_SHIFT 16
33#define POWER_IN_MW_MASK 0x1
34#define NUM_PERF_DOMAINS_MASK 0xFFFF
35
36// Total number of performance domains, Attr Bits [15:0]
37#define SCMI_PERF_TOTAL_DOMAINS(Attr) (Attr & NUM_PERF_DOMAINS_MASK)
38
39// A flag to express power values in mW or platform specific way, Attr Bit [16]
40#define SCMI_PERF_POWER_IN_MW(Attr) ((Attr >> POWER_IN_MW_SHIFT) & \
41 POWER_IN_MW_MASK)
42
43// Performance protocol attributes return values.
44typedef struct {
45 UINT32 Attributes;
46 UINT64 StatisticsAddress;
47 UINT32 StatisticsLen;
49
50#define SCMI_PERF_SUPPORT_LVL_CHANGE_NOTIFY(Attr) ((Attr >> 28) & 0x1)
51#define SCMI_PERF_SUPPORT_LIM_CHANGE_NOTIFY(Attr) ((Attr >> 29) & 0x1)
52#define SCMI_PERF_SUPPORT_SET_LVL(Attr) ((Attr >> 30) & 0x1)
53#define SCMI_PERF_SUPPORT_SET_LIM(Attr) ((Attr >> 31) & 0x1)
54#define SCMI_PERF_RATE_LIMIT(RateLimit) (RateLimit & 0xFFF)
55
56// Performance protocol domain attributes.
57typedef struct {
58 UINT32 Attributes;
59 UINT32 RateLimit;
60 UINT32 SustainedFreq;
61 UINT32 SustainedPerfLevel;
62 UINT8 Name[SCMI_MAX_STR_LEN];
64
65// Worst case latency in microseconds, Bits[15:0]
66#define PERF_LATENCY_MASK 0xFFFF
67#define SCMI_PERFORMANCE_PROTOCOL_LATENCY(Latency) (Latency & PERF_LATENCY_MASK)
68
69// Performance protocol performance level.
70typedef struct {
71 UINT32 Level;
72 UINT32 PowerCost;
73 UINT32 Latency;
75
76// Performance protocol performance limit.
77typedef struct {
78 UINT32 RangeMax;
79 UINT32 RangeMin;
81
83#define SCMI_PERF_FC_ATTRIB_HAS_DOORBELL BIT0
84
86typedef struct {
88 UINT32 Attributes;
89
91 UINT32 RateLimit;
92
95
98
100 UINT32 ChanSize;
101
104
107
110
113
116
120
121#pragma pack()
122
124typedef enum {
125 ScmiMessageIdPerformanceDomainAttributes = 0x3,
126 ScmiMessageIdPerformanceDescribeLevels = 0x4,
127 ScmiMessageIdPerformanceLimitsSet = 0x5,
128 ScmiMessageIdPerformanceLimitsGet = 0x6,
129 ScmiMessageIdPerformanceLevelSet = 0x7,
130 ScmiMessageIdPerformanceLevelGet = 0x8,
131 ScmiMessageIdPerformanceDescribeFastchannel = 0xB,
133
146typedef
150 OUT UINT32 *Version
151 );
152
163typedef
168
169 );
170
182typedef
186 IN UINT32 DomainId,
188 );
189
207typedef
211 IN UINT32 DomainId,
212 OUT UINT32 *NumLevels,
213 IN OUT UINT32 *LevelArraySize,
214 OUT SCMI_PERFORMANCE_LEVEL *LevelArray
215 );
216
227typedef
231 IN UINT32 DomainId,
233 );
234
246typedef
250 UINT32 DomainId,
252 );
253
264typedef
268 IN UINT32 DomainId,
269 IN UINT32 Level
270 );
271
283typedef
287 IN UINT32 DomainId,
288 OUT UINT32 *Level
289 );
290
310typedef
314 IN UINT32 DomainId,
317 );
318
321 SCMI_PERFORMANCE_GET_ATTRIBUTES GetProtocolAttributes;
322 SCMI_PERFORMANCE_GET_DOMAIN_ATTRIBUTES GetDomainAttributes;
328 SCMI_PERFORMANCE_DESCRIBE_FASTCHANNEL DescribeFastchannel;
330
331#endif /* ARM_SCMI_PERFORMANCE_PROTOCOL_H_ */
EFI_STATUS(EFIAPI * SCMI_PERFORMANCE_LEVEL_GET)(IN SCMI_PERFORMANCE_PROTOCOL *This, IN UINT32 DomainId, OUT UINT32 *Level)
EFI_STATUS(EFIAPI * SCMI_PERFORMANCE_GET_VERSION)(IN SCMI_PERFORMANCE_PROTOCOL *This, OUT UINT32 *Version)
EFI_STATUS(EFIAPI * SCMI_PERFORMANCE_LIMITS_SET)(IN SCMI_PERFORMANCE_PROTOCOL *This, IN UINT32 DomainId, IN SCMI_PERFORMANCE_LIMITS *Limits)
EFI_STATUS(EFIAPI * SCMI_PERFORMANCE_GET_ATTRIBUTES)(IN SCMI_PERFORMANCE_PROTOCOL *This, OUT SCMI_PERFORMANCE_PROTOCOL_ATTRIBUTES *Attributes)
EFI_STATUS(EFIAPI * SCMI_PERFORMANCE_LEVEL_SET)(IN SCMI_PERFORMANCE_PROTOCOL *This, IN UINT32 DomainId, IN UINT32 Level)
EFI_STATUS(EFIAPI * SCMI_PERFORMANCE_DESCRIBE_FASTCHANNEL)(IN SCMI_PERFORMANCE_PROTOCOL *This, IN UINT32 DomainId, IN SCMI_MESSAGE_ID_PERFORMANCE MessageId, OUT SCMI_PERFORMANCE_FASTCHANNEL *FastChannel)
SCMI_MESSAGE_ID_PERFORMANCE
SCMI Message Ids for the Performance Protocol.
EFI_STATUS(EFIAPI * SCMI_PERFORMANCE_DESCRIBE_LEVELS)(IN SCMI_PERFORMANCE_PROTOCOL *This, IN UINT32 DomainId, OUT UINT32 *NumLevels, IN OUT UINT32 *LevelArraySize, OUT SCMI_PERFORMANCE_LEVEL *LevelArray)
EFI_STATUS(EFIAPI * SCMI_PERFORMANCE_LIMITS_GET)(SCMI_PERFORMANCE_PROTOCOL *This, UINT32 DomainId, SCMI_PERFORMANCE_LIMITS *Limits)
EFI_STATUS(EFIAPI * SCMI_PERFORMANCE_GET_DOMAIN_ATTRIBUTES)(IN SCMI_PERFORMANCE_PROTOCOL *This, IN UINT32 DomainId, OUT SCMI_PERFORMANCE_DOMAIN_ATTRIBUTES *DomainAttributes)
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
Definition: Base.h:213
Performance protocol describe fastchannel.
UINT32 DoorbellAddrHigh
Higher 32 bits of the doorbell address.
UINT32 DoorbellSetMaskHigh
Mask of higher 32 bits to set when writing to the doorbell register.
UINT32 DoorbellAddrLow
Lower 32 bits of the doorbell address.
UINT32 ChanAddrHigh
Higher 32 bits of the FastChannel address.
UINT32 DoorbellSetMaskLow
Mask of lower 32 bits to set when writing to the doorbell register.
UINT32 ChanAddrLow
Lower 32 bits of the FastChannel address.
UINT32 DoorbellPreserveMaskHigh
Mask of higher 32 bits to preserve when writing to the doorbell register.
UINT32 ChanSize
Size of the FastChannel in bytes.
UINT32 DoorbellPreserveMaskLow
Mask of lower 32 bits to preserve when writing to the doorbell register.