qseecom_kernel.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2012-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __QSEECOM_KERNEL_H_
  6. #define __QSEECOM_KERNEL_H_
  7. #include <linux/types.h>
  8. #define QSEECOM_ALIGN_SIZE 0x40
  9. #define QSEECOM_ALIGN_MASK (QSEECOM_ALIGN_SIZE - 1)
  10. #define QSEECOM_ALIGN(x) \
  11. ((x + QSEECOM_ALIGN_MASK) & (~QSEECOM_ALIGN_MASK))
  12. /*
  13. * struct qseecom_handle -
  14. * Handle to the qseecom device for kernel clients
  15. * @sbuf - shared buffer pointer
  16. * @sbbuf_len - shared buffer size
  17. */
  18. struct qseecom_handle {
  19. void *dev; /* in/out */
  20. unsigned char *sbuf; /* in/out */
  21. uint32_t sbuf_len; /* in/out */
  22. };
  23. int qseecom_start_app(struct qseecom_handle **handle,
  24. char *app_name, uint32_t size);
  25. int qseecom_shutdown_app(struct qseecom_handle **handle);
  26. int qseecom_send_command(struct qseecom_handle *handle, void *send_buf,
  27. uint32_t sbuf_len, void *resp_buf, uint32_t rbuf_len);
  28. int qseecom_set_bandwidth(struct qseecom_handle *handle, bool high);
  29. #if IS_ENABLED(CONFIG_QSEECOM)
  30. int qseecom_process_listener_from_smcinvoke(uint32_t *result,
  31. u64 *response_type, unsigned int *data);
  32. #else
  33. static inline int qseecom_process_listener_from_smcinvoke(uint32_t *result,
  34. u64 *response_type, unsigned int *data)
  35. {
  36. return -EOPNOTSUPP;
  37. }
  38. #endif
  39. #endif /* __QSEECOM_KERNEL_H_ */