qseecom_legacy.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* Qualcomm Secure Execution Environment Communicator (QSEECOM) driver
  2. *
  3. * Copyright (c) 2012, The Linux Foundation. All rights reserved.
  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. #ifndef __QSEECOM_LEGACY_H_
  15. #define __QSEECOM_LEGACY_H_
  16. #include <linux/types.h>
  17. #define TZ_SCHED_CMD_ID_REGISTER_LISTENER 0x04
  18. enum tz_sched_cmd_type {
  19. TZ_SCHED_CMD_INVALID = 0,
  20. TZ_SCHED_CMD_NEW, /* New TZ Scheduler Command */
  21. TZ_SCHED_CMD_PENDING, /* Pending cmd...sched will restore stack */
  22. TZ_SCHED_CMD_COMPLETE, /* TZ sched command is complete */
  23. TZ_SCHED_CMD_MAX = 0x7FFFFFFF
  24. };
  25. enum tz_sched_cmd_status {
  26. TZ_SCHED_STATUS_INCOMPLETE = 0,
  27. TZ_SCHED_STATUS_COMPLETE,
  28. TZ_SCHED_STATUS_MAX = 0x7FFFFFFF
  29. };
  30. /* Command structure for initializing shared buffers */
  31. __packed struct qse_pr_init_sb_req_s {
  32. /* First 4 bytes should always be command id */
  33. uint32_t pr_cmd;
  34. /* Pointer to the physical location of sb buffer */
  35. uint32_t sb_ptr;
  36. /* length of shared buffer */
  37. uint32_t sb_len;
  38. uint32_t listener_id;
  39. };
  40. __packed struct qse_pr_init_sb_rsp_s {
  41. /* First 4 bytes should always be command id */
  42. uint32_t pr_cmd;
  43. /* Return code, 0 for success, Approp error code otherwise */
  44. int32_t ret;
  45. };
  46. /*
  47. * struct QSEECom_command - QSECom command buffer
  48. * @cmd_type: value from enum tz_sched_cmd_type
  49. * @sb_in_cmd_addr: points to physical location of command
  50. * buffer
  51. * @sb_in_cmd_len: length of command buffer
  52. */
  53. __packed struct qseecom_command {
  54. uint32_t cmd_type;
  55. uint8_t *sb_in_cmd_addr;
  56. uint32_t sb_in_cmd_len;
  57. };
  58. /*
  59. * struct QSEECom_response - QSECom response buffer
  60. * @cmd_status: value from enum tz_sched_cmd_status
  61. * @sb_in_rsp_addr: points to physical location of response
  62. * buffer
  63. * @sb_in_rsp_len: length of command response
  64. */
  65. __packed struct qseecom_response {
  66. uint32_t cmd_status;
  67. uint8_t *sb_in_rsp_addr;
  68. uint32_t sb_in_rsp_len;
  69. };
  70. #endif /* __QSEECOM_LEGACY_H_ */