android_kernel_google_msm/drivers/misc/qseecom_legacy.h

80 lines
2.5 KiB
C
Raw Normal View History

qseecom: Add qseecom Driver This driver is based of the TZCOM (planned to be deprecated soon). It shares the same design as TZCOM with some re-organization and new features added. QSEEcom (Qualcomm Secure Execution environment Communicator) is named accordingly to be consistent with the nomenclature used in the secure domain. The following additional features (on top of current TZCOM) driver are implemented: (1) Add support for multi-image loading. The image that was loaded in TZCOM was hard-coded to "tzapps". During a open() tzapps was loaded using pil driver call pil_get(). This severly limted the number of images that could be loaded to one single application: named "tzapps". qseecom driver provides a way to load any image on request. Client simply send the image data in a specific format and this data is sent over to QSEE (Qualcomm Secure Execution enviroment) to load accordingly. (2) Add support for multi-client. TZcom driver did not have provisions to support multiple clients to interface with the single tzapp image loaded on the secure domain. The changes added in qseecom driver allows for multiple client to interface with a single image laoded and running in secure domain. (3) Add support for performance tweaking in QSEE Added capability to send requests to QSEE to set specific clocks for optimal crypto performance. This essentially will increase the crypto performance on the secure domain. The crypto functionality is used extensively by the current existing qseecom client(s). (4) Retain legacy support for QSEOS version 1.3. In order for the existing applications to work with old QSEE image, qseecom also supports the old mechanism (loading tzapp image via pil). This was a requirement for existing products that are not yet using the latest secure code. Change-Id: I7cf2d62c612cb4d17b33579e66bee44c9844dfda Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2012-02-17 21:53:11 +00:00
/* Qualcomm Secure Execution Environment Communicator (QSEECOM) driver
*
* Copyright (c) 2012, The Linux Foundation. All rights reserved.
qseecom: Add qseecom Driver This driver is based of the TZCOM (planned to be deprecated soon). It shares the same design as TZCOM with some re-organization and new features added. QSEEcom (Qualcomm Secure Execution environment Communicator) is named accordingly to be consistent with the nomenclature used in the secure domain. The following additional features (on top of current TZCOM) driver are implemented: (1) Add support for multi-image loading. The image that was loaded in TZCOM was hard-coded to "tzapps". During a open() tzapps was loaded using pil driver call pil_get(). This severly limted the number of images that could be loaded to one single application: named "tzapps". qseecom driver provides a way to load any image on request. Client simply send the image data in a specific format and this data is sent over to QSEE (Qualcomm Secure Execution enviroment) to load accordingly. (2) Add support for multi-client. TZcom driver did not have provisions to support multiple clients to interface with the single tzapp image loaded on the secure domain. The changes added in qseecom driver allows for multiple client to interface with a single image laoded and running in secure domain. (3) Add support for performance tweaking in QSEE Added capability to send requests to QSEE to set specific clocks for optimal crypto performance. This essentially will increase the crypto performance on the secure domain. The crypto functionality is used extensively by the current existing qseecom client(s). (4) Retain legacy support for QSEOS version 1.3. In order for the existing applications to work with old QSEE image, qseecom also supports the old mechanism (loading tzapp image via pil). This was a requirement for existing products that are not yet using the latest secure code. Change-Id: I7cf2d62c612cb4d17b33579e66bee44c9844dfda Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
2012-02-17 21:53:11 +00:00
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*/
#ifndef __QSEECOM_LEGACY_H_
#define __QSEECOM_LEGACY_H_
#include <linux/types.h>
#define TZ_SCHED_CMD_ID_REGISTER_LISTENER 0x04
enum tz_sched_cmd_type {
TZ_SCHED_CMD_INVALID = 0,
TZ_SCHED_CMD_NEW, /* New TZ Scheduler Command */
TZ_SCHED_CMD_PENDING, /* Pending cmd...sched will restore stack */
TZ_SCHED_CMD_COMPLETE, /* TZ sched command is complete */
TZ_SCHED_CMD_MAX = 0x7FFFFFFF
};
enum tz_sched_cmd_status {
TZ_SCHED_STATUS_INCOMPLETE = 0,
TZ_SCHED_STATUS_COMPLETE,
TZ_SCHED_STATUS_MAX = 0x7FFFFFFF
};
/* Command structure for initializing shared buffers */
__packed struct qse_pr_init_sb_req_s {
/* First 4 bytes should always be command id */
uint32_t pr_cmd;
/* Pointer to the physical location of sb buffer */
uint32_t sb_ptr;
/* length of shared buffer */
uint32_t sb_len;
uint32_t listener_id;
};
__packed struct qse_pr_init_sb_rsp_s {
/* First 4 bytes should always be command id */
uint32_t pr_cmd;
/* Return code, 0 for success, Approp error code otherwise */
int32_t ret;
};
/*
* struct QSEECom_command - QSECom command buffer
* @cmd_type: value from enum tz_sched_cmd_type
* @sb_in_cmd_addr: points to physical location of command
* buffer
* @sb_in_cmd_len: length of command buffer
*/
__packed struct qseecom_command {
uint32_t cmd_type;
uint8_t *sb_in_cmd_addr;
uint32_t sb_in_cmd_len;
};
/*
* struct QSEECom_response - QSECom response buffer
* @cmd_status: value from enum tz_sched_cmd_status
* @sb_in_rsp_addr: points to physical location of response
* buffer
* @sb_in_rsp_len: length of command response
*/
__packed struct qseecom_response {
uint32_t cmd_status;
uint8_t *sb_in_rsp_addr;
uint32_t sb_in_rsp_len;
};
#endif /* __QSEECOM_LEGACY_H_ */