ENGR00156850 gpu-viv: add gpu-viv driver source
[wandboard.git] / drivers / mxc / gpu-viv / Kbuild
blob13fd9b4e408c26f0a81aad87c030b8286ea58918
1 ##############################################################################
3 #    Copyright (C) 2005 - 2011 by Vivante Corp.
5 #    This program is free software; you can redistribute it and/or modify
6 #    it under the terms of the GNU General Public License as published by
7 #    the Free Software Foundation; either version 2 of the license, or
8 #    (at your option) any later version.
10 #    This program is distributed in the hope that it will be useful,
11 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
12 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 #    GNU General Public License for more details.
15 #    You should have received a copy of the GNU General Public License
16 #    along with this program; if not write to the Free Software
17 #    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 ##############################################################################
23 # Linux build file for kernel HAL driver.
26 AQROOT := $(srctree)/drivers/mxc/gpu-viv
27 AQARCH := $(AQROOT)/arch/XAQ2
28 AQVGARCH := $(AQROOT)/arch/GC350
30 include $(AQROOT)/config
32 KERNEL_DIR ?= $(TOOL_DIR)/kernel
34 OS_KERNEL_DIR   := hal/os/linux/kernel
35 ARCH_KERNEL_DIR := arch/$(notdir $(AQARCH))/hal/kernel
36 ARCH_VG_KERNEL_DIR := arch/$(notdir $(AQVGARCH))/hal/kernel
37 HAL_KERNEL_DIR  := hal/kernel
39 EXTRA_CFLAGS += -Werror
41 OBJS := $(OS_KERNEL_DIR)/gc_hal_kernel_device.o \
42         $(OS_KERNEL_DIR)/gc_hal_kernel_driver.o \
43         $(OS_KERNEL_DIR)/gc_hal_kernel_linux.o \
44         $(OS_KERNEL_DIR)/gc_hal_kernel_math.o \
45         $(OS_KERNEL_DIR)/gc_hal_kernel_os.o
47 ifeq ($(USE_3D_VG), 1)
49 OBJS += $(HAL_KERNEL_DIR)/gc_hal_kernel.o \
50         $(HAL_KERNEL_DIR)/gc_hal_kernel_command.o \
51         $(HAL_KERNEL_DIR)/gc_hal_kernel_db.o \
52         $(HAL_KERNEL_DIR)/gc_hal_kernel_debug.o \
53         $(HAL_KERNEL_DIR)/gc_hal_kernel_event.o \
54         $(HAL_KERNEL_DIR)/gc_hal_kernel_heap.o \
55         $(HAL_KERNEL_DIR)/gc_hal_kernel_mmu.o \
56         $(HAL_KERNEL_DIR)/gc_hal_kernel_video_memory.o
58 OBJS += $(ARCH_KERNEL_DIR)/gc_hal_kernel_context.o \
59         $(ARCH_KERNEL_DIR)/gc_hal_kernel_hardware.o
61 ifeq ($(VIVANTE_ENABLE_VG), 1)
62 OBJS +=\
63           $(HAL_KERNEL_DIR)/gc_hal_kernel_vg.o\
64           $(HAL_KERNEL_DIR)/gc_hal_kernel_command_vg.o\
65           $(HAL_KERNEL_DIR)/gc_hal_kernel_interrupt_vg.o\
66           $(HAL_KERNEL_DIR)/gc_hal_kernel_mmu_vg.o\
67           $(ARCH_VG_KERNEL_DIR)/gc_hal_kernel_hardware_command_vg.o\
68           $(ARCH_VG_KERNEL_DIR)/gc_hal_kernel_hardware_vg.o
69 endif
70 else
72 OBJS += $(HAL_KERNEL_DIR)/gc_hal_kernel.o \
73         $(HAL_KERNEL_DIR)/gc_hal_kernel_command.o \
74         $(HAL_KERNEL_DIR)/gc_hal_kernel_heap.o \
75         $(HAL_KERNEL_DIR)/gc_hal_kernel_interrupt.o \
76         $(HAL_KERNEL_DIR)/gc_hal_kernel_mmu.o \
77         $(HAL_KERNEL_DIR)/gc_hal_kernel_video_memory.o \
78         $(OS_KERNEL_DIR)/gc_hal_kernel_debug.o
80 OBJS += $(ARCH_KERNEL_DIR)/gc_hal_kernel_hardware.o \
81         $(ARCH_KERNEL_DIR)/gc_hal_kernel_hardware_command.o
83 endif
85 ifeq ($(KERNELRELEASE), )
87 .PHONY: all clean install
89 # Define targets.
90 all:
91         @make V=$(V) ARCH=$(ARCH_TYPE) -C $(KERNEL_DIR) SUBDIRS=`pwd` modules
93 clean:
94         @rm -rf $(OBJS)
95         @rm -rf modules.order Module.symvers
96         @find $(AQROOT) -name ".gc_*.cmd" | xargs rm -f
98 install: all
99         @mkdir -p $(SDK_DIR)/drivers
101 else
104 EXTRA_CFLAGS += -DLINUX -DDRIVER
106 ifeq ($(ENUM_WORKAROUND), 1)
107 EXTRA_CFLAGS += -DENUM_WORKAROUND=1
108 else
109 EXTRA_CFLAGS += -DENUM_WORKAROUND=0
110 endif
112 ifeq ($(FLAREON),1)
113 EXTRA_CFLAGS += -DFLAREON
114 endif
116 ifeq ($(DEBUG), 1)
117 EXTRA_CFLAGS += -DDBG=1 -DDEBUG -D_DEBUG
118 else
119 EXTRA_CFLAGS += -DDBG=0
120 endif
122 ifeq ($(NO_DMA_COHERENT), 1)
123 EXTRA_CFLAGS += -DNO_DMA_COHERENT
124 endif
126 ifeq ($(CONFIG_DOVE_GPU), 1)
127 EXTRA_CFLAGS += -DCONFIG_DOVE_GPU=1
128 endif
130 ifeq ($(USE_POWER_MANAGEMENT), 1)
131 EXTRA_CFLAGS += -DgcdPOWER_MANAGEMENT=1
132 else
133 EXTRA_CFLAGS += -DgcdPOWER_MANAGEMENT=0
134 endif
136 ifneq ($(USE_PLATFORM_DRIVER), 0)
137 EXTRA_CFLAGS += -DUSE_PLATFORM_DRIVER=1
138 else
139 EXTRA_CFLAGS += -DUSE_PLATFORM_DRIVER=0
140 endif
142 ifeq ($(USE_PROFILER), 1)
143 EXTRA_CFLAGS += -DVIVANTE_PROFILER=1
144 else
145 EXTRA_CFLAGS += -DVIVANTE_PROFILER=0
146 endif
148 ifeq ($(ANDROID), 1)
149 EXTRA_CFLAGS += -DANDROID=1
150 endif
152 ifeq ($(ENABLE_GPU_CLOCK_BY_DRIVER), 1)
153 EXTRA_CFLAGS += -DENABLE_GPU_CLOCK_BY_DRIVER=1
154 else
155 EXTRA_CFLAGS += -DENABLE_GPU_CLOCK_BY_DRIVER=0
156 endif
158 ifeq ($(USE_NEW_LINUX_SIGNAL), 1)
159 EXTRA_CFLAGS += -DUSE_NEW_LINUX_SIGNAL=1
160 else
161 EXTRA_CFLAGS += -DUSE_NEW_LINUX_SIGNAL=0
162 endif
164 ifeq ($(NO_USER_DIRECT_ACCESS_FROM_KERNEL), 1)
165 EXTRA_CFLAGS += -DNO_USER_DIRECT_ACCESS_FROM_KERNEL=1
166 else
167 EXTRA_CFLAGS += -DNO_USER_DIRECT_ACCESS_FROM_KERNEL=0
168 endif
170 ifeq ($(ENABLE_CACHED_VIDEO_MEMORY), 1)
171 EXTRA_CFLAGS += -DgcdPAGED_MEMORY_CACHEABLE=1
172 else
173 EXTRA_CFLAGS += -DgcdPAGED_MEMORY_CACHEABLE=0
174 endif
176 ifeq ($(NONPAGED_MEMORY_CACHEABLE), 1)
177 EXTRA_CFLAGS += -DgcdNONPAGED_MEMORY_CACHEABLE=1
178 else
179 EXTRA_CFLAGS += -DgcdNONPAGED_MEMORY_CACHEABLE=0
180 endif
182 ifeq ($(NONPAGED_MEMORY_BUFFERABLE), 1)
183 EXTRA_CFLAGS += -DgcdNONPAGED_MEMORY_BUFFERABLE=1
184 else
185 EXTRA_CFLAGS += -DgcdNONPAGED_MEMORY_BUFFERABLE=0
186 endif
188 ifeq ($(CACHE_FUNCTION_UNIMPLEMENTED), 1)
189 EXTRA_CFLAGS += -DgcdCACHE_FUNCTION_UNIMPLEMENTED=1
190 else
191 EXTRA_CFLAGS += -DgcdCACHE_FUNCTION_UNIMPLEMENTED=0
192 endif
194 ifeq ($(VIVANTE_ENABLE_VG), 1)
195 EXTRA_CFLAGS += -DgcdENABLE_VG=1
196 else
197 EXTRA_CFLAGS += -DgcdENABLE_VG=0
198 endif
202 EXTRA_CFLAGS += -I$(AQROOT)/hal/kernel/inc
203 EXTRA_CFLAGS += -I$(AQROOT)/hal/kernel
204 EXTRA_CFLAGS += -I$(AQARCH)/hal/kernel
205 EXTRA_CFLAGS += -I$(AQROOT)/hal/os/linux/kernel
207 ifeq ($(VIVANTE_ENABLE_VG), 1)
208 EXTRA_CFLAGS += -I$(AQVGARCH)/hal/kernel
209 endif
211 obj-$(CONFIG_MXC_GPU_VIV) += galcore.o
213 galcore-objs  := $(OBJS)
215 endif