cvp_vm.h 944 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0-only
  2. *
  3. * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
  4. */
  5. #ifndef _CVP_VM_H_
  6. #define _CVP_VM_H_
  7. #include <linux/types.h>
  8. #include "cvp_comm_def.h"
  9. #include "msm_cvp_core.h"
  10. #include "msm_cvp_internal.h"
  11. #include "cvp_core_hfi.h"
  12. #include "cvp_vm_msgq.h"
  13. #include "cvp_vm_resource.h"
  14. enum cvp_vm_id {
  15. VM_PRIMARY = 1,
  16. VM_TRUSTED = 2,
  17. VM_INVALID = 3,
  18. };
  19. enum cvp_vm_state {
  20. VM_STATE_INIT = 1,
  21. VM_STATE_ACTIVE = 2,
  22. VM_STATE_ERROR = 3,
  23. VM_STATE_INVALID = 4,
  24. };
  25. struct msm_cvp_vm_ops {
  26. int (*vm_start)(struct msm_cvp_core *core);
  27. int (*vm_init_reg_and_irq)(struct iris_hfi_device *device,
  28. struct msm_cvp_platform_resources *res);
  29. };
  30. struct msm_cvp_vm_manager {
  31. enum cvp_vm_state vm_state;
  32. enum cvp_vm_id vm_id;
  33. struct cvp_msgq_drv *msgq_drv;
  34. struct cvp_vm_resource *vm_rm;
  35. struct msm_cvp_vm_ops *vm_ops;
  36. };
  37. extern struct msm_cvp_vm_manager vm_manager;
  38. #endif