# # (C) COPYRIGHT 2012,2014 ARM Limited. All rights reserved. # # This program is free software and is provided to you under the terms of the # GNU General Public License version 2 as published by the Free Software # Foundation, and any use by you of this program is subject to the terms # of such GNU licence. # # A copy of the licence is included with the program, and can also be obtained # from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301, USA. # # # Driver version string which is returned to userspace via an ioctl MALI_RELEASE_NAME ?= "r7p0-03rel0" # Paths required for build KBASE_PATH = $(src) KBASE_PLATFORM_PATH = $(KBASE_PATH)/platform_dummy UMP_PATH = $(src)/../../../base ifeq ($(CONFIG_MALI_ERROR_INJECTION),y) MALI_ERROR_INJECT_ON = 1 endif # Set up defaults if not defined by build system MALI_CUSTOMER_RELEASE ?= 1 MALI_UNIT_TEST ?= 0 MALI_KERNEL_TEST_API ?= 0 MALI_ERROR_INJECT_ON ?= 0 MALI_MOCK_TEST ?= 0 MALI_COVERAGE ?= 0 MALI_INSTRUMENTATION_LEVEL ?= 0 # MALI_SEC_SECURE_RENDERING MALI_SUPPORT_ASP_SECURE ?= 0 # This workaround is for what seems to be a compiler bug we observed in # GCC 4.7 on AOSP 4.3. The bug caused an intermittent failure compiling # the "_Pragma" syntax, where an error message is returned: # # "internal compiler error: unspellable token PRAGMA" # # This regression has thus far only been seen on the GCC 4.7 compiler bundled # with AOSP 4.3.0. So this makefile, intended for in-tree kernel builds # which are not known to be used with AOSP, is hardcoded to disable the # workaround, i.e. set the define to 0. MALI_GCC_WORKAROUND_MIDCOM_4598 ?= 0 # Set up our defines, which will be passed to gcc DEFINES = \ -DMALI_CUSTOMER_RELEASE=$(MALI_CUSTOMER_RELEASE) \ -DMALI_KERNEL_TEST_API=$(MALI_KERNEL_TEST_API) \ -DMALI_UNIT_TEST=$(MALI_UNIT_TEST) \ -DMALI_ERROR_INJECT_ON=$(MALI_ERROR_INJECT_ON) \ -DMALI_MOCK_TEST=$(MALI_MOCK_TEST) \ -DMALI_COVERAGE=$(MALI_COVERAGE) \ -DMALI_INSTRUMENTATION_LEVEL=$(MALI_INSTRUMENTATION_LEVEL) \ -DMALI_RELEASE_NAME=\"$(MALI_RELEASE_NAME)\" \ -DMALI_GCC_WORKAROUND_MIDCOM_4598=$(MALI_GCC_WORKAROUND_MIDCOM_4598) \ -DMALI_SEC_CL_BOOST \ -DMALI_SEC_FENCE_INTEGRATION \ -DMALI_SEC_UTILIZATION \ -DKBASE_FENCE_TIMEOUT_FAKE_SIGNAL \ -DMALI_SEC_ASP_SECURE_RENDERING=$(MALI_SUPPORT_ASP_SECURE) ifeq ($(CONFIG_MALI_GATOR_SUPPORT_TIMELINE_T72X),y) DEFINES +=-DCONFIG_MALI_GATOR_SUPPORT endif ifeq ($(KBUILD_EXTMOD),) # in-tree DEFINES +=-DMALI_KBASE_THIRDPARTY_PATH=../../$(src)/platform/$(CONFIG_MALI_PLATFORM_THIRDPARTY_NAME) else # out-of-tree DEFINES +=-DMALI_KBASE_THIRDPARTY_PATH=$(src)/platform/$(CONFIG_MALI_PLATFORM_THIRDPARTY_NAME) endif DEFINES += -I$(srctree)/drivers/staging/android ifeq ($(CONFIG_MALI_SEC_HWCNT),y) DEFINES +=-DMALI_SEC_HWCNT endif DEFINES += -I$(srctree)/drivers/soc/samsung/pwrcal # Use our defines when compiling ccflags-y += $(DEFINES) -I$(KBASE_PATH) -I$(KBASE_PLATFORM_PATH) -I$(UMP_PATH) -I$(srctree)/include/linux subdir-ccflags-y += $(DEFINES) -I$(KBASE_PATH) -I$(KBASE_PLATFORM_PATH) -I$(OSK_PATH) -I$(UMP_PATH) -I$(srctree)/include/linux SRC := \ mali_kbase_device.c \ mali_kbase_cache_policy.c \ mali_kbase_mem.c \ mali_kbase_mmu.c \ mali_kbase_ipa.c \ mali_kbase_jd.c \ mali_kbase_jd_debugfs.c \ mali_kbase_jm.c \ mali_kbase_gpuprops.c \ mali_kbase_js.c \ mali_kbase_js_ctx_attr.c \ mali_kbase_event.c \ mali_kbase_context.c \ mali_kbase_pm.c \ mali_kbase_config.c \ mali_kbase_security.c \ mali_kbase_instr.c \ mali_kbase_vinstr.c \ mali_kbase_softjobs.c \ mali_kbase_10969_workaround.c \ mali_kbase_hw.c \ mali_kbase_utility.c \ mali_kbase_debug.c \ mali_kbase_trace_timeline.c \ mali_kbase_gpu_memory_debugfs.c \ mali_kbase_mem_linux.c \ mali_kbase_core_linux.c \ mali_kbase_sync.c \ mali_kbase_sync_user.c \ mali_kbase_replay.c \ mali_kbase_mem_profile_debugfs.c \ mali_kbase_mmu_mode_lpae.c \ mali_kbase_disjoint_events.c \ mali_kbase_gator_api.c \ mali_kbase_debug_mem_view.c \ mali_kbase_debug_job_fault.c \ mali_kbase_smc.c \ mali_kbase_mem_pool.c \ mali_kbase_mem_pool_debugfs.c ifeq ($(CONFIG_MALI_MIPE_ENABLED_T72X),y) SRC += mali_kbase_tlstream.c ifeq ($(MALI_UNIT_TEST),1) SRC += mali_kbase_tlstream_test.c endif endif # Job Scheduler Policy: Completely Fair Scheduler SRC += mali_kbase_js_policy_cfs.c ccflags-y += -I$(KBASE_PATH) ifeq ($(CONFIG_MALI_PLATFORM_THIRDPARTY),y) # remove begin and end quotes from the Kconfig string type platform_name := $(shell echo $(CONFIG_MALI_PLATFORM_THIRDPARTY_NAME)) MALI_PLATFORM_THIRDPARTY_DIR := platform/exynos ccflags-y += -I$(src)/$(MALI_PLATFORM_THIRDPARTY_DIR) ifeq ($(CONFIG_MALI_R7P0_T72X),m) include $(src)/platform/$(platform_name)/Kbuild else ifeq ($(CONFIG_MALI_R7P0_T72X),y) obj-$(CONFIG_MALI_R7P0_T72X) += platform/ endif endif ifeq ($(CONFIG_MALI_PLATFORM_DEVICETREE),y) SRC += platform/devicetree/mali_kbase_runtime_pm.c SRC += platform/devicetree/mali_kbase_config_devicetree.c ccflags-y += -I$(src)/platform/devicetree endif # Tell the Linux build system from which .o file to create the kernel module obj-$(CONFIG_MALI_R7P0_T72X) += mali_kbase.o # Tell the Linux build system to enable building of our .c files mali_kbase-y := $(SRC:.c=.o) ifneq ($(wildcard $(src)/internal/Kbuild),) ifeq ($(MALI_CUSTOMER_RELEASE),0) # This include may set MALI_BACKEND_PATH and CONFIG_MALI_BACKEND_REAL include $(src)/internal/Kbuild mali_kbase-y += $(INTERNAL:.c=.o) endif endif MALI_BACKEND_PATH ?= backend CONFIG_MALI_BACKEND ?= gpu CONFIG_MALI_BACKEND_REAL ?= $(CONFIG_MALI_BACKEND) ifeq ($(MALI_MOCK_TEST),1) ifeq ($(CONFIG_MALI_BACKEND_REAL),gpu) # Test functionality mali_kbase-y += tests/internal/src/mock/mali_kbase_pm_driver_mock.o endif endif include $(src)/$(MALI_BACKEND_PATH)/$(CONFIG_MALI_BACKEND_REAL)/Kbuild mali_kbase-y += $(BACKEND:.c=.o) ccflags-y += -I$(src)/$(MALI_BACKEND_PATH)/$(CONFIG_MALI_BACKEND_REAL) subdir-ccflags-y += -I$(src)/$(MALI_BACKEND_PATH)/$(CONFIG_MALI_BACKEND_REAL)