3 Copyright (c) 2017-2018, Arm Limited. All rights reserved.
5 SPDX-License-Identifier: BSD-2-Clause-Patent
7 System Control and Management Interface V1.0
8 http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/
9 DEN0056A_System_Control_and_Management_Interface.pdf
12 #ifndef ARM_SCMI_CLOCK_PROTOCOL_PRIVATE_H_
13 #define ARM_SCMI_CLOCK_PROTOCOL_PRIVATE_H_
17 // Clock rate in two 32bit words.
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) \
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))
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)
37 // Return values for the CLOCK_DESCRIBER_RATE command.
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
44 CLOCK_RATE_DWORD Rates
[1];
45 } CLOCK_DESCRIBE_RATES
;
47 #define CLOCK_SET_DEFAULT_FLAGS 0
49 // Message parameters for CLOCK_RATE_SET command.
53 CLOCK_RATE_DWORD Rate
;
54 } CLOCK_RATE_SET_ATTRIBUTES
;
56 // Message parameters for CLOCK_CONFIG_SET command.
60 } CLOCK_CONFIG_SET_ATTRIBUTES
;
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)
68 UINT8 ClockName
[SCMI_MAX_STR_LEN
];
73 /** Initialize clock management protocol and install protocol on a given handle.
75 @param[in] Handle Handle to install clock management protocol.
77 @retval EFI_SUCCESS Clock protocol interface installed successfully.
80 ScmiClockProtocolInit (
84 #endif /* ARM_SCMI_CLOCK_PROTOCOL_PRIVATE_H_ */