TianoCore EDK2 master
Loading...
Searching...
No Matches
ArmScmiClockProtocolPrivate.h
Go to the documentation of this file.
1
12#ifndef ARM_SCMI_CLOCK_PROTOCOL_PRIVATE_H_
13#define ARM_SCMI_CLOCK_PROTOCOL_PRIVATE_H_
14
15#pragma pack(1)
16
17// Clock rate in two 32bit words.
18typedef struct {
19 UINT32 Low;
20 UINT32 High;
22
23// Format of the returned rate array. Linear or Non-linear,.RatesFlag Bit[12]
24#define RATE_FORMAT_SHIFT 12
25#define RATE_FORMAT_MASK 0x0001
26#define RATE_FORMAT(RatesFlags) ((RatesFlags >> RATE_FORMAT_SHIFT) \
27 & RATE_FORMAT_MASK)
28
29// Number of remaining rates after a call to the SCP, RatesFlag Bits[31:16]
30#define NUM_REMAIN_RATES_SHIFT 16
31#define NUM_REMAIN_RATES(RatesFlags) ((RatesFlags >> NUM_REMAIN_RATES_SHIFT))
32
33// Number of rates that are returned by a call.to the SCP, RatesFlag Bits[11:0]
34#define NUM_RATES_MASK 0x0FFF
35#define NUM_RATES(RatesFlags) (RatesFlags & NUM_RATES_MASK)
36
37// Return values for the CLOCK_DESCRIBER_RATE command.
38typedef struct {
39 UINT32 NumRatesFlags;
40
41 // NOTE: Since EDK2 does not allow flexible array member [] we declare
42 // here array of 1 element length. However below is used as a variable
43 // length array.
44 CLOCK_RATE_DWORD Rates[1];
46
47#define CLOCK_SET_DEFAULT_FLAGS 0
48
49// Message parameters for CLOCK_RATE_SET command.
50typedef struct {
51 UINT32 Flags;
52 UINT32 ClockId;
55
56// Message parameters for CLOCK_CONFIG_SET command.
57typedef struct {
58 UINT32 ClockId;
59 UINT32 Attributes;
61
62// if ClockAttr Bit[0] is set then clock device is enabled.
63#define CLOCK_ENABLE_MASK 0x1
64#define CLOCK_ENABLED(ClockAttr) ((ClockAttr & CLOCK_ENABLE_MASK) == 1)
65
66typedef struct {
67 UINT32 Attributes;
68 UINT8 ClockName[SCMI_MAX_STR_LEN];
70
71#pragma pack()
72
81 IN EFI_HANDLE *Handle
82 );
83
84#endif /* ARM_SCMI_CLOCK_PROTOCOL_PRIVATE_H_ */
EFI_STATUS ScmiClockProtocolInit(IN EFI_HANDLE *Handle)
#define IN
Definition: Base.h:279
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33