1/*
2 *
3 * (C) COPYRIGHT 2017-2020 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 licence.
9 *
10 * A copy of the licence is included with the program, and can also be obtained
11 * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12 * Boston, MA 02110-1301, USA.
13 *
14 */
15
16/* Kernel-side tests may include mali_kbase's headers. Therefore any config
17 * options which affect the sizes of any structs (e.g. adding extra members)
18 * must be included in these defaults, so that the structs are consistent in
19 * both mali_kbase and the test modules. */
20bob_defaults {
21    name: "mali_kbase_shared_config_defaults",
22    no_mali: {
23        kbuild_options: ["CONFIG_MALI_BIFROST_NO_MALI=y"],
24    },
25    mali_real_hw: {
26        kbuild_options: ["CONFIG_MALI_REAL_HW=y"],
27    },
28    mali_dma_fence: {
29        kbuild_options: ["CONFIG_MALI_BIFROST_DMA_FENCE=y"],
30    },
31    mali_devfreq: {
32        kbuild_options: ["CONFIG_MALI_BIFROST_DEVFREQ=y"],
33    },
34    mali_midgard_dvfs: {
35        kbuild_options: ["CONFIG_MALI_BIFROST_DVFS=y"],
36    },
37    mali_debug: {
38        kbuild_options: ["CONFIG_MALI_BIFROST_DEBUG=y"],
39    },
40    buslog: {
41        kbuild_options: ["CONFIG_MALI_BUSLOG=y"],
42    },
43    cinstr_vector_dump: {
44        kbuild_options: ["CONFIG_MALI_VECTOR_DUMP=y"],
45    },
46    cinstr_gwt: {
47        kbuild_options: ["CONFIG_MALI_CINSTR_GWT=y"],
48    },
49    mali_gator_support: {
50        kbuild_options: ["CONFIG_MALI_BIFROST_GATOR_SUPPORT=y"],
51    },
52    mali_midgard_enable_trace: {
53        kbuild_options: ["CONFIG_MALI_BIFROST_ENABLE_TRACE=y"],
54    },
55    mali_system_trace: {
56        kbuild_options: ["CONFIG_MALI_BIFROST_SYSTEM_TRACE=y"],
57    },
58    mali_pwrsoft_765: {
59        kbuild_options: ["CONFIG_MALI_PWRSOFT_765=y"],
60    },
61    mali_memory_fully_backed: {
62        kbuild_options: ["CONFIG_MALI_MEMORY_FULLY_BACKED=y"],
63    },
64    mali_dma_buf_map_on_demand: {
65        kbuild_options: ["CONFIG_MALI_DMA_BUF_MAP_ON_DEMAND=y"],
66    },
67    mali_dma_buf_legacy_compat: {
68        kbuild_options: ["CONFIG_MALI_DMA_BUF_LEGACY_COMPAT=y"],
69    },
70    mali_arbiter_support: {
71        kbuild_options: ["CONFIG_MALI_ARBITER_SUPPORT=y"],
72    },
73    mali_gem5_build: {
74       kbuild_options: ["CONFIG_MALI_GEM5_BUILD=y"],
75    },
76    kbuild_options: [
77        "MALI_UNIT_TEST={{.unit_test_code}}",
78        "MALI_CUSTOMER_RELEASE={{.release}}",
79        "MALI_USE_CSF={{.gpu_has_csf}}",
80        "MALI_KERNEL_TEST_API={{.debug}}",
81    ],
82    defaults: ["kernel_defaults"],
83}
84
85bob_kernel_module {
86    name: "mali_kbase",
87    srcs: [
88        "*.c",
89        "*.h",
90        "Kbuild",
91        "backend/gpu/*.c",
92        "backend/gpu/*.h",
93        "backend/gpu/Kbuild",
94        "context/*.c",
95        "context/*.h",
96        "ipa/*.c",
97        "ipa/*.h",
98        "ipa/Kbuild",
99        "platform/*.h",
100        "platform/*/*.c",
101        "platform/*/*.h",
102        "platform/*/Kbuild",
103        "thirdparty/*.c",
104        "debug/*.c",
105        "debug/*.h",
106        "device/*.c",
107        "device/*.h",
108        "gpu/*.c",
109        "gpu/*.h",
110        "tl/*.c",
111        "tl/*.h",
112        "mmu/*.c",
113        "mmu/*.h",
114    ],
115    kbuild_options: [
116        "CONFIG_MALI_KUTF=n",
117        "CONFIG_MALI_MIDGARD=m",
118        "CONFIG_MALI_NO_MALI_DEFAULT_GPU={{.gpu}}",
119        "CONFIG_MALI_PLATFORM_NAME={{.mali_platform_name}}",
120    ],
121    buslog: {
122        extra_symbols: [
123            "bus_logger",
124        ],
125    },
126    mali_corestack: {
127        kbuild_options: ["CONFIG_MALI_CORESTACK=y"],
128    },
129    mali_error_inject: {
130        kbuild_options: ["CONFIG_MALI_BIFROST_ERROR_INJECT=y"],
131    },
132    mali_error_inject_random: {
133        kbuild_options: ["CONFIG_MALI_ERROR_INJECT_RANDOM=y"],
134    },
135    cinstr_secondary_hwc: {
136        kbuild_options: ["CONFIG_MALI_BIFROST_PRFCNT_SET_SECONDARY=y"],
137    },
138    cinstr_secondary_hwc_via_debug_fs: {
139        kbuild_options: ["CONFIG_MALI_PRFCNT_SET_SECONDARY_VIA_DEBUG_FS=y"],
140    },
141    mali_2mb_alloc: {
142        kbuild_options: ["CONFIG_MALI_2MB_ALLOC=y"],
143    },
144    mali_hw_errata_1485982_not_affected: {
145        kbuild_options: ["CONFIG_MALI_HW_ERRATA_1485982_NOT_AFFECTED=y"],
146    },
147    mali_hw_errata_1485982_use_clock_alternative: {
148        kbuild_options: ["CONFIG_MALI_HW_ERRATA_1485982_USE_CLOCK_ALTERNATIVE=y"],
149    },
150    gpu_has_job_manager: {
151        srcs: [
152            "context/backend/*_jm.c",
153            "debug/backend/*_jm.c",
154            "debug/backend/*_jm.h",
155            "device/backend/*_jm.c",
156            "gpu/backend/*_jm.c",
157            "gpu/backend/*_jm.h",
158            "jm/*.h",
159            "tl/backend/*_jm.c",
160            "mmu/backend/*_jm.c",
161        ],
162    },
163    gpu_has_csf: {
164        srcs: [
165            "context/backend/*_csf.c",
166            "csf/*.c",
167            "csf/*.h",
168            "csf/Kbuild",
169            "debug/backend/*_csf.c",
170            "debug/backend/*_csf.h",
171            "device/backend/*_csf.c",
172            "gpu/backend/*_csf.c",
173            "gpu/backend/*_csf.h",
174            "tl/backend/*_csf.c",
175            "mmu/backend/*_csf.c",
176        ],
177    },
178    mali_arbiter_support: {
179        srcs: [
180            "arbiter/*.c",
181            "arbiter/*.h",
182            "arbiter/Kbuild",
183        ],
184    },
185    defaults: ["mali_kbase_shared_config_defaults"],
186}
187