msm_cvp_resources.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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. struct clk *clk;
  48. u32 count;
  49. bool has_scaling;
  50. bool has_mem_retention;
  51. };
  52. struct clock_set {
  53. struct clock_info *clock_tbl;
  54. u32 count;
  55. };
  56. struct bus_info {
  57. char *name;
  58. int master;
  59. int slave;
  60. unsigned int range[2];
  61. const char *governor;
  62. struct device *dev;
  63. struct devfreq_dev_profile devfreq_prof;
  64. struct devfreq *devfreq;
  65. struct icc_path *client;
  66. bool is_prfm_gov_used;
  67. };
  68. struct bus_set {
  69. struct bus_info *bus_tbl;
  70. u32 count;
  71. };
  72. enum power_state {
  73. CVP_POWER_INIT,
  74. CVP_POWER_ON,
  75. CVP_POWER_OFF,
  76. CVP_POWER_INVALID,
  77. };
  78. struct reset_info {
  79. struct reset_control *rst;
  80. enum power_state required_state;
  81. const char *name;
  82. };
  83. struct reset_set {
  84. struct reset_info *reset_tbl;
  85. u32 count;
  86. };
  87. struct allowed_clock_rates_table {
  88. u32 clock_rate;
  89. };
  90. struct clock_profile_entry {
  91. u32 codec_mask;
  92. u32 vpp_cycles;
  93. u32 vsp_cycles;
  94. u32 low_power_cycles;
  95. };
  96. struct clock_freq_table {
  97. struct clock_profile_entry *clk_prof_entries;
  98. u32 count;
  99. };
  100. struct subcache_info {
  101. const char *name;
  102. bool isactive;
  103. bool isset;
  104. struct llcc_slice_desc *subcache;
  105. };
  106. struct subcache_set {
  107. struct subcache_info *subcache_tbl;
  108. u32 count;
  109. };
  110. struct msm_cvp_mem_cdsp {
  111. struct device *dev;
  112. };
  113. struct msm_cvp_platform_resources {
  114. phys_addr_t firmware_base;
  115. phys_addr_t register_base;
  116. phys_addr_t ipcc_reg_base;
  117. phys_addr_t gcc_reg_base;
  118. uint32_t register_size;
  119. uint32_t ipcc_reg_size;
  120. uint32_t gcc_reg_size;
  121. uint32_t irq;
  122. uint32_t sku_version;
  123. struct allowed_clock_rates_table *allowed_clks_tbl;
  124. u32 allowed_clks_tbl_size;
  125. struct clock_freq_table clock_freq_tbl;
  126. bool sys_cache_present;
  127. bool sys_cache_res_set;
  128. struct subcache_set subcache_set;
  129. struct reg_set reg_set;
  130. struct addr_set qdss_addr_set;
  131. uint32_t max_load;
  132. struct platform_device *pdev;
  133. struct regulator_set regulator_set;
  134. struct clock_set clock_set;
  135. struct bus_set bus_set;
  136. struct reset_set reset_set;
  137. bool use_non_secure_pil;
  138. bool sw_power_collapsible;
  139. bool auto_pil;
  140. bool dsp_enabled;
  141. struct list_head context_banks;
  142. bool thermal_mitigable;
  143. const char *fw_name;
  144. const char *hfi_version;
  145. bool never_unload_fw;
  146. bool debug_timeout;
  147. uint32_t pm_qos_latency_us;
  148. uint32_t max_inst_count;
  149. uint32_t max_secure_inst_count;
  150. int msm_cvp_hw_rsp_timeout;
  151. int msm_cvp_dsp_rsp_timeout;
  152. int msm_cvp_firmware_unload_delay;
  153. uint32_t msm_cvp_pwr_collapse_delay;
  154. bool non_fatal_pagefaults;
  155. struct msm_cvp_mem_cdsp mem_cdsp;
  156. uint32_t vpu_ver;
  157. uint32_t fw_cycles;
  158. struct msm_cvp_ubwc_config_data *ubwc_config;
  159. };
  160. static inline bool is_iommu_present(struct msm_cvp_platform_resources *res)
  161. {
  162. return !list_empty(&res->context_banks);
  163. }
  164. #endif