12#ifndef ARM_SCMI_CLOCK_PROTOCOL_H_
13#define ARM_SCMI_CLOCK_PROTOCOL_H_
17#define ARM_SCMI_CLOCK_PROTOCOL_GUID {\
18 0x91ce67a8, 0xe0aa, 0x4012, {0xb9, 0x9f, 0xb6, 0xfc, 0xf3, 0x4, 0x8e, 0xaa} \
21extern EFI_GUID gArmScmiClockProtocolGuid;
25 ScmiMessageIdClockAttributes = 0x3,
26 ScmiMessageIdClockDescribeRates = 0x4,
27 ScmiMessageIdClockRateSet = 0x5,
28 ScmiMessageIdClockRateGet = 0x6,
29 ScmiMessageIdClockConfigSet = 0x7
30} SCMI_MESSAGE_ID_CLOCK;
33 ScmiClockRateFormatDiscrete,
34 ScmiClockRateFormatLinear
35} SCMI_CLOCK_RATE_FORMAT;
38#define SCMI_CLOCK_PROTOCOL_VERSION 0x10000
40#define SCMI_CLOCK_PROTOCOL_PENDING_ASYNC_RATES_MASK 0xFFU
41#define SCMI_CLOCK_PROTOCOL_PENDING_ASYNC_RATES_SHIFT 16
42#define SCMI_CLOCK_PROTOCOL_NUM_CLOCKS_MASK 0xFFFFU
47#define SCMI_CLOCK_PROTOCOL_MAX_ASYNC_CLK_RATES(Attr) ( \
48 (Attr >> SCMI_CLOCK_PROTOCOL_PENDING_ASYNC_RATES_SHIFT) && \
49 SCMI_CLOCK_PROTOCOL_PENDING_ASYNC_RATES_MASK)
52#define SCMI_CLOCK_PROTOCOL_TOTAL_CLKS(Attr) (Attr & SCMI_CLOCK_PROTOCOL_NUM_CLOCKS_MASK)
112 OUT UINT32 *TotalClocks
133 OUT BOOLEAN *Enabled,
134 OUT CHAR8 *ClockAsciiName
165 OUT SCMI_CLOCK_RATE_FORMAT *Format,
166 OUT UINT32 *TotalRates,
167 IN OUT UINT32 *RateArraySize,
EFI_STATUS(EFIAPI * SCMI_CLOCK_DESCRIBE_RATES)(IN SCMI_CLOCK_PROTOCOL *This, IN UINT32 ClockId, OUT SCMI_CLOCK_RATE_FORMAT *Format, OUT UINT32 *TotalRates, IN OUT UINT32 *RateArraySize, OUT SCMI_CLOCK_RATE *RateArray)
EFI_STATUS(EFIAPI * SCMI_CLOCK_RATE_GET)(IN SCMI_CLOCK_PROTOCOL *This, IN UINT32 ClockId, OUT UINT64 *Rate)
EFI_STATUS(EFIAPI * SCMI_CLOCK_GET_TOTAL_CLOCKS)(IN SCMI_CLOCK_PROTOCOL *This, OUT UINT32 *TotalClocks)
EFI_STATUS(EFIAPI * SCMI_CLOCK_GET_CLOCK_ATTRIBUTES)(IN SCMI_CLOCK_PROTOCOL *This, IN UINT32 ClockId, OUT BOOLEAN *Enabled, OUT CHAR8 *ClockAsciiName)
EFI_STATUS(EFIAPI * SCMI_CLOCK_GET_VERSION)(IN SCMI_CLOCK_PROTOCOL *This, OUT UINT32 *Version)
EFI_STATUS(EFIAPI * SCMI_CLOCK_RATE_SET)(IN SCMI_CLOCK_PROTOCOL *This, IN UINT32 ClockId, IN UINT64 Rate)