TianoCore EDK2 master
Loading...
Searching...
No Matches
ScmiClockProtocol.c File Reference

Go to the source code of this file.

Functions

STATIC UINT64 ConvertTo64Bit (IN UINT32 Low, IN UINT32 High)
 
STATIC EFI_STATUS ClockGetVersion (IN SCMI_CLOCK_PROTOCOL *This, OUT UINT32 *Version)
 
STATIC EFI_STATUS ClockGetTotalClocks (IN SCMI_CLOCK_PROTOCOL *This, OUT UINT32 *TotalClocks)
 
STATIC EFI_STATUS ClockGetClockAttributes (IN SCMI_CLOCK_PROTOCOL *This, IN UINT32 ClockId, OUT BOOLEAN *Enabled, OUT CHAR8 *ClockAsciiName)
 
STATIC EFI_STATUS ClockDescribeRates (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)
 
STATIC EFI_STATUS ClockRateGet (IN SCMI_CLOCK_PROTOCOL *This, IN UINT32 ClockId, OUT UINT64 *Rate)
 
STATIC EFI_STATUS ClockRateSet (IN SCMI_CLOCK_PROTOCOL *This, IN UINT32 ClockId, IN UINT64 Rate)
 
STATIC EFI_STATUS ClockEnable (IN SCMI_CLOCK2_PROTOCOL *This, IN UINT32 ClockId, IN BOOLEAN Enable)
 
EFI_STATUS ScmiClockProtocolInit (IN EFI_HANDLE *Handle)
 

Variables

STATIC CONST SCMI_CLOCK_PROTOCOL ScmiClockProtocol
 
STATIC CONST SCMI_CLOCK2_PROTOCOL ScmiClock2Protocol
 

Detailed Description

Copyright (c) 2017-2021, Arm Limited. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

System Control and Management Interface V1.0 http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/ DEN0056A_System_Control_and_Management_Interface.pdf

Definition in file ScmiClockProtocol.c.

Function Documentation

◆ ClockDescribeRates()

STATIC EFI_STATUS ClockDescribeRates ( 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 
)

Return list of rates supported by a given clock device.

Parameters
[in]ThisA pointer to SCMI_CLOCK_PROTOCOL Instance.
[in]ClockIdIdentifier for the clock device.
[out]FormatScmiClockRateFormatDiscrete: Clock device supports range of clock rates which are non-linear.

ScmiClockRateFormatLinear: Clock device supports range of linear clock rates from Min to Max in steps.

Parameters
[out]TotalRatesTotal number of rates.
[in,out]RateArraySizeSize of the RateArray.
[out]RateArrayList of clock rates.
Return values
EFI_SUCCESSList of clock rates is returned.
EFI_DEVICE_ERRORSCP returns an SCMI error.
EFI_BUFFER_TOO_SMALLRateArraySize is too small for the result. It has been updated to the size needed.
!(EFI_SUCCESS)Other errors.

Definition at line 176 of file ScmiClockProtocol.c.

◆ ClockEnable()

STATIC EFI_STATUS ClockEnable ( IN SCMI_CLOCK2_PROTOCOL This,
IN UINT32  ClockId,
IN BOOLEAN  Enable 
)

Enable/Disable specified clock.

Parameters
[in]ThisA Pointer to SCMI_CLOCK_PROTOCOL Instance.
[in]ClockIdIdentifier for the clock device.
[in]EnableTRUE to enable, FALSE to disable.
Return values
EFI_SUCCESSClock enable/disable successful.
EFI_DEVICE_ERRORSCP returns an SCMI error.
!(EFI_SUCCESS)Other errors.

Definition at line 397 of file ScmiClockProtocol.c.

◆ ClockGetClockAttributes()

STATIC EFI_STATUS ClockGetClockAttributes ( IN SCMI_CLOCK_PROTOCOL This,
IN UINT32  ClockId,
OUT BOOLEAN *  Enabled,
OUT CHAR8 *  ClockAsciiName 
)

Return attributes of a clock device.

Parameters
[in]ThisA Pointer to SCMI_CLOCK_PROTOCOL Instance.
[in]ClockIdIdentifier for the clock device.
[out]EnabledIf TRUE, the clock device is enabled.
[out]ClockAsciiNameA NULL terminated ASCII string with the clock name, of up to 16 bytes.
Return values
EFI_SUCCESSClock device attributes are returned.
EFI_DEVICE_ERRORSCP returns an SCMI error.
!(EFI_SUCCESS)Other errors.

Definition at line 104 of file ScmiClockProtocol.c.

◆ ClockGetTotalClocks()

STATIC EFI_STATUS ClockGetTotalClocks ( IN SCMI_CLOCK_PROTOCOL This,
OUT UINT32 *  TotalClocks 
)

Return total number of clock devices supported by the clock management protocol.

Parameters
[in]ThisA Pointer to SCMI_CLOCK_PROTOCOL Instance.
[out]TotalClocksTotal number of clocks supported.
Return values
EFI_SUCCESSTotal number of clocks supported is returned.
EFI_DEVICE_ERRORSCP returns an SCMI error.
!(EFI_SUCCESS)Other errors.

Definition at line 71 of file ScmiClockProtocol.c.

◆ ClockGetVersion()

STATIC EFI_STATUS ClockGetVersion ( IN SCMI_CLOCK_PROTOCOL This,
OUT UINT32 *  Version 
)

Return version of the clock management protocol supported by SCP firmware.

Parameters
[in]ThisA Pointer to SCMI_CLOCK_PROTOCOL Instance.
[out]VersionVersion of the supported SCMI Clock management protocol.
Return values
EFI_SUCCESSThe version is returned.
EFI_DEVICE_ERRORSCP returns an SCMI error.
!(EFI_SUCCESS)Other errors.

Definition at line 50 of file ScmiClockProtocol.c.

◆ ClockRateGet()

STATIC EFI_STATUS ClockRateGet ( IN SCMI_CLOCK_PROTOCOL This,
IN UINT32  ClockId,
OUT UINT64 *  Rate 
)

Get clock rate.

Parameters
[in]ThisA Pointer to SCMI_CLOCK_PROTOCOL Instance.
[in]ClockIdIdentifier for the clock device.
[out]RateClock rate.
Return values
EFI_SUCCESSClock rate is returned.
EFI_DEVICE_ERRORSCP returns an SCMI error.
!(EFI_SUCCESS)Other errors.

Definition at line 294 of file ScmiClockProtocol.c.

◆ ClockRateSet()

STATIC EFI_STATUS ClockRateSet ( IN SCMI_CLOCK_PROTOCOL This,
IN UINT32  ClockId,
IN UINT64  Rate 
)

Set clock rate.

Parameters
[in]ThisA Pointer to SCMI_CLOCK_PROTOCOL Instance.
[in]ClockIdIdentifier for the clock device.
[in]RateClock rate.
Return values
EFI_SUCCESSClock rate set success.
EFI_DEVICE_ERRORSCP returns an SCMI error.
!(EFI_SUCCESS)Other errors.

Definition at line 348 of file ScmiClockProtocol.c.

◆ ConvertTo64Bit()

STATIC UINT64 ConvertTo64Bit ( IN UINT32  Low,
IN UINT32  High 
)

Convert to 64 bit value from two 32 bit words.

Parameters
[in]LowLower 32 bits.
[in]HighHigher 32 bits.
Return values
UINT6464 bit value.

Definition at line 30 of file ScmiClockProtocol.c.

◆ ScmiClockProtocolInit()

EFI_STATUS ScmiClockProtocolInit ( IN EFI_HANDLE Handle)

Initialize clock management protocol and install protocol on a given handle.

Parameters
[in]HandleHandle to install clock management protocol.
Return values
EFI_SUCCESSClock protocol interface installed successfully.

Definition at line 461 of file ScmiClockProtocol.c.

Variable Documentation

◆ ScmiClock2Protocol

STATIC CONST SCMI_CLOCK2_PROTOCOL ScmiClock2Protocol
Initial value:
= {
SCMI_CLOCK2_PROTOCOL_VERSION,
}
EFI_STATUS(EFIAPI * SCMI_CLOCK2_RATE_GET)(IN SCMI_CLOCK2_PROTOCOL *This, IN UINT32 ClockId, OUT UINT64 *Rate)
EFI_STATUS(EFIAPI * SCMI_CLOCK2_DESCRIBE_RATES)(IN SCMI_CLOCK2_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_CLOCK2_GET_CLOCK_ATTRIBUTES)(IN SCMI_CLOCK2_PROTOCOL *This, IN UINT32 ClockId, OUT BOOLEAN *Enabled, OUT CHAR8 *ClockAsciiName)
EFI_STATUS(EFIAPI * SCMI_CLOCK2_GET_VERSION)(IN SCMI_CLOCK2_PROTOCOL *This, OUT UINT32 *Version)
EFI_STATUS(EFIAPI * SCMI_CLOCK2_GET_TOTAL_CLOCKS)(IN SCMI_CLOCK2_PROTOCOL *This, OUT UINT32 *TotalClocks)
EFI_STATUS(EFIAPI * SCMI_CLOCK2_RATE_SET)(IN SCMI_CLOCK2_PROTOCOL *This, IN UINT32 ClockId, IN UINT64 Rate)
STATIC EFI_STATUS ClockRateGet(IN SCMI_CLOCK_PROTOCOL *This, IN UINT32 ClockId, OUT UINT64 *Rate)
STATIC EFI_STATUS ClockRateSet(IN SCMI_CLOCK_PROTOCOL *This, IN UINT32 ClockId, IN UINT64 Rate)
STATIC EFI_STATUS ClockDescribeRates(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)
STATIC EFI_STATUS ClockEnable(IN SCMI_CLOCK2_PROTOCOL *This, IN UINT32 ClockId, IN BOOLEAN Enable)
STATIC EFI_STATUS ClockGetTotalClocks(IN SCMI_CLOCK_PROTOCOL *This, OUT UINT32 *TotalClocks)
STATIC EFI_STATUS ClockGetVersion(IN SCMI_CLOCK_PROTOCOL *This, OUT UINT32 *Version)
STATIC EFI_STATUS ClockGetClockAttributes(IN SCMI_CLOCK_PROTOCOL *This, IN UINT32 ClockId, OUT BOOLEAN *Enabled, OUT CHAR8 *ClockAsciiName)

Definition at line 443 of file ScmiClockProtocol.c.

◆ ScmiClockProtocol