VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/ArmPkg/Drivers/ArmScmiDxe/ArmScmiClockProtocolPrivate.h@ 100307

Last change on this file since 100307 was 99464, checked in by vboxsync, 2 years ago

Devices/EFI/Firmware: Restore ArmPkg, ArmVirtPkg, ArmPlatformPkg in order to be able to build Aarch64 and Aarch32 firmware images for the virt platform, bugref:10400

  • Property svn:eol-style set to native
File size: 2.4 KB
Line 
1/** @file
2
3 Copyright (c) 2017-2018, Arm Limited. All rights reserved.
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
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
10**/
11
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;
21} CLOCK_RATE_DWORD;
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];
45} CLOCK_DESCRIBE_RATES;
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;
53 CLOCK_RATE_DWORD Rate;
54} CLOCK_RATE_SET_ATTRIBUTES;
55
56// Message parameters for CLOCK_CONFIG_SET command.
57typedef struct {
58 UINT32 ClockId;
59 UINT32 Attributes;
60} CLOCK_CONFIG_SET_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];
69} CLOCK_ATTRIBUTES;
70
71#pragma pack()
72
73/** Initialize clock management protocol and install protocol on a given handle.
74
75 @param[in] Handle Handle to install clock management protocol.
76
77 @retval EFI_SUCCESS Clock protocol interface installed successfully.
78**/
79EFI_STATUS
80ScmiClockProtocolInit (
81 IN EFI_HANDLE *Handle
82 );
83
84#endif /* ARM_SCMI_CLOCK_PROTOCOL_PRIVATE_H_ */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette