3 Copyright (c) 2017-2018, Arm Limited. All rights reserved.
5 SPDX-License-Identifier: BSD-2-Clause-Patent
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
12 #ifndef ARM_SCMI_BASE_PROTOCOL_H_
13 #define ARM_SCMI_BASE_PROTOCOL_H_
15 #include <Protocol/ArmScmi.h>
17 #define BASE_PROTOCOL_VERSION 0x10000
19 #define NUM_PROTOCOL_MASK 0xFFU
20 #define NUM_AGENT_MASK 0xFFU
22 #define NUM_AGENT_SHIFT 0x8
24 /** Returns total number of protocols that are
25 implemented (excluding the Base protocol)
27 #define SCMI_TOTAL_PROTOCOLS(Attr) (Attr & NUM_PROTOCOL_MASK)
29 // Returns total number of agents in the system.
30 #define SCMI_TOTAL_AGENTS(Attr) ((Attr >> NUM_AGENT_SHIFT) & NUM_AGENT_MASK)
32 #define ARM_SCMI_BASE_PROTOCOL_GUID { \
33 0xd7e5abe9, 0x33ab, 0x418e, {0x9f, 0x91, 0x72, 0xda, 0xe2, 0xba, 0x8e, 0x2f} \
36 extern EFI_GUID gArmScmiBaseProtocolGuid
;
38 typedef struct _SCMI_BASE_PROTOCOL SCMI_BASE_PROTOCOL
;
40 /** Return version of the Base protocol supported by SCP firmware.
42 @param[in] This A Pointer to SCMI_BASE_PROTOCOL Instance.
44 @param[out] Version Version of the supported SCMI Base protocol.
46 @retval EFI_SUCCESS The version of the protocol is returned.
47 @retval EFI_DEVICE_ERROR SCP returns an SCMI error.
48 @retval !(EFI_SUCCESS) Other errors.
52 (EFIAPI
*SCMI_BASE_GET_VERSION
) (
53 IN SCMI_BASE_PROTOCOL
*This
,
57 /** Return total number of SCMI protocols supported by the SCP firmware.
59 @param[in] This A Pointer to SCMI_BASE_PROTOCOL Instance.
61 @param[out] TotalProtocols Total number of SCMI protocols supported.
63 @retval EFI_SUCCESS Total number of protocols supported are returned.
64 @retval EFI_DEVICE_ERROR SCP returns a SCMI error.
65 @retval !(EFI_SUCCESS) Other errors.
69 (EFIAPI
*SCMI_BASE_GET_TOTAL_PROTOCOLS
) (
70 IN SCMI_BASE_PROTOCOL
*This
,
71 OUT UINT32
*TotalProtocols
74 /** Return vendor name.
76 @param[in] This A Pointer to SCMI_BASE_PROTOCOL Instance.
78 @param[out] VendorIdentifier Null terminated ASCII string of up to
79 16 bytes with a vendor name.
81 @retval EFI_SUCCESS VendorIdentifier is returned.
82 @retval EFI_DEVICE_ERROR SCP returns a SCMI error.
83 @retval !(EFI_SUCCESS) Other errors.
87 (EFIAPI
*SCMI_BASE_DISCOVER_VENDOR
) (
88 IN SCMI_BASE_PROTOCOL
*This
,
89 OUT UINT8 VendorIdentifier
[SCMI_MAX_STR_LEN
]
92 /** Return sub vendor name.
94 @param[in] This A Pointer to SCMI_BASE_PROTOCOL Instance.
96 @param[out] VendorIdentifier Null terminated ASCII string of up to
97 16 bytes with a vendor name.
99 @retval EFI_SUCCESS VendorIdentifier is returned.
100 @retval EFI_DEVICE_ERROR SCP returns a SCMI error.
101 @retval !(EFI_SUCCESS) Other errors.
105 (EFIAPI
*SCMI_BASE_DISCOVER_SUB_VENDOR
) (
106 IN SCMI_BASE_PROTOCOL
*This
,
107 OUT UINT8 VendorIdentifier
[SCMI_MAX_STR_LEN
]
110 /** Return implementation version.
112 @param[in] This A Pointer to SCMI_BASE_PROTOCOL Instance.
114 @param[out] ImplementationVersion Vendor specific implementation version.
116 @retval EFI_SUCCESS Implementation version is returned.
117 @retval EFI_DEVICE_ERROR SCP returns a SCMI error.
118 @retval !(EFI_SUCCESS) Other errors.
122 (EFIAPI
*SCMI_BASE_DISCOVER_IMPLEMENTATION_VERSION
) (
123 IN SCMI_BASE_PROTOCOL
*This
,
124 OUT UINT32
*ImplementationVersion
127 /** Return list of protocols.
129 @param[in] This A Pointer to SCMI_BASE_PROTOCOL Instance.
131 @param[out] ProtocolListSize Size of the ProtocolList.
133 @param[out] ProtocolList Protocol list.
135 @retval EFI_SUCCESS List of protocols is returned.
136 @retval EFI_BUFFER_TOO_SMALL ProtocolListSize is too small for the result.
137 It has been updated to the size needed.
138 @retval EFI_DEVICE_ERROR SCP returns a SCMI error.
139 @retval !(EFI_SUCCESS) Other errors.
143 (EFIAPI
*SCMI_BASE_DISCOVER_LIST_PROTOCOLS
) (
144 IN SCMI_BASE_PROTOCOL
*This
,
145 IN OUT UINT32
*ProtocolListSize
,
146 OUT UINT8
*ProtocolList
150 typedef struct _SCMI_BASE_PROTOCOL
{
151 SCMI_BASE_GET_VERSION GetVersion
;
152 SCMI_BASE_GET_TOTAL_PROTOCOLS GetTotalProtocols
;
153 SCMI_BASE_DISCOVER_VENDOR DiscoverVendor
;
154 SCMI_BASE_DISCOVER_SUB_VENDOR DiscoverSubVendor
;
155 SCMI_BASE_DISCOVER_IMPLEMENTATION_VERSION DiscoverImplementationVersion
;
156 SCMI_BASE_DISCOVER_LIST_PROTOCOLS DiscoverListProtocols
;
157 } SCMI_BASE_PROTOCOL
;
159 // SCMI Message IDs for Base protocol.
161 SCMI_MESSAGE_ID_BASE_DISCOVER_VENDOR
= 0x3,
162 SCMI_MESSAGE_ID_BASE_DISCOVER_SUB_VENDOR
= 0x4,
163 SCMI_MESSAGE_ID_BASE_DISCOVER_IMPLEMENTATION_VERSION
= 0x5,
164 SCMI_MESSAGE_ID_BASE_DISCOVER_LIST_PROTOCOLS
= 0x6
165 } SCMI_MESSAGE_ID_BASE
;
167 #endif /* ARM_SCMI_BASE_PROTOCOL_H_ */