tcs.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __SOC_QCOM_TCS_H__
  6. #define __SOC_QCOM_TCS_H__
  7. #define MAX_RPMH_PAYLOAD 16
  8. /**
  9. * rpmh_state: state for the request
  10. *
  11. * RPMH_SLEEP_STATE: State of the resource when the processor subsystem
  12. * is powered down. There is no client using the
  13. * resource actively.
  14. * RPMH_WAKE_ONLY_STATE: Resume resource state to the value previously
  15. * requested before the processor was powered down.
  16. * RPMH_ACTIVE_ONLY_STATE: Active or AMC mode requests. Resource state
  17. * is aggregated immediately.
  18. */
  19. enum rpmh_state {
  20. RPMH_SLEEP_STATE,
  21. RPMH_WAKE_ONLY_STATE,
  22. RPMH_ACTIVE_ONLY_STATE,
  23. };
  24. /**
  25. * struct tcs_cmd: an individual request to RPMH.
  26. *
  27. * @addr: the address of the resource slv_id:18:16 | offset:0:15
  28. * @data: the resource state request
  29. * @wait: wait for this request to be complete before sending the next
  30. */
  31. struct tcs_cmd {
  32. u32 addr;
  33. u32 data;
  34. u32 wait;
  35. };
  36. /**
  37. * struct tcs_request: A set of tcs_cmds sent together in a TCS
  38. *
  39. * @state: state for the request.
  40. * @wait_for_compl: wait until we get a response from the h/w accelerator
  41. * @num_cmds: the number of @cmds in this request
  42. * @cmds: an array of tcs_cmds
  43. */
  44. struct tcs_request {
  45. enum rpmh_state state;
  46. u32 wait_for_compl;
  47. u32 num_cmds;
  48. struct tcs_cmd *cmds;
  49. };
  50. #endif /* __SOC_QCOM_TCS_H__ */