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

Go to the source code of this file.

Macros

#define RESPONSE_TIMEOUT   20000
 

Functions

EFI_STATUS ScmiCommandGetPayload (OUT UINT32 **Payload)
 
EFI_STATUS ScmiCommandExecute (IN SCMI_COMMAND *Command, IN OUT UINT32 *PayloadLength, OUT UINT32 **ReturnValues OPTIONAL)
 
STATIC EFI_STATUS ScmiProtocolDiscoveryCommon (IN SCMI_PROTOCOL_ID ProtocolId, IN SCMI_MESSAGE_ID MessageId, OUT UINT32 **ReturnValues)
 
EFI_STATUS ScmiGetProtocolVersion (IN SCMI_PROTOCOL_ID ProtocolId, OUT UINT32 *Version)
 
EFI_STATUS ScmiGetProtocolAttributes (IN SCMI_PROTOCOL_ID ProtocolId, OUT UINT32 **ReturnValues)
 
EFI_STATUS ScmiGetProtocolMessageAttributes (IN SCMI_PROTOCOL_ID ProtocolId, OUT UINT32 **ReturnValues)
 

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 Scmi.c.

Macro Definition Documentation

◆ RESPONSE_TIMEOUT

#define RESPONSE_TIMEOUT   20000

Definition at line 20 of file Scmi.c.

Function Documentation

◆ ScmiCommandExecute()

EFI_STATUS ScmiCommandExecute ( IN SCMI_COMMAND Command,
IN OUT UINT32 *  PayloadLength,
OUT UINT32 **ReturnValues  OPTIONAL 
)

Execute a SCMI command and receive a response.

This function uses a MTL channel to transfer message to SCP and waits for a response.

Parameters
[in]CommandPointer to the SCMI command (Protocol ID and Message ID)
[in,out]PayloadLengthSCMI command message length.
[out]OPTIONALReturnValues Pointer to SCMI response.
Return values
OUTEFI_SUCCESS Command sent and message received successfully.
OUTEFI_UNSUPPORTED Channel not supported.
OUTEFI_TIMEOUT Timeout on the channel.
OUTEFI_DEVICE_ERROR Channel not ready.
OUTEFI_DEVICE_ERROR Message Header corrupted.
OUTEFI_DEVICE_ERROR SCMI error.

Definition at line 76 of file Scmi.c.

◆ ScmiCommandGetPayload()

EFI_STATUS ScmiCommandGetPayload ( OUT UINT32 **  Payload)

Return a pointer to the message payload.

Parameters
[out]PayloadHolds pointer to the message payload.
Return values
EFI_SUCCESSPayload holds a valid message payload pointer.
EFI_TIMEOUTTime out error if MTL channel is busy.
EFI_UNSUPPORTEDIf MTL channel is unsupported.

Definition at line 31 of file Scmi.c.

◆ ScmiGetProtocolAttributes()

EFI_STATUS ScmiGetProtocolAttributes ( IN SCMI_PROTOCOL_ID  ProtocolId,
OUT UINT32 **  ReturnValues 
)

Return protocol attributes from SCP for a given protocol ID.

Parameters
[in]ProtocolID Protocol ID.
[out]ReturnValuesPointer to attributes of the protocol.
Return values
EFI_SUCCESSReturnValues points to protocol attributes.
EFI_DEVICE_ERRORSCMI error.
!(EFI_SUCCESS)Other errors.

Definition at line 222 of file Scmi.c.

◆ ScmiGetProtocolMessageAttributes()

EFI_STATUS ScmiGetProtocolMessageAttributes ( IN SCMI_PROTOCOL_ID  ProtocolId,
OUT UINT32 **  ReturnValues 
)

Return protocol message attributes from SCP for a given protocol ID.

Parameters
[in]ProtocolID Protocol ID.
[out]AttributesPointer to attributes of the protocol.
Return values
EFI_SUCCESSReturnValues points to protocol message attributes.
EFI_DEVICE_ERRORSCMI error.
!(EFI_SUCCESS)Other errors.

Definition at line 244 of file Scmi.c.

◆ ScmiGetProtocolVersion()

EFI_STATUS ScmiGetProtocolVersion ( IN SCMI_PROTOCOL_ID  ProtocolId,
OUT UINT32 *  Version 
)

Return protocol version from SCP for a given protocol ID.

Parameters
[in]ProtocolID Protocol ID.
[out]VersionPointer to version of the protocol.
Return values
EFI_SUCCESSVersion holds a valid version received from the SCP.
EFI_DEVICE_ERRORSCMI error.
!(EFI_SUCCESS)Other errors.

Definition at line 190 of file Scmi.c.

◆ ScmiProtocolDiscoveryCommon()

STATIC EFI_STATUS ScmiProtocolDiscoveryCommon ( IN SCMI_PROTOCOL_ID  ProtocolId,
IN SCMI_MESSAGE_ID  MessageId,
OUT UINT32 **  ReturnValues 
)

Internal common function useful for common protocol discovery messages.

Parameters
[in]ProtocolIdProtocol Id of the protocol.
[in]MessageIdMessage Id of the message.
[out]ReturnValuesSCMI response return values.
Return values
EFI_SUCCESSSuccess with valid return values.
EFI_DEVICE_ERRORSCMI error.
!(EFI_SUCCESS)Other errors.

Definition at line 159 of file Scmi.c.