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