1#
2# (C) COPYRIGHT 2012-2020 ARM Limited. All rights reserved.
3#
4# This program is free software and is provided to you under the terms of the
5# GNU General Public License version 2 as published by the Free Software
6# Foundation, and any use by you of this program is subject to the terms
7# of such GNU licence.
8#
9# A copy of the licence is included with the program, and can also be obtained
10# from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
11# Boston, MA  02110-1301, USA.
12#
13#
14
15
16menuconfig MALI_BIFROST
17	bool "Mali Midgard series support"
18	default y
19	help
20	  Enable this option to build support for a ARM Mali Midgard GPU.
21
22	  To compile this driver as a module, choose M here:
23	  this will generate a single module, called mali_kbase.
24
25config MALI_BIFROST_GATOR_SUPPORT
26	bool "Enable Streamline tracing support"
27	depends on MALI_BIFROST && !BACKEND_USER
28	default y
29	help
30	  Enables kbase tracing used by the Arm Streamline Performance Analyzer.
31	  The tracepoints are used to derive GPU activity charts in Streamline.
32
33config MALI_BIFROST_DVFS
34	bool "Enable legacy DVFS"
35	depends on MALI_BIFROST && !MALI_BIFROST_DEVFREQ
36	default n
37	help
38	  Choose this option to enable legacy DVFS in the Mali Midgard DDK.
39
40config MALI_BIFROST_ENABLE_TRACE
41	bool "Enable kbase tracing"
42	default y if MALI_BIFROST_DEBUG
43	default n
44	help
45	  Enables tracing in kbase.  Trace log available through
46	  the "mali_trace" debugfs file, when the CONFIG_DEBUG_FS is enabled
47
48config MALI_BIFROST_DEVFREQ
49	bool "devfreq support for Mali"
50	depends on MALI_BIFROST
51	default y if PLATFORM_JUNO
52	default y if PLATFORM_CUSTOM
53	help
54	  Support devfreq for Mali.
55
56	  Using the devfreq framework and, by default, the simpleondemand
57	  governor, the frequency of Mali will be dynamically selected from the
58	  available OPPs.
59
60config MALI_BIFROST_DMA_FENCE
61	bool "DMA_BUF fence support for Mali"
62	depends on MALI_BIFROST
63	default n
64	help
65	  Support DMA_BUF fences for Mali.
66
67	  This option should only be enabled if the Linux Kernel has built in
68	  support for DMA_BUF fences.
69
70config MALI_PLATFORM_NAME
71	depends on MALI_BIFROST
72	string "Platform name"
73	default "hisilicon" if PLATFORM_HIKEY960
74	default "hisilicon" if PLATFORM_HIKEY970
75	default "devicetree"
76	help
77	  Enter the name of the desired platform configuration directory to
78	  include in the build. 'platform/$(MALI_PLATFORM_NAME)/Kbuild' must
79	  exist.
80
81	  When PLATFORM_CUSTOM is set, this needs to be set manually to
82	  pick up the desired platform files.
83
84config MALI_ARBITER_SUPPORT
85	bool "Enable arbiter support for Mali"
86	depends on MALI_BIFROST && !GPU_HAS_CSF
87	default n
88	help
89	  Enable support for the arbiter interface in the driver.
90	  This allows an external arbiter to manage driver access
91	  to GPU hardware in a virtualized environment
92
93	  If unsure, say N.
94
95# MALI_BIFROST_EXPERT configuration options
96
97menuconfig MALI_BIFROST_EXPERT
98	depends on MALI_BIFROST
99	bool "Enable Expert Settings"
100	default y
101	help
102	  Enabling this option and modifying the default settings may produce a driver with performance or
103	  other limitations.
104
105config MALI_CORESTACK
106	bool "Support controlling power to the GPU core stack"
107	depends on MALI_BIFROST && MALI_BIFROST_EXPERT
108	default n
109	help
110	  Enabling this feature on supported GPUs will let the driver powering
111	  on/off the GPU core stack independently without involving the Power
112	  Domain Controller. This should only be enabled on platforms which
113	  integration of the PDC to the Mali GPU is known to be problematic.
114	  This feature is currently only supported on t-Six and t-HEx GPUs.
115
116	  If unsure, say N.
117
118config MALI_BIFROST_DEBUG
119	bool "Debug build"
120	depends on MALI_BIFROST && MALI_BIFROST_EXPERT
121	default y if DEBUG
122	default n
123	help
124	  Select this option for increased checking and reporting of errors.
125
126config MALI_BIFROST_FENCE_DEBUG
127	bool "Debug sync fence usage"
128	depends on MALI_BIFROST && MALI_BIFROST_EXPERT
129	default y if MALI_BIFROST_DEBUG
130	help
131	  Select this option to enable additional checking and reporting on the
132	  use of sync fences in the Mali driver.
133
134	  This will add a 3s timeout to all sync fence waits in the Mali
135	  driver, so that when work for Mali has been waiting on a sync fence
136	  for a long time a debug message will be printed, detailing what fence
137	  is causing the block, and which dependent Mali atoms are blocked as a
138	  result of this.
139
140	  The timeout can be changed at runtime through the js_soft_timeout
141	  device attribute, where the timeout is specified in milliseconds.
142
143choice
144	prompt "Error injection level"
145	default MALI_ERROR_INJECT_NONE
146	help
147	  Enables insertion of errors to test module failure and recovery mechanisms.
148
149config MALI_ERROR_INJECT_NONE
150	bool "disabled"
151	help
152	  Error injection is disabled.
153
154config MALI_ERROR_INJECT_TRACK_LIST
155	bool "error track list"
156	depends on MALI_BIFROST && MALI_BIFROST_EXPERT && NO_MALI
157	help
158	  Errors to inject are pre-configured by the user.
159
160config MALI_ERROR_INJECT_RANDOM
161	bool "random error injection"
162	depends on MALI_BIFROST && MALI_BIFROST_EXPERT && NO_MALI
163	help
164	  Injected errors are random, rather than user-driven.
165
166endchoice
167
168config MALI_ERROR_INJECT_ON
169	string
170	default "0" if MALI_ERROR_INJECT_NONE
171	default "1" if MALI_ERROR_INJECT_TRACK_LIST
172	default "2" if MALI_ERROR_INJECT_RANDOM
173
174config MALI_BIFROST_ERROR_INJECT
175	bool
176	default y if !MALI_ERROR_INJECT_NONE
177
178config MALI_BIFROST_SYSTEM_TRACE
179	bool "Enable system event tracing support"
180	depends on MALI_BIFROST && MALI_BIFROST_EXPERT
181	default y if MALI_BIFROST_DEBUG
182	default n
183	help
184	  Choose this option to enable system trace events for each
185	  kbase event. This is typically used for debugging but has
186	  minimal overhead when not in use. Enable only if you know what
187	  you are doing.
188
189config MALI_2MB_ALLOC
190	bool "Attempt to allocate 2MB pages"
191	depends on MALI_BIFROST && MALI_BIFROST_EXPERT
192	default n
193	help
194	  Rather than allocating all GPU memory page-by-page, attempt to
195	  allocate 2MB pages from the kernel. This reduces TLB pressure and
196	  helps to prevent memory fragmentation.
197
198	  If in doubt, say N
199
200config MALI_PWRSOFT_765
201	bool "PWRSOFT-765 ticket"
202	depends on MALI_BIFROST && MALI_BIFROST_EXPERT
203	default n
204	help
205	  PWRSOFT-765 fixes devfreq cooling devices issues. However, they are
206	  not merged in mainline kernel yet. So this define helps to guard those
207	  parts of the code.
208
209config MALI_MEMORY_FULLY_BACKED
210	bool "Memory fully physically-backed"
211	default n
212	help
213	  This option enables full backing of all virtual memory allocations
214	  for the kernel. This only affects grow-on-GPU-page-fault memory.
215
216config MALI_DMA_BUF_MAP_ON_DEMAND
217	bool "Map imported dma-bufs on demand"
218	depends on MALI_BIFROST
219	default n
220	default y if !DMA_BUF_SYNC_IOCTL_SUPPORTED
221	help
222	  This option caused kbase to set up the GPU mapping of imported
223	  dma-buf when needed to run atoms.  This is the legacy behaviour.
224
225config MALI_DMA_BUF_LEGACY_COMPAT
226	bool "Enable legacy compatibility cache flush on dma-buf map"
227	depends on MALI_BIFROST && !MALI_DMA_BUF_MAP_ON_DEMAND
228	default n
229	help
230	  This option enables compatibility with legacy dma-buf mapping
231	  behavior, then the dma-buf is mapped on import, by adding cache
232	  maintenance where MALI_DMA_BUF_MAP_ON_DEMAND would do the mapping,
233	  including a cache flush.
234
235config MALI_REAL_HW
236	bool
237	default y
238	default n if NO_MALI
239
240config MALI_HW_ERRATA_1485982_NOT_AFFECTED
241	bool "Disable workaround for BASE_HW_ISSUE_GPU2017_1336"
242	depends on MALI_BIFROST && MALI_BIFROST_EXPERT
243	default n
244	default y if PLATFORM_JUNO
245	help
246	  This option disables the default workaround for GPU2017-1336. The
247	  workaround keeps the L2 cache powered up except for powerdown and reset.
248
249	  The workaround introduces a limitation that will prevent the running of
250	  protected mode content on fully coherent platforms, as the switch to IO
251	  coherency mode requires the L2 to be turned off.
252
253config MALI_HW_ERRATA_1485982_USE_CLOCK_ALTERNATIVE
254	bool "Use alternative workaround for BASE_HW_ISSUE_GPU2017_1336"
255	depends on MALI_BIFROST && MALI_BIFROST_EXPERT && !MALI_HW_ERRATA_1485982_NOT_AFFECTED
256	default n
257	help
258	  This option uses an alternative workaround for GPU2017-1336. Lowering
259	  the GPU clock to a, platform specific, known good frequeuncy before
260	  powering down the L2 cache. The clock can be specified in the device
261	  tree using the property, opp-mali-errata-1485982. Otherwise the
262	  slowest clock will be selected.
263
264config MALI_GEM5_BUILD
265	bool "Enable build of Mali kernel driver for GEM5"
266	depends on MALI_BIFROST
267	default n
268	help
269	  This option is to do a Mali GEM5 build.
270	  If unsure, say N.
271
272# Instrumentation options.
273
274# config MALI_JOB_DUMP exists in the Kernel Kconfig but is configured using CINSTR_JOB_DUMP in Mconfig.
275# config MALI_BIFROST_PRFCNT_SET_SECONDARY exists in the Kernel Kconfig but is configured using CINSTR_SECONDARY_HWC in Mconfig.
276
277source "kernel/drivers/gpu/arm/midgard/tests/Mconfig"
278