Skip to content
This repository was archived by the owner on Oct 5, 2018. It is now read-only.

Commit 31916f9

Browse files
committed
Merge pull request #23 from ldts/hikey-mali
Tested with the Debian snapshot #128 and the binary user-side drivers available at the public download page: http://malideveloper.arm.com/develop-for-mali/features/mali-t6xx-gpu-user-space-drivers/
2 parents a378686 + 79b1e2c commit 31916f9

File tree

147 files changed

+36632
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+36632
-6
lines changed

arch/arm64/boot/dts/hi6220.dtsi

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -991,6 +991,23 @@
991991
};
992992
};
993993

994+
mali:mali@f4080000 {
995+
compatible = "arm,mali-450", "arm,mali-utgard";
996+
reg = <0x0 0x3f100000 0x0 0x00708000>;
997+
clocks = <&clock_media HI6220_G3D_CLK>,
998+
<&clock_media HI6220_G3D_PCLK>;
999+
clock-names = "clk_g3d", "pclk_g3d";
1000+
G3D_PD_VDD-supply = <&mtcmos1>;
1001+
mali_def_freq = <500>;
1002+
pclk_freq = <144>;
1003+
dfs_steps = <2>;
1004+
dfs_lockprf = <1>;
1005+
dfs_limit_max_prf = <1>;
1006+
dfs_profile_num = <2>;
1007+
dfs_profiles = <250 3 0>, <500 1 0>;
1008+
mali_type = <2>;
1009+
};
1010+
9941011
dwmmc_0: dwmmc0@f723d000 {
9951012
compatible = "hisilicon,hisi-dw-mshc";
9961013
num-slots = <0x1>;
@@ -1038,11 +1055,13 @@
10381055

10391056
mtcmos1: regulator@a1{
10401057
regulator-name = "G3D_PD_VDD";
1058+
regulator-compatible = "mtcmos1";
10411059
hisilicon,ctrl-regs = <0x830 0x834 0x83c>;
10421060
hisilicon,ctrl-data = <1 0x1>;
10431061
};
10441062
mtcmos2: regulator@a2{
10451063
regulator-name = "SOC_MED";
1064+
regulator-compatible = "mtcmos2";
10461065
hisilicon,ctrl-regs = <0x830 0x834 0x83c>;
10471066
hisilicon,ctrl-data = <2 0x1>;
10481067
};

arch/arm64/configs/defconfig

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,6 @@ CONFIG_SPI_PL022=y
250250
CONFIG_GPIO_SYSFS=y
251251
CONFIG_GPIO_XGENE=y
252252
CONFIG_THERMAL=y
253-
CONFIG_THERMAL_HWMON=y
254-
CONFIG_THERMAL_OF=y
255-
CONFIG_THERMAL_DEFAULT_GOV_STEP_WISE=y
256-
CONFIG_THERMAL_GOV_STEP_WISE=y
257253
CONFIG_THERMAL_GOV_USER_SPACE=y
258254
CONFIG_CPU_THERMAL=y
259255
CONFIG_HISI_THERMAL=y
@@ -263,9 +259,16 @@ CONFIG_REGULATOR_HI6220=y
263259
CONFIG_MEDIA_SUPPORT=y
264260
CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
265261
# CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
262+
CONFIG_MALI400=m
263+
CONFIG_MALI450=y
264+
# CONFIG_MALI400_PROFILING is not set
265+
# CONFIG_MALI_DVFS is not set
266+
CONFIG_MALI_SHARED_INTERRUPTS=y
267+
CONFIG_MALI_DT=y
268+
CONFIG_MALI_PLAT_SPECIFIC_DT=y
266269
CONFIG_DRM=y
267-
CONFIG_DRM_HISI=y
268270
CONFIG_DRM_I2C_ADV7533=y
271+
CONFIG_DRM_HISI=y
269272
CONFIG_FB_ARMCLCD=y
270273
CONFIG_FRAMEBUFFER_CONSOLE=y
271274
CONFIG_LOGO=y

drivers/gpu/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
obj-y += drm/ vga/
1+
obj-y += drm/ vga/ arm/
22
obj-$(CONFIG_TEGRA_HOST1X) += host1x/
33
obj-$(CONFIG_IMX_IPUV3_CORE) += ipu-v3/

drivers/gpu/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source "drivers/gpu/arm/utgard/Kconfig"

drivers/gpu/arm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
obj-y += utgard/

drivers/gpu/arm/utgard/Kbuild

Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
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 ?= 0
20+
MALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED ?= 0
21+
MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS ?= 0
22+
MALI_UPPER_HALF_SCHEDULING ?= 1
23+
MALI_ENABLE_CPU_CYCLES ?= 0
24+
25+
# For customer releases the Linux Device Drivers will be provided as ARM proprietary and GPL releases:
26+
# The ARM proprietary product will only include the license/proprietary directory
27+
# The GPL product will only include the license/gpl directory
28+
ifeq ($(wildcard $(src)/linux/license/gpl/*),)
29+
ccflags-y += -I$(src)/linux/license/proprietary
30+
ifeq ($(CONFIG_MALI400_PROFILING),y)
31+
$(error Profiling is incompatible with non-GPL license)
32+
endif
33+
ifeq ($(CONFIG_PM_RUNTIME),y)
34+
$(error Runtime PM is incompatible with non-GPL license)
35+
endif
36+
ifeq ($(CONFIG_DMA_SHARED_BUFFER),y)
37+
$(error DMA-BUF is incompatible with non-GPL license)
38+
endif
39+
$(error Linux Device integration is incompatible with non-GPL license)
40+
else
41+
ccflags-y += -I$(src)/linux/license/gpl
42+
endif
43+
44+
ifeq ($(USING_GPU_UTILIZATION), 1)
45+
ifeq ($(USING_DVFS), 1)
46+
$(error USING_GPU_UTILIZATION conflict with USING_DVFS you can read the Integration Guide to choose which one do you need)
47+
endif
48+
endif
49+
50+
mali-y += \
51+
linux/mali_osk_atomics.o \
52+
linux/mali_osk_irq.o \
53+
linux/mali_osk_wq.o \
54+
linux/mali_osk_locks.o \
55+
linux/mali_osk_wait_queue.o \
56+
linux/mali_osk_low_level_mem.o \
57+
linux/mali_osk_math.o \
58+
linux/mali_osk_memory.o \
59+
linux/mali_osk_misc.o \
60+
linux/mali_osk_mali.o \
61+
linux/mali_osk_notification.o \
62+
linux/mali_osk_time.o \
63+
linux/mali_osk_timers.o
64+
65+
mali-y += linux/mali_memory.o linux/mali_memory_os_alloc.o
66+
mali-y += linux/mali_memory_external.o
67+
mali-y += linux/mali_memory_block_alloc.o
68+
69+
mali-y += \
70+
linux/mali_ukk_mem.o \
71+
linux/mali_ukk_gp.o \
72+
linux/mali_ukk_pp.o \
73+
linux/mali_ukk_core.o \
74+
linux/mali_ukk_soft_job.o \
75+
linux/mali_ukk_timeline.o
76+
77+
# Source files which always are included in a build
78+
mali-y += \
79+
common/mali_kernel_core.o \
80+
linux/mali_kernel_linux.o \
81+
common/mali_kernel_descriptor_mapping.o \
82+
common/mali_session.o \
83+
linux/mali_device_pause_resume.o \
84+
common/mali_kernel_vsync.o \
85+
linux/mali_ukk_vsync.o \
86+
linux/mali_kernel_sysfs.o \
87+
common/mali_mmu.o \
88+
common/mali_mmu_page_directory.o \
89+
common/mali_mem_validation.o \
90+
common/mali_hw_core.o \
91+
common/mali_gp.o \
92+
common/mali_pp.o \
93+
common/mali_pp_job.o \
94+
common/mali_gp_job.o \
95+
common/mali_soft_job.o \
96+
common/mali_scheduler.o \
97+
common/mali_executor.o \
98+
common/mali_group.o \
99+
common/mali_dlbu.o \
100+
common/mali_broadcast.o \
101+
common/mali_pm.o \
102+
common/mali_pmu.o \
103+
common/mali_user_settings_db.o \
104+
common/mali_kernel_utilization.o \
105+
common/mali_control_timer.o \
106+
common/mali_l2_cache.o \
107+
common/mali_timeline.o \
108+
common/mali_timeline_fence_wait.o \
109+
common/mali_timeline_sync_fence.o \
110+
common/mali_spinlock_reentrant.o \
111+
common/mali_pm_domain.o \
112+
linux/mali_osk_pm.o \
113+
linux/mali_pmu_power_up_down.o \
114+
__malidrv_build_info.o
115+
116+
EXTRA_DEFINES += -DMALI_FAKE_PLATFORM_DEVICE=1
117+
mali-y += platform/hikey/mali_hikey.o
118+
119+
mali-$(CONFIG_MALI400_PROFILING) += linux/mali_ukk_profiling.o
120+
mali-$(CONFIG_MALI400_PROFILING) += linux/mali_osk_profiling.o
121+
122+
mali-$(CONFIG_MALI400_INTERNAL_PROFILING) += linux/mali_profiling_internal.o timestamp-$(TIMESTAMP)/mali_timestamp.o
123+
ccflags-$(CONFIG_MALI400_INTERNAL_PROFILING) += -I$(src)/timestamp-$(TIMESTAMP)
124+
125+
mali-$(CONFIG_DMA_SHARED_BUFFER) += linux/mali_memory_dma_buf.o
126+
mali-$(CONFIG_SYNC) += linux/mali_sync.o
127+
ccflags-$(CONFIG_SYNC) += -Idrivers/staging/android
128+
129+
mali-$(CONFIG_MALI400_UMP) += linux/mali_memory_ump.o
130+
131+
mali-$(CONFIG_MALI_DVFS) += common/mali_dvfs_policy.o
132+
133+
# Tell the Linux build system from which .o file to create the kernel module
134+
obj-$(CONFIG_MALI400) := mali.o
135+
136+
ccflags-y += $(EXTRA_DEFINES)
137+
138+
# Set up our defines, which will be passed to gcc
139+
ccflags-y += -DMALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP=$(MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP)
140+
ccflags-y += -DMALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED=$(MALI_PP_SCHEDULER_KEEP_SUB_JOB_STARTS_ALIGNED)
141+
ccflags-y += -DMALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS=$(MALI_PP_SCHEDULER_FORCE_NO_JOB_OVERLAP_BETWEEN_APPS)
142+
ccflags-y += -DMALI_STATE_TRACKING=1
143+
ccflags-y += -DMALI_OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=$(OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB)
144+
ccflags-y += -DUSING_GPU_UTILIZATION=$(USING_GPU_UTILIZATION)
145+
ccflags-y += -DMALI_ENABLE_CPU_CYCLES=$(MALI_ENABLE_CPU_CYCLES)
146+
147+
ifeq ($(MALI_UPPER_HALF_SCHEDULING),1)
148+
ccflags-y += -DMALI_UPPER_HALF_SCHEDULING
149+
endif
150+
151+
ccflags-$(CONFIG_MALI400_UMP) += -I$(src)/../../ump/include/ump
152+
ccflags-$(CONFIG_MALI400_DEBUG) += -DDEBUG
153+
154+
# Use our defines when compiling
155+
ccflags-y += -I$(src) -I$(src)/include -I$(src)/common -I$(src)/linux -I$(src)/platform
156+
157+
# Get subversion revision number, fall back to only ${MALI_RELEASE_NAME} if no svn info is available
158+
MALI_RELEASE_NAME=$(shell cat $(src)/.version 2> /dev/null)
159+
160+
SVN_INFO = (cd $(src); svn info 2>/dev/null)
161+
162+
ifneq ($(shell $(SVN_INFO) 2>/dev/null),)
163+
# SVN detected
164+
SVN_REV := $(shell $(SVN_INFO) | grep '^Revision: '| sed -e 's/^Revision: //' 2>/dev/null)
165+
DRIVER_REV := $(MALI_RELEASE_NAME)-r$(SVN_REV)
166+
CHANGE_DATE := $(shell $(SVN_INFO) | grep '^Last Changed Date: ' | cut -d: -f2- | cut -b2-)
167+
CHANGED_REVISION := $(shell $(SVN_INFO) | grep '^Last Changed Rev: ' | cut -d: -f2- | cut -b2-)
168+
REPO_URL := $(shell $(SVN_INFO) | grep '^URL: ' | cut -d: -f2- | cut -b2-)
169+
170+
else # SVN
171+
GIT_REV := $(shell cd $(src); git describe --always 2>/dev/null)
172+
ifneq ($(GIT_REV),)
173+
# Git detected
174+
DRIVER_REV := $(MALI_RELEASE_NAME)-$(GIT_REV)
175+
CHANGE_DATE := $(shell cd $(src); git log -1 --format="%ci")
176+
CHANGED_REVISION := $(GIT_REV)
177+
REPO_URL := $(shell cd $(src); git describe --all --always 2>/dev/null)
178+
179+
else # Git
180+
# No Git or SVN detected
181+
DRIVER_REV := $(MALI_RELEASE_NAME)
182+
CHANGE_DATE := $(MALI_RELEASE_NAME)
183+
CHANGED_REVISION := $(MALI_RELEASE_NAME)
184+
endif
185+
endif
186+
187+
ccflags-y += -DSVN_REV_STRING=\"$(DRIVER_REV)\"
188+
189+
VERSION_STRINGS :=
190+
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 )
191+
VERSION_STRINGS += REPO_URL=$(REPO_URL)
192+
VERSION_STRINGS += REVISION=$(DRIVER_REV)
193+
VERSION_STRINGS += CHANGED_REVISION=$(CHANGED_REVISION)
194+
VERSION_STRINGS += CHANGE_DATE=$(CHANGE_DATE)
195+
VERSION_STRINGS += BUILD_DATE=$(shell date)
196+
ifdef CONFIG_MALI400_DEBUG
197+
VERSION_STRINGS += BUILD=debug
198+
else
199+
VERSION_STRINGS += BUILD=release
200+
endif
201+
VERSION_STRINGS += TARGET_PLATFORM=$(TARGET_PLATFORM)
202+
VERSION_STRINGS += MALI_PLATFORM=$(MALI_PLATFORM)
203+
VERSION_STRINGS += KDIR=$(KDIR)
204+
VERSION_STRINGS += OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB=$(OS_MEMORY_KERNEL_BUFFER_SIZE_IN_MB)
205+
VERSION_STRINGS += USING_UMP=$(CONFIG_MALI400_UMP)
206+
VERSION_STRINGS += USING_PROFILING=$(CONFIG_MALI400_PROFILING)
207+
VERSION_STRINGS += USING_INTERNAL_PROFILING=$(CONFIG_MALI400_INTERNAL_PROFILING)
208+
VERSION_STRINGS += USING_GPU_UTILIZATION=$(USING_GPU_UTILIZATION)
209+
VERSION_STRINGS += USING_DVFS=$(CONFIG_MALI_DVFS)
210+
VERSION_STRINGS += MALI_UPPER_HALF_SCHEDULING=$(MALI_UPPER_HALF_SCHEDULING)
211+
212+
# Create file with Mali driver configuration
213+
$(src)/__malidrv_build_info.c:
214+
@echo 'const char *__malidrv_build_info(void) { return "malidrv: $(VERSION_STRINGS)";}' > $(src)/__malidrv_build_info.c

0 commit comments

Comments
 (0)