xref: /openbmc/linux/drivers/gpu/drm/panfrost/panfrost_issues.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1f3ba9122SRob Herring /* SPDX-License-Identifier: GPL-2.0 */
2f3ba9122SRob Herring /* (C) COPYRIGHT 2014-2018 ARM Limited. All rights reserved. */
3f3ba9122SRob Herring /* Copyright 2019 Linaro, Ltd., Rob Herring <robh@kernel.org> */
4f3ba9122SRob Herring #ifndef __PANFROST_ISSUES_H__
5f3ba9122SRob Herring #define __PANFROST_ISSUES_H__
6f3ba9122SRob Herring 
7f3ba9122SRob Herring #include <linux/bitops.h>
8f3ba9122SRob Herring 
9f3ba9122SRob Herring #include "panfrost_device.h"
10f3ba9122SRob Herring 
11f3ba9122SRob Herring /*
12f3ba9122SRob Herring  * This is not a complete list of issues, but only the ones the driver needs
13f3ba9122SRob Herring  * to care about.
14f3ba9122SRob Herring  */
15f3ba9122SRob Herring enum panfrost_hw_issue {
161c5f087aSAlyssa Rosenzweig 	/* Need way to guarantee that all previously-translated memory accesses
1781d9d7f8STom Rix 	 * are committed */
18f3ba9122SRob Herring 	HW_ISSUE_6367,
191c5f087aSAlyssa Rosenzweig 
201c5f087aSAlyssa Rosenzweig 	/* On job complete with non-done the cache is not flushed */
21f3ba9122SRob Herring 	HW_ISSUE_6787,
221c5f087aSAlyssa Rosenzweig 
231c5f087aSAlyssa Rosenzweig 	/* Write of PRFCNT_CONFIG_MODE_MANUAL to PRFCNT_CONFIG causes a
241c5f087aSAlyssa Rosenzweig 	 * instrumentation dump if PRFCNT_TILER_EN is enabled */
25f3ba9122SRob Herring 	HW_ISSUE_8186,
261c5f087aSAlyssa Rosenzweig 
271c5f087aSAlyssa Rosenzweig 	/* TIB: Reports faults from a vtile which has not yet been allocated */
28f3ba9122SRob Herring 	HW_ISSUE_8245,
291c5f087aSAlyssa Rosenzweig 
301c5f087aSAlyssa Rosenzweig 	/* uTLB deadlock could occur when writing to an invalid page at the
311c5f087aSAlyssa Rosenzweig 	 * same time as access to a valid page in the same uTLB cache line ( ==
321c5f087aSAlyssa Rosenzweig 	 * 4 PTEs == 16K block of mapping) */
33f3ba9122SRob Herring 	HW_ISSUE_8316,
341c5f087aSAlyssa Rosenzweig 
351c5f087aSAlyssa Rosenzweig 	/* HT: TERMINATE for RUN command ignored if previous LOAD_DESCRIPTOR is
361c5f087aSAlyssa Rosenzweig 	 * still executing */
37f3ba9122SRob Herring 	HW_ISSUE_8394,
381c5f087aSAlyssa Rosenzweig 
391c5f087aSAlyssa Rosenzweig 	/* CSE: Sends a TERMINATED response for a task that should not be
401c5f087aSAlyssa Rosenzweig 	 * terminated */
41f3ba9122SRob Herring 	HW_ISSUE_8401,
421c5f087aSAlyssa Rosenzweig 
431c5f087aSAlyssa Rosenzweig 	/* Repeatedly Soft-stopping a job chain consisting of (Vertex Shader,
441c5f087aSAlyssa Rosenzweig 	 * Cache Flush, Tiler) jobs causes DATA_INVALID_FAULT on tiler job. */
45f3ba9122SRob Herring 	HW_ISSUE_8408,
461c5f087aSAlyssa Rosenzweig 
471c5f087aSAlyssa Rosenzweig 	/* Disable the Pause Buffer in the LS pipe. */
48f3ba9122SRob Herring 	HW_ISSUE_8443,
491c5f087aSAlyssa Rosenzweig 
501c5f087aSAlyssa Rosenzweig 	/* Change in RMUs in use causes problems related with the core's SDC */
51f3ba9122SRob Herring 	HW_ISSUE_8987,
521c5f087aSAlyssa Rosenzweig 
531c5f087aSAlyssa Rosenzweig 	/* Compute endpoint has a 4-deep queue of tasks, meaning a soft stop
541c5f087aSAlyssa Rosenzweig 	 * won't complete until all 4 tasks have completed */
55f3ba9122SRob Herring 	HW_ISSUE_9435,
561c5f087aSAlyssa Rosenzweig 
571c5f087aSAlyssa Rosenzweig 	/* HT: Tiler returns TERMINATED for non-terminated command */
58f3ba9122SRob Herring 	HW_ISSUE_9510,
591c5f087aSAlyssa Rosenzweig 
601c5f087aSAlyssa Rosenzweig 	/* Occasionally the GPU will issue multiple page faults for the same
611c5f087aSAlyssa Rosenzweig 	 * address before the MMU page table has been read by the GPU */
62f3ba9122SRob Herring 	HW_ISSUE_9630,
631c5f087aSAlyssa Rosenzweig 
641c5f087aSAlyssa Rosenzweig 	/* RA DCD load request to SDC returns invalid load ignore causing
651c5f087aSAlyssa Rosenzweig 	 * colour buffer mismatch */
66f3ba9122SRob Herring 	HW_ISSUE_10327,
671c5f087aSAlyssa Rosenzweig 
681c5f087aSAlyssa Rosenzweig 	/* MMU TLB invalidation hazards */
69f3ba9122SRob Herring 	HW_ISSUE_10649,
701c5f087aSAlyssa Rosenzweig 
711c5f087aSAlyssa Rosenzweig 	/* Missing cache flush in multi core-group configuration */
72f3ba9122SRob Herring 	HW_ISSUE_10676,
731c5f087aSAlyssa Rosenzweig 
741c5f087aSAlyssa Rosenzweig 	/* Chicken bit on T72X for a hardware workaround in compiler */
75f3ba9122SRob Herring 	HW_ISSUE_10797,
761c5f087aSAlyssa Rosenzweig 
771c5f087aSAlyssa Rosenzweig 	/* Soft-stopping fragment jobs might fail with TILE_RANGE_FAULT */
78f3ba9122SRob Herring 	HW_ISSUE_10817,
791c5f087aSAlyssa Rosenzweig 
801c5f087aSAlyssa Rosenzweig 	/* Intermittent missing interrupt on job completion */
81f3ba9122SRob Herring 	HW_ISSUE_10883,
821c5f087aSAlyssa Rosenzweig 
831c5f087aSAlyssa Rosenzweig 	/* Soft-stopping fragment jobs might fail with TILE_RANGE_ERROR
841c5f087aSAlyssa Rosenzweig 	 * (similar to issue 10817) and can use #10817 workaround */
85f3ba9122SRob Herring 	HW_ISSUE_10959,
861c5f087aSAlyssa Rosenzweig 
871c5f087aSAlyssa Rosenzweig 	/* Soft-stopped fragment shader job can restart with out-of-bound
881c5f087aSAlyssa Rosenzweig 	 * restart index */
89f3ba9122SRob Herring 	HW_ISSUE_10969,
901c5f087aSAlyssa Rosenzweig 
911c5f087aSAlyssa Rosenzweig 	/* Race condition can cause tile list corruption */
92f3ba9122SRob Herring 	HW_ISSUE_11020,
931c5f087aSAlyssa Rosenzweig 
941c5f087aSAlyssa Rosenzweig 	/* Write buffer can cause tile list corruption */
95f3ba9122SRob Herring 	HW_ISSUE_11024,
961c5f087aSAlyssa Rosenzweig 
971c5f087aSAlyssa Rosenzweig 	/* Pause buffer can cause a fragment job hang */
98f3ba9122SRob Herring 	HW_ISSUE_11035,
991c5f087aSAlyssa Rosenzweig 
1001c5f087aSAlyssa Rosenzweig 	/* Dynamic Core Scaling not supported due to errata */
101f3ba9122SRob Herring 	HW_ISSUE_11056,
1021c5f087aSAlyssa Rosenzweig 
1031c5f087aSAlyssa Rosenzweig 	/* Clear encoder state for a hard stopped fragment job which is AFBC
1041c5f087aSAlyssa Rosenzweig 	 * encoded by soft resetting the GPU. Only for T76X r0p0, r0p1 and
1051c5f087aSAlyssa Rosenzweig 	 * r0p1_50rel0 */
106f3ba9122SRob Herring 	HW_ISSUE_T76X_3542,
1071c5f087aSAlyssa Rosenzweig 
1081c5f087aSAlyssa Rosenzweig 	/* Keep tiler module clock on to prevent GPU stall */
109f3ba9122SRob Herring 	HW_ISSUE_T76X_3953,
1101c5f087aSAlyssa Rosenzweig 
1111c5f087aSAlyssa Rosenzweig 	/* Must ensure L2 is not transitioning when we reset. Workaround with a
1121c5f087aSAlyssa Rosenzweig 	 * busy wait until L2 completes transition; ensure there is a maximum
1131c5f087aSAlyssa Rosenzweig 	 * loop count as she may never complete her transition. (On chips
1141c5f087aSAlyssa Rosenzweig 	 * without this errata, it's totally okay if L2 transitions.) */
115f3ba9122SRob Herring 	HW_ISSUE_TMIX_8463,
1161c5f087aSAlyssa Rosenzweig 
1171c5f087aSAlyssa Rosenzweig 	/* Don't set SC_LS_ATTR_CHECK_DISABLE/SC_LS_ALLOW_ATTR_TYPES */
118f3ba9122SRob Herring 	GPUCORE_1619,
1191c5f087aSAlyssa Rosenzweig 
1201c5f087aSAlyssa Rosenzweig 	/* When a hard-stop follows close after a soft-stop, the completion
1211c5f087aSAlyssa Rosenzweig 	 * code for the terminated job may be incorrectly set to STOPPED */
122f3ba9122SRob Herring 	HW_ISSUE_TMIX_8438,
1231c5f087aSAlyssa Rosenzweig 
1241c5f087aSAlyssa Rosenzweig 	/* "Protected mode" is buggy on Mali-G31 some Bifrost chips, so the
1251c5f087aSAlyssa Rosenzweig 	 * kernel must fiddle with L2 caches to prevent data leakage */
126f3ba9122SRob Herring 	HW_ISSUE_TGOX_R1_1234,
1271c5f087aSAlyssa Rosenzweig 
12838243570SAlyssa Rosenzweig 	/* Must set SC_VAR_ALGORITHM */
12938243570SAlyssa Rosenzweig 	HW_ISSUE_TTRX_2968_TTRX_3162,
13038243570SAlyssa Rosenzweig 
1310c0af438SAlyssa Rosenzweig 	/* Bus fault from occlusion query write may cause future fragment jobs
1320c0af438SAlyssa Rosenzweig 	 * to hang */
1330c0af438SAlyssa Rosenzweig 	HW_ISSUE_TTRX_3076,
1340c0af438SAlyssa Rosenzweig 
135892e7fb7SAlyssa Rosenzweig 	/* Must issue a dummy job before starting real work to prevent hangs */
136892e7fb7SAlyssa Rosenzweig 	HW_ISSUE_TTRX_3485,
137892e7fb7SAlyssa Rosenzweig 
138f3ba9122SRob Herring 	HW_ISSUE_END
139f3ba9122SRob Herring };
140f3ba9122SRob Herring 
141f3ba9122SRob Herring #define hw_issues_all (\
142f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_9435))
143f3ba9122SRob Herring 
144f3ba9122SRob Herring #define hw_issues_t600 (\
145f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_6367) | \
146f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_6787) | \
147f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_8408) | \
148f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_9510) | \
149f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10649) | \
150f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10676) | \
151f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10883) | \
152f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11020) | \
153f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11035) | \
154f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11056) | \
155f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_TMIX_8438))
156f3ba9122SRob Herring 
157f3ba9122SRob Herring #define hw_issues_t600_r0p0_15dev0 (\
158f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_8186) | \
159f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_8245) | \
160f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_8316) | \
161f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_8394) | \
162f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_8401) | \
163f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_8443) | \
164f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_8987) | \
165f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_9630) | \
166f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10969) | \
167f3ba9122SRob Herring 	BIT_ULL(GPUCORE_1619))
168f3ba9122SRob Herring 
169f3ba9122SRob Herring #define hw_issues_t620 (\
170f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10649) | \
171f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10883) | \
172f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10959) | \
173f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11056) | \
174f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_TMIX_8438))
175f3ba9122SRob Herring 
176f3ba9122SRob Herring #define hw_issues_t620_r0p1 (\
177f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10327) | \
178f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10676) | \
179f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10817) | \
180f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11020) | \
181f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11024) | \
182f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11035))
183f3ba9122SRob Herring 
184f3ba9122SRob Herring #define hw_issues_t620_r1p0 (\
185f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11020) | \
186f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11024))
187f3ba9122SRob Herring 
188f3ba9122SRob Herring #define hw_issues_t720 (\
189f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10649) | \
190f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10797) | \
191f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10883) | \
192f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11056) | \
193f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_TMIX_8438))
194f3ba9122SRob Herring 
195f3ba9122SRob Herring #define hw_issues_t760 (\
196f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10883) | \
197f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_T76X_3953) | \
198f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_TMIX_8438))
199f3ba9122SRob Herring 
200f3ba9122SRob Herring #define hw_issues_t760_r0p0 (\
201f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11020) | \
202f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11024) | \
203f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_T76X_3542))
204f3ba9122SRob Herring 
205f3ba9122SRob Herring #define hw_issues_t760_r0p1 (\
206f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11020) | \
207f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11024) | \
208f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_T76X_3542))
209f3ba9122SRob Herring 
210f3ba9122SRob Herring #define hw_issues_t760_r0p1_50rel0 (\
211f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_T76X_3542))
212f3ba9122SRob Herring 
213f3ba9122SRob Herring #define hw_issues_t760_r0p2 (\
214f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11020) | \
215f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_11024) | \
216f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_T76X_3542))
217f3ba9122SRob Herring 
218f3ba9122SRob Herring #define hw_issues_t760_r0p3 (\
219f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_T76X_3542))
220f3ba9122SRob Herring 
221f3ba9122SRob Herring #define hw_issues_t820 (\
222f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10883) | \
223f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_T76X_3953) | \
224f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_TMIX_8438))
225f3ba9122SRob Herring 
226f3ba9122SRob Herring #define hw_issues_t830 (\
227f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10883) | \
228f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_T76X_3953) | \
229f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_TMIX_8438))
230f3ba9122SRob Herring 
231f3ba9122SRob Herring #define hw_issues_t860 (\
232f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10883) | \
233f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_T76X_3953) | \
234f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_TMIX_8438))
235f3ba9122SRob Herring 
236f3ba9122SRob Herring #define hw_issues_t880 (\
237f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_10883) | \
238f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_T76X_3953) | \
239f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_TMIX_8438))
240f3ba9122SRob Herring 
241f3ba9122SRob Herring #define hw_issues_g31 0
242f3ba9122SRob Herring 
243f3ba9122SRob Herring #define hw_issues_g31_r1p0 (\
244f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_TGOX_R1_1234))
245f3ba9122SRob Herring 
246f3ba9122SRob Herring #define hw_issues_g51 0
247f3ba9122SRob Herring 
248f3ba9122SRob Herring #define hw_issues_g52 0
249f3ba9122SRob Herring 
250f3ba9122SRob Herring #define hw_issues_g71 (\
251f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_TMIX_8463) | \
252f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_TMIX_8438))
253f3ba9122SRob Herring 
254f3ba9122SRob Herring #define hw_issues_g71_r0p0_05dev0 (\
255f3ba9122SRob Herring 	BIT_ULL(HW_ISSUE_T76X_3953))
256f3ba9122SRob Herring 
257f3ba9122SRob Herring #define hw_issues_g72 0
258f3ba9122SRob Herring 
259f3ba9122SRob Herring #define hw_issues_g76 0
260f3ba9122SRob Herring 
261*5ba99fcaSAlyssa Rosenzweig #define hw_issues_g57 (\
262*5ba99fcaSAlyssa Rosenzweig 	BIT_ULL(HW_ISSUE_TTRX_2968_TTRX_3162) | \
263*5ba99fcaSAlyssa Rosenzweig 	BIT_ULL(HW_ISSUE_TTRX_3076))
264*5ba99fcaSAlyssa Rosenzweig 
265*5ba99fcaSAlyssa Rosenzweig #define hw_issues_g57_r0p0 (\
266*5ba99fcaSAlyssa Rosenzweig 	BIT_ULL(HW_ISSUE_TTRX_3485))
267*5ba99fcaSAlyssa Rosenzweig 
panfrost_has_hw_issue(const struct panfrost_device * pfdev,enum panfrost_hw_issue issue)268a17775a1SAlyssa Rosenzweig static inline bool panfrost_has_hw_issue(const struct panfrost_device *pfdev,
269f3ba9122SRob Herring 					 enum panfrost_hw_issue issue)
270f3ba9122SRob Herring {
271f3ba9122SRob Herring 	return test_bit(issue, pfdev->features.hw_issues);
272f3ba9122SRob Herring }
273f3ba9122SRob Herring 
274f3ba9122SRob Herring #endif /* __PANFROST_ISSUES_H__ */
275