3 Copyright (c) 2017-2018, Arm Limited. All rights reserved.
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 System Control and Management Interface V1.0
14 http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/
15 DEN0056A_System_Control_and_Management_Interface.pdf
18 #ifndef ARM_SCMI_CLOCK_PROTOCOL_PRIVATE_H_
19 #define ARM_SCMI_CLOCK_PROTOCOL_PRIVATE_H_
23 // Clock rate in two 32bit words.
29 // Format of the returned rate array. Linear or Non-linear,.RatesFlag Bit[12]
30 #define RATE_FORMAT_SHIFT 12
31 #define RATE_FORMAT_MASK 0x0001
32 #define RATE_FORMAT(RatesFlags) ((RatesFlags >> RATE_FORMAT_SHIFT) \
35 // Number of remaining rates after a call to the SCP, RatesFlag Bits[31:16]
36 #define NUM_REMAIN_RATES_SHIFT 16
37 #define NUM_REMAIN_RATES(RatesFlags) ((RatesFlags >> NUM_REMAIN_RATES_SHIFT))
39 // Number of rates that are returned by a call.to the SCP, RatesFlag Bits[11:0]
40 #define NUM_RATES_MASK 0x0FFF
41 #define NUM_RATES(RatesFlags) (RatesFlags & NUM_RATES_MASK)
43 // Return values for the CLOCK_DESCRIBER_RATE command.
47 // NOTE: Since EDK2 does not allow flexible array member [] we declare
48 // here array of 1 element length. However below is used as a variable
50 CLOCK_RATE_DWORD Rates
[1];
51 } CLOCK_DESCRIBE_RATES
;
53 #define CLOCK_SET_DEFAULT_FLAGS 0
55 // Message parameters for CLOCK_RATE_SET command.
59 CLOCK_RATE_DWORD Rate
;
60 } CLOCK_RATE_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_ */