import OT_8063_20170412 mali driver
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / misc / mediatek / gpu / mt8127 / mali / ump / Kbuild
CommitLineData
6fa3eb70
S
1#
2# This confidential and proprietary software may be used only as
3# authorised by a licensing agreement from ARM Limited
4# (C) COPYRIGHT 2008-2012 ARM Limited
5# ALL RIGHTS RESERVED
6# The entire notice above must be reproduced on all authorised
7# copies and copies may only be made to the extent permitted
8# by a licensing agreement from ARM Limited.
9#
10
11# Set default configuration to use, if Makefile didn't provide one.
12# Change this to use a different config.h
bdc132d7 13CONFIG ?= default
6fa3eb70
S
14
15# Validate selected config
16ifneq ($(shell [ -d $(src)/arch-$(CONFIG) ] && [ -f $(src)/arch-$(CONFIG)/config.h ] && echo "OK"), OK)
17$(warning Current directory is $(src))
18$(error No configuration found for config $(CONFIG). Check that arch-$(CONFIG)/config.h exists)
19else
20# Link arch to the selected arch-config directory
21$(shell [ -L $(src)/arch ] && rm $(src)/arch)
22$(shell ln -sf arch-$(CONFIG) $(src)/arch)
23$(shell touch $(src)/arch/config.h)
24endif
25
26UDD_FILE_PREFIX = ../mali/
27
28# Get subversion revision number, fall back to 0000 if no svn info is available
29SVN_INFO = (cd $(src); svn info 2>/dev/null)
30
31ifneq ($(shell $(SVN_INFO) 2>/dev/null),)
32# SVN detected
33SVN_REV := $(shell $(SVN_INFO) | grep '^Revision: '| sed -e 's/^Revision: //' 2>/dev/null)
34DRIVER_REV := $(MALI_RELEASE_NAME)-r$(SVN_REV)
35CHANGE_DATE := $(shell $(SVN_INFO) | grep '^Last Changed Date: ' | cut -d: -f2- | cut -b2-)
36CHANGED_REVISION := $(shell $(SVN_INFO) | grep '^Last Changed Rev: ' | cut -d: -f2- | cut -b2-)
37REPO_URL := $(shell $(SVN_INFO) | grep '^URL: ' | cut -d: -f2- | cut -b2-)
38
39else # SVN
40GIT_REV := $(shell cd $(src); git describe --always 2>/dev/null)
41ifneq ($(GIT_REV),)
42# Git detected
43DRIVER_REV := $(MALI_RELEASE_NAME)-$(GIT_REV)
44CHANGE_DATE := $(shell cd $(src); git log -1 --format="%ci")
45CHANGED_REVISION := $(GIT_REV)
46REPO_URL := $(shell cd $(src); git describe --all --always 2>/dev/null)
47
48else # Git
49# No Git or SVN detected
50DRIVER_REV := $(MALI_RELEASE_NAME)
51CHANGE_DATE := $(MALI_RELEASE_NAME)
52CHANGED_REVISION := $(MALI_RELEASE_NAME)
53endif
54endif
55
56ccflags-y += -DSVN_REV=$(SVN_REV)
57ccflags-y += -DSVN_REV_STRING=\"$(DRIVER_REV)\"
58
59ccflags-y += -I$(src) -I$(src)/common -I$(src)/linux -I$(src)/../mali/common -I$(src)/../mali/linux -I$(src)/../../ump/include/ump
60ccflags-y += -DMALI_STATE_TRACKING=0
61ccflags-y += -DMALI_ENABLE_CPU_CYCLES=0
62ccflags-$(CONFIG_UMP_DEBUG) += -DDEBUG
63
64# For customer releases the Linux Device Drivers will be provided as ARM proprietary and GPL releases:
65# The ARM proprietary product will only include the license/proprietary directory
66# The GPL product will only include the license/gpl directory
67
68ifeq ($(wildcard $(src)/linux/license/gpl/*),)
69ccflags-y += -I$(src)/linux/license/proprietary -I$(src)/../mali/linux/license/proprietary
70else
71ccflags-y += -I$(src)/linux/license/gpl -I$(src)/../mali/linux/license/gpl
72endif
73
74ump-y = common/ump_kernel_common.o \
75 common/ump_kernel_descriptor_mapping.o \
76 common/ump_kernel_api.o \
77 common/ump_kernel_ref_drv.o \
78 linux/ump_kernel_linux.o \
79 linux/ump_kernel_memory_backend_os.o \
80 linux/ump_kernel_memory_backend_dedicated.o \
81 linux/ump_memory_backend.o \
82 linux/ump_ukk_wrappers.o \
83 linux/ump_ukk_ref_wrappers.o \
84 linux/ump_osk_atomics.o \
85 linux/ump_osk_low_level_mem.o \
86 linux/ump_osk_misc.o \
bdc132d7 87 linux/ump_kernel_random_mapping.o \
6fa3eb70
S
88 $(UDD_FILE_PREFIX)linux/mali_osk_atomics.o \
89 $(UDD_FILE_PREFIX)linux/mali_osk_locks.o \
90 $(UDD_FILE_PREFIX)linux/mali_osk_memory.o \
91 $(UDD_FILE_PREFIX)linux/mali_osk_math.o \
92 $(UDD_FILE_PREFIX)linux/mali_osk_misc.o
93
94obj-$(CONFIG_UMP) := ump.o
95