Mona Hossain | 2892b6b | 2012-02-17 13:53:11 -0800 | [diff] [blame] | 1 | /* Qualcomm Secure Execution Environment Communicator (QSEECOM) driver |
| 2 | * |
Duy Truong | 790f06d | 2013-02-13 16:38:12 -0800 | [diff] [blame] | 3 | * Copyright (c) 2012, The Linux Foundation. All rights reserved. |
Mona Hossain | 2892b6b | 2012-02-17 13:53:11 -0800 | [diff] [blame] | 4 | * |
| 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 | |
| 22 | enum 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 | |
| 30 | enum 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_ */ |