diff options
Diffstat (limited to 'jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk')
-rw-r--r-- | jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk | 604 |
1 files changed, 604 insertions, 0 deletions
diff --git a/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk new file mode 100644 index 0000000..247d1e1 --- /dev/null +++ b/jacinto6/sgx_src/eurasia_km/eurasiacon/build/linux2/config/core.mk | |||
@@ -0,0 +1,604 @@ | |||
1 | ########################################################################### ### | ||
2 | #@Title Root build configuration. | ||
3 | #@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved | ||
4 | #@License Dual MIT/GPLv2 | ||
5 | # | ||
6 | # The contents of this file are subject to the MIT license as set out below. | ||
7 | # | ||
8 | # Permission is hereby granted, free of charge, to any person obtaining a copy | ||
9 | # of this software and associated documentation files (the "Software"), to deal | ||
10 | # in the Software without restriction, including without limitation the rights | ||
11 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
12 | # copies of the Software, and to permit persons to whom the Software is | ||
13 | # furnished to do so, subject to the following conditions: | ||
14 | # | ||
15 | # The above copyright notice and this permission notice shall be included in | ||
16 | # all copies or substantial portions of the Software. | ||
17 | # | ||
18 | # Alternatively, the contents of this file may be used under the terms of | ||
19 | # the GNU General Public License Version 2 ("GPL") in which case the provisions | ||
20 | # of GPL are applicable instead of those above. | ||
21 | # | ||
22 | # If you wish to allow use of your version of this file only under the terms of | ||
23 | # GPL, and not to allow others to use your version of this file under the terms | ||
24 | # of the MIT license, indicate your decision by deleting the provisions above | ||
25 | # and replace them with the notice and other provisions required by GPL as set | ||
26 | # out in the file called "GPL-COPYING" included in this distribution. If you do | ||
27 | # not delete the provisions above, a recipient may use your version of this file | ||
28 | # under the terms of either the MIT license or GPL. | ||
29 | # | ||
30 | # This License is also included in this distribution in the file called | ||
31 | # "MIT-COPYING". | ||
32 | # | ||
33 | # EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS | ||
34 | # PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING | ||
35 | # BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR | ||
36 | # PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR | ||
37 | # COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
38 | # IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
39 | # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
40 | ### ########################################################################### | ||
41 | |||
42 | # Configuration wrapper for new build system. This file deals with | ||
43 | # configuration of the build. Add to this file anything that deals | ||
44 | # with switching driver options on/off and altering the defines or | ||
45 | # objects the build uses. | ||
46 | # | ||
47 | # At the end of this file is an exhaustive list of all variables | ||
48 | # that are passed between the platform/config stage and the generic | ||
49 | # build. PLEASE refrain from adding more variables than necessary | ||
50 | # to this stage -- almost all options can go through config.h. | ||
51 | # | ||
52 | |||
53 | ################################# MACROS #################################### | ||
54 | |||
55 | # Write out a kernel GNU make option. | ||
56 | # | ||
57 | define KernelConfigMake | ||
58 | $$(shell echo "override $(1) := $(2)" >>$(CONFIG_KERNEL_MK).new) | ||
59 | endef | ||
60 | |||
61 | # Write out a GNU make option for both user & kernel | ||
62 | # | ||
63 | define BothConfigMake | ||
64 | $$(eval $$(call KernelConfigMake,$(1),$(2))) | ||
65 | endef | ||
66 | |||
67 | # Conditionally write out a kernel GNU make option | ||
68 | # | ||
69 | define TunableKernelConfigMake | ||
70 | ifneq ($$($(1)),) | ||
71 | ifneq ($$($(1)),0) | ||
72 | $$(eval $$(call KernelConfigMake,$(1),$$($(1)))) | ||
73 | endif | ||
74 | else | ||
75 | ifneq ($(2),) | ||
76 | $$(eval $$(call KernelConfigMake,$(1),$(2))) | ||
77 | endif | ||
78 | endif | ||
79 | endef | ||
80 | |||
81 | # Conditionally write out a GNU make option for both user & kernel | ||
82 | # | ||
83 | define TunableBothConfigMake | ||
84 | $$(eval $$(call TunableKernelConfigMake,$(1),$(2))) | ||
85 | endef | ||
86 | |||
87 | # Write out a kernel-only option | ||
88 | # | ||
89 | define KernelConfigC | ||
90 | $$(shell echo "#define $(1) $(2)" >>$(CONFIG_KERNEL_H).new) | ||
91 | endef | ||
92 | |||
93 | # Write out an option for both user & kernel | ||
94 | # | ||
95 | define BothConfigC | ||
96 | $$(eval $$(call KernelConfigC,$(1),$(2))) | ||
97 | endef | ||
98 | |||
99 | # Conditionally write out a kernel-only option | ||
100 | # | ||
101 | define TunableKernelConfigC | ||
102 | ifneq ($$($(1)),) | ||
103 | ifneq ($$($(1)),0) | ||
104 | ifeq ($$($(1)),1) | ||
105 | $$(eval $$(call KernelConfigC,$(1),)) | ||
106 | else | ||
107 | $$(eval $$(call KernelConfigC,$(1),$$($(1)))) | ||
108 | endif | ||
109 | endif | ||
110 | else | ||
111 | ifneq ($(2),) | ||
112 | ifeq ($(2),1) | ||
113 | $$(eval $$(call KernelConfigC,$(1),)) | ||
114 | else | ||
115 | $$(eval $$(call KernelConfigC,$(1),$(2))) | ||
116 | endif | ||
117 | endif | ||
118 | endif | ||
119 | endef | ||
120 | |||
121 | # Conditionally write out an option for both user & kernel | ||
122 | # | ||
123 | define TunableBothConfigC | ||
124 | $$(eval $$(call TunableKernelConfigC,$(1),$(2))) | ||
125 | endef | ||
126 | |||
127 | ############################### END MACROS ################################## | ||
128 | |||
129 | # Check we have a new enough version of GNU make. | ||
130 | # | ||
131 | need := 3.81 | ||
132 | ifeq ($(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need)))),) | ||
133 | $(error A version of GNU make >= $(need) is required - this is version $(MAKE_VERSION)) | ||
134 | endif | ||
135 | |||
136 | # Try to guess EURASIAROOT if it wasn't set. Check this location. | ||
137 | # | ||
138 | _GUESSED_EURASIAROOT := $(abspath ../../../..) | ||
139 | ifneq ($(strip $(EURASIAROOT)),) | ||
140 | # We don't want to warn about EURASIAROOT if it's empty: this might mean that | ||
141 | # it's not set at all anywhere, but it could also mean that it's set like | ||
142 | # "export EURASIAROOT=" or "make EURASIAROOT= sometarget". If it is set but | ||
143 | # empty, we'll act as if it's unset and not warn. | ||
144 | ifneq ($(strip $(EURASIAROOT)),$(_GUESSED_EURASIAROOT)) | ||
145 | nothing := | ||
146 | space := $(nothing) $(nothing) | ||
147 | $(warning EURASIAROOT is set (via: $(origin EURASIAROOT)), but its value does not) | ||
148 | $(warning match the root of this source tree, so it is being ignored) | ||
149 | $(warning EURASIAROOT is set to: $(EURASIAROOT)) | ||
150 | $(warning $(space)The detected root is: $(_GUESSED_EURASIAROOT)) | ||
151 | $(warning To suppress this message, unset EURASIAROOT or set it empty) | ||
152 | endif | ||
153 | # else, EURASIAROOT matched the actual root of the source tree: don't warn | ||
154 | endif | ||
155 | override EURASIAROOT := $(_GUESSED_EURASIAROOT) | ||
156 | TOP := $(EURASIAROOT) | ||
157 | |||
158 | ifneq ($(words $(TOP)),1) | ||
159 | $(warning This source tree is located in a path which contains whitespace,) | ||
160 | $(warning which is not supported.) | ||
161 | $(warning $(space)The root is: $(TOP)) | ||
162 | $(error Whitespace found in $$(TOP)) | ||
163 | endif | ||
164 | |||
165 | $(call directory-must-exist,$(TOP)) | ||
166 | |||
167 | include ../defs.mk | ||
168 | |||
169 | # Infer PVR_BUILD_DIR from the directory configuration is launched from. | ||
170 | # Check anyway that such a directory exists. | ||
171 | # | ||
172 | PVR_BUILD_DIR := $(notdir $(abspath .)) | ||
173 | $(call directory-must-exist,$(TOP)/eurasiacon/build/linux2/$(PVR_BUILD_DIR)) | ||
174 | |||
175 | # Output directory for configuration, object code, | ||
176 | # final programs/libraries, and install/rc scripts. | ||
177 | # | ||
178 | BUILD ?= release | ||
179 | # TI: Added SGX type to binary build location so builds for different GPUs | ||
180 | # with the same build directory are put in different places | ||
181 | OUT ?= $(TOP)/eurasiacon/binary2_$(SGXCORE)_$(SGX_CORE_REV)_$(PVR_BUILD_DIR)_$(BUILD) | ||
182 | override OUT := $(if $(filter /%,$(OUT)),$(OUT),$(TOP)/$(OUT)) | ||
183 | |||
184 | CONFIG_MK := $(OUT)/config.mk | ||
185 | CONFIG_H := $(OUT)/config.h | ||
186 | CONFIG_KERNEL_MK := $(OUT)/config_kernel.mk | ||
187 | CONFIG_KERNEL_H := $(OUT)/config_kernel.h | ||
188 | |||
189 | # Create the OUT directory and delete any previous intermediary files | ||
190 | # | ||
191 | $(shell mkdir -p $(OUT)) | ||
192 | $(shell \ | ||
193 | for file in $(CONFIG_MK).new $(CONFIG_H).new \ | ||
194 | $(CONFIG_KERNEL_MK).new $(CONFIG_KERNEL_H).new; do \ | ||
195 | rm -f $$file; \ | ||
196 | done) | ||
197 | |||
198 | # Some targets don't need information about any modules. If we only specify | ||
199 | # these targets on the make command line, set INTERNAL_CLOBBER_ONLY to | ||
200 | # indicate that toplevel.mk shouldn't read any makefiles | ||
201 | CLOBBER_ONLY_TARGETS := clean clobber help install | ||
202 | INTERNAL_CLOBBER_ONLY := | ||
203 | ifneq ($(strip $(MAKECMDGOALS)),) | ||
204 | INTERNAL_CLOBBER_ONLY := \ | ||
205 | $(if \ | ||
206 | $(strip $(foreach _cmdgoal,$(MAKECMDGOALS),\ | ||
207 | $(if $(filter $(_cmdgoal),$(CLOBBER_ONLY_TARGETS)),,x))),,true) | ||
208 | endif | ||
209 | |||
210 | # For a clobber-only build, we shouldn't regenerate any config files, or | ||
211 | # require things like SGXCORE to be set | ||
212 | ifneq ($(INTERNAL_CLOBBER_ONLY),true) | ||
213 | |||
214 | -include ../config/user-defs.mk | ||
215 | |||
216 | # FIXME: Backwards compatibility remaps. | ||
217 | # | ||
218 | ifeq ($(SUPPORT_SLC),1) | ||
219 | SGX_FEATURE_SYSTEM_CACHE := 1 | ||
220 | endif | ||
221 | ifeq ($(BYPASS_SLC),1) | ||
222 | SGX_BYPASS_SYSTEM_CACHE := 1 | ||
223 | endif | ||
224 | ifeq ($(BYPASS_DCU),1) | ||
225 | SGX_BYPASS_DCU := 1 | ||
226 | endif | ||
227 | ifneq ($(SGXCOREREV),) | ||
228 | SGX_CORE_REV := $(SGXCOREREV) | ||
229 | endif | ||
230 | |||
231 | # Core handling | ||
232 | # | ||
233 | ifeq ($(SGXCORE),) | ||
234 | $(error Must specify SGXCORE) | ||
235 | endif | ||
236 | ifeq ($(SGX_CORE_REV),) | ||
237 | override USE_SGX_CORE_REV_HEAD := 1 | ||
238 | else ifeq ($(SGX_CORE_REV),000) | ||
239 | override USE_SGX_CORE_REV_HEAD := 1 | ||
240 | override SGX_CORE_REV := | ||
241 | else | ||
242 | override USE_SGX_CORE_REV_HEAD := 0 | ||
243 | endif | ||
244 | |||
245 | # Enforced dependencies. Move this to an include. | ||
246 | # | ||
247 | ifeq ($(SUPPORT_LINUX_USING_WORKQUEUES),1) | ||
248 | override PVR_LINUX_USING_WORKQUEUES := 1 | ||
249 | override PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE := 1 | ||
250 | override PVR_LINUX_TIMERS_USING_WORKQUEUES := 1 | ||
251 | override SYS_CUSTOM_POWERLOCK_WRAP := 1 | ||
252 | else ifeq ($(SUPPORT_LINUX_USING_SHARED_WORKQUEUES),1) | ||
253 | override PVR_LINUX_USING_WORKQUEUES := 1 | ||
254 | override PVR_LINUX_MISR_USING_WORKQUEUE := 1 | ||
255 | override PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE := 1 | ||
256 | override SYS_CUSTOM_POWERLOCK_WRAP := 1 | ||
257 | endif | ||
258 | |||
259 | ifneq ($(PDUMP),1) | ||
260 | override SUPPORT_PDUMP_MULTI_PROCESS := 0 | ||
261 | endif | ||
262 | |||
263 | ifeq ($(SUPPORT_HYBRID_PB),1) | ||
264 | override SUPPORT_SHARED_PB := 1 | ||
265 | override SUPPORT_PERCONTEXT_PB := 1 | ||
266 | else ifeq ($(SUPPORT_PERCONTEXT_PB),1) | ||
267 | override SUPPORT_SHARED_PB := 0 | ||
268 | endif | ||
269 | |||
270 | ifeq ($(NO_HARDWARE),1) | ||
271 | override SYS_USING_INTERRUPTS := 0 | ||
272 | override SUPPORT_HW_RECOVERY := 0 | ||
273 | override SUPPORT_ACTIVE_POWER_MANAGEMENT := 0 | ||
274 | endif | ||
275 | |||
276 | # We're bumping against USSE limits on older cores because the ukernel | ||
277 | # is too large when building both SGX_DISABLE_VISTEST_SUPPORT=0 and | ||
278 | # PVRSRV_USSE_EDM_STATUS_DEBUG=1. | ||
279 | # | ||
280 | # Automatically disable vistest support if debugging the ukernel to | ||
281 | # prevent build failures. | ||
282 | # | ||
283 | ifneq ($(filter 520 530 531 535 540,$(SGXCORE)),) | ||
284 | ifneq ($(SGX_DISABLE_VISTEST_SUPPORT),1) | ||
285 | SGX_DISABLE_VISTEST_SUPPORT ?= not-overridden | ||
286 | ifeq ($(SGX_DISABLE_VISTEST_SUPPORT),not-overridden) | ||
287 | $(warning Setting SGX_DISABLE_VISTEST_SUPPORT=1 because PVRSRV_USSE_EDM_STATUS_DEBUG=1) | ||
288 | SGX_DISABLE_VISTEST_SUPPORT := 1 | ||
289 | endif | ||
290 | endif | ||
291 | endif | ||
292 | |||
293 | ifeq ($(SGXCORE),535) | ||
294 | ifeq ($(PVRSRV_USSE_EDM_STATUS_DEBUG),1) | ||
295 | SUPPORT_SGX_HWPERF ?= not-overridden | ||
296 | ifeq ($(SUPPORT_SGX_HWPERF),not-overridden) | ||
297 | $(warning Setting SUPPORT_SGX_HWPERF=0 because PVRSRV_USSE_EDM_STATUS_DEBUG=1) | ||
298 | SUPPORT_SGX_HWPERF := 0 | ||
299 | endif | ||
300 | endif | ||
301 | PVR2D_ALT_2DHW ?= 0 | ||
302 | endif | ||
303 | |||
304 | # Multi-core handling must be done separately to other options | ||
305 | # Also do some sanity checks | ||
306 | # | ||
307 | ifeq ($(SGX_FEATURE_MP),1) | ||
308 | ifeq ($(SGX_FEATURE_MP_CORE_COUNT),) | ||
309 | ifeq ($(SGX_FEATURE_MP_CORE_COUNT_TA),) | ||
310 | $(error Must specify SGX_FEATURE_MP_CORE_COUNT or both SGX_FEATURE_MP_CORE_COUNT_TA and SGX_FEATURE_MP_CORE_COUNT_3D with SGX_FEATURE_MP) | ||
311 | else | ||
312 | $(eval $(call BothConfigC,SGX_FEATURE_MP_CORE_COUNT_TA,$(SGX_FEATURE_MP_CORE_COUNT_TA))) | ||
313 | endif | ||
314 | ifeq ($(SGX_FEATURE_MP_CORE_COUNT_3D),) | ||
315 | $(error Must specify SGX_FEATURE_MP_CORE_COUNT or both SGX_FEATURE_MP_CORE_COUNT_TA and SGX_FEATURE_MP_CORE_COUNT_3D with SGX_FEATURE_MP) | ||
316 | else | ||
317 | $(eval $(call BothConfigC,SGX_FEATURE_MP_CORE_COUNT_3D,$(SGX_FEATURE_MP_CORE_COUNT_3D))) | ||
318 | endif | ||
319 | else | ||
320 | $(eval $(call BothConfigC,SGX_FEATURE_MP_CORE_COUNT,$(SGX_FEATURE_MP_CORE_COUNT))) | ||
321 | endif | ||
322 | endif | ||
323 | |||
324 | # Rather than requiring the user to have to define two variables (one quoted, | ||
325 | # one not), make PVRSRV_MODNAME a non-tunable and give it an overridable | ||
326 | # default here. | ||
327 | # | ||
328 | PVRSRV_MODNAME ?= pvrsrvkm | ||
329 | |||
330 | # The user didn't set CROSS_COMPILE. There's probably nothing wrong | ||
331 | # with that, but we'll let them know anyway. | ||
332 | # | ||
333 | ifeq ($(CROSS_COMPILE),) | ||
334 | $(warning CROSS_COMPILE is not set. Target components will be built with the host compiler) | ||
335 | endif | ||
336 | |||
337 | # The user is trying to set one of the old SUPPORT_ options on the | ||
338 | # command line or in the environment. This isn't supported any more | ||
339 | # and will often break the build. The user is generally only trying | ||
340 | # to remove a component from the list of targets to build, so we'll | ||
341 | # point them at the new way of doing this. | ||
342 | define sanity-check-support-option-origin | ||
343 | ifeq ($$(filter undefined file,$$(origin $(1))),) | ||
344 | $$(warning *** Setting $(1) via $$(origin $(1)) is deprecated) | ||
345 | $$(error If you are trying to disable a component, use e.g. EXCLUDED_APIS="opengles1 opengl") | ||
346 | endif | ||
347 | endef | ||
348 | $(foreach _o,SYS_CFLAGS SYS_CXXFLAGS SYS_EXE_LDFLAGS SYS_LIB_LDFLAGS SUPPORT_EWS SUPPORT_OPENGLES1 SUPPORT_OPENGLES2 SUPPORT_OPENVG SUPPORT_OPENCL SUPPORT_OPENGL SUPPORT_UNITTESTS SUPPORT_XORG,$(eval $(call sanity-check-support-option-origin,$(_o)))) | ||
349 | |||
350 | # Check for words in EXCLUDED_APIS that aren't understood by the | ||
351 | # common/apis/*.mk files. This should be kept in sync with all the tests on | ||
352 | # EXCLUDED_APIS in those files | ||
353 | _excludable_apis := opencl opengl opengles1 opengles2 openvg ews unittests xorg xorg_unittests scripts | ||
354 | _unrecognised := $(strip $(filter-out $(_excludable_apis),$(EXCLUDED_APIS))) | ||
355 | ifneq ($(_unrecognised),) | ||
356 | $(warning *** Unrecognised entries in EXCLUDED_APIS: $(_unrecognised)) | ||
357 | $(warning *** EXCLUDED_APIS was set via: $(origin EXCLUDED_APIS)) | ||
358 | $(error Excludable APIs are: $(_excludable_apis)) | ||
359 | endif | ||
360 | |||
361 | # Build's selected list of components | ||
362 | # | ||
363 | -include components.mk | ||
364 | |||
365 | # PDUMP needs extra components | ||
366 | # | ||
367 | ifeq ($(PDUMP),1) | ||
368 | ifneq ($(COMPONENTS),) | ||
369 | COMPONENTS += pdump | ||
370 | endif | ||
371 | ifeq ($(SUPPORT_DRI_DRM),1) | ||
372 | EXTRA_PVRSRVKM_COMPONENTS += dbgdrv | ||
373 | else | ||
374 | KERNEL_COMPONENTS += dbgdrv | ||
375 | endif | ||
376 | endif | ||
377 | |||
378 | ifeq ($(SUPPORT_PVR_REMOTE),1) | ||
379 | ifneq ($(filter pvr2d,$(COMPONENTS)),) | ||
380 | COMPONENTS += null_pvr2d_remote | ||
381 | endif | ||
382 | COMPONENTS += pvrvncsrv | ||
383 | endif | ||
384 | |||
385 | # If KERNELDIR is set, write it out to the config.mk, with | ||
386 | # KERNEL_COMPONENTS and KERNEL_ID | ||
387 | # | ||
388 | ifneq ($(strip $(KERNELDIR)),) | ||
389 | include ../kernel_version.mk | ||
390 | PVRSRV_MODULE_BASEDIR ?= /lib/modules/$(KERNEL_ID)/extra/ | ||
391 | $(eval $(call KernelConfigMake,KERNELDIR,$(KERNELDIR))) | ||
392 | # Needed only by install script | ||
393 | $(eval $(call KernelConfigMake,KERNEL_COMPONENTS,$(KERNEL_COMPONENTS))) | ||
394 | $(eval $(call TunableKernelConfigMake,EXTRA_PVRSRVKM_COMPONENTS,)) | ||
395 | $(eval $(call TunableKernelConfigMake,EXTRA_KBUILD_SOURCE,)) | ||
396 | |||
397 | # If KERNEL_CROSS_COMPILE is set to "undef", this is magically | ||
398 | # equivalent to being unset. If it is unset, we use CROSS_COMPILE | ||
399 | # (which might also be unset). If it is set, use it directly. | ||
400 | ifneq ($(KERNEL_CROSS_COMPILE),undef) | ||
401 | KERNEL_CROSS_COMPILE ?= $(CROSS_COMPILE) | ||
402 | $(eval $(call TunableBothConfigMake,KERNEL_CROSS_COMPILE,)) | ||
403 | endif | ||
404 | |||
405 | # Check the KERNELDIR has a kernel built and also check that it is | ||
406 | # not 64-bit, which we do not support. | ||
407 | VMLINUX := $(strip $(wildcard $(KERNELDIR)/vmlinux)) | ||
408 | ifneq ($(VMLINUX),) | ||
409 | VMLINUX_IS_64BIT := $(shell file $(VMLINUX) | grep -q 64-bit || echo false) | ||
410 | ifneq ($(VMLINUX_IS_64BIT),false) | ||
411 | $(warning $$(KERNELDIR)/vmlinux is 64-bit, which is not supported. Kbuild may fail.) | ||
412 | endif | ||
413 | else | ||
414 | $(warning $$(KERNELDIR)/vmlinux does not exist. Kbuild may fail.) | ||
415 | endif | ||
416 | endif | ||
417 | |||
418 | |||
419 | # Ideally configured by platform Makefiles, as necessary | ||
420 | # | ||
421 | |||
422 | # Invariant options for Linux | ||
423 | # | ||
424 | $(eval $(call BothConfigC,LINUX,)) | ||
425 | |||
426 | $(eval $(call BothConfigC,PVR_BUILD_DIR,"\"$(PVR_BUILD_DIR)\"")) | ||
427 | $(eval $(call BothConfigC,PVR_BUILD_TYPE,"\"$(BUILD)\"")) | ||
428 | $(eval $(call BothConfigC,PVRSRV_MODNAME,"\"$(PVRSRV_MODNAME)\"")) | ||
429 | |||
430 | $(eval $(call TunableBothConfigC,SGXCORE,)) | ||
431 | $(eval $(call BothConfigC,SGX$(SGXCORE),)) | ||
432 | $(eval $(call BothConfigC,SUPPORT_SGX$(SGXCORE),)) | ||
433 | |||
434 | $(eval $(call TunableBothConfigC,SUPPORT_SGX,1)) | ||
435 | $(eval $(call TunableBothConfigC,SGX_CORE_REV,)) | ||
436 | $(eval $(call TunableBothConfigC,USE_SGX_CORE_REV_HEAD,)) | ||
437 | |||
438 | $(eval $(call BothConfigC,TRANSFER_QUEUE,)) | ||
439 | $(eval $(call BothConfigC,PVR_SECURE_HANDLES,)) | ||
440 | |||
441 | ifneq ($(DISPLAY_CONTROLLER),) | ||
442 | $(eval $(call BothConfigC,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER))) | ||
443 | endif | ||
444 | |||
445 | PVR_LINUX_MEM_AREA_POOL_MAX_PAGES ?= 0 | ||
446 | ifneq ($(PVR_LINUX_MEM_AREA_POOL_MAX_PAGES),0) | ||
447 | PVR_LINUX_MEM_AREA_USE_VMAP ?= 1 | ||
448 | include ../kernel_version.mk | ||
449 | ifeq ($(call kernel-version-at-least,3,0),true) | ||
450 | PVR_LINUX_MEM_AREA_POOL_ALLOW_SHRINK ?= 1 | ||
451 | endif | ||
452 | endif | ||
453 | $(eval $(call KernelConfigC,PVR_LINUX_MEM_AREA_POOL_MAX_PAGES,$(PVR_LINUX_MEM_AREA_POOL_MAX_PAGES))) | ||
454 | $(eval $(call TunableKernelConfigC,PVR_LINUX_MEM_AREA_USE_VMAP,)) | ||
455 | $(eval $(call TunableKernelConfigC,PVR_LINUX_MEM_AREA_POOL_ALLOW_SHRINK,)) | ||
456 | |||
457 | |||
458 | $(eval $(call BothConfigMake,PVR_SYSTEM,$(PVR_SYSTEM))) | ||
459 | |||
460 | |||
461 | # Build-type dependent options | ||
462 | # | ||
463 | $(eval $(call BothConfigMake,BUILD,$(BUILD))) | ||
464 | |||
465 | ifeq ($(BUILD),debug) | ||
466 | $(eval $(call BothConfigC,DEBUG,)) | ||
467 | $(eval $(call KernelConfigC,DEBUG_LINUX_MEMORY_ALLOCATIONS,)) | ||
468 | $(eval $(call KernelConfigC,DEBUG_LINUX_MEM_AREAS,)) | ||
469 | $(eval $(call KernelConfigC,DEBUG_LINUX_MMAP_AREAS,)) | ||
470 | $(eval $(call KernelConfigC,DEBUG_BRIDGE_KM,)) | ||
471 | else ifeq ($(BUILD),release) | ||
472 | $(eval $(call BothConfigC,RELEASE,)) | ||
473 | $(eval $(call TunableBothConfigMake,DEBUGLINK,1)) | ||
474 | else ifeq ($(BUILD),timing) | ||
475 | $(eval $(call BothConfigC,TIMING,)) | ||
476 | $(eval $(call TunableBothConfigMake,DEBUGLINK,1)) | ||
477 | else | ||
478 | $(error BUILD= must be either debug, release or timing) | ||
479 | endif | ||
480 | |||
481 | # User-configurable options | ||
482 | # | ||
483 | $(eval $(call TunableBothConfigC,SUPPORT_PERCONTEXT_PB,1)) | ||
484 | $(eval $(call TunableBothConfigC,SUPPORT_SHARED_PB,)) | ||
485 | $(eval $(call TunableBothConfigC,SUPPORT_HYBRID_PB,)) | ||
486 | $(eval $(call TunableBothConfigC,SUPPORT_HW_RECOVERY,1)) | ||
487 | $(eval $(call TunableBothConfigC,SUPPORT_ACTIVE_POWER_MANAGEMENT,1)) | ||
488 | $(eval $(call TunableBothConfigC,SUPPORT_SGX_HWPERF,1)) | ||
489 | $(eval $(call TunableBothConfigC,SUPPORT_SGX_LOW_LATENCY_SCHEDULING,1)) | ||
490 | $(eval $(call TunableBothConfigC,SUPPORT_MEMINFO_IDS,)) | ||
491 | $(eval $(call TunableBothConfigC,SUPPORT_SGX_NEW_STATUS_VALS,1)) | ||
492 | $(eval $(call TunableBothConfigC,SUPPORT_PDUMP_MULTI_PROCESS,)) | ||
493 | $(eval $(call TunableBothConfigC,SUPPORT_DBGDRV_EVENT_OBJECTS,1)) | ||
494 | $(eval $(call TunableBothConfigC,SGX_FEATURE_SYSTEM_CACHE,)) | ||
495 | $(eval $(call TunableBothConfigC,SGX_BYPASS_SYSTEM_CACHE,)) | ||
496 | $(eval $(call TunableBothConfigC,SGX_BYPASS_DCU,)) | ||
497 | $(eval $(call TunableBothConfigC,SGX_FAST_DPM_INIT,)) | ||
498 | $(eval $(call TunableBothConfigC,SGX_FEATURE_MP,)) | ||
499 | $(eval $(call TunableBothConfigC,SGX_FEATURE_MP_PLUS,)) | ||
500 | $(eval $(call TunableBothConfigC,FPGA,)) | ||
501 | $(eval $(call TunableBothConfigC,PDUMP,)) | ||
502 | $(eval $(call TunableBothConfigC,NO_HARDWARE,)) | ||
503 | $(eval $(call TunableBothConfigC,PDUMP_DEBUG_OUTFILES,)) | ||
504 | $(eval $(call TunableBothConfigC,PVRSRV_USSE_EDM_STATUS_DEBUG,)) | ||
505 | $(eval $(call TunableBothConfigC,SGX_DISABLE_VISTEST_SUPPORT,)) | ||
506 | $(eval $(call TunableBothConfigC,PVRSRV_RESET_ON_HWTIMEOUT,)) | ||
507 | $(eval $(call TunableBothConfigC,SYS_USING_INTERRUPTS,1)) | ||
508 | $(eval $(call TunableBothConfigC,SUPPORT_EXTERNAL_SYSTEM_CACHE,)) | ||
509 | $(eval $(call TunableBothConfigC,PVRSRV_NEW_PVR_DPF,)) | ||
510 | $(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_DPF,)) | ||
511 | $(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_ASSERT,)) | ||
512 | $(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_TRACE,)) | ||
513 | $(eval $(call TunableBothConfigC,SUPPORT_SECURE_33657_FIX,)) | ||
514 | $(eval $(call TunableBothConfigC,SUPPORT_ION,)) | ||
515 | $(eval $(call TunableBothConfigC,SUPPORT_HWRECOVERY_TRACE_LIMIT,)) | ||
516 | $(eval $(call TunableBothConfigC,SUPPORT_PVRSRV_GET_DC_SYSTEM_BUFFER,1)) | ||
517 | $(eval $(call TunableBothConfigC,SUPPORT_NV12_FROM_2_HWADDRS,)) | ||
518 | |||
519 | $(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_WRITECOMBINE,1)) | ||
520 | $(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_PAT,1)) | ||
521 | $(eval $(call TunableKernelConfigC,SGX_DYNAMIC_TIMING_INFO,)) | ||
522 | $(eval $(call TunableKernelConfigC,SYS_SGX_ACTIVE_POWER_LATENCY_MS,)) | ||
523 | $(eval $(call TunableKernelConfigC,SYS_CUSTOM_POWERLOCK_WRAP,)) | ||
524 | $(eval $(call TunableKernelConfigC,PVR_LINUX_USING_WORKQUEUES,)) | ||
525 | $(eval $(call TunableKernelConfigC,PVR_LINUX_MISR_USING_WORKQUEUE,)) | ||
526 | $(eval $(call TunableKernelConfigC,PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE,)) | ||
527 | $(eval $(call TunableKernelConfigC,PVR_LINUX_TIMERS_USING_WORKQUEUES,)) | ||
528 | $(eval $(call TunableKernelConfigC,PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE,)) | ||
529 | $(eval $(call TunableKernelConfigC,LDM_PLATFORM,)) | ||
530 | $(eval $(call TunableKernelConfigC,PVR_LDM_PLATFORM_PRE_REGISTERED,)) | ||
531 | $(eval $(call TunableKernelConfigC,PVR_LDM_PLATFORM_PRE_REGISTERED_DEV,)) | ||
532 | $(eval $(call TunableKernelConfigC,PVR_LDM_DRIVER_REGISTRATION_NAME,"\"$(PVRSRV_MODNAME)\"")) | ||
533 | $(eval $(call TunableKernelConfigC,LDM_PCI,)) | ||
534 | $(eval $(call TunableKernelConfigC,PVRSRV_DUMP_MK_TRACE,)) | ||
535 | $(eval $(call TunableKernelConfigC,PVRSRV_DUMP_KERNEL_CCB,)) | ||
536 | $(eval $(call TunableKernelConfigC,PVRSRV_REFCOUNT_DEBUG,)) | ||
537 | $(eval $(call TunableKernelConfigC,PVRSRV_MMU_MAKE_READWRITE_ON_DEMAND,)) | ||
538 | $(eval $(call TunableKernelConfigC,HYBRID_SHARED_PB_SIZE,)) | ||
539 | $(eval $(call TunableKernelConfigC,SUPPORT_LARGE_GENERAL_HEAP,)) | ||
540 | $(eval $(call TunableKernelConfigC,TTRACE,)) | ||
541 | |||
542 | ifeq ($(BUILD),debug) | ||
543 | $(eval $(call TunableKernelConfigC,CONFIG_PVR_PROC_FS,1)) | ||
544 | else | ||
545 | $(eval $(call TunableKernelConfigC,CONFIG_PVR_PROC_FS,)) | ||
546 | endif | ||
547 | |||
548 | $(eval $(call TunableKernelConfigC,CONFIG_PVR_PROC_FS_HEAP_ALLOC_DEBUG,)) | ||
549 | |||
550 | $(eval $(call TunableBothConfigMake,SUPPORT_ION,)) | ||
551 | |||
552 | |||
553 | $(eval $(call TunableBothConfigMake,OPTIM,)) | ||
554 | |||
555 | |||
556 | $(eval $(call TunableKernelConfigMake,TTRACE,)) | ||
557 | |||
558 | endif # INTERNAL_CLOBBER_ONLY | ||
559 | |||
560 | export INTERNAL_CLOBBER_ONLY | ||
561 | export TOP | ||
562 | export OUT | ||
563 | |||
564 | MAKE_ETC := -Rr --no-print-directory -C $(TOP) TOP=$(TOP) OUT=$(OUT) \ | ||
565 | -f eurasiacon/build/linux2/toplevel.mk | ||
566 | |||
567 | # This must match the default value of MAKECMDGOALS below, and the default | ||
568 | # goal in toplevel.mk | ||
569 | .DEFAULT_GOAL := build | ||
570 | |||
571 | ifeq ($(MAKECMDGOALS),) | ||
572 | MAKECMDGOALS := build | ||
573 | else | ||
574 | # We can't pass autogen to toplevel.mk | ||
575 | MAKECMDGOALS := $(filter-out autogen,$(MAKECMDGOALS)) | ||
576 | endif | ||
577 | |||
578 | .PHONY: autogen | ||
579 | autogen: | ||
580 | ifeq ($(INTERNAL_CLOBBER_ONLY),) | ||
581 | @$(MAKE) -s --no-print-directory -C $(EURASIAROOT) \ | ||
582 | -f eurasiacon/build/linux2/prepare_tree.mk \ | ||
583 | LDM_PCI=$(LDM_PCI) LDM_PLATFORM=$(LDM_PLATFORM) | ||
584 | else | ||
585 | @: | ||
586 | endif | ||
587 | |||
588 | # This deletes built-in suffix rules. Otherwise the submake isn't run when | ||
589 | # saying e.g. "make thingy.a" | ||
590 | .SUFFIXES: | ||
591 | |||
592 | # Because we have a match-anything rule below, we'll run the main build when | ||
593 | # we're actually trying to remake various makefiles after they're read in. | ||
594 | # These rules try to prevent that | ||
595 | %.mk: ; | ||
596 | Makefile%: ; | ||
597 | Makefile: ; | ||
598 | |||
599 | .PHONY: build kbuild install | ||
600 | build kbuild install: autogen | ||
601 | @$(if $(MAKECMDGOALS),$(MAKE) $(MAKE_ETC) $(MAKECMDGOALS) $(eval MAKECMDGOALS :=),:) | ||
602 | |||
603 | %: autogen | ||
604 | @$(if $(MAKECMDGOALS),$(MAKE) $(MAKE_ETC) $(MAKECMDGOALS) $(eval MAKECMDGOALS :=),:) | ||