blob: 35d6e0611e9a996b23c82dcc89d5ef885b0a1c99 [file] [log] [blame]
Mona Hossain2892b6b2012-02-17 13:53:11 -08001/* Qualcomm Secure Execution Environment Communicator (QSEECOM) driver
2 *
Duy Truong790f06d2013-02-13 16:38:12 -08003 * Copyright (c) 2012, The Linux Foundation. All rights reserved.
Mona Hossain2892b6b2012-02-17 13:53:11 -08004 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 and
7 * only version 2 as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#ifndef __QSEECOM_LEGACY_H_
16#define __QSEECOM_LEGACY_H_
17
18#include <linux/types.h>
19
20#define TZ_SCHED_CMD_ID_REGISTER_LISTENER 0x04
21
22enum tz_sched_cmd_type {
23 TZ_SCHED_CMD_INVALID = 0,
24 TZ_SCHED_CMD_NEW, /* New TZ Scheduler Command */
25 TZ_SCHED_CMD_PENDING, /* Pending cmd...sched will restore stack */
26 TZ_SCHED_CMD_COMPLETE, /* TZ sched command is complete */
27 TZ_SCHED_CMD_MAX = 0x7FFFFFFF
28};
29
30enum tz_sched_cmd_status {
31 TZ_SCHED_STATUS_INCOMPLETE = 0,
32 TZ_SCHED_STATUS_COMPLETE,
33 TZ_SCHED_STATUS_MAX = 0x7FFFFFFF
34};
35/* Command structure for initializing shared buffers */
36__packed struct qse_pr_init_sb_req_s {
37 /* First 4 bytes should always be command id */
38 uint32_t pr_cmd;
39 /* Pointer to the physical location of sb buffer */
40 uint32_t sb_ptr;
41 /* length of shared buffer */
42 uint32_t sb_len;
43 uint32_t listener_id;
44};
45
46__packed struct qse_pr_init_sb_rsp_s {
47 /* First 4 bytes should always be command id */
48 uint32_t pr_cmd;
49 /* Return code, 0 for success, Approp error code otherwise */
50 int32_t ret;
51};
52
53/*
54 * struct QSEECom_command - QSECom command buffer
55 * @cmd_type: value from enum tz_sched_cmd_type
56 * @sb_in_cmd_addr: points to physical location of command
57 * buffer
58 * @sb_in_cmd_len: length of command buffer
59 */
60__packed struct qseecom_command {
61 uint32_t cmd_type;
62 uint8_t *sb_in_cmd_addr;
63 uint32_t sb_in_cmd_len;
64};
65
66/*
67 * struct QSEECom_response - QSECom response buffer
68 * @cmd_status: value from enum tz_sched_cmd_status
69 * @sb_in_rsp_addr: points to physical location of response
70 * buffer
71 * @sb_in_rsp_len: length of command response
72 */
73__packed struct qseecom_response {
74 uint32_t cmd_status;
75 uint8_t *sb_in_rsp_addr;
76 uint32_t sb_in_rsp_len;
77};
78
79#endif /* __QSEECOM_LEGACY_H_ */