msm_cvp_resources.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef __MSM_CVP_RESOURCES_H__
  6. #define __MSM_CVP_RESOURCES_H__
  7. #include <linux/devfreq.h>
  8. #include <linux/platform_device.h>
  9. #include "msm_cvp_core.h"
  10. #include <linux/soc/qcom/llcc-qcom.h>
  11. struct reg_value_pair {
  12. u32 reg;
  13. u32 value;
  14. };
  15. struct reg_set {
  16. struct reg_value_pair *reg_tbl;
  17. int count;
  18. };
  19. struct addr_range {
  20. u32 start;
  21. u32 size;
  22. };
  23. struct addr_set {
  24. struct addr_range *addr_tbl;
  25. int count;
  26. };
  27. struct context_bank_info {
  28. struct list_head list;
  29. const char *name;
  30. u32 buffer_type;
  31. bool is_secure;
  32. struct addr_range addr_range;
  33. struct device *dev;
  34. struct iommu_domain *domain;
  35. };
  36. struct regulator_info {
  37. struct regulator *regulator;
  38. bool has_hw_power_collapse;
  39. char *name;
  40. };
  41. struct regulator_set {
  42. struct regulator_info *regulator_tbl;
  43. u32 count;
  44. };
  45. struct clock_info {
  46. const char *name;
  47. u32 clk_id;
  48. struct clk *clk;
  49. u32 count;
  50. bool has_scaling;
  51. bool has_mem_retention;
  52. };
  53. struct clock_set {
  54. struct clock_info *clock_tbl;
  55. u32 count;
  56. };
  57. struct bus_info {
  58. char *name;
  59. int master;
  60. int slave;
  61. unsigned int range[2];
  62. const char *governor;
  63. struct device *dev;
  64. struct devfreq_dev_profile devfreq_prof;
  65. struct devfreq *devfreq;
  66. struct icc_path *client;
  67. bool is_prfm_gov_used;
  68. };
  69. struct bus_set {
  70. struct bus_info *bus_tbl;
  71. u32 count;
  72. };
  73. enum power_state {
  74. CVP_POWER_INIT,
  75. CVP_POWER_ON,
  76. CVP_POWER_OFF,
  77. CVP_POWER_INVALID,
  78. };
  79. struct reset_info {
  80. struct reset_control *rst;
  81. enum power_state required_state;
  82. const char *name;
  83. };
  84. struct reset_set {
  85. struct reset_info *reset_tbl;
  86. u32 count;
  87. };
  88. struct allowed_clock_rates_table {
  89. u32 clock_rate;
  90. };
  91. struct clock_profile_entry {
  92. u32 codec_mask;
  93. u32 vpp_cycles;
  94. u32 vsp_cycles;
  95. u32 low_power_cycles;
  96. };
  97. struct clock_freq_table {
  98. struct clock_profile_entry *clk_prof_entries;
  99. u32 count;
  100. };
  101. struct subcache_info {
  102. const char *name;
  103. bool isactive;
  104. bool isset;
  105. struct llcc_slice_desc *subcache;
  106. };
  107. struct subcache_set {
  108. struct subcache_info *subcache_tbl;
  109. u32 count;
  110. };
  111. struct msm_cvp_mem_cdsp {
  112. struct device *dev;
  113. };
  114. struct msm_cvp_platform_resources {
  115. phys_addr_t firmware_base;
  116. phys_addr_t register_base;
  117. phys_addr_t ipcc_reg_base;
  118. phys_addr_t gcc_reg_base;
  119. uint32_t register_size;
  120. uint32_t ipcc_reg_size;
  121. uint32_t gcc_reg_size;
  122. uint32_t irq;
  123. uint32_t sku_version;
  124. struct allowed_clock_rates_table *allowed_clks_tbl;
  125. u32 allowed_clks_tbl_size;
  126. struct clock_freq_table clock_freq_tbl;
  127. bool sys_cache_present;
  128. bool sys_cache_res_set;
  129. struct subcache_set subcache_set;
  130. struct reg_set reg_set;
  131. struct addr_set qdss_addr_set;
  132. uint32_t max_ssr_allowed;
  133. struct platform_device *pdev;
  134. struct regulator_set regulator_set;
  135. struct clock_set clock_set;
  136. struct bus_set bus_set;
  137. struct reset_set reset_set;
  138. bool use_non_secure_pil;
  139. bool sw_power_collapsible;
  140. bool auto_pil;
  141. bool dsp_enabled;
  142. struct list_head context_banks;
  143. bool thermal_mitigable;
  144. const char *fw_name;
  145. const char *hfi_version;
  146. bool never_unload_fw;
  147. bool debug_timeout;
  148. uint32_t pm_qos_latency_us;
  149. uint32_t max_inst_count;
  150. uint32_t max_secure_inst_count;
  151. int msm_cvp_hw_rsp_timeout;
  152. int msm_cvp_dsp_rsp_timeout;
  153. int msm_cvp_firmware_unload_delay;
  154. uint32_t msm_cvp_pwr_collapse_delay;
  155. bool non_fatal_pagefaults;
  156. struct msm_cvp_mem_cdsp mem_cdsp;
  157. uint32_t vpu_ver;
  158. uint32_t fw_cycles;
  159. struct msm_cvp_ubwc_config_data *ubwc_config;
  160. };
  161. static inline bool is_iommu_present(struct msm_cvp_platform_resources *res)
  162. {
  163. return !list_empty(&res->context_banks);
  164. }
  165. #endif