xref: /optee_os/lib/libutee/include/pta_scmi_client.h (revision b0a1c2504aafdb9804b1b64fe8792918dfbdcd72)
1*b0a1c250SEtienne Carriere /* SPDX-License-Identifier: BSD-2-Clause */
2*b0a1c250SEtienne Carriere /*
3*b0a1c250SEtienne Carriere  * Copyright (c) 2019-2021, Linaro Limited
4*b0a1c250SEtienne Carriere  */
5*b0a1c250SEtienne Carriere #ifndef PTA_SCMI_CLIENT_H
6*b0a1c250SEtienne Carriere #define PTA_SCMI_CLIENT_H
7*b0a1c250SEtienne Carriere 
8*b0a1c250SEtienne Carriere #define PTA_SCMI_UUID { 0xa8cfe406, 0xd4f5, 0x4a2e, \
9*b0a1c250SEtienne Carriere 		{ 0x9f, 0x8d, 0xa2, 0x5d, 0xc7, 0x54, 0xc0, 0x99 } }
10*b0a1c250SEtienne Carriere 
11*b0a1c250SEtienne Carriere #define PTA_SCMI_NAME "PTA-SCMI"
12*b0a1c250SEtienne Carriere 
13*b0a1c250SEtienne Carriere /*
14*b0a1c250SEtienne Carriere  * PTA_SCMI_CMD_CAPABILITIES - Get channel capabilities
15*b0a1c250SEtienne Carriere  *
16*b0a1c250SEtienne Carriere  * [out]    value[0].a: Capabilities bit mask (PTA_SCMI_CAPS_*)
17*b0a1c250SEtienne Carriere  * [out]    value[0].b: Extended capabilities or 0
18*b0a1c250SEtienne Carriere  */
19*b0a1c250SEtienne Carriere #define PTA_SCMI_CMD_CAPABILITIES	0
20*b0a1c250SEtienne Carriere 
21*b0a1c250SEtienne Carriere /*
22*b0a1c250SEtienne Carriere  * PTA_SCMI_CMD_PROCESS_SMT_CHANNEL - Process SCMI message in SMT buffer
23*b0a1c250SEtienne Carriere  *
24*b0a1c250SEtienne Carriere  * [in]     value[0].a: Channel handle
25*b0a1c250SEtienne Carriere  *
26*b0a1c250SEtienne Carriere  * Shared memory used for SCMI message/response exhange is expected
27*b0a1c250SEtienne Carriere  * already identified and bound to channel handle in both SCMI agent
28*b0a1c250SEtienne Carriere  * and SCMI server (OP-TEE) parts.
29*b0a1c250SEtienne Carriere  * The memory uses SMT header to carry SCMI meta-data (protocol ID and
30*b0a1c250SEtienne Carriere  * protocol message ID).
31*b0a1c250SEtienne Carriere  */
32*b0a1c250SEtienne Carriere #define PTA_SCMI_CMD_PROCESS_SMT_CHANNEL	1
33*b0a1c250SEtienne Carriere 
34*b0a1c250SEtienne Carriere /*
35*b0a1c250SEtienne Carriere  * PTA_SCMI_CMD_PROCESS_SMT_CHANNEL_MESSAGE - Process SCMI message in
36*b0a1c250SEtienne Carriere  *				SMT buffer pointed by memref parameters
37*b0a1c250SEtienne Carriere  *
38*b0a1c250SEtienne Carriere  * [in]     value[0].a: Channel handle
39*b0a1c250SEtienne Carriere  * [in/out] memref[1]: Message/response buffer (SMT and SCMI payload)
40*b0a1c250SEtienne Carriere  *
41*b0a1c250SEtienne Carriere  * Shared memory used for SCMI message/response is a SMT buffer
42*b0a1c250SEtienne Carriere  * referenced by param[1]. It shall be 128 bytes large to fit response
43*b0a1c250SEtienne Carriere  * payload whatever message playload size.
44*b0a1c250SEtienne Carriere  * The memory uses SMT header to carry SCMI meta-data (protocol ID and
45*b0a1c250SEtienne Carriere  * protocol message ID).
46*b0a1c250SEtienne Carriere  */
47*b0a1c250SEtienne Carriere #define PTA_SCMI_CMD_PROCESS_SMT_CHANNEL_MESSAGE	2
48*b0a1c250SEtienne Carriere 
49*b0a1c250SEtienne Carriere /*
50*b0a1c250SEtienne Carriere  * PTA_SCMI_CMD_GET_CHANNEL_HANDLE - Get handle for an SCMI channel
51*b0a1c250SEtienne Carriere  *
52*b0a1c250SEtienne Carriere  * Get a handle for the SCMI channel. This handle value is to be passed
53*b0a1c250SEtienne Carriere  * as argument to some commands as PTA_SCMI_CMD_PROCESS_*.
54*b0a1c250SEtienne Carriere  *
55*b0a1c250SEtienne Carriere  * [in]     value[0].a: Channel identifier or 0 if no assigned ID
56*b0a1c250SEtienne Carriere  * [in]     value[0].b: Requested capabilities mask (PTA_SCMI_CAPS_*)
57*b0a1c250SEtienne Carriere  * [out]    value[0].a: Returned channel handle
58*b0a1c250SEtienne Carriere  */
59*b0a1c250SEtienne Carriere #define PTA_SCMI_CMD_GET_CHANNEL_HANDLE		3
60*b0a1c250SEtienne Carriere 
61*b0a1c250SEtienne Carriere /*
62*b0a1c250SEtienne Carriere  * Capabilities
63*b0a1c250SEtienne Carriere  */
64*b0a1c250SEtienne Carriere 
65*b0a1c250SEtienne Carriere /* Channel supports shared memory using the SMT header protocol */
66*b0a1c250SEtienne Carriere #define PTA_SCMI_CAPS_SMT_HEADER			BIT32(0)
67*b0a1c250SEtienne Carriere 
68*b0a1c250SEtienne Carriere #endif /* SCMI_PTA_SCMI_CLIENT_H */
69