|
| 1 | +# |
| 2 | +# Copyright (C) 2010-2011 ARM Limited. All rights reserved. |
| 3 | +# |
| 4 | +# This program is free software and is provided to you under the terms of the GNU General Public License version 2 |
| 5 | +# as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence. |
| 6 | +# |
| 7 | +# A copy of the licence is included with the program, and can also be obtained from Free Software |
| 8 | +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 9 | +# |
| 10 | + |
| 11 | +# This file is called by the Linux build system. |
| 12 | + |
| 13 | +# set up defaults if not defined by the user |
| 14 | +TIMESTAMP ?= default |
| 15 | +OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB ?= 16 |
| 16 | +USING_GPU_UTILIZATION ?= 0 |
| 17 | +PROFILING_SKIP_PP_JOBS ?= 0 |
| 18 | +PROFILING_SKIP_PP_AND_GP_JOBS ?= 0 |
| 19 | +MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP ?= 1 |
| 20 | +MALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED ?= 1 |
| 21 | +MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS ?= 1 |
| 22 | +MALI_UPPER_HALF_SCHEDULING ?= 1 |
| 23 | + |
| 24 | +# For customer releases the Linux Device Drivers will be provided as ARM proprietary and GPL releases: |
| 25 | +# The ARM proprietary product will only include the license/proprietary directory |
| 26 | +# The GPL product will only include the license/gpl directory |
| 27 | +ifeq ($(wildcard $(src)/linux/license/gpl/*),) |
| 28 | + ccflags-y += -I$(src)/linux/license/proprietary |
| 29 | + ifeq ($(CONFIG_MALI400_PROFILING),y) |
| 30 | + $(error Profiling is incompatible with non-GPL license) |
| 31 | + endif |
| 32 | + ifeq ($(CONFIG_PM_RUNTIME),y) |
| 33 | + $(error Runtime PM is incompatible with non-GPL license) |
| 34 | + endif |
| 35 | + ifeq ($(CONFIG_DMA_SHARED_BUFFER),y) |
| 36 | + $(error DMA-BUF is incompatible with non-GPL license) |
| 37 | + endif |
| 38 | + $(error Linux Device integration is incompatible with non-GPL license) |
| 39 | +else |
| 40 | + ccflags-y += -I$(src)/linux/license/gpl |
| 41 | +endif |
| 42 | + |
| 43 | +mali-y += \ |
| 44 | + linux/mali_osk_atomics.o \ |
| 45 | + linux/mali_osk_irq.o \ |
| 46 | + linux/mali_osk_wq.o \ |
| 47 | + linux/mali_osk_locks.o \ |
| 48 | + linux/mali_osk_wait_queue.o \ |
| 49 | + linux/mali_osk_low_level_mem.o \ |
| 50 | + linux/mali_osk_math.o \ |
| 51 | + linux/mali_osk_memory.o \ |
| 52 | + linux/mali_osk_misc.o \ |
| 53 | + linux/mali_osk_mali.o \ |
| 54 | + linux/mali_osk_notification.o \ |
| 55 | + linux/mali_osk_time.o \ |
| 56 | + linux/mali_osk_timers.o |
| 57 | + |
| 58 | +mali-y += \ |
| 59 | + linux/mali_ukk_mem.o \ |
| 60 | + linux/mali_ukk_gp.o \ |
| 61 | + linux/mali_ukk_pp.o \ |
| 62 | + linux/mali_ukk_core.o |
| 63 | + |
| 64 | +# Source files which always are included in a build |
| 65 | +mali-y += \ |
| 66 | + common/mali_kernel_core.o \ |
| 67 | + linux/mali_kernel_linux.o \ |
| 68 | + common/mali_kernel_descriptor_mapping.o \ |
| 69 | + common/mali_session.o \ |
| 70 | + common/mali_device_pause_resume.o \ |
| 71 | + common/mali_kernel_vsync.o \ |
| 72 | + linux/mali_ukk_vsync.o \ |
| 73 | + linux/mali_kernel_sysfs.o \ |
| 74 | + common/mali_mmu.o \ |
| 75 | + common/mali_mmu_page_directory.o \ |
| 76 | + common/mali_memory.o \ |
| 77 | + common/mali_kernel_memory_engine.o \ |
| 78 | + common/mali_block_allocator.o \ |
| 79 | + common/mali_kernel_mem_os.o \ |
| 80 | + common/mali_mem_validation.o \ |
| 81 | + common/mali_hw_core.o \ |
| 82 | + common/mali_gp.o \ |
| 83 | + common/mali_pp.o \ |
| 84 | + common/mali_pp_job.o \ |
| 85 | + common/mali_gp_job.o \ |
| 86 | + common/mali_scheduler.o \ |
| 87 | + common/mali_gp_scheduler.o \ |
| 88 | + common/mali_pp_scheduler.o \ |
| 89 | + common/mali_group.o \ |
| 90 | + common/mali_dlbu.o \ |
| 91 | + common/mali_broadcast.o \ |
| 92 | + common/mali_pm.o \ |
| 93 | + common/mali_pmu.o \ |
| 94 | + common/mali_user_settings_db.o \ |
| 95 | + common/mali_kernel_utilization.o \ |
| 96 | + common/mali_l2_cache.o \ |
| 97 | + linux/mali_osk_pm.o \ |
| 98 | + linux/mali_pmu_power_up_down.o \ |
| 99 | + platform/arm/arm.o \ |
| 100 | + __malidrv_build_info.o |
| 101 | + |
| 102 | +mali-$(CONFIG_MALI400_PROFILING) += linux/mali_ukk_profiling.o |
| 103 | +mali-$(CONFIG_MALI400_PROFILING) += linux/mali_osk_profiling.o |
| 104 | + |
| 105 | +mali-$(CONFIG_MALI400_INTERNAL_PROFILING) += linux/mali_profiling_internal.o timestamp-$(TIMESTAMP)/mali_timestamp.o |
| 106 | +ccflags-$(CONFIG_MALI400_INTERNAL_PROFILING) += -I$(src)/timestamp-$(TIMESTAMP) |
| 107 | + |
| 108 | +mali-$(CONFIG_DMA_SHARED_BUFFER) += linux/mali_dma_buf.o |
| 109 | +mali-$(CONFIG_SYNC) += linux/mali_sync.o linux/mali_sync_user.o |
| 110 | + |
| 111 | +# Tell the Linux build system from which .o file to create the kernel module |
| 112 | +obj-$(CONFIG_MALI400) := mali.o |
| 113 | + |
| 114 | +#ifdef CONFIG_PM |
| 115 | +#ifdef CONFIG_PM_RUNTIME |
| 116 | +# KERNEL_RUNTIME_PM_ENABLED = 1 |
| 117 | +#endif |
| 118 | +#endif |
| 119 | +#export EXTRA_DEFINES += -DMALI_PMM_RUNTIME_JOB_CONTROL_ON=$(KERNEL_RUNTIME_PM_ENABLED) |
| 120 | + |
| 121 | +export EXTRA_DEFINES += -DMALI_FAKE_PLATFORM_DEVICE=1 |
| 122 | +export EXTRA_DEFINES += -DCONFIG_MALI400_UMP=1 |
| 123 | +export EXTRA_DEFINES += -DMALI_PMM_RUNTIME_JOB_CONTROL_ON=0 |
| 124 | +export EXTRA_DEFINES += -D_MALI_OSK_SPECIFIC_INDIRECT_MMAP |
| 125 | +export EXTRA_DEFINES += -DMALI_DVFS_ENABLED=0 |
| 126 | +export EXTRA_DEFINES += -DMALI_VOLTAGE_LOCK=0 |
| 127 | +export EXTRA_DEFINES += -DMALI_TIMELINE_PROFILING_ENABLED=0 |
| 128 | +export EXTRA_DEFINES += -DMALI_POWER_MGMT_TEST_SUITE=0 |
| 129 | +export EXTRA_DEFINES += -DUSING_MALI_PMM=0 |
| 130 | +export EXTRA_DEFINES += -DDEBUG=1 |
| 131 | +ccflags-y += $(EXTRA_DEFINES) |
| 132 | + |
| 133 | +# Set up our defines, which will be passed to gcc |
| 134 | +ccflags-y += -DPROFILING_SKIP_PP_JOBS=$(PROFILING_SKIP_PP_JOBS) |
| 135 | +ccflags-y += -DPROFILING_SKIP_PP_AND_GP_JOBS=$(PROFILING_SKIP_PP_AND_GP_JOBS) |
| 136 | +ccflags-y += -DUSING_MALI400=1 |
| 137 | +ccflags-y += -DMALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP=1 |
| 138 | +ccflags-y += -DMALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED=1 |
| 139 | +ccflags-y += -DMALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS=1 |
| 140 | +ccflags-y += -DMALI_STATE_TRACKING=0 |
| 141 | +ccflags-y += -DMALI_OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=256 |
| 142 | +ccflags-y += -DUSING_GPU_UTILIZATION=0 |
| 143 | +ccflags-y += -DMALI_LICENSE_IS_GPL=1 |
| 144 | + |
| 145 | +ifeq ($(MALI_UPPER_HALF_SCHEDULING),1) |
| 146 | + ccflags-y += -DMALI_UPPER_HALF_SCHEDULING |
| 147 | +endif |
| 148 | + |
| 149 | +ccflags-$(CONFIG_MALI400_UMP) += -I$(src)/../../ump_r3p2/include/ump |
| 150 | +ccflags-$(CONFIG_MALI400_DEBUG) += -DDEBUG |
| 151 | + |
| 152 | +# Use our defines when compiling |
| 153 | +ccflags-y += -I$(src) -I$(src)/include -I$(src)/common -I$(src)/linux -I$(src)/platform |
| 154 | + |
| 155 | +# Get subversion revision number, fall back to only ${MALI_RELEASE_NAME} if no svn info is available |
| 156 | +MALI_RELEASE_NAME=$(shell cat $(src)/.version 2> /dev/null) |
| 157 | + |
| 158 | +SVN_INFO = (cd $(src); (svn info || git svn info || \ |
| 159 | + echo -e "\nURL: $(MALI_RELEASE_NAME)\n" \ |
| 160 | + "Last Changed Rev: $(MALI_RELEASE_NAME)\n" \ |
| 161 | + "Last Changed Date: $(MALI_RELEASE_NAME)") 2>/dev/null) |
| 162 | + |
| 163 | +SVN_REV := $(shell (cd $(src); echo "$(SVN_INFO)" | grep '^Revision: '| sed -e 's/^Revision: //' ) 2>/dev/null ) |
| 164 | +ifeq ($(SVN_REV),) |
| 165 | +SVN_REV := $(MALI_RELEASE_NAME) |
| 166 | +else |
| 167 | +SVN_REV := $(MALI_RELEASE_NAME)-r$(SVN_REV) |
| 168 | +endif |
| 169 | + |
| 170 | +ccflags-y += -DSVN_REV_STRING=\"$(SVN_REV)\" |
| 171 | + |
| 172 | +VERSION_STRINGS := |
| 173 | +VERSION_STRINGS += API_VERSION=$(shell cd $(src); grep "\#define _MALI_API_VERSION" $(FILES_PREFIX)include/linux/mali/mali_utgard_uk_types.h | cut -d' ' -f 3 ) |
| 174 | +VERSION_STRINGS += REPO_URL=$(shell $(SVN_INFO) | grep '^URL: ' | cut -d: -f2- | cut -b2-) |
| 175 | +VERSION_STRINGS += REVISION=$(SVN_REV) |
| 176 | +VERSION_STRINGS += CHANGED_REVISION=$(shell $(SVN_INFO) | grep '^Last Changed Rev: ' | cut -d: -f2- | cut -b2-) |
| 177 | +VERSION_STRINGS += CHANGE_DATE=$(shell $(SVN_INFO) | grep '^Last Changed Date: ' | cut -d: -f2- | cut -b2-) |
| 178 | +VERSION_STRINGS += BUILD_DATE=$(shell date) |
| 179 | +ifdef CONFIG_MALI400_DEBUG |
| 180 | +VERSION_STRINGS += BUILD=debug |
| 181 | +else |
| 182 | +VERSION_STRINGS += BUILD=release |
| 183 | +endif |
| 184 | +VERSION_STRINGS += TARGET_PLATFORM=$(TARGET_PLATFORM) |
| 185 | +VERSION_STRINGS += MALI_PLATFORM=$(MALI_PLATFORM) |
| 186 | +VERSION_STRINGS += KDIR=$(KDIR) |
| 187 | +VERSION_STRINGS += OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=$(OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB) |
| 188 | +VERSION_STRINGS += USING_UMP=$(CONFIG_MALI400_UMP) |
| 189 | +VERSION_STRINGS += USING_PROFILING=$(CONFIG_MALI400_PROFILING) |
| 190 | +VERSION_STRINGS += USING_INTERNAL_PROFILING=$(CONFIG_MALI400_INTERNAL_PROFILING) |
| 191 | +VERSION_STRINGS += USING_GPU_UTILIZATION=$(USING_GPU_UTILIZATION) |
| 192 | +VERSION_STRINGS += MALI_UPPER_HALF_SCHEDULING=$(MALI_UPPER_HALF_SCHEDULING) |
| 193 | + |
| 194 | +# Create file with Mali driver configuration |
| 195 | +$(src)/__malidrv_build_info.c: |
| 196 | + @echo 'const char *__malidrv_build_info(void) { return "malidrv: $(VERSION_STRINGS)";}' > $(src)/__malidrv_build_info.c |
0 commit comments