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