Commit Graph

168 Commits

Author SHA1 Message Date
Zhen Chen
4a1507af5a MALI: rockchip: upgrade bifrost DDK to r10p0-01rel0
in addition,
resolve all the conflicts;
rename all the configs and macros that have a same name in midgard/;
fix a compiling error.

Change-Id: I5abc8c925049e087c59b66da57c82aac3092be71
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2018-03-13 13:55:01 +08:00
Zhen Chen
25c5dc5a92 MALI: midgard: rk: fix a memory leak in platform specific code
Change-Id: I31ecc394c8ac971ed915b18b08d5b5cba5d440e2
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2018-03-13 10:40:59 +08:00
Zhen Chen
1ffc1d8044 MALI: bifrost: rk: fix a memory leak in platform specific code
Change-Id: I88a8614742b9663454349d09b84e63998f0aeb66
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2018-03-13 10:40:25 +08:00
Liang Chen
3efb6d37bd PM / devfreq: record opp rate instead of real clock rate for thermal
Opp rate is used to calc power in thermal framework, so we record
this rate instead of real clock rate.
Devfreq is not ready in target() when use performance governor, so
we need record opp rate in probe().

Change-Id: Iec1918ad5d12124b9f112964f247339e0d50645f
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-03-08 15:08:36 +08:00
Zhen Chen
789d098dd4 MALI: bifrost: rockchip: not to enable clk_gpu when probing
Otherwise, clk_gpu won't be disabled actually in the runtime.

Change-Id: I92787a5e23bfb92f5a79efda92c130832751cc3b
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2018-03-07 09:19:16 +08:00
Finley Xiao
f09c78549e MALI: bifrost: support sharing regulator with other devices
If the regulator is shared between several devices then the lowest
request voltage that meets the system constraints will be used.

Change-Id: Icb6afcb571bddd6709d352dfad8fc2da80567bc0
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-13 16:21:57 +08:00
Finley Xiao
6e0e7a80fa MALI: bifrost: Avoid GPU voltage domain keeping the initial voltage
If there is only one opp whose frequency is equal to the initial value
in opp table list, the GPU voltage domain will keep the initial voltage,
it may be too large.

Change-Id: If2ae1c876de185d810e05296b1b9e98855c3ef48
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2018-02-13 16:21:48 +08:00
Zhen Chen
a58d4bfdbb drivers/gpu/arm: add bifrost/ into kernel build system
Change-Id: Ia5728750e6a98d3c366e116013fbd43bff1a1459
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2018-02-05 20:18:26 +08:00
Zhen Chen
24b77886e3 bifrost: make it possible to build midgard and bifrost as module in one make
including :
	modifications for changing patch from drivers/gpu/arm/midgard
		to drivers/gpu/arm/bifrost;
	rename output mali_kbase.ko to bifrost_kbase.ko;
	rename configs, which have duplicated names in midgard, in Kconfig,
		Kbuild and source files.

Change-Id: I127d8c8043db9010398946b3f4a90640ab1f13fe
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2018-02-05 20:18:26 +08:00
Zhen Chen
07210d909f MALI: bifrost: rk: ipa/: to fit current 'struct devfreq_cooling_power'
Need CONFIG_MALI_PWRSOFT_765 enabled

Change-Id: I96476f6b884bf48e46643685aa6d77dadcd80edb
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2018-02-05 20:17:47 +08:00
Zhen Chen
1d3cef672c MALI: bifrost: rk: not to use sg_dma_len in bifrost DDK r8p0-01rel0
When CONFIG_NEED_SG_DMA_LENGTH is enabled,
sg_dma_len is defined as follow :
"#define sg_dma_len(sg)             ((sg)->dma_length)"
But, dma_length is not used by the framework indeed.

Change-Id: I93b4ceed28882236dc252fcabb7c7710153804a0
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2018-02-05 17:08:31 +08:00
Zhen Chen
7481e8328c MALI: bifrost: add rk_platform_specific_code
Copyed from midgard/platform/rk at commit 77a680a3.

Change-Id: Iaa218e2183e5fc6ef34f50678fc34376a54a29a4
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2018-02-05 16:36:56 +08:00
Zhen Chen
2152419621 MALI: midgard: RK: rename output mali_kbase.ko to midgard_kbase.ko
Some optimizations on files of KBuild in addition.

Change-Id: I1db012e116b8b69897a2791ae610da35365a1a61
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2018-02-05 16:35:07 +08:00
Zhen Chen
142f58d546 MALI: rockchip: add arm release of Bifrost DDK r8p0-01rel0
Change-Id: If8d2c3a903a205e3a7c101c4383735940439c9d0
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2018-02-05 14:28:39 +08:00
Tao Huang
f9eefeeaa7 rk: add SPDX license identifier to files with no license
Change-Id: I754250669891307b0deab2bdab1bd01512713f79
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-01-31 20:56:06 +08:00
Zhen Chen
cc941b22d4 MALI Utgard: rk.c: change licence announcement to use GPLv2
Change-Id: I1230425dd33b48b7dc3d8b49d8912713ebb97ca5
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2018-01-31 20:45:39 +08:00
Zhen Chen
469e3ee54b MALI Utgard: RK: remove unused files with proprietary announcement
Change-Id: Iffe6df7c406dff1efad10934fc09ca7fd2f101ec
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2018-01-31 20:45:25 +08:00
Javi Merino
5dcb4226bb BACKPORT: devfreq_cooling: pass a pointer to devfreq in the power model callbacks
When the devfreq cooling device was designed, it was an oversight not to
pass a pointer to the struct devfreq as the first parameters of the
callbacks.  The design patterns of the kernel suggest it for a good
reason.

By passing a pointer to struct devfreq, the driver can register one
function that works with multiple devices.  With the current
implementation, a driver that can work with multiple devices has to
create multiple copies of the same function with different parameters so
that each devfreq_cooling_device can use the appropriate one.  By
passing a pointer to struct devfreq, the driver can identify which
device it's referring to.

Change-Id: I384bf9aafd2391eccab2ca6a76e4e57f2740aa6b
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Reviewed-by: Punit Agrawal <punit.agrawal@arm.com>
Reviewed-by: Ørjan Eide <orjan.eide@arm.com>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Signed-off-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
(cherry picked from commit 3aa5374376)
2018-01-04 09:22:34 +08:00
Liang Chen
17efab953d soc: rockchip: add functions to select opp level form device-tree
Some chips need adjust opp level by different chip-process, add
common functions to select opp level from device-tree, so modules
can select opp level easy.

Change-Id: Ifbd5f720e6a52a68f13697bbb37ac01ff4a87e3e
Signed-off-by: Liang Chen <cl@rock-chips.com>
2018-01-02 10:21:39 +08:00
Zhen Chen
aaa43b14a5 MALI Utgard: RK: only prepare clk_gpu not enable it in mali_probe()
Change-Id: I53b2b9e0a277bedc4a15899ae680ed944219f7bf
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2017-12-11 18:49:22 +08:00
Zhen Chen
690d49fe40 MALI: utgard: to adapt legacy GPU dts node format for mali_device befor r5p0
Just for rk3066 that has 4 PPs.

Change-Id: Ie3dfa436ee2842f6bcb8bcc7d72ff8e6cd147734
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2017-12-04 17:58:27 +08:00
Zhen Chen
dac44b4210 MALI Utgard: RK: add nodes to get gpu_utilisation
Change-Id: I7ceebd882282fc08c8560fba5ec8978d18d5b819
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2017-11-21 17:19:07 +08:00
Zhen Chen
1919e3d736 MALI Utgard: RK: fix some potential problems about pm_runtime
Including:
	not to call pm_runtime_suspend() in mali_runtime_idle();
	make it more strict to power off the GPU.

Change-Id: I8c49dd13f57826f28606fd7a4e451707978b2906
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2017-11-20 14:23:36 +08:00
Caesar Wang
758b887b1c MALI: utgard: RK: fixes the mali driver load failed on rk3036
As the gpu driver used the devfreq thermal, The mali will be failure to
load the driver since the rk platform hadn't the driver requested
deferred probing.

as the following is failure log:
[    7.126149] Mali: ERR: drivers/gpu/arm/mali400/mali/linux/mali_kernel_linux.c
[    7.126157]            mali_probe() 550
                          mali_probe(): Failed to initialize platform device.
[    7.126191] mali-utgard: probe of 10091000.gpu failed with error -14
..

Add the SoCs judge if we will use the devfreq-thermal for mali driver.
If the other SoCs has the similar issue, we can do this way.

Change-Id: I9faf6530119adb99efeac491e665641ee8b1143d
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2017-11-03 13:29:58 +08:00
Finley Xiao
21d227bdc2 MALI: utgard: support sharing regulator with other devices
If the regulator is shared between several devices then the lowest
request voltage that meets the system constraints will be used.

Change-Id: I68536a8e9cc5a78c21b55564a2ed540b9c184cb8
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-09-11 18:37:27 +08:00
Finley Xiao
002c83bd47 MALI: utgard: Avoid GPU voltage domain keeping the initial voltage
If there is only one opp whose frequency is equal to the initial value
in opp table list, the GPU voltage domain will keep the initial voltage,
it may be too large.

Change-Id: I3dd97fe252a15b789f218f44b8fbc7d4143f7085
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-09-11 18:37:17 +08:00
Zhen Chen
86f562ac0b MALI: utgard: not to treat absence of relative thermal zone as a fatal error
Change-Id: I8831d9dc2f76266d92119ef5acac4a0adb13bc8a
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2017-08-31 11:53:42 +08:00
Finley Xiao
ad8c4dfa3a MALI: rockchip: Add support to select voltage according to leakage
The greater leakage, the lower the OPP's voltage. In order to reduce
power consumption, it is necessary to adjust OPP's voltage according
to leakage.

Change-Id: I2bba04ac941cc6a0703b5208cb4e757ec2813bab
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-08-18 10:05:08 +08:00
Finley Xiao
848f3c8daf MALI: rockchip: Add support to select voltage according to pvtm value
At same voltage and frequency, the greater the PVTM value, the lower
the OPP's voltage. In order to reduce power consumption, it is necessary
to adjust OPP's voltage according to PVTM value.

Change-Id: Ifcac57fc965e3ea45523db2d9df19435479f6cee
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
2017-08-18 10:03:56 +08:00
chenzhen
56659dcda3 MALI: utgard: fix the too small "max_job_runtime" in platform information
The original setting of "max_job_runtime" is too small
that jobs are too easy to timeout and be killed.

Change-Id: I5316c2b594d94dd0b844ef9a297baa7b226c4665
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-07-21 16:18:16 +08:00
chenzhen
40b400f156 MALI: utgard: read parameters of power model from device tree
Change-Id: I6e71100b77b98d2994c0b284b992942e696b023a
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-06-29 16:08:51 +08:00
chenzhen
f2605eb08a MALI: utgard: fix deadlocks when CONFIG_SYNC is set
This is the content of
Case693349_the_spinlock_fix_patch_2_for_kernel_4.4.patch
from support_mali, with slight modifications for building
with rockchip_linux_defconfig,
in which CONFIG_SYNC is not set.

Change-Id: Icedff21f7941fd1aefceb6be4fda638378fe4ca8
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-06-20 16:03:23 +08:00
chenzhen
0212025c7b MALI: utgard: remove no longer used source files
Change-Id: I8e686736eca19cf2b7854c82fe83fc128501a221
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-06-20 16:03:23 +08:00
chenzhen
1a1325fa26 MALI: utgard: upgrade DDK to r7p0-00rel1
Change-Id: If789dea2b6a9c11dc82c6f91d4bdd10761e2f7d1
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-06-20 16:03:23 +08:00
Caesar Wang
ef2cd29548 MALI: fix thermal crash with booting up
If the temperature(sbs-battery) reaches the switch_on_temp, it would try
to calculate requested power of all thermal instances. Then hit the
crash[0] caused by the gpu thermal sensor, since the thermal driver had not
registered in time.

[0]
[    0.827943] Call trace:
[    0.827953] [<          (null)>]           (null)
[    0.827969] [<ffffffc00070af1c>] get_static_power+0xd8/0xe8
[    0.827981] [<ffffffc00070b190>] devfreq_cooling_get_requested_power+0x94/0x170
[    0.827997] [<ffffffc0007094c8>] power_allocator_throttle+0x270/0x804
..

Change-Id: I63f66e54d69115165a7b3ec798b9009c360daa62
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
2017-04-27 19:26:43 +08:00
chenzhen
bf96e75ed3 MALI: utgard: RK: reconstruct platform specific code for devfreq DVFS
Change-Id: I1ddf7be0868fb885784098c14feb16634d76dcd9
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-04-05 17:15:09 +08:00
chenzhen
522a988e99 MALI: utgard: upgrade DDK to r7p0-00rel0
Change-Id: Ia1dc7b104a7bbb743e46d25e2c434e92c5596353
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-04-05 17:16:29 +08:00
chenzhen
25b0332fe6 MALI: utgard: upgrade DDK to r6p1-01rel0
Change-Id: I88e8aba740ec223c1107def64eb004390b7fd940
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-04-05 17:16:10 +08:00
chenzhen
fe2c9f20c2 MALI: utgard: RK: remove core_scaling in "platform specific code"
DDK integrate_guide says
"not to use core_scaling on r5p0-01rel0 and later."

Change-Id: Ibb3eddac75548bb9f6763dc4dc9bad540746191f
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-04-05 17:15:52 +08:00
chenzhen
c0778d1eb7 MALI: utgard: RK: use late_initcall_sync instead of module_init
Some dependences of mali device driver should be initialized first.

Change-Id: I76f1d8b029345801bf0a68266889ec1c5a28b524
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-04-05 17:14:55 +08:00
chenzhen
3c56220563 MALI: utgard: RK: fix compile errors under arm64
Change-Id: I88df540e9822f148703aa07f74fbea59fbbf3350
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-04-05 17:14:44 +08:00
Jacob Chen
916b289ede MALI: midgard: Linux: support custom ondemand_data
get parameter from dts

Change-Id: Id1b11e3d6a5809cbd4f6f52b1595562e0fa66f70
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
2017-03-29 13:06:58 +08:00
chenzhen
30e2eaaf4b Revert "Revert "MALI: midgard: support sharing regulator with other devices""
This reverts commit eb6c2ed720.

Change-Id: I09424d08bfac3457da24b10fe2b97d2856399e63
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-03-15 09:45:49 +08:00
chenzhen
6b022755ac Revert "Revert "MALI: midgard: avoid GPU voltage domain keeping the initial voltage""
This reverts commit e7db50b512.

Change-Id: I47f9c1d114b06264d6dd4098bc0e00228fd8f187
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-03-15 09:45:49 +08:00
chenzhen
422afe6b4a MALI: midgard: RK: add wake_lock for delayed_work_to_power_off_gpu
To ensure that the work is executed before system being suspended.

Change-Id: Iec1bd114dfff53e2464540f09ced66cf6be81d1a
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-03-15 09:45:49 +08:00
chenzhen
17085bc663 MALI: midgard: RK: adapt cores_pm in DDK r14 for solution_1_for_glitch
Change-Id: I383779bd39d6ae52f65ad25bf2e0eb0f1a25dd00
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-02-20 14:27:46 +08:00
chenzhen
3054c50dd8 MALI: rockchip: upgrade midgard DDK to r14p0-01rel0
Along with a slight modification in mali_kbase_core_linux.c,
for building in rk Linux 4.4:
-#if KERNEL_VERSION(4, 6, 0) > LINUX_VERSION_CODE
+#if KERNEL_VERSION(4, 4, 0) > LINUX_VERSION_CODE

Change-Id: I34565cb975866b46c5e3a4d8e2ac5e350dcceb80
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-02-20 14:27:24 +08:00
chenzhen
a90cb0ed3e Revert "Revert "MALI: midgard: RK: not to power off all the pm cores""
This reverts commit d94880b547.

Change-Id: Iac64d84ff5a7ee3e5666ed2829c17de413fc9bcd
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-02-20 14:27:12 +08:00
chenzhen
2d1c49463b Revert "MALI: midgard: RK: slowdown clk_gpu before poweroff cores"
This reverts commit 89501d8dd3.

Change-Id: I403b63847da10bc2c5536bd26f692bafc849588e
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-02-20 14:26:57 +08:00
chenzhen
e7db50b512 Revert "MALI: midgard: avoid GPU voltage domain keeping the initial voltage"
This reverts commit 57984d5318.

Change-Id: If538c9bbeb5d3fc7302f9683cb85f8acdd309a09
Signed-off-by: chenzhen <chenzhen@rock-chips.com>
2017-02-20 14:26:43 +08:00