aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEtienne Carriere <etienne.carriere@linaro.org>2021-04-05 13:59:43 +0200
committerJérôme Forissier <jerome@forissier.org>2021-04-29 09:25:07 +0200
commitb0a1c2504aafdb9804b1b64fe8792918dfbdcd72 (patch)
tree516d935257fd146ff50220c73f8e7ed9f1d337bd /lib
parent3e530666840c1d676be8de1c137e07c598fa02cc (diff)
core: pta: scmi: new interface to REE SCMI agent
Adds a PTA interface to REE SCMI agents to get SCMI message communication channel for processing in OP-TEE SCMI server. Currently implement supports for a SCMI server built with CFG_SCMI_MSG_SMT=y. The implementation is made so that an alternate SCMI server implementation can added. Client gets SCMI channel capabilities with PTA_SCMI_CMD_CAPABILITIES. Client gets a handle for an SCMI channel with command PTA_SCMI_CMD_GET_CHANNEL_HANDLE. Client pushes SCMI messages with command PTA_SCMI_CMD_PROCESS_SMT_CHANNEL or PTA_SCMI_CMD_PROCESS_SMT_CHANNEL_MESSAGE. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libutee/include/pta_scmi_client.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/lib/libutee/include/pta_scmi_client.h b/lib/libutee/include/pta_scmi_client.h
new file mode 100644
index 00000000..2e98bc77
--- /dev/null
+++ b/lib/libutee/include/pta_scmi_client.h
@@ -0,0 +1,68 @@
+/* SPDX-License-Identifier: BSD-2-Clause */
+/*
+ * Copyright (c) 2019-2021, Linaro Limited
+ */
+#ifndef PTA_SCMI_CLIENT_H
+#define PTA_SCMI_CLIENT_H
+
+#define PTA_SCMI_UUID { 0xa8cfe406, 0xd4f5, 0x4a2e, \
+ { 0x9f, 0x8d, 0xa2, 0x5d, 0xc7, 0x54, 0xc0, 0x99 } }
+
+#define PTA_SCMI_NAME "PTA-SCMI"
+
+/*
+ * PTA_SCMI_CMD_CAPABILITIES - Get channel capabilities
+ *
+ * [out] value[0].a: Capabilities bit mask (PTA_SCMI_CAPS_*)
+ * [out] value[0].b: Extended capabilities or 0
+ */
+#define PTA_SCMI_CMD_CAPABILITIES 0
+
+/*
+ * PTA_SCMI_CMD_PROCESS_SMT_CHANNEL - Process SCMI message in SMT buffer
+ *
+ * [in] value[0].a: Channel handle
+ *
+ * Shared memory used for SCMI message/response exhange is expected
+ * already identified and bound to channel handle in both SCMI agent
+ * and SCMI server (OP-TEE) parts.
+ * The memory uses SMT header to carry SCMI meta-data (protocol ID and
+ * protocol message ID).
+ */
+#define PTA_SCMI_CMD_PROCESS_SMT_CHANNEL 1
+
+/*
+ * PTA_SCMI_CMD_PROCESS_SMT_CHANNEL_MESSAGE - Process SCMI message in
+ * SMT buffer pointed by memref parameters
+ *
+ * [in] value[0].a: Channel handle
+ * [in/out] memref[1]: Message/response buffer (SMT and SCMI payload)
+ *
+ * Shared memory used for SCMI message/response is a SMT buffer
+ * referenced by param[1]. It shall be 128 bytes large to fit response
+ * payload whatever message playload size.
+ * The memory uses SMT header to carry SCMI meta-data (protocol ID and
+ * protocol message ID).
+ */
+#define PTA_SCMI_CMD_PROCESS_SMT_CHANNEL_MESSAGE 2
+
+/*
+ * PTA_SCMI_CMD_GET_CHANNEL_HANDLE - Get handle for an SCMI channel
+ *
+ * Get a handle for the SCMI channel. This handle value is to be passed
+ * as argument to some commands as PTA_SCMI_CMD_PROCESS_*.
+ *
+ * [in] value[0].a: Channel identifier or 0 if no assigned ID
+ * [in] value[0].b: Requested capabilities mask (PTA_SCMI_CAPS_*)
+ * [out] value[0].a: Returned channel handle
+ */
+#define PTA_SCMI_CMD_GET_CHANNEL_HANDLE 3
+
+/*
+ * Capabilities
+ */
+
+/* Channel supports shared memory using the SMT header protocol */
+#define PTA_SCMI_CAPS_SMT_HEADER BIT32(0)
+
+#endif /* SCMI_PTA_SCMI_CLIENT_H */