panfrost_issues.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* (C) COPYRIGHT 2014-2018 ARM Limited. All rights reserved. */
  3. /* Copyright 2019 Linaro, Ltd., Rob Herring <[email protected]> */
  4. #ifndef __PANFROST_ISSUES_H__
  5. #define __PANFROST_ISSUES_H__
  6. #include <linux/bitops.h>
  7. #include "panfrost_device.h"
  8. /*
  9. * This is not a complete list of issues, but only the ones the driver needs
  10. * to care about.
  11. */
  12. enum panfrost_hw_issue {
  13. /* Need way to guarantee that all previously-translated memory accesses
  14. * are committed */
  15. HW_ISSUE_6367,
  16. /* On job complete with non-done the cache is not flushed */
  17. HW_ISSUE_6787,
  18. /* Write of PRFCNT_CONFIG_MODE_MANUAL to PRFCNT_CONFIG causes a
  19. * instrumentation dump if PRFCNT_TILER_EN is enabled */
  20. HW_ISSUE_8186,
  21. /* TIB: Reports faults from a vtile which has not yet been allocated */
  22. HW_ISSUE_8245,
  23. /* uTLB deadlock could occur when writing to an invalid page at the
  24. * same time as access to a valid page in the same uTLB cache line ( ==
  25. * 4 PTEs == 16K block of mapping) */
  26. HW_ISSUE_8316,
  27. /* HT: TERMINATE for RUN command ignored if previous LOAD_DESCRIPTOR is
  28. * still executing */
  29. HW_ISSUE_8394,
  30. /* CSE: Sends a TERMINATED response for a task that should not be
  31. * terminated */
  32. HW_ISSUE_8401,
  33. /* Repeatedly Soft-stopping a job chain consisting of (Vertex Shader,
  34. * Cache Flush, Tiler) jobs causes DATA_INVALID_FAULT on tiler job. */
  35. HW_ISSUE_8408,
  36. /* Disable the Pause Buffer in the LS pipe. */
  37. HW_ISSUE_8443,
  38. /* Change in RMUs in use causes problems related with the core's SDC */
  39. HW_ISSUE_8987,
  40. /* Compute endpoint has a 4-deep queue of tasks, meaning a soft stop
  41. * won't complete until all 4 tasks have completed */
  42. HW_ISSUE_9435,
  43. /* HT: Tiler returns TERMINATED for non-terminated command */
  44. HW_ISSUE_9510,
  45. /* Occasionally the GPU will issue multiple page faults for the same
  46. * address before the MMU page table has been read by the GPU */
  47. HW_ISSUE_9630,
  48. /* RA DCD load request to SDC returns invalid load ignore causing
  49. * colour buffer mismatch */
  50. HW_ISSUE_10327,
  51. /* MMU TLB invalidation hazards */
  52. HW_ISSUE_10649,
  53. /* Missing cache flush in multi core-group configuration */
  54. HW_ISSUE_10676,
  55. /* Chicken bit on T72X for a hardware workaround in compiler */
  56. HW_ISSUE_10797,
  57. /* Soft-stopping fragment jobs might fail with TILE_RANGE_FAULT */
  58. HW_ISSUE_10817,
  59. /* Intermittent missing interrupt on job completion */
  60. HW_ISSUE_10883,
  61. /* Soft-stopping fragment jobs might fail with TILE_RANGE_ERROR
  62. * (similar to issue 10817) and can use #10817 workaround */
  63. HW_ISSUE_10959,
  64. /* Soft-stopped fragment shader job can restart with out-of-bound
  65. * restart index */
  66. HW_ISSUE_10969,
  67. /* Race condition can cause tile list corruption */
  68. HW_ISSUE_11020,
  69. /* Write buffer can cause tile list corruption */
  70. HW_ISSUE_11024,
  71. /* Pause buffer can cause a fragment job hang */
  72. HW_ISSUE_11035,
  73. /* Dynamic Core Scaling not supported due to errata */
  74. HW_ISSUE_11056,
  75. /* Clear encoder state for a hard stopped fragment job which is AFBC
  76. * encoded by soft resetting the GPU. Only for T76X r0p0, r0p1 and
  77. * r0p1_50rel0 */
  78. HW_ISSUE_T76X_3542,
  79. /* Keep tiler module clock on to prevent GPU stall */
  80. HW_ISSUE_T76X_3953,
  81. /* Must ensure L2 is not transitioning when we reset. Workaround with a
  82. * busy wait until L2 completes transition; ensure there is a maximum
  83. * loop count as she may never complete her transition. (On chips
  84. * without this errata, it's totally okay if L2 transitions.) */
  85. HW_ISSUE_TMIX_8463,
  86. /* Don't set SC_LS_ATTR_CHECK_DISABLE/SC_LS_ALLOW_ATTR_TYPES */
  87. GPUCORE_1619,
  88. /* When a hard-stop follows close after a soft-stop, the completion
  89. * code for the terminated job may be incorrectly set to STOPPED */
  90. HW_ISSUE_TMIX_8438,
  91. /* "Protected mode" is buggy on Mali-G31 some Bifrost chips, so the
  92. * kernel must fiddle with L2 caches to prevent data leakage */
  93. HW_ISSUE_TGOX_R1_1234,
  94. /* Must set SC_VAR_ALGORITHM */
  95. HW_ISSUE_TTRX_2968_TTRX_3162,
  96. /* Bus fault from occlusion query write may cause future fragment jobs
  97. * to hang */
  98. HW_ISSUE_TTRX_3076,
  99. /* Must issue a dummy job before starting real work to prevent hangs */
  100. HW_ISSUE_TTRX_3485,
  101. HW_ISSUE_END
  102. };
  103. #define hw_issues_all (\
  104. BIT_ULL(HW_ISSUE_9435))
  105. #define hw_issues_t600 (\
  106. BIT_ULL(HW_ISSUE_6367) | \
  107. BIT_ULL(HW_ISSUE_6787) | \
  108. BIT_ULL(HW_ISSUE_8408) | \
  109. BIT_ULL(HW_ISSUE_9510) | \
  110. BIT_ULL(HW_ISSUE_10649) | \
  111. BIT_ULL(HW_ISSUE_10676) | \
  112. BIT_ULL(HW_ISSUE_10883) | \
  113. BIT_ULL(HW_ISSUE_11020) | \
  114. BIT_ULL(HW_ISSUE_11035) | \
  115. BIT_ULL(HW_ISSUE_11056) | \
  116. BIT_ULL(HW_ISSUE_TMIX_8438))
  117. #define hw_issues_t600_r0p0_15dev0 (\
  118. BIT_ULL(HW_ISSUE_8186) | \
  119. BIT_ULL(HW_ISSUE_8245) | \
  120. BIT_ULL(HW_ISSUE_8316) | \
  121. BIT_ULL(HW_ISSUE_8394) | \
  122. BIT_ULL(HW_ISSUE_8401) | \
  123. BIT_ULL(HW_ISSUE_8443) | \
  124. BIT_ULL(HW_ISSUE_8987) | \
  125. BIT_ULL(HW_ISSUE_9630) | \
  126. BIT_ULL(HW_ISSUE_10969) | \
  127. BIT_ULL(GPUCORE_1619))
  128. #define hw_issues_t620 (\
  129. BIT_ULL(HW_ISSUE_10649) | \
  130. BIT_ULL(HW_ISSUE_10883) | \
  131. BIT_ULL(HW_ISSUE_10959) | \
  132. BIT_ULL(HW_ISSUE_11056) | \
  133. BIT_ULL(HW_ISSUE_TMIX_8438))
  134. #define hw_issues_t620_r0p1 (\
  135. BIT_ULL(HW_ISSUE_10327) | \
  136. BIT_ULL(HW_ISSUE_10676) | \
  137. BIT_ULL(HW_ISSUE_10817) | \
  138. BIT_ULL(HW_ISSUE_11020) | \
  139. BIT_ULL(HW_ISSUE_11024) | \
  140. BIT_ULL(HW_ISSUE_11035))
  141. #define hw_issues_t620_r1p0 (\
  142. BIT_ULL(HW_ISSUE_11020) | \
  143. BIT_ULL(HW_ISSUE_11024))
  144. #define hw_issues_t720 (\
  145. BIT_ULL(HW_ISSUE_10649) | \
  146. BIT_ULL(HW_ISSUE_10797) | \
  147. BIT_ULL(HW_ISSUE_10883) | \
  148. BIT_ULL(HW_ISSUE_11056) | \
  149. BIT_ULL(HW_ISSUE_TMIX_8438))
  150. #define hw_issues_t760 (\
  151. BIT_ULL(HW_ISSUE_10883) | \
  152. BIT_ULL(HW_ISSUE_T76X_3953) | \
  153. BIT_ULL(HW_ISSUE_TMIX_8438))
  154. #define hw_issues_t760_r0p0 (\
  155. BIT_ULL(HW_ISSUE_11020) | \
  156. BIT_ULL(HW_ISSUE_11024) | \
  157. BIT_ULL(HW_ISSUE_T76X_3542))
  158. #define hw_issues_t760_r0p1 (\
  159. BIT_ULL(HW_ISSUE_11020) | \
  160. BIT_ULL(HW_ISSUE_11024) | \
  161. BIT_ULL(HW_ISSUE_T76X_3542))
  162. #define hw_issues_t760_r0p1_50rel0 (\
  163. BIT_ULL(HW_ISSUE_T76X_3542))
  164. #define hw_issues_t760_r0p2 (\
  165. BIT_ULL(HW_ISSUE_11020) | \
  166. BIT_ULL(HW_ISSUE_11024) | \
  167. BIT_ULL(HW_ISSUE_T76X_3542))
  168. #define hw_issues_t760_r0p3 (\
  169. BIT_ULL(HW_ISSUE_T76X_3542))
  170. #define hw_issues_t820 (\
  171. BIT_ULL(HW_ISSUE_10883) | \
  172. BIT_ULL(HW_ISSUE_T76X_3953) | \
  173. BIT_ULL(HW_ISSUE_TMIX_8438))
  174. #define hw_issues_t830 (\
  175. BIT_ULL(HW_ISSUE_10883) | \
  176. BIT_ULL(HW_ISSUE_T76X_3953) | \
  177. BIT_ULL(HW_ISSUE_TMIX_8438))
  178. #define hw_issues_t860 (\
  179. BIT_ULL(HW_ISSUE_10883) | \
  180. BIT_ULL(HW_ISSUE_T76X_3953) | \
  181. BIT_ULL(HW_ISSUE_TMIX_8438))
  182. #define hw_issues_t880 (\
  183. BIT_ULL(HW_ISSUE_10883) | \
  184. BIT_ULL(HW_ISSUE_T76X_3953) | \
  185. BIT_ULL(HW_ISSUE_TMIX_8438))
  186. #define hw_issues_g31 0
  187. #define hw_issues_g31_r1p0 (\
  188. BIT_ULL(HW_ISSUE_TGOX_R1_1234))
  189. #define hw_issues_g51 0
  190. #define hw_issues_g52 0
  191. #define hw_issues_g71 (\
  192. BIT_ULL(HW_ISSUE_TMIX_8463) | \
  193. BIT_ULL(HW_ISSUE_TMIX_8438))
  194. #define hw_issues_g71_r0p0_05dev0 (\
  195. BIT_ULL(HW_ISSUE_T76X_3953))
  196. #define hw_issues_g72 0
  197. #define hw_issues_g76 0
  198. #define hw_issues_g57 (\
  199. BIT_ULL(HW_ISSUE_TTRX_2968_TTRX_3162) | \
  200. BIT_ULL(HW_ISSUE_TTRX_3076))
  201. #define hw_issues_g57_r0p0 (\
  202. BIT_ULL(HW_ISSUE_TTRX_3485))
  203. static inline bool panfrost_has_hw_issue(const struct panfrost_device *pfdev,
  204. enum panfrost_hw_issue issue)
  205. {
  206. return test_bit(issue, pfdev->features.hw_issues);
  207. }
  208. #endif /* __PANFROST_ISSUES_H__ */