xref: /OK3568_Linux_fs/kernel/drivers/gpu/arm/bifrost/build.bp (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 *
4 * (C) COPYRIGHT 2017-2023 ARM Limited. All rights reserved.
5 *
6 * This program is free software and is provided to you under the terms of the
7 * GNU General Public License version 2 as published by the Free Software
8 * Foundation, and any use by you of this program is subject to the terms
9 * of such GNU license.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you can access it online at
18 * http://www.gnu.org/licenses/gpl-2.0.html.
19 *
20 */
21
22/* Kernel-side tests may include mali_kbase's headers. Therefore any config
23 * options which affect the sizes of any structs (e.g. adding extra members)
24 * must be included in these defaults, so that the structs are consistent in
25 * both mali_kbase and the test modules. */
26bob_defaults {
27    name: "mali_kbase_shared_config_defaults",
28    defaults: [
29        "kernel_defaults",
30    ],
31    mali_no_mali: {
32        kbuild_options: [
33            "CONFIG_MALI_BIFROST_NO_MALI=y",
34            "CONFIG_MALI_NO_MALI_DEFAULT_GPU={{.gpu}}",
35            "CONFIG_GPU_HWVER={{.hwver}}",
36        ],
37    },
38    mali_platform_dt_pin_rst: {
39        kbuild_options: ["CONFIG_MALI_PLATFORM_DT_PIN_RST=y"],
40    },
41    gpu_has_csf: {
42        kbuild_options: ["CONFIG_MALI_CSF_SUPPORT=y"],
43    },
44    mali_devfreq: {
45        kbuild_options: ["CONFIG_MALI_BIFROST_DEVFREQ=y"],
46    },
47    mali_midgard_dvfs: {
48        kbuild_options: ["CONFIG_MALI_BIFROST_DVFS=y"],
49    },
50    mali_gator_support: {
51        kbuild_options: ["CONFIG_MALI_BIFROST_GATOR_SUPPORT=y"],
52    },
53    mali_midgard_enable_trace: {
54        kbuild_options: ["CONFIG_MALI_BIFROST_ENABLE_TRACE=y"],
55    },
56    mali_arbiter_support: {
57        kbuild_options: ["CONFIG_MALI_ARBITER_SUPPORT=y"],
58    },
59    mali_dma_buf_map_on_demand: {
60        kbuild_options: ["CONFIG_MALI_DMA_BUF_MAP_ON_DEMAND=y"],
61    },
62    mali_dma_buf_legacy_compat: {
63        kbuild_options: ["CONFIG_MALI_DMA_BUF_LEGACY_COMPAT=y"],
64    },
65    large_page_alloc_override: {
66        kbuild_options: ["CONFIG_LARGE_PAGE_ALLOC_OVERRIDE=y"],
67    },
68    large_page_alloc: {
69        kbuild_options: ["CONFIG_LARGE_PAGE_ALLOC=y"],
70    },
71    mali_memory_fully_backed: {
72        kbuild_options: ["CONFIG_MALI_MEMORY_FULLY_BACKED=y"],
73    },
74    mali_corestack: {
75        kbuild_options: ["CONFIG_MALI_CORESTACK=y"],
76    },
77    mali_real_hw: {
78        kbuild_options: ["CONFIG_MALI_REAL_HW=y"],
79    },
80    mali_error_inject_none: {
81        kbuild_options: ["CONFIG_MALI_ERROR_INJECT_NONE=y"],
82    },
83    mali_error_inject_track_list: {
84        kbuild_options: ["CONFIG_MALI_ERROR_INJECT_TRACK_LIST=y"],
85    },
86    mali_error_inject_random: {
87        kbuild_options: ["CONFIG_MALI_ERROR_INJECT_RANDOM=y"],
88    },
89    mali_error_inject: {
90        kbuild_options: ["CONFIG_MALI_BIFROST_ERROR_INJECT=y"],
91    },
92    mali_debug: {
93        kbuild_options: [
94            "CONFIG_MALI_BIFROST_DEBUG=y",
95            "MALI_KERNEL_TEST_API={{.debug}}",
96        ],
97    },
98    mali_fence_debug: {
99        kbuild_options: ["CONFIG_MALI_BIFROST_FENCE_DEBUG=y"],
100    },
101    mali_system_trace: {
102        kbuild_options: ["CONFIG_MALI_BIFROST_SYSTEM_TRACE=y"],
103    },
104    buslog: {
105        kbuild_options: ["CONFIG_MALI_BUSLOG=y"],
106    },
107    cinstr_vector_dump: {
108        kbuild_options: ["CONFIG_MALI_VECTOR_DUMP=y"],
109    },
110    cinstr_gwt: {
111        kbuild_options: ["CONFIG_MALI_CINSTR_GWT=y"],
112    },
113    cinstr_primary_hwc: {
114        kbuild_options: ["CONFIG_MALI_PRFCNT_SET_PRIMARY=y"],
115    },
116    cinstr_secondary_hwc: {
117        kbuild_options: ["CONFIG_MALI_BIFROST_PRFCNT_SET_SECONDARY=y"],
118    },
119    cinstr_tertiary_hwc: {
120        kbuild_options: ["CONFIG_MALI_PRFCNT_SET_TERTIARY=y"],
121    },
122    cinstr_hwc_set_select_via_debug_fs: {
123        kbuild_options: ["CONFIG_MALI_PRFCNT_SET_SELECT_VIA_DEBUG_FS=y"],
124    },
125    mali_job_dump: {
126        kbuild_options: ["CONFIG_MALI_JOB_DUMP"],
127    },
128    mali_pwrsoft_765: {
129        kbuild_options: ["CONFIG_MALI_PWRSOFT_765=y"],
130    },
131    mali_hw_errata_1485982_not_affected: {
132        kbuild_options: ["CONFIG_MALI_HW_ERRATA_1485982_NOT_AFFECTED=y"],
133    },
134    mali_hw_errata_1485982_use_clock_alternative: {
135        kbuild_options: ["CONFIG_MALI_HW_ERRATA_1485982_USE_CLOCK_ALTERNATIVE=y"],
136    },
137    platform_is_fpga: {
138        kbuild_options: ["CONFIG_MALI_IS_FPGA=y"],
139    },
140    mali_coresight: {
141        kbuild_options: ["CONFIG_MALI_CORESIGHT=y"],
142    },
143    kbuild_options: [
144        "CONFIG_MALI_PLATFORM_NAME={{.mali_platform_name}}",
145        "MALI_CUSTOMER_RELEASE={{.release}}",
146        "MALI_UNIT_TEST={{.unit_test_code}}",
147        "MALI_USE_CSF={{.gpu_has_csf}}",
148        "MALI_JIT_PRESSURE_LIMIT_BASE={{.jit_pressure_limit_base}}",
149
150        // Start of CS experimental features definitions.
151        // If there is nothing below, definition should be added as follows:
152        // "MALI_EXPERIMENTAL_FEATURE={{.experimental_feature}}"
153        // experimental_feature above comes from Mconfig in
154        // <ddk_root>/product/base/
155        // However, in Mconfig, experimental_feature should be looked up (for
156        // similar explanation to this one) as ALLCAPS, i.e.
157        // EXPERIMENTAL_FEATURE.
158        //
159        // IMPORTANT: MALI_CS_EXPERIMENTAL should NEVER be defined below as it
160        // is an umbrella feature that would be open for inappropriate use
161        // (catch-all for experimental CS code without separating it into
162        // different features).
163        "MALI_INCREMENTAL_RENDERING_JM={{.incremental_rendering_jm}}",
164        "MALI_BASE_CSF_PERFORMANCE_TESTS={{.base_csf_performance_tests}}",
165    ],
166}
167
168bob_kernel_module {
169    name: "mali_kbase",
170    defaults: [
171        "mali_kbase_shared_config_defaults",
172    ],
173    srcs: [
174        "*.c",
175        "*.h",
176        "Kbuild",
177        "backend/gpu/*.c",
178        "backend/gpu/*.h",
179        "backend/gpu/Kbuild",
180        "context/*.c",
181        "context/*.h",
182        "context/Kbuild",
183        "hwcnt/*.c",
184        "hwcnt/*.h",
185        "hwcnt/backend/*.h",
186        "hwcnt/Kbuild",
187        "ipa/*.c",
188        "ipa/*.h",
189        "ipa/Kbuild",
190        "platform/*.h",
191        "platform/*/*.c",
192        "platform/*/*.h",
193        "platform/*/Kbuild",
194        "platform/*/*/*.c",
195        "platform/*/*/*.h",
196        "platform/*/*/Kbuild",
197        "platform/*/*/*.c",
198        "platform/*/*/*.h",
199        "platform/*/*/Kbuild",
200        "platform/*/*/*/*.c",
201        "platform/*/*/*/*.h",
202        "platform/*/*/*/Kbuild",
203        "thirdparty/*.c",
204        "thirdparty/Kbuild",
205        "debug/*.c",
206        "debug/*.h",
207        "debug/Kbuild",
208        "device/*.c",
209        "device/*.h",
210        "device/Kbuild",
211        "gpu/*.c",
212        "gpu/*.h",
213        "gpu/Kbuild",
214        "tl/*.c",
215        "tl/*.h",
216        "tl/Kbuild",
217        "mmu/*.c",
218        "mmu/*.h",
219        "mmu/Kbuild",
220    ],
221    gpu_has_job_manager: {
222        srcs: [
223            "context/backend/*_jm.c",
224            "debug/backend/*_jm.c",
225            "debug/backend/*_jm.h",
226            "device/backend/*_jm.c",
227            "gpu/backend/*_jm.c",
228            "gpu/backend/*_jm.h",
229            "hwcnt/backend/*_jm.c",
230            "hwcnt/backend/*_jm.h",
231            "hwcnt/backend/*_jm_*.c",
232            "hwcnt/backend/*_jm_*.h",
233            "jm/*.h",
234            "tl/backend/*_jm.c",
235            "mmu/backend/*_jm.c",
236            "ipa/backend/*_jm.c",
237            "ipa/backend/*_jm.h",
238        ],
239    },
240    gpu_has_csf: {
241        srcs: [
242            "context/backend/*_csf.c",
243            "csf/*.c",
244            "csf/*.h",
245            "csf/Kbuild",
246            "csf/ipa_control/*.c",
247            "csf/ipa_control/*.h",
248            "csf/ipa_control/Kbuild",
249            "debug/backend/*_csf.c",
250            "debug/backend/*_csf.h",
251            "device/backend/*_csf.c",
252            "gpu/backend/*_csf.c",
253            "gpu/backend/*_csf.h",
254            "hwcnt/backend/*_csf.c",
255            "hwcnt/backend/*_csf.h",
256            "hwcnt/backend/*_csf_*.c",
257            "hwcnt/backend/*_csf_*.h",
258            "tl/backend/*_csf.c",
259            "mmu/backend/*_csf.c",
260            "ipa/backend/*_csf.c",
261            "ipa/backend/*_csf.h",
262        ],
263    },
264    mali_arbiter_support: {
265        srcs: [
266            "arbiter/*.c",
267            "arbiter/*.h",
268            "arbiter/Kbuild",
269        ],
270    },
271    kbuild_options: [
272        "CONFIG_MALI_BIFROST=m",
273        "CONFIG_MALI_KUTF=n",
274    ],
275    buslog: {
276        extra_symbols: [
277            "bus_logger",
278        ],
279    },
280}
281