TianoCore EDK2 master
Loading...
Searching...
No Matches
ScmiPrivate.h File Reference

Go to the source code of this file.

Data Structures

struct  SCMI_COMMAND
 
struct  SCMI_MESSAGE_RESPONSE
 
struct  SCMI_MESSAGE_HEADER
 

Macros

#define MESSAGE_TYPE_SHIFT   8
 
#define PROTOCOL_ID_SHIFT   10
 
#define SCMI_MESSAGE_HEADER(MsgId, MsgType, ProtocolId)
 

Enumerations

enum  SCMI_PROTOCOL_ID {
  ScmiProtocolIdBase = 0x10 , ScmiProtocolIdPowerDomain = 0x11 , ScmiProtocolIdSystemPower = 0x12 , ScmiProtocolIdPerformance = 0x13 ,
  ScmiProtocolIdClock = 0x14 , ScmiProtocolIdSensor = 0x15
}
 
enum  SCMI_MESSAGE_TYPE { ScmiMessageTypeCommand = 0 , ScmiMessageTypeDelayedResponse = 2 , ScmiMessageTypeNotification = 3 }
 
enum  SCMI_STATUS {
  ScmiSuccess = 0 , ScmiNotSupported = -1 , ScmiInvalidParameters = -2 , ScmiDenied = -3 ,
  ScmiNotFound = -4 , ScmiOutOfRange = -5 , ScmiBusy = -6 , ScmiCommsError = -7 ,
  ScmiGenericError = -8 , ScmiHardwareError = -9 , ScmiProtocolError = -10
}
 
enum  SCMI_MESSAGE_ID { ScmiMessageIdProtocolVersion = 0x0 , ScmiMessageIdProtocolAttributes = 0x1 , ScmiMessageIdProtocolMessageAttributes = 0x2 }
 

Functions

EFI_STATUS ScmiCommandGetPayload (OUT UINT32 **Payload)
 
EFI_STATUS ScmiCommandExecute (IN SCMI_COMMAND *Command, IN OUT UINT32 *PayloadLength, OUT UINT32 **ReturnValues OPTIONAL)
 
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 ScmiPrivate.h.

Macro Definition Documentation

◆ MESSAGE_TYPE_SHIFT

#define MESSAGE_TYPE_SHIFT   8

Definition at line 69 of file ScmiPrivate.h.

◆ PROTOCOL_ID_SHIFT

#define PROTOCOL_ID_SHIFT   10

Definition at line 70 of file ScmiPrivate.h.

◆ SCMI_MESSAGE_HEADER

#define SCMI_MESSAGE_HEADER (   MsgId,
  MsgType,
  ProtocolId 
)
Value:
( \
MsgType << MESSAGE_TYPE_SHIFT | \
ProtocolId << PROTOCOL_ID_SHIFT | \
MsgId \
)

Definition at line 71 of file ScmiPrivate.h.

Enumeration Type Documentation

◆ SCMI_MESSAGE_ID

enum SCMI_MESSAGE_ID

Definition at line 48 of file ScmiPrivate.h.

◆ SCMI_MESSAGE_TYPE

enum SCMI_MESSAGE_TYPE

Definition at line 26 of file ScmiPrivate.h.

◆ SCMI_PROTOCOL_ID

enum SCMI_PROTOCOL_ID

Definition at line 16 of file ScmiPrivate.h.

◆ SCMI_STATUS

enum SCMI_STATUS

Definition at line 33 of file ScmiPrivate.h.

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.