^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) # SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) # (C) COPYRIGHT 2012-2021 ARM Limited. All rights reserved.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) # This program is free software and is provided to you under the terms of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) # GNU General Public License version 2 as published by the Free Software
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) # Foundation, and any use by you of this program is subject to the terms
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) # of such GNU license.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) # This program is distributed in the hope that it will be useful,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) # but WITHOUT ANY WARRANTY; without even the implied warranty of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) # GNU General Public License for more details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) # You should have received a copy of the GNU General Public License
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) # along with this program; if not, you can access it online at
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) # http://www.gnu.org/licenses/gpl-2.0.html.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) menuconfig MALI_BIFROST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) tristate "Mali Bifrost series support"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) select GPU_TRACEPOINTS if ANDROID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) select DMA_SHARED_BUFFER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) select FW_LOADER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) Enable this option to build support for a ARM Mali Bifrost GPU.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) To compile this driver as a module, choose M here:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) this will generate a single module, called mali_kbase.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) if MALI_BIFROST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) config MALI_PLATFORM_NAME
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) depends on MALI_BIFROST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) string "Platform name"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) default "devicetree"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) Enter the name of the desired platform configuration directory to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) include in the build. 'platform/$(MALI_PLATFORM_NAME)/Kbuild' must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) exist.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) config MALI_REAL_HW
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) depends on MALI_BIFROST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) def_bool !MALI_BIFROST_NO_MALI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) menu "Platform specific options"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) source "drivers/gpu/arm/bifrost/platform/Kconfig"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) endmenu
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) config MALI_CSF_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) bool "Enable Mali CSF based GPU support"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) Enables support for CSF based GPUs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) config MALI_BIFROST_DEVFREQ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) bool "Enable devfreq support for Mali"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) depends on MALI_BIFROST && PM_DEVFREQ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) select DEVFREQ_GOV_SIMPLE_ONDEMAND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) Support devfreq for Mali.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) Using the devfreq framework and, by default, the simple on-demand
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) governor, the frequency of Mali will be dynamically selected from the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) available OPPs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) config MALI_BIFROST_DVFS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) bool "Enable legacy DVFS"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) depends on MALI_BIFROST && !MALI_BIFROST_DEVFREQ
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) Choose this option to enable legacy DVFS in the Mali Midgard DDK.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) config MALI_BIFROST_GATOR_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) bool "Enable Streamline tracing support"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) depends on MALI_BIFROST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) default y
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) Enables kbase tracing used by the Arm Streamline Performance Analyzer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) The tracepoints are used to derive GPU activity charts in Streamline.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) config MALI_BIFROST_ENABLE_TRACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) bool "Enable kbase tracing"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) depends on MALI_BIFROST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) default y if MALI_BIFROST_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) Enables tracing in kbase. Trace log available through
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) the "mali_trace" debugfs file, when the CONFIG_DEBUG_FS is enabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) config MALI_BIFROST_DMA_FENCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) bool "Enable DMA_BUF fence support for Mali"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) depends on MALI_BIFROST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) Support DMA_BUF fences for Mali.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) This option should only be enabled if the Linux Kernel has built in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) support for DMA_BUF fences.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) config MALI_ARBITER_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) bool "Enable arbiter support for Mali"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) depends on MALI_BIFROST && !MALI_CSF_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) Enable support for the arbiter interface in the driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) This allows an external arbiter to manage driver access
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) to GPU hardware in a virtualized environment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) config MALI_DMA_BUF_MAP_ON_DEMAND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) bool "Enable map imported dma-bufs on demand"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) depends on MALI_BIFROST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) This option caused kbase to set up the GPU mapping of imported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) dma-buf when needed to run atoms. This is the legacy behavior.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) This is intended for testing and the option will get removed in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) future.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) config MALI_DMA_BUF_LEGACY_COMPAT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) bool "Enable legacy compatibility cache flush on dma-buf map"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) depends on MALI_BIFROST && !MALI_DMA_BUF_MAP_ON_DEMAND
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) This option enables compatibility with legacy dma-buf mapping
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) behavior, then the dma-buf is mapped on import, by adding cache
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) maintenance where MALI_DMA_BUF_MAP_ON_DEMAND would do the mapping,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) including a cache flush.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) This option might work-around issues related to missing cache
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) flushes in other drivers. This only has an effect for clients using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) UK 11.18 or older. For later UK versions it is not possible.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) menuconfig MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) depends on MALI_BIFROST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) bool "Enable Expert Settings"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) Enabling this option and modifying the default settings may produce
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) a driver with performance or other limitations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) if MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) config MALI_2MB_ALLOC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) bool "Attempt to allocate 2MB pages"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) Rather than allocating all GPU memory page-by-page, attempt to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) allocate 2MB pages from the kernel. This reduces TLB pressure and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) helps to prevent memory fragmentation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) If in doubt, say N
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) config MALI_MEMORY_FULLY_BACKED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) bool "Enable memory fully physically-backed"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) This option enables full physical backing of all virtual
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) memory allocations in the kernel. Notice that this build
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) option only affects allocations of grow-on-GPU-page-fault
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) memory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) config MALI_CORESTACK
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) bool "Enable support of GPU core stack power control"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) Enabling this feature on supported GPUs will let the driver powering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) on/off the GPU core stack independently without involving the Power
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) Domain Controller. This should only be enabled on platforms which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) integration of the PDC to the Mali GPU is known to be problematic.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) This feature is currently only supported on t-Six and t-HEx GPUs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) comment "Platform options"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) config MALI_BIFROST_NO_MALI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) bool "Enable No Mali"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) This can be used to test the driver in a simulated environment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) whereby the hardware is not physically present. If the hardware is physically
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) present it will not be used. This can be used to test the majority of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) driver without needing actual hardware or for software benchmarking.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) All calls to the simulated hardware will complete immediately as if the hardware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) completed the task.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) config MALI_BIFROST_ERROR_INJECT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) bool "Enable No Mali error injection"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) depends on MALI_BIFROST && MALI_BIFROST_EXPERT && MALI_BIFROST_NO_MALI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) Enables insertion of errors to test module failure and recovery mechanisms.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) config MALI_GEM5_BUILD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) bool "Enable build of Mali kernel driver for GEM5"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) This option is to do a Mali GEM5 build.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) comment "Debug options"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) config MALI_FW_CORE_DUMP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) bool "Enable support for FW core dump"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) depends on MALI_BIFROST && MALI_BIFROST_EXPERT && MALI_CSF_SUPPORT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) Adds ability to request firmware core dump
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) Example:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) * To explicitly request core dump:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) echo 1 >/sys/kernel/debug/mali0/fw_core_dump
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) * To output current core dump (after explicitly requesting a core dump,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) or kernel driver reported an internal firmware error):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) cat /sys/kernel/debug/mali0/fw_core_dump
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) config MALI_BIFROST_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) bool "Enable debug build"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) Select this option for increased checking and reporting of errors.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) config MALI_BIFROST_FENCE_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) bool "Enable debug sync fence usage"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) depends on MALI_BIFROST && MALI_BIFROST_EXPERT && (SYNC || SYNC_FILE)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) default y if MALI_BIFROST_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) Select this option to enable additional checking and reporting on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) use of sync fences in the Mali driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) This will add a 3s timeout to all sync fence waits in the Mali
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) driver, so that when work for Mali has been waiting on a sync fence
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) for a long time a debug message will be printed, detailing what fence
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) is causing the block, and which dependent Mali atoms are blocked as a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) result of this.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) The timeout can be changed at runtime through the js_soft_timeout
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) device attribute, where the timeout is specified in milliseconds.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) config MALI_BIFROST_SYSTEM_TRACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) bool "Enable system event tracing support"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) default y if MALI_BIFROST_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) Choose this option to enable system trace events for each
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) kbase event. This is typically used for debugging but has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) minimal overhead when not in use. Enable only if you know what
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) you are doing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) comment "Instrumentation options"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) choice
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) prompt "Select Performance counters set"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) default MALI_PRFCNT_SET_PRIMARY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) config MALI_PRFCNT_SET_PRIMARY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) bool "Primary"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) Select this option to use primary set of performance counters.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) config MALI_BIFROST_PRFCNT_SET_SECONDARY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) bool "Secondary"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) Select this option to use secondary set of performance counters. Kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) features that depend on an access to the primary set of counters may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) become unavailable. Enabling this option will prevent power management
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) from working optimally and may cause instrumentation tools to return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) bogus results.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) If unsure, use MALI_PRFCNT_SET_PRIMARY.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) config MALI_PRFCNT_SET_TERTIARY
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) bool "Tertiary"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) Select this option to use tertiary set of performance counters. Kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) features that depend on an access to the primary set of counters may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) become unavailable. Enabling this option will prevent power management
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) from working optimally and may cause instrumentation tools to return
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) bogus results.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) If unsure, use MALI_PRFCNT_SET_PRIMARY.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) endchoice
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) config MALI_PRFCNT_SET_SELECT_VIA_DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) bool "Enable runtime selection of performance counters set via debugfs"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) depends on MALI_BIFROST && MALI_BIFROST_EXPERT && DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) Select this option to make the secondary set of performance counters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) available at runtime via debugfs. Kernel features that depend on an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) access to the primary set of counters may become unavailable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) If no runtime debugfs option is set, the build time counter set
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) choice will be used.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) This feature is unsupported and unstable, and may break at any time.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) Enabling this option will prevent power management from working
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) optimally and may cause instrumentation tools to return bogus results.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) No validation is done on the debugfs input. Invalid input could cause
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) performance counter errors. Valid inputs are the values accepted by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) the SET_SELECT bits of the PRFCNT_CONFIG register as defined in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) architecture specification.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) config MALI_JOB_DUMP
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) bool "Enable system level support needed for job dumping"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) Choose this option to enable system level support needed for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335) job dumping. This is typically used for instrumentation but has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) minimal overhead when not in use. Enable only if you know what
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) you are doing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) comment "Workarounds"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) config MALI_PWRSOFT_765
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) bool "Enable workaround for PWRSOFT-765"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) PWRSOFT-765 fixes devfreq cooling devices issues. The fix was merged
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) in kernel v4.10, however if backported into the kernel then this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) option must be manually selected.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) If using kernel >= v4.10 then say N, otherwise if devfreq cooling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) changes have been backported say Y to avoid compilation errors.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) config MALI_HW_ERRATA_1485982_NOT_AFFECTED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) bool "Disable workaround for BASE_HW_ISSUE_GPU2017_1336"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) depends on MALI_BIFROST && MALI_BIFROST_EXPERT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) This option disables the default workaround for GPU2017-1336. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) workaround keeps the L2 cache powered up except for powerdown and reset.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) The workaround introduces a limitation that will prevent the running of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) protected mode content on fully coherent platforms, as the switch to IO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) coherency mode requires the L2 to be turned off.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) config MALI_HW_ERRATA_1485982_USE_CLOCK_ALTERNATIVE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) bool "Use alternative workaround for BASE_HW_ISSUE_GPU2017_1336"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) depends on MALI_BIFROST && MALI_BIFROST_EXPERT && !MALI_HW_ERRATA_1485982_NOT_AFFECTED
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) This option uses an alternative workaround for GPU2017-1336. Lowering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) the GPU clock to a, platform specific, known good frequency before
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) powering down the L2 cache. The clock can be specified in the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) tree using the property, opp-mali-errata-1485982. Otherwise the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) slowest clock will be selected.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) config MALI_ARBITRATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) tristate "Enable Virtualization reference code"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) depends on MALI_BIFROST
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) default n
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) help
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) Enables the build of several reference modules used in the reference
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) virtualization setup for Mali
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) If unsure, say N.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) if MALI_ARBITRATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) source "drivers/gpu/arm/bifrost/arbitration/Kconfig"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) # source "drivers/gpu/arm/bifrost/tests/Kconfig"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) endif